void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_SHADOW_CRASH: if (Unit* target = CheckPlayersInRange(RAID_MODE(4, 9), 15.0f, 50.0f)) DoCast(target, SPELL_SHADOW_CRASH); events.ScheduleEvent(EVENT_SHADOW_CRASH, urand(8*IN_MILLISECONDS, 12*IN_MILLISECONDS)); return; case EVENT_SEARING_FLAMES: DoCastAOE(SPELL_SEARING_FLAMES); events.ScheduleEvent(EVENT_SEARING_FLAMES, urand(14*IN_MILLISECONDS, 17.5*IN_MILLISECONDS)); return; case EVENT_MARK_OF_THE_FACELESS: if (Unit* target = CheckPlayersInRange(RAID_MODE(4, 9), 15.0f, 50.0f)) DoCast(target, SPELL_MARK_OF_THE_FACELESS); events.ScheduleEvent(EVENT_MARK_OF_THE_FACELESS, urand(35*IN_MILLISECONDS, 45*IN_MILLISECONDS)); return; case EVENT_SURGE_OF_DARKNESS: Talk(EMOTE_SURGE_OF_DARKNESS); Talk(SAY_SURGE_OF_DARKNESS); DoCast(me, SPELL_SURGE_OF_DARKNESS); events.ScheduleEvent(EVENT_SURGE_OF_DARKNESS, urand(50*IN_MILLISECONDS, 70*IN_MILLISECONDS)); return; case EVENT_SUMMON_SARONITE_VAPOR: DoCast(me, SPELL_SUMMON_SARONITE_VAPORS, true); // Spells summons 33488 in a random place in 40 meters if (summons.size() >= 6) // summons include both vapors and saronite animus, but since the animus was not spawned yet... { events.CancelEvent(EVENT_SUMMON_SARONITE_VAPOR); // Should always be cancelled after six vapors got spawned if (!vaporKilled && notHardModed) // If animus was not spawned yet and no vapor got killed yet... DoCast(SPELL_SUMMON_SARONITE_ANIMUS); events.CancelEvent(EVENT_SUMMON_SARONITE_VAPOR); } else events.ScheduleEvent(EVENT_SUMMON_SARONITE_VAPOR, urand(30*IN_MILLISECONDS, 35*IN_MILLISECONDS)); return; case EVENT_BERSERK: Talk(SAY_BERSERK); DoCast(me, SPELL_BERSERK); return; default: return; } } DoMeleeAttackIfReady(); }
void UpdateAI(uint32 diff) override { if (!UpdateVictim()) return; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_SHADOW_CRASH: { Unit* target = CheckPlayersInRange(RAID_MODE<uint8>(4, 9), 15.0f, 50.0f); if (!target) target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150.0f, true); if (target) DoCast(target, SPELL_SHADOW_CRASH); events.ScheduleEvent(EVENT_SHADOW_CRASH, urand(8000, 12000)); break; } case EVENT_SEARING_FLAMES: DoCastAOE(SPELL_SEARING_FLAMES); events.ScheduleEvent(EVENT_SEARING_FLAMES, urand(14000, 17500)); break; case EVENT_MARK_OF_THE_FACELESS: { Unit* target = CheckPlayersInRange(RAID_MODE<uint8>(4, 9), 15.0f, 50.0f); if (!target) target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150.0f, true); if (target) DoCast(target, SPELL_MARK_OF_THE_FACELESS); events.ScheduleEvent(EVENT_MARK_OF_THE_FACELESS, urand(35000, 45000)); break; } case EVENT_SURGE_OF_DARKNESS: Talk(EMOTE_SURGE_OF_DARKNESS); Talk(SAY_SURGE_OF_DARKNESS); DoCast(me, SPELL_SURGE_OF_DARKNESS); events.ScheduleEvent(EVENT_SURGE_OF_DARKNESS, urand(50000, 70000)); break; case EVENT_SARONITE_VAPORS: DoCast(SPELL_SUMMON_SARONITE_VAPORS); events.ScheduleEvent(EVENT_SARONITE_VAPORS, urand(30000, 35000)); if (++vaporCount == 6 && smellSaronite) { Talk(SAY_HARDMODE); Talk(EMOTE_BARRIER); summons.DespawnAll(); DoCast(me, SPELL_SARONITE_BARRIER); DoCast(SPELL_SUMMON_SARONITE_ANIMUS); me->AddLootMode(LOOT_MODE_HARD_MODE_1); events.CancelEvent(EVENT_SARONITE_VAPORS); events.CancelEvent(EVENT_SEARING_FLAMES); } break; case EVENT_BERSERK: Talk(SAY_BERSERK); DoCast(me, SPELL_BERSERK); break; } if (me->HasUnitState(UNIT_STATE_CASTING)) return; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; events.Update(uiDiff); if (me->HasUnitState(UNIT_STAT_CASTING)) return; while (uint32 uiEventId = events.ExecuteEvent()) { switch (uiEventId) { case EVENT_SHADOW_CRASH: if (Unit * pTarget = GetPlayerAtMinimumRange(15.0f)) DoCast(pTarget, SPELL_SHADOW_CRASH); events.ScheduleEvent(EVENT_SHADOW_CRASH, urand(8000, 12000)); break; case EVENT_SEARING_FLAMES: DoCastAOE(SPELL_SEARING_FLAMES); events.ScheduleEvent(EVENT_SEARING_FLAMES, urand(14000, 17500)); break; case EVENT_MARK_OF_THE_FACELESS: Unit* pTarget; /* He will not cast this on players within 15 yards of him. However, if there are not at least 9 people outside of 15 yards he will start casting it on players inside 15 yards melee and tank included. */ if (!(pTarget = CheckPlayersInRange(RAID_MODE(4, 9), 15.0f, 50.f))) pTarget = SelectTarget(SELECT_TARGET_RANDOM); DoCast(pTarget, SPELL_MARK_OF_THE_FACELESS); events.ScheduleEvent(EVENT_MARK_OF_THE_FACELESS, urand(35000, 45000)); break; case EVENT_SURGE_OF_DARKNESS: DoScriptText(EMOTE_SURGE_OF_DARKNESS, me); DoScriptText(SAY_SURGE_OF_DARKNESS, me); DoCast(me, SPELL_SURGE_OF_DARKNESS); events.ScheduleEvent(EVENT_SURGE_OF_DARKNESS, urand(50000, 70000)); break; case EVENT_SARONITE_VAPORS: DoCast(SPELL_SUMMON_SARONITE_VAPORS); events.ScheduleEvent(EVENT_SARONITE_VAPORS, urand(30000, 35000)); if (++uiVaporCount == 6 && bSmellSaronite) { DoScriptText(SAY_HARDMODE, me); DoScriptText(EMOTE_BARRIER, me); summons.DespawnAll(); DoCast(me, SPELL_SARONITE_BARRIER); DoCast(SPELL_SUMMON_SARONITE_ANIMUS); me->AddLootMode(LOOT_MODE_HARD_MODE_1); events.CancelEvent(EVENT_SARONITE_VAPORS); events.CancelEvent(EVENT_SEARING_FLAMES); } break; case EVENT_BERSERK: DoScriptText(SAY_BERSERK, me); DoCast(me, SPELL_BERSERK); break; } } DoMeleeAttackIfReady(); }
void UpdateAI(uint32 diff) { if (!UpdateVictim()) return; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_SUMMON_VAPOR: float x, y, angle; angle = float(2 * M_PI * rand_norm()); x = 1841.98f + float(25) * cos(angle); y = 113.078f + float(25) * sin(angle); me->SummonCreature(ENTRY_SARONIT_VAPOR, x, y, 344.13f, 0.0f); if (!_animusSummoned) events.ScheduleEvent(EVENT_SUMMON_VAPOR, 30*IN_MILLISECONDS); else summons.DespawnEntry(ENTRY_SARONIT_VAPOR); break; case EVENT_SURGE_OF_DARKNESS: DoCast(me, SPELL_SURGE_OF_DARKNESS); Talk(SAY_SURGE_OF_DARKNESS); Talk(EMOTE_SURGE_OF_DARKNESS); events.ScheduleEvent(EVENT_SURGE_OF_DARKNESS, 63*IN_MILLISECONDS); break; case EVENT_SHADOW_CRASH: { Unit* target = CheckPlayersInRange(RAID_MODE<uint8>(4, 9), 15.0f, 100.0f); if (!target) target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true); if (target) { me->SetTarget(target->GetGUID()); DoCast(target, SPELL_SHADOW_CRASH); } events.ScheduleEvent(EVENT_SHADOW_CRASH, 10*IN_MILLISECONDS); events.ScheduleEvent(EVENT_RESET_TARGET, 1*IN_MILLISECONDS); break; } case EVENT_RESET_TARGET: if (me->GetVictim()) me->SetTarget(me->GetVictim()->GetGUID()); break; case EVENT_MARK_OF_THE_FACELESS: { Unit* target = CheckPlayersInRange(RAID_MODE<uint8>(4, 9), 15.0f, 100.0f); if (!target) target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true); if (target) DoCast(target, SPELL_MARK_OF_THE_FACELESS); events.ScheduleEvent(EVENT_MARK_OF_THE_FACELESS, urand(15, 25) * IN_MILLISECONDS); break; } case EVENT_BERSERK: DoCast(me, SPELL_BERSERK, true); Talk(SAY_BERSERK); break; case EVENT_RESET_IMMUNITY: // called right after Searing Flames' UNIT_STAT_CASTING gets removed me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, true); break; case EVENT_SEARING_FLAMES: me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false); DoCast(SPELL_SEARING_FLAMES); events.ScheduleEvent(EVENT_SEARING_FLAMES, urand(10, 15) * IN_MILLISECONDS); events.ScheduleEvent(EVENT_RESET_IMMUNITY, 0); return; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim() ) return; _DoAggroPulse(diff); if (!AnimusSummoned) if (SummonVarpor_Timer < diff) { DoSummon(ENTRY_SARONIT_VARPOR, me, 45.0f, 30000, TEMPSUMMON_MANUAL_DESPAWN); SummonVarpor_Timer = 30000; }else SummonVarpor_Timer -= diff; if (SurgeOfDarkness_Timer < diff) { if (!me->IsNonMeleeSpellCasted(false)) { DoCast(me, SPELL_SURGE_OF_DARKNESS); DoScriptText(SAY_KITE, me); DoScriptText(EMOTE_SURGE_OF_DARKNESS, me); SurgeOfDarkness_Timer = 63000; } }else SurgeOfDarkness_Timer -= diff; if (ShadowCrash_Timer < diff) { if (!me->IsNonMeleeSpellCasted(false)) { Unit* target = CheckPlayersInRange(RAID_MODE<uint8>(4, 9), 15.0f, 50.0f); if (!target) target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150.0f, true); if (target) DoCast(target, SPELL_SHADOW_CRASH); ShadowCrash_Timer = 10000; } }else ShadowCrash_Timer -= diff; if (!AnimusSummoned || AnimusKilled) if (SearingFlames_Timer < diff) { if (!me->IsNonMeleeSpellCasted(false)) { me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false); DoCast(SPELL_SEARING_FLAMES); SearingFlames_Timer = urand(10000, 15000); ImmunityToReset = true; ResetImmunity_Timer = 2000; } }else SearingFlames_Timer -= diff; if (ImmunityToReset) if (ResetImmunity_Timer < diff) { me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, true); ResetImmunity_Timer = 0; ImmunityToReset = false; }else ResetImmunity_Timer -= diff; if (MarkOfTheFaceless < diff) { if (!me->IsNonMeleeSpellCasted(false)) { Unit* target = CheckPlayersInRange(RAID_MODE<uint8>(4, 9), 15.0f, 50.0f); if (!target) target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150.0f, true); if (target) DoCast(target, SPELL_MARK_OF_THE_FACELESS); MarkOfTheFaceless = urand(15000, 25000); } }else MarkOfTheFaceless -= diff; if (!Berserk) if (Berserk_Timer < diff) { if (!me->IsNonMeleeSpellCasted(false)) { DoCast(me, SPELL_BERSERK, true); DoScriptText(SAY_BERSERK, me); Berserk = true; } }else Berserk_Timer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; events.Update(diff); _DoAggroPulse(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_SUMMON_VAPOR: float x, y, angle; angle = float(2 * M_PI * rand_norm()); x = 1841.98f + float(25) * cos(angle); y = 113.078f + float(25) * sin(angle); me->SummonCreature(ENTRY_SARONIT_VAPOR, x, y, 344.13f, 0.0f); if (!_animusSummoned) events.ScheduleEvent(EVENT_SUMMON_VAPOR, 30*IN_MILLISECONDS); else summons.DespawnEntry(ENTRY_SARONIT_VAPOR); break; case EVENT_SURGE_OF_DARKNESS: DoCast(me, SPELL_SURGE_OF_DARKNESS); DoScriptText(SAY_KITE, me); DoScriptText(EMOTE_SURGE_OF_DARKNESS, me); events.ScheduleEvent(EVENT_SURGE_OF_DARKNESS, 63*IN_MILLISECONDS); break; case EVENT_SHADOW_CRASH: { Unit* target = CheckPlayersInRange(RAID_MODE<uint8>(4, 9), 15.0f, 100.0f); if (!target) target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true); if (target) { me->SetTarget(target->GetGUID()); DoCast(target, SPELL_SHADOW_CRASH); } events.ScheduleEvent(EVENT_SHADOW_CRASH, 10*IN_MILLISECONDS); events.ScheduleEvent(EVENT_RESET_TARGET, 1*IN_MILLISECONDS); break; } case EVENT_RESET_TARGET: if (me->getVictim()) me->SetTarget(me->getVictim()->GetGUID()); break; case EVENT_MARK_OF_THE_FACELESS: { Unit* target = CheckPlayersInRange(RAID_MODE<uint8>(4, 9), 15.0f, 100.0f); if (!target) target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true); if (target) DoCast(target, SPELL_MARK_OF_THE_FACELESS); events.ScheduleEvent(EVENT_MARK_OF_THE_FACELESS, urand(15, 25) * IN_MILLISECONDS); break; } case EVENT_BERSERK: DoCast(me, SPELL_BERSERK, true); DoScriptText(SAY_BERSERK, me); break; case EVENT_SEARING_FLAMES: DoCast(SPELL_SEARING_FLAMES); events.ScheduleEvent(EVENT_SEARING_FLAMES, urand(10, 15) * IN_MILLISECONDS); return; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim() ) return; if(!AnimusSummoned) if(uiSummonVarpor_Timer < diff) { DoSummon(ENTRY_SARONIT_VARPOR,me,45.0f,30000,TEMPSUMMON_MANUAL_DESPAWN); uiSummonVarpor_Timer = 30000; }else uiSummonVarpor_Timer -= diff; if(uiSurgeOfDarkness_Timer < diff) { if(!me->IsNonMeleeSpellCasted(false)) { DoCast(me,SPELL_SURGE_OF_DARKNESS); DoScriptText(SAY_KITE,me); uiSurgeOfDarkness_Timer = 63000; } }else uiSurgeOfDarkness_Timer -= diff; if(uiShadowCrash_Timer < diff) { if(!me->IsNonMeleeSpellCasted(false)) { if(Unit* target = GetPlayerAtMinimumRange(15.0f)) DoCast(target,SPELL_SHADOW_CRASH,false); else if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true)) DoCast(target,SPELL_SHADOW_CRASH,false); uiShadowCrash_Timer = 10000; } }else uiShadowCrash_Timer -= diff; if(!AnimusSummoned || AnimusKilled) if(uiSearingFlames_Timer < diff) { if(!me->IsNonMeleeSpellCasted(false)) { me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false); DoCast(SPELL_SEARING_FLAMES); uiSearingFlames_Timer = urand(10000,15000); ImmunityToReset = true; uiResetImmunity_Timer = 2000; } }else uiSearingFlames_Timer -= diff; if(ImmunityToReset) if(uiResetImmunity_Timer < diff) { me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, true); uiResetImmunity_Timer = 0; ImmunityToReset = false; }else uiResetImmunity_Timer -= diff; if(uiMarkOfTheFaceless < diff) { if(!me->IsNonMeleeSpellCasted(false)) { if(Unit* target = CheckPlayersInRange(RAID_MODE(4,9), 15.0f, 50.f)) DoCast(target,SPELL_MARK_OF_THE_FACELESS,false); else if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true)) DoCast(target,SPELL_MARK_OF_THE_FACELESS,false); uiMarkOfTheFaceless = urand(15000,25000); } }else uiMarkOfTheFaceless -= diff; DoMeleeAttackIfReady(); }