Ru-MaNGOS

Ru-MaNGOS (http://mangos.ytdb.ru/index.php)
-   Patch-Submissions (http://mangos.ytdb.ru/forumdisplay.php?f=65)
-   -   Sentry totem minimap ping at attack (http://mangos.ytdb.ru/showthread.php?t=6355)

alexluana 20.10.2012 01:26

Sentry totem minimap ping at attack
 
Credits Feanordev

Код:

diff --git "a/C:\\Users\\Axxl\\AppData\\Local\\Temp\\Tot37F1.tmp\\TotemAI-91c2376-left.cpp" "b/E:\\Wow Git Sources\\Wotlk\\cmangos\\src\\game\\TotemAI.cpp"
index 32006d1..ef18907 100644
--- "a/C:\\Users\\Axxl\\AppData\\Local\\Temp\\Tot37F1.tmp\\TotemAI-91c2376-left.cpp"
+++ "b/E:\\Wow Git Sources\\Wotlk\\cmangos\\src\\game\\TotemAI.cpp"       
@@ -107,6 +107,15 @@ TotemAI::IsVisible(Unit*) const
 void
 TotemAI::AttackStart(Unit*)
 {
+    // Sentry totem sends ping on attack
+    if (m_creature->GetEntry() == SENTRY_TOTEM_ENTRY && m_creature->GetOwner() && m_creature->GetOwner()->GetTypeId() == TYPEID_PLAYER)
+    {
+        WorldPacket data(MSG_MINIMAP_PING, (8+4+4));
+        data << m_creature->GetObjectGuid();
+        data << m_creature->GetPositionX();
+        data << m_creature->GetPositionY();
+        ((Player*)m_creature->GetOwner())->GetSession()->SendPacket(&data);
+    }
 }
 
 Totem& TotemAI::getTotem()

Код:

diff --git "a/C:\\Users\\Axxl\\AppData\\Local\\Temp\\Tot9F7A.tmp\\TotemAI-91c2376-left.h" "b/E:\\Wow Git Sources\\Wotlk\\cmangos\\src\\game\\TotemAI.h"
index fe51156..3b29272 100644
--- "a/C:\\Users\\Axxl\\AppData\\Local\\Temp\\Tot9F7A.tmp\\TotemAI-91c2376-left.h"
+++ "b/E:\\Wow Git Sources\\Wotlk\\cmangos\\src\\game\\TotemAI.h"       
@@ -26,6 +26,8 @@
 class Creature;
 class Totem;
 
+#define SENTRY_TOTEM_ENTRY  3968
+
 class MANGOS_DLL_DECL TotemAI : public CreatureAI
 {
    public:


schmoozerd 21.10.2012 14:16

just to understand: what is a sentry totem, with which spell can this be summoned?

Vladimir 21.10.2012 22:30

druid totem that redirect view point to self when summoned as i remember.

Amaru 22.10.2012 10:26

shaman totem =)

alexluana 22.10.2012 10:56

ya shamy totem:D I think vlad made a typo with druid totem:D


Текущее время: 11:59. Часовой пояс GMT +3.

ru-mangos.ru - Русское сообщество MaNGOS