aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-10-10 19:05:06 -0300
committerariel- <ariel-@users.noreply.github.com>2016-10-10 19:05:06 -0300
commitf749dea8b20168a15a381931bc22812c6931fa53 (patch)
tree32c5225640e6fe27f95517c7c711cc03daab1349 /src
parenta129b41f3dadb96944fcace77851a0d15d5d9fa2 (diff)
Core/Scripts: don't check ghoul each update. Send proper text packet, so client replaces %s with DK name
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index a1543e1199c..7cce7e4655e 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -2801,17 +2801,25 @@ public:
class player_ghoulAI : public PlayerAI
{
public:
- player_ghoulAI(Player* player, ObjectGuid ghoulGUID) : PlayerAI(player), _ghoulGUID(ghoulGUID) { }
+ player_ghoulAI(Player* player, ObjectGuid ghoulGUID) : PlayerAI(player), _ghoulGUID(ghoulGUID), _ghoulCheckTimer(1000){ }
- void UpdateAI(uint32 /*diff*/) override
+ void UpdateAI(uint32 diff) override
{
- Creature* ghoul = ObjectAccessor::GetCreature(*me, _ghoulGUID);
- if (!ghoul || !ghoul->IsAlive())
- me->RemoveAura(SPELL_DK_RAISE_ALLY);
+ if (_ghoulCheckTimer <= diff)
+ {
+ _ghoulCheckTimer = 1000;
+
+ Creature* ghoul = ObjectAccessor::GetCreature(*me, _ghoulGUID);
+ if (!ghoul || !ghoul->IsAlive())
+ me->RemoveAura(SPELL_DK_RAISE_ALLY);
+ }
+ else
+ _ghoulCheckTimer -= diff;
}
private:
ObjectGuid _ghoulGUID;
+ uint32 _ghoulCheckTimer;
};
// 46619 - Raise Ally
@@ -2833,7 +2841,7 @@ public:
void SendText()
{
if (Unit* original = GetOriginalCaster())
- original->Whisper(TEXT_RISE_ALLY, GetCaster()->ToPlayer(), true);
+ original->Unit::Whisper(TEXT_RISE_ALLY, GetCaster()->ToPlayer(), true);
}
void HandleSummon(SpellEffIndex effIndex)