From 02a9cd6a43a18f2350801bd9473c2346b36b0575 Mon Sep 17 00:00:00 2001 From: _manuel_ Date: Thu, 11 Mar 2010 16:42:40 -0300 Subject: Improvements in boss_four_horsemen script. --HG-- branch : trunk --- src/scripts/northrend/naxxramas/boss_four_horsemen.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/scripts/northrend/naxxramas/boss_four_horsemen.cpp b/src/scripts/northrend/naxxramas/boss_four_horsemen.cpp index 43ca22e7a21..acb0d9e6eed 100644 --- a/src/scripts/northrend/naxxramas/boss_four_horsemen.cpp +++ b/src/scripts/northrend/naxxramas/boss_four_horsemen.cpp @@ -88,7 +88,7 @@ struct boss_four_horsemenAI : public BossAI } Horsemen id; - Unit *eventStarter; + uint64 uiEventStarterGUID; uint8 nextWP; uint32 punishTimer; bool caster; @@ -105,7 +105,7 @@ struct boss_four_horsemenAI : public BossAI DoEncounterAction(NULL, false, true, false); me->SetReactState(REACT_AGGRESSIVE); - eventStarter = NULL; + uiEventStarterGUID = 0; nextWP = 0; punishTimer = 2000; nextMovementStarted = false; @@ -210,7 +210,9 @@ struct boss_four_horsemenAI : public BossAI movementCompleted = true; me->SetReactState(REACT_AGGRESSIVE); - if (me->canAttack(eventStarter)) + Unit *eventStarter = Unit::GetUnit(*me, uiEventStarterGUID); + + if (eventStarter && me->canAttack(eventStarter)) AttackStart(eventStarter); else if (!UpdateVictim()) { @@ -242,7 +244,7 @@ struct boss_four_horsemenAI : public BossAI { if (!movementCompleted && !movementStarted) { - eventStarter = who; + uiEventStarterGUID = who->GetGUID(); BeginFourHorsemenMovement(); if (!encounterActionAttack) -- cgit v1.2.3