Make Sartharion check if dragons alive before cast on them. Patch by Gyullo

--HG--
branch : trunk
This commit is contained in:
Kudlaty
2009-08-20 21:50:30 +02:00
parent 52a43d19ef
commit 2035948f63
@@ -255,9 +255,9 @@ struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI
void FetchDragons()
{
Unit* pTene = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_TENEBRON));
Unit* pShad = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_SHADRON));
Unit* pVesp = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_VESPERON));
Unit* pTene = Unit::GetUnit(*m_creature, m_pInstance->GetData64(DATA_TENEBRON));
Unit* pShad = Unit::GetUnit(*m_creature, m_pInstance->GetData64(DATA_SHADRON));
Unit* pVesp = Unit::GetUnit(*m_creature, m_pInstance->GetData64(DATA_VESPERON));
//if at least one of the dragons are alive and are being called
bool bCanUseWill = false;
@@ -355,11 +355,15 @@ struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI
if (!UpdateVictim())
return;
Unit* pTene = Unit::GetUnit(*m_creature, m_pInstance->GetData64(DATA_TENEBRON));
Unit* pShad = Unit::GetUnit(*m_creature, m_pInstance->GetData64(DATA_SHADRON));
Unit* pVesp = Unit::GetUnit(*m_creature, m_pInstance->GetData64(DATA_VESPERON));
//spell will target dragons, if they are still alive at 35%
if (!m_bIsBerserk && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 35)
if (!m_bIsBerserk && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 35 && (pTene->isAlive() || pShad->isAlive() || pVesp->isAlive()))
{
DoScriptText(SAY_SARTHARION_BERSERK,m_creature);
DoCast(m_creature,SPELL_BERSERK);
DoScriptText(SAY_SARTHARION_BERSERK, m_creature);
DoCast(m_creature, SPELL_BERSERK);
m_bIsBerserk = true;
}