void Aggro(Unit* pWho) { SummonOrbs(); if (!m_bIntro) DoScriptText(-1713555, m_creature); m_creature->SetInCombatWithZone(); m_pInstance->SetData(TYPE_ANUBARAK, IN_PROGRESS); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); }
void UpdateAI(const uint32 uiDiff) { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; switch(m_uiPhase) { case PHASE_NORMAL: { if(m_uiTwinSpikeTimer < uiDiff) { DoCastSpellIfCan(m_creature->getVictim(), SPELL_TWIN_SPIKE_L); m_uiTwinSpikeTimer = urand(25000, 35000); }else m_uiTwinSpikeTimer -= uiDiff; if(m_uiVortexTimer < uiDiff) { if(Unit* pPlayer = PlayerWithDarkEssence()) m_creature->CastSpell(pPlayer, SPELL_DARK_VORTEX, false); DoScriptText(-1713540,m_creature); m_uiVortexTimer = 3*MINUTE*IN_MILLISECONDS; }else m_uiVortexTimer -= uiDiff; if(m_uiSummonOrbsTimer < uiDiff) { SummonOrbs(); m_uiSummonOrbsTimer = 25000; }else m_uiSummonOrbsTimer -= uiDiff; if(m_bIsHeroicMode) { if(m_uiTouchOfLightTimer < uiDiff) { if(Unit* pPlayer = PlayerWithDarkEssence()) DoCastSpellIfCan(pPlayer, SPELL_LIGHT_TOUCH); m_uiTouchOfLightTimer = urand(35000, 50000); }else m_uiTouchOfLightTimer -= uiDiff; } if(m_uiChangePhaseTimer < uiDiff) { if(m_creature->GetHealthPercent() <= 50.0f) { m_uiPhase = PHASE_HEAL; } m_uiChangePhaseTimer = 0; }else m_uiChangePhaseTimer -= uiDiff; if(m_uiTwinPowerTimer < uiDiff) { if(Creature* pFjola = m_pInstance->GetSingleCreatureFromStorage(NPC_DARKBANE)) { if(pFjola->GetHealthPercent() <= 50.0f && pFjola->HasAura(SPELL_SHIELD_DARK)) m_creature->CastSpell(m_creature, SPELL_TWIN_POWER, true); } m_uiTwinPowerTimer = 1*MINUTE*IN_MILLISECONDS; }else m_uiTwinPowerTimer -= uiDiff; DoMeleeAttackIfReady(); break; } case PHASE_HEAL: { //Cast Shield and channel Twin's Pact if(m_uiSpecialTimer < uiDiff) { m_creature->InterruptNonMeleeSpells(true); DoCastSpellIfCan(m_creature, SPELL_SHIELD_LIGHT); DoScriptText(-1713539,m_creature); m_uiSpecialTimer = 1*MINUTE*IN_MILLISECONDS; }else m_uiSpecialTimer -= uiDiff; if(m_uiHealTimer < uiDiff) { DoCastSpellIfCan(m_creature, SPELL_TWIN_PACT_H); m_uiHealTimer = 1*MINUTE*IN_MILLISECONDS; }else m_uiHealTimer -= uiDiff; if(m_uiSwitchPhaseTimer < uiDiff) { m_uiPhase = PHASE_NORMAL; m_uiChangePhaseTimer = 1*MINUTE*IN_MILLISECONDS; m_uiSwitchPhaseTimer = 1*MINUTE*IN_MILLISECONDS; }else m_uiSwitchPhaseTimer -= uiDiff; break; } } }