*hyjal update

- despawn Anetheron's summons if boss is dead / despawned (wiped)
- same for Azgalor

--HG--
branch : trunk
This commit is contained in:
Rat
2009-04-14 22:12:17 +02:00
parent ad24fa7328
commit c97a4519c5
2 changed files with 43 additions and 2 deletions

View File

@@ -225,15 +225,21 @@ struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI
{
mob_towering_infernalAI(Creature *c) : ScriptedAI(c)
{
Reset();
pInstance = ((ScriptedInstance*)c->GetInstanceData());
if(pInstance)
AnetheronGUID = pInstance->GetData64(DATA_ANETHERON);
}
uint32 ImmolationTimer;
uint32 CheckTimer;
uint64 AnetheronGUID;
ScriptedInstance* pInstance;
void Reset()
{
DoCast(m_creature, SPELL_INFERNO_EFFECT);
ImmolationTimer = 5000;
CheckTimer = 5000;
}
void Aggro(Unit *who)
@@ -262,6 +268,21 @@ struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(CheckTimer < diff)
{
if(AnetheronGUID)
{
Creature* boss = Unit::GetCreature((*m_creature),AnetheronGUID);
if(!boss || (boss && boss->isDead()))
{
m_creature->setDeathState(JUST_DIED);
m_creature->RemoveCorpse();
return;
}
}
CheckTimer = 5000;
}else CheckTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;

View File

@@ -188,17 +188,22 @@ struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI
mob_lesser_doomguardAI(Creature *c) : hyjal_trashAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
if(pInstance)
AzgalorGUID = pInstance->GetData64(DATA_AZGALOR);
}
uint32 CrippleTimer;
uint32 WarstompTimer;
uint32 CheckTimer;
uint64 AzgalorGUID;
ScriptedInstance* pInstance;
void Reset()
{
CrippleTimer = 50000;
WarstompTimer = 10000;
DoCast(m_creature, SPELL_THRASH);
CheckTimer = 5000;
}
void Aggro(Unit *who)
@@ -231,6 +236,21 @@ struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI
void UpdateAI(const uint32 diff)
{
if(CheckTimer < diff)
{
if(AzgalorGUID)
{
Creature* boss = Unit::GetCreature((*m_creature),AzgalorGUID);
if(!boss || (boss && boss->isDead()))
{
m_creature->setDeathState(JUST_DIED);
m_creature->RemoveCorpse();
return;
}
}
CheckTimer = 5000;
}else CheckTimer -= diff;
//Return since we have no target
if (!UpdateVictim() )
return;