Drak'Tharon Keep: Fix Trollgore's achievement

Fix possible crash in Tharon'Ja's script
		  Add player spells in Tharon'Ja's script

--HG--
branch : trunk
This commit is contained in:
tartalo
2009-10-31 21:29:00 +01:00
parent 7f00bab916
commit d9e728eade
2 changed files with 24 additions and 2 deletions
@@ -168,8 +168,15 @@ struct TRINITY_DLL_DECL boss_tharon_jaAI : public ScriptedAI
for (std::list<HostilReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) for (std::list<HostilReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{ {
Unit *pTemp = Unit::GetUnit((*m_creature),(*itr)->getUnitGuid()); Unit *pTemp = Unit::GetUnit((*m_creature),(*itr)->getUnitGuid());
if (pTemp->GetTypeId() == TYPEID_PLAYER) if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
{
Player *pTarget = CAST_PLR(pTemp);
DoCast(pTemp, SPELL_GIFT_OF_THARON_JA); DoCast(pTemp, SPELL_GIFT_OF_THARON_JA);
pTarget->AddTemporarySpell(SPELL_PLAYER_PHASE2_BONE_ARMOR);
pTarget->AddTemporarySpell(SPELL_PLAYER_PHASE2_SLAYING_STRIKE);
pTarget->AddTemporarySpell(SPELL_PLAYER_PHASE2_TAUNT);
pTarget->AddTemporarySpell(SPELL_PLAYER_PHASE2_TOUCH_OF_LIFE);
}
} }
uiPhaseTimer = 20000; uiPhaseTimer = 20000;
uiLightningBreathTimer = urand(3000,4000); uiLightningBreathTimer = urand(3000,4000);
@@ -217,6 +224,21 @@ struct TRINITY_DLL_DECL boss_tharon_jaAI : public ScriptedAI
uiCurseOfLifeTimer = 1000; uiCurseOfLifeTimer = 1000;
uiRainOfFireTimer = urand(14000,18000); uiRainOfFireTimer = urand(14000,18000);
uiShadowVolleyTimer = urand(8000,10000); uiShadowVolleyTimer = urand(8000,10000);
std::list<HostilReference*>& threatlist = m_creature->getThreatManager().getThreatList();
for (std::list<HostilReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
Unit *pTemp = Unit::GetUnit((*m_creature),(*itr)->getUnitGuid());
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
{
if (pTemp->HasAura(SPELL_GIFT_OF_THARON_JA))
pTemp->RemoveAura(SPELL_GIFT_OF_THARON_JA);
Player *pTarget = CAST_PLR(pTemp);
pTarget->RemoveTemporarySpell(SPELL_PLAYER_PHASE2_BONE_ARMOR);
pTarget->RemoveTemporarySpell(SPELL_PLAYER_PHASE2_SLAYING_STRIKE);
pTarget->RemoveTemporarySpell(SPELL_PLAYER_PHASE2_TAUNT);
pTarget->RemoveTemporarySpell(SPELL_PLAYER_PHASE2_TOUCH_OF_LIFE);
}
}
} else uiPhaseTimer -= diff; } else uiPhaseTimer -= diff;
break; break;
} }
@@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL boss_trollgoreAI : public ScriptedAI
uiInfectedWoundTimer = urand(6000,10000); uiInfectedWoundTimer = urand(6000,10000);
uiExplodeCorpseTimer = 3000; uiExplodeCorpseTimer = 3000;
bAchiev = true; bAchiev = HeroicMode;
if (pInstance) if (pInstance)
pInstance->SetData(DATA_TROLLGORE_EVENT, NOT_STARTED); pInstance->SetData(DATA_TROLLGORE_EVENT, NOT_STARTED);