aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrazom62 <none@none>2010-09-07 20:52:42 +0200
committerTrazom62 <none@none>2010-09-07 20:52:42 +0200
commit88daff9676c7d85f138a2ac111de65738e143de3 (patch)
treee6a2d1816acbf31e0ff3d874c1373c82951f749d
parent0e9d0f6bcb7e01635e34ae3cd4e5e6d5981ed659 (diff)
Script: Fix crash in boss_tharon_ja.
Fixes issue #3356. --HG-- branch : trunk
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp
index 0da57724115..902b9518352 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp
@@ -150,15 +150,14 @@ public:
{
DoScriptText(RAND(SAY_FLESH_1,SAY_FLESH_2),me);
me->SetDisplayId(MODEL_FLESH);
- std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
- for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
+
+ std::list<Unit *> playerList;
+ SelectTargetList(playerList, 5, SELECT_TARGET_TOPAGGRO, 0, true);
+ for (std::list<Unit*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
{
- Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
- if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
- {
- me->AddAura(SPELL_GIFT_OF_THARON_JA,pTemp);
- pTemp->SetDisplayId(MODEL_SKELETON);
- }
+ Unit *pTemp = (*itr);
+ me->AddAura(SPELL_GIFT_OF_THARON_JA,pTemp);
+ pTemp->SetDisplayId(MODEL_SKELETON);
}
uiPhaseTimer = 20*IN_MILLISECONDS;
uiLightningBreathTimer = urand(3*IN_MILLISECONDS,4*IN_MILLISECONDS);
@@ -206,16 +205,15 @@ public:
uiCurseOfLifeTimer = 1*IN_MILLISECONDS;
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
- std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
- for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
+
+ std::list<Unit *> playerList;
+ SelectTargetList(playerList, 5, SELECT_TARGET_TOPAGGRO, 0, true);
+ for (std::list<Unit*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
{
- Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
- if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
- {
- if (pTemp->HasAura(SPELL_GIFT_OF_THARON_JA))
- pTemp->RemoveAura(SPELL_GIFT_OF_THARON_JA);
- pTemp->DeMorph();
- }
+ Unit *pTemp = (*itr);
+ if (pTemp->HasAura(SPELL_GIFT_OF_THARON_JA))
+ pTemp->RemoveAura(SPELL_GIFT_OF_THARON_JA);
+ pTemp->DeMorph();
}
} else uiPhaseTimer -= diff;
break;