[SD2] Boss Gar tidy up
This commit is contained in:
parent
7543d235e1
commit
5b2d90bde4
@ -189,15 +189,25 @@ struct mob_firesworn : public CreatureScript
|
|||||||
{
|
{
|
||||||
m_uiImmolateTimer = urand(4 * IN_MILLISECONDS, 8 * IN_MILLISECONDS); // These times are probably wrong
|
m_uiImmolateTimer = urand(4 * IN_MILLISECONDS, 8 * IN_MILLISECONDS); // These times are probably wrong
|
||||||
m_uiSeparationCheckTimer = 5 * IN_MILLISECONDS;
|
m_uiSeparationCheckTimer = 5 * IN_MILLISECONDS;
|
||||||
m_uiExplodeTimer = 0;
|
m_bExploding = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DamageTaken(Unit* /*pDealer*/, uint32& uiDamage) override
|
void DamageTaken(Unit* /*pDealer*/, uint32& uiDamage) override
|
||||||
{
|
{
|
||||||
if (!m_uiExplodeTimer && m_creature->HealthBelowPctDamaged(10, uiDamage))
|
if (!m_bExploding && m_creature->HealthBelowPctDamaged(10, uiDamage))
|
||||||
{
|
{
|
||||||
m_creature->CastSpell(m_creature, SPELL_ERUPTION, true);
|
ReceiveAIEvent(AI_EVENT_CUSTOM_A, m_creature, m_creature, SPELL_ERUPTION);
|
||||||
m_uiExplodeTimer = 500;
|
uiDamage = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReceiveAIEvent(AIEventType type, Creature* /*pSender*/, Unit* pInvoker, uint32 uiData) override
|
||||||
|
{
|
||||||
|
if (type == AI_EVENT_CUSTOM_A && pInvoker == m_creature)
|
||||||
|
{
|
||||||
|
m_creature->CastSpell(m_creature, uiData, true);
|
||||||
|
m_creature->ForcedDespawn(100);
|
||||||
|
m_bExploding = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,15 +218,18 @@ struct mob_firesworn : public CreatureScript
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_uiExplodeTimer)
|
if (m_uiSeparationCheckTimer < uiDiff)
|
||||||
{
|
{
|
||||||
if (m_uiExplodeTimer <= uiDiff)
|
// Distance guesswork, but should be ok
|
||||||
m_creature->SetHealth(0);
|
Creature* pGarr = m_pInstance->GetSingleCreatureFromStorage(NPC_GARR);
|
||||||
else
|
if (pGarr && pGarr->IsAlive() && !m_creature->IsWithinDist2d(pGarr->GetPositionX(), pGarr->GetPositionY(), 50.0f))
|
||||||
m_uiExplodeTimer -= uiDiff;
|
{
|
||||||
|
DoCastSpellIfCan(m_creature, SPELL_SEPARATION_ANXIETY, CAST_TRIGGERED);
|
||||||
|
}
|
||||||
|
|
||||||
return; // no other actions during and after explosion
|
m_uiSeparationCheckTimer = 5000;
|
||||||
}
|
}
|
||||||
|
else m_uiSeparationCheckTimer -= uiDiff;
|
||||||
|
|
||||||
// Immolate_Timer
|
// Immolate_Timer
|
||||||
if (m_uiImmolateTimer < uiDiff)
|
if (m_uiImmolateTimer < uiDiff)
|
||||||
@ -259,3 +272,4 @@ void AddSC_boss_garr()
|
|||||||
//pNewScript->GetAI = &GetAI_mob_firesworn;
|
//pNewScript->GetAI = &GetAI_mob_firesworn;
|
||||||
//pNewScript->RegisterSelf();
|
//pNewScript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user