void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; // Void Zone if (VoidZoneTimer <= diff) { DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true), SPELL_VOIDZONE, true); VoidZoneTimer = 15000; } else VoidZoneTimer -= diff; // NetherInfusion Berserk if (!Berserk && NetherInfusionTimer <= diff) { me->AddAura(SPELL_NETHER_INFUSION, me); DoCast(me, SPELL_NETHERSPITE_ROAR); Berserk = true; } else NetherInfusionTimer -= diff; if (PortalPhase) // PORTAL PHASE { // Distribute beams and buffs if (PortalTimer <= diff) { UpdatePortals(); PortalTimer = 1000; } else PortalTimer -= diff; // Empowerment & Nether Burn if (EmpowermentTimer <= diff) { DoCast(me, SPELL_EMPOWERMENT); me->AddAura(SPELL_NETHERBURN_AURA, me); EmpowermentTimer = 90000; } else EmpowermentTimer -= diff; if (PhaseTimer <= diff) { if (!me->IsNonMeleeSpellCasted(false)) { SwitchToBanishPhase(); return; } } else PhaseTimer -= diff; } else // BANISH PHASE { // Netherbreath if (NetherbreathTimer <= diff) { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true)) DoCast(pTarget, SPELL_NETHERBREATH); NetherbreathTimer = urand(5000, 7000); } else NetherbreathTimer -= diff; if (PhaseTimer <= diff) { if (!me->IsNonMeleeSpellCasted(false)) { SwitchToPortalPhase(); return; } } else PhaseTimer -= diff; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if(!UpdateVictim()) return; DoSpecialThings(diff, DO_EVERYTHING, 125.0f, 1.5f); // Void Zone if(VoidZoneTimer < diff) { if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1,GetSpellMaxRange(SPELL_VOIDZONE),true, m_creature->getVictimGUID())) AddSpellToCast(target,SPELL_VOIDZONE,true); VoidZoneTimer = 15000; } else VoidZoneTimer -= diff; // NetherInfusion Berserk if(!Berserk && NetherInfusionTimer < diff) { m_creature->AddAura(SPELL_NETHER_INFUSION, m_creature); ForceSpellCast(m_creature, SPELL_NETHERSPITE_ROAR, INTERRUPT_AND_CAST_INSTANTLY); Berserk = true; } else NetherInfusionTimer -= diff; if(PortalPhase) // PORTAL PHASE { // Distribute beams and buffs if(PortalTimer < diff) { UpdatePortals(); PortalTimer = 1000; } else PortalTimer -= diff; // Empowerment & Nether Burn if(EmpowermentTimer < diff) { ForceSpellCast(m_creature, SPELL_EMPOWERMENT); m_creature->AddAura(SPELL_NETHERBURN_AURA, m_creature); EmpowermentTimer = 90000; } else EmpowermentTimer -= diff; if(PhaseTimer < diff) { if(!m_creature->IsNonMeleeSpellCast(false)) { SwitchToBanishPhase(); return; } } else PhaseTimer -= diff; DoMeleeAttackIfReady(); } else // BANISH PHASE { if(m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) { m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MoveIdle(); } // Netherbreath if(NetherbreathTimer < diff) { if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0,GetSpellMaxRange(SPELL_NETHERBREATH),true)) AddSpellToCast(target,SPELL_NETHERBREATH); NetherbreathTimer = 5000+rand()%2000; } else NetherbreathTimer -= diff; if(PhaseTimer < diff) { if(!m_creature->IsNonMeleeSpellCast(false)) { SwitchToPortalPhase(); return; } } else PhaseTimer -= diff; } CastNextSpellIfAnyAndReady(); }