void UpdateAI(uint32 diff) override { if (!UpdateVictim()) return; events.Update(diff); while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_HARD_ENRAGE: if (!_isHardEnraged) { DoCast(me, SPELL_PYROBUFFET, true); _isHardEnraged = true; } break; case EVENT_FLAME_TSUNAMI: Talk(WHISPER_LAVA_CHURN); switch (urand(0, 1)) { case 0: { if (Creature* right1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight1Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000)) right1->GetMotionMaster()->MovePoint(0, FlameRight1Direction); if (Creature* right2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight2Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000)) right2->GetMotionMaster()->MovePoint(0, FlameRight2Direction); if (Creature* right3 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight3Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000)) right3->GetMotionMaster()->MovePoint(0, FlameRight3Direction); break; } case 1: { if (Creature* left1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft1Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000)) left1->GetMotionMaster()->MovePoint(0, FlameLeft1Direction); if (Creature* left2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft2Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000)) left2->GetMotionMaster()->MovePoint(0, FlameLeft2Direction); break; } } events.ScheduleEvent(EVENT_FLAME_TSUNAMI, 30000); break; case EVENT_FLAME_BREATH: Talk(SAY_SARTHARION_BREATH); DoCastVictim(SPELL_FLAME_BREATH); events.ScheduleEvent(EVENT_FLAME_BREATH, urand(25000, 35000)); break; case EVENT_TAIL_SWEEP: DoCastVictim(SPELL_TAIL_LASH); events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000)); break; case EVENT_CLEAVE_ATTACK: DoCastVictim(SPELL_CLEAVE); events.ScheduleEvent(EVENT_CLEAVE_ATTACK, urand(7000, 10000)); break; case EVENT_LAVA_STRIKE: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { CastLavaStrikeOnTarget(target); if (urand(0, 5) == 0) Talk(SAY_SARTHARION_SPECIAL); } events.ScheduleEvent(EVENT_LAVA_STRIKE, (_isSoftEnraged ? urand(1400, 2000) : urand(5000, 20000))); break; case EVENT_CALL_TENEBRON: CallDragon(DATA_TENEBRON); break; case EVENT_CALL_SHADRON: CallDragon(DATA_SHADRON); break; case EVENT_CALL_VESPERON: CallDragon(DATA_VESPERON); break; default: break; } } // At 35% spell will target dragons, if they are still alive. if (!_isBerserk && !HealthAbovePct(35)) { if (instance->GetBossState(DATA_TENEBRON) != DONE || instance->GetBossState(DATA_SHADRON) != DONE || instance->GetBossState(DATA_VESPERON) != DONE) { Talk(SAY_SARTHARION_BERSERK); DoCast(me, SPELL_BERSERK); _isBerserk = true; } } // Soft Enrage used while determining Lava Strike cooldown. if (!_isSoftEnraged && HealthBelowPct(10)) { _isSoftEnraged = true; } DoMeleeAttackIfReady(); EnterEvadeIfOutOfCombatArea(diff); }
void UpdateAI(const uint32 uiDiff) override { // Return since we have no target if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; // spell will target dragons, if they are still alive at 35% if (!m_bIsBerserk && m_creature->GetHealthPercent() < 35.0f) { if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK) { DoScriptText(SAY_SARTHARION_BERSERK, m_creature); m_bIsBerserk = true; } } // soft enrage if (!m_bIsSoftEnraged && m_creature->GetHealthPercent() <= 10.0f) { // TODO m_bIsSoftEnraged = true; } // hard enrage if (!m_bIsHardEnraged) { if (m_uiEnrageTimer < uiDiff) { if (DoCastSpellIfCan(m_creature, SPELL_PYROBUFFET, CAST_TRIGGERED) == CAST_OK) m_bIsHardEnraged = true; } else m_uiEnrageTimer -= uiDiff; } // flame tsunami if (m_uiFlameTsunamiTimer < uiDiff) { SendFlameTsunami(); m_uiFlameTsunamiTimer = 30000; } else m_uiFlameTsunamiTimer -= uiDiff; // flame breath if (m_uiFlameBreathTimer < uiDiff) { if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_FLAME_BREATH : SPELL_FLAME_BREATH_H) == CAST_OK) { DoScriptText(SAY_SARTHARION_BREATH, m_creature); m_uiFlameBreathTimer = urand(25000, 35000); } } else m_uiFlameBreathTimer -= uiDiff; // Tail Sweep if (m_uiTailSweepTimer < uiDiff) { if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_TAIL_LASH : SPELL_TAIL_LASH_H) == CAST_OK) m_uiTailSweepTimer = urand(15000, 20000); } else m_uiTailSweepTimer -= uiDiff; // Cleave if (m_uiCleaveTimer < uiDiff) { if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK) m_uiCleaveTimer = urand(7000, 10000); } else m_uiCleaveTimer -= uiDiff; // Lavas Strike if (m_uiLavaStrikeTimer < uiDiff) { if (m_pInstance) { if (Creature* pCyclone = m_creature->GetMap()->GetCreature(m_pInstance->SelectRandomFireCycloneGuid())) pCyclone->CastSpell(pCyclone, SPELL_CYCLONE_AURA_STRIKE, true); switch (urand(0, 5)) { case 0: DoScriptText(SAY_SARTHARION_SPECIAL_1, m_creature); break; case 1: DoScriptText(SAY_SARTHARION_SPECIAL_2, m_creature); break; case 2: DoScriptText(SAY_SARTHARION_SPECIAL_3, m_creature); break; case 3: DoScriptText(SAY_SARTHARION_SPECIAL_4, m_creature); break; } } m_uiLavaStrikeTimer = 30000; } else m_uiLavaStrikeTimer -= uiDiff; // call tenebron if (!m_bHasCalledTenebron) { if (m_uiTenebronTimer < uiDiff) { CallDragon(NPC_TENEBRON); m_bHasCalledTenebron = true; } else m_uiTenebronTimer -= uiDiff; } // call shadron if (!m_bHasCalledShadron) { if (m_uiShadronTimer < uiDiff) { CallDragon(NPC_SHADRON); m_bHasCalledShadron = true; } else m_uiShadronTimer -= uiDiff; } // call vesperon if (!m_bHasCalledVesperon) { if (m_uiVesperonTimer < uiDiff) { CallDragon(NPC_VESPERON); m_bHasCalledVesperon = true; } else m_uiVesperonTimer -= uiDiff; } DoMeleeAttackIfReady(); EnterEvadeIfOutOfCombatArea(uiDiff); }
void UpdateAI(const uint32 uiDiff) { //Return since we have no target if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; //spell will target dragons, if they are still alive at 35% if (!m_bIsBerserk && m_creature->GetHealthPercent() < 35.0f) { DoScriptText(SAY_SARTHARION_BERSERK, m_creature); DoCastSpellIfCan(m_creature, SPELL_BERSERK); m_bIsBerserk = true; } //soft enrage if (!m_bIsSoftEnraged && m_creature->GetHealthPercent() <= 10.0f) { // TODO m_bIsSoftEnraged = true; } // hard enrage if (!m_bIsHardEnraged) { if (m_uiEnrageTimer < uiDiff) { DoCastSpellIfCan(m_creature, SPELL_PYROBUFFET, CAST_TRIGGERED); m_bIsHardEnraged = true; } else m_uiEnrageTimer -= uiDiff; } // flame tsunami if (m_uiFlameTsunamiTimer < uiDiff) { SendFlameTsunami(); m_uiFlameTsunamiTimer = 30000; } else m_uiFlameTsunamiTimer -= uiDiff; // flame breath if (m_uiFlameBreathTimer < uiDiff) { DoScriptText(SAY_SARTHARION_BREATH, m_creature); DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_FLAME_BREATH : SPELL_FLAME_BREATH_H); m_uiFlameBreathTimer = urand(25000, 35000); } else m_uiFlameBreathTimer -= uiDiff; // Tail Sweep if (m_uiTailSweepTimer < uiDiff) { DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_TAIL_LASH : SPELL_TAIL_LASH_H); m_uiTailSweepTimer = urand(15000, 20000); } else m_uiTailSweepTimer -= uiDiff; // Cleave if (m_uiCleaveTimer < uiDiff) { DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); m_uiCleaveTimer = urand(7000, 10000); } else m_uiCleaveTimer -= uiDiff; // Lavas Strike if (m_uiLavaStrikeTimer < uiDiff) { if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { DoCastSpellIfCan(pTarget, SPELL_LAVA_STRIKE); switch(urand(0, 15)) { case 0: DoScriptText(SAY_SARTHARION_SPECIAL_1, m_creature); break; case 1: DoScriptText(SAY_SARTHARION_SPECIAL_2, m_creature); break; case 2: DoScriptText(SAY_SARTHARION_SPECIAL_3, m_creature); break; } } m_uiLavaStrikeTimer = urand(5000, 20000); } else m_uiLavaStrikeTimer -= uiDiff; // call tenebron if (!m_bHasCalledTenebron && m_uiTenebronTimer < uiDiff) { CallDragon(DATA_TENEBRON); m_bHasCalledTenebron = true; } else m_uiTenebronTimer -= uiDiff; // call shadron if (!m_bHasCalledShadron && m_uiShadronTimer < uiDiff) { CallDragon(DATA_SHADRON); m_bHasCalledShadron = true; } else m_uiShadronTimer -= uiDiff; // call vesperon if (!m_bHasCalledVesperon && m_uiVesperonTimer < uiDiff) { CallDragon(DATA_VESPERON); m_bHasCalledVesperon = true; } else m_uiVesperonTimer -= uiDiff; DoMeleeAttackIfReady(); EnterEvadeIfOutOfCombatArea(uiDiff); }