void UpdateAI(uint32 diff) { if (!UpdateVictim() || !CheckInRoom()) return; events.Update(diff); while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_DISRUPT: DoCastAOE(SPELL_SPELL_DISRUPTION); events.ScheduleEvent(EVENT_DISRUPT, urand(5000, 10000)); break; case EVENT_FEVER: DoCastAOE(SPELL_DECREPIT_FEVER); events.ScheduleEvent(EVENT_FEVER, urand(20000, 25000)); break; case EVENT_PHASE1: TalkToMap(EMOTE_TELEPORT2); me->SetReactState(REACT_AGGRESSIVE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); DoZoneInCombat(); events.Reset(); eruptSection = 3; events.ScheduleEvent(EVENT_DISRUPT, urand(10000, 25000)); events.ScheduleEvent(EVENT_FEVER, urand(15000, 20000)); events.ScheduleEvent(EVENT_PHASE2, 90000); events.ScheduleEvent(EVENT_ERUPT, 15000); phase = PHASE_1; break; case EVENT_PHASE2: TalkToMap(SAY_PHASE); TalkToMap(EMOTE_TELEPORT1); me->SetReactState(REACT_PASSIVE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->AttackStop(); me->RemoveAllAuras(); DoCast(SPELL_TELEPORT_SELF); DoCastAOE(SPELL_PLAGUE_CLOUD); events.Reset(); events.ScheduleEvent(EVENT_PHASE1, 45000); events.ScheduleEvent(EVENT_ERUPT, 8000); phase = PHASE_2; break; case EVENT_ERUPT: instance->SetData(DATA_HEIGAN_ERUPT, eruptSection); TeleportCheaters(); if (eruptSection == 0) eruptDirection = true; else if (eruptSection == 3) eruptDirection = false; eruptDirection ? ++eruptSection : --eruptSection; events.ScheduleEvent(EVENT_ERUPT, EVENT_PHASE1 ? 10000 : 3000); break; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim() || !CheckInRoom()) return; events.Update(diff); while (uint32 eventId = events.ExecuteEvent()) { switch(eventId) { case EVENT_DISRUPT: DoCastAOE(SPELL_SPELL_DISRUPTION); events.ScheduleEvent(EVENT_DISRUPT, urand(5000, 10000)); break; case EVENT_FEVER: DoCastAOE(SPELL_DECREPIT_FEVER); events.ScheduleEvent(EVENT_FEVER, urand(20000, 25000)); break; case EVENT_PHASE: // TODO : Add missing texts for both phase switches EnterPhase(phase == PHASE_FIGHT ? PHASE_DANCE : PHASE_FIGHT); break; case EVENT_ERUPT: instance->SetData(DATA_HEIGAN_ERUPT, eruptSection); TeleportCheaters(); if (eruptSection == 0) eruptDirection = true; else if (eruptSection == 3) eruptDirection = false; eruptDirection ? ++eruptSection : --eruptSection; events.ScheduleEvent(EVENT_ERUPT, phase == PHASE_FIGHT ? 10000 : 4000); //Shiro: time between eruption set from 3000 to 4000 break; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim() || !CheckInRoom()) return; events.Update(diff); while(uint32 eventId = events.ExecuteEvent()) { switch(eventId) { case EVENT_DISRUPT: DoCastAOE(SPELL_SPELL_DISRUPTION); events.ScheduleEvent(EVENT_DISRUPT, 5000); return; case EVENT_FEVER: DoCastAOE(SPELL_DECREPIT_FEVER); events.ScheduleEvent(EVENT_FEVER, 20000); return; case EVENT_PHASE: EnterPhase(phase == PHASE_FIGHT ? PHASE_DANCE : PHASE_FIGHT); return; case EVENT_ERUPT: instance->SetData(DATA_HEIGAN_ERUPT, eruptSection); TeleportCheaters(); if (eruptSection == 0) eruptDirection = true; else if (eruptSection == 3) eruptDirection = false; eruptDirection ? ++eruptSection : --eruptSection; events.ScheduleEvent(EVENT_ERUPT, phase == PHASE_FIGHT ? 10000 : 3000); break; } } DoMeleeAttackIfReady(); }
void UpdateAI(uint32 diff) override { if (!UpdateVictim() || !CheckInRoom()) return; events.Update(diff); while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_DISRUPT: DoCastAOE(SPELL_SPELL_DISRUPTION); events.ScheduleEvent(EVENT_DISRUPT, 11 * IN_MILLISECONDS); break; case EVENT_FEVER: DoCastAOE(SPELL_DECREPIT_FEVER); events.ScheduleEvent(EVENT_FEVER, urand(20 * IN_MILLISECONDS, 25 * IN_MILLISECONDS)); break; case EVENT_DANCE: events.SetPhase(PHASE_DANCE); Talk(SAY_TAUNT); Talk(EMOTE_DANCE); eruptSection = 3; me->SetReactState(REACT_PASSIVE); me->AttackStop(); me->StopMoving(); DoCast(SPELL_TELEPORT_SELF); DoCastAOE(SPELL_PLAGUE_CLOUD); events.ScheduleEvent(EVENT_DANCE_END, 45 * IN_MILLISECONDS, 0, PHASE_DANCE); events.ScheduleEvent(EVENT_ERUPT, 10 * IN_MILLISECONDS); break; case EVENT_DANCE_END: events.SetPhase(PHASE_FIGHT); Talk(EMOTE_DANCE_END); eruptSection = 3; events.ScheduleEvent(EVENT_DISRUPT, urand(10, 25) * IN_MILLISECONDS, 0, PHASE_FIGHT); events.ScheduleEvent(EVENT_FEVER, urand(15, 20) * IN_MILLISECONDS, 0, PHASE_FIGHT); events.ScheduleEvent(EVENT_DANCE, 90 * IN_MILLISECONDS, 0, PHASE_FIGHT); events.ScheduleEvent(EVENT_ERUPT, 15 * IN_MILLISECONDS, 0, PHASE_FIGHT); me->CastStop(); me->SetReactState(REACT_AGGRESSIVE); DoZoneInCombat(); break; case EVENT_ERUPT: instance->SetData(DATA_HEIGAN_ERUPT, eruptSection); TeleportCheaters(); if (eruptSection == 0) eruptDirection = true; else if (eruptSection == 3) eruptDirection = false; eruptDirection ? ++eruptSection : --eruptSection; if (events.IsInPhase(PHASE_DANCE)) events.ScheduleEvent(EVENT_ERUPT, 3 * IN_MILLISECONDS, 0, PHASE_DANCE); else events.ScheduleEvent(EVENT_ERUPT, 10 * IN_MILLISECONDS, 0, PHASE_FIGHT); break; } } DoMeleeAttackIfReady(); }
void UpdateAI(uint32 diff) override { if (!UpdateVictim()) return; events.Update(diff); while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_DISRUPT: DoCastAOE(SPELL_SPELL_DISRUPTION); events.Repeat(Seconds(11)); break; case EVENT_FEVER: DoCastAOE(SPELL_DECREPIT_FEVER); events.Repeat(randtime(Seconds(20), Seconds(25))); break; case EVENT_DANCE: events.SetPhase(PHASE_DANCE); Talk(SAY_TAUNT); Talk(EMOTE_DANCE); _safeSection = 0; me->SetReactState(REACT_PASSIVE); me->AttackStop(); me->StopMoving(); DoCast(SPELL_TELEPORT_SELF); DoCastAOE(SPELL_PLAGUE_CLOUD); events.ScheduleEvent(EVENT_DANCE_END, Seconds(45), 0, PHASE_DANCE); events.RescheduleEvent(EVENT_ERUPT, Seconds(10)); break; case EVENT_DANCE_END: events.SetPhase(PHASE_FIGHT); Talk(EMOTE_DANCE_END); _safeSection = 0; events.ScheduleEvent(EVENT_DISRUPT, randtime(Seconds(10), Seconds(25)), 0, PHASE_FIGHT); events.ScheduleEvent(EVENT_FEVER, randtime(Seconds(15), Seconds(20)), 0, PHASE_FIGHT); events.ScheduleEvent(EVENT_DANCE, Minutes(1) + Seconds(30), 0, PHASE_FIGHT); events.RescheduleEvent(EVENT_ERUPT, Seconds(15)); me->CastStop(); me->SetReactState(REACT_AGGRESSIVE); DoZoneInCombat(); break; case EVENT_ERUPT: TeleportCheaters(); for (uint8 section = 0; section < numSections; ++section) if (section != _safeSection) for (ObjectGuid tileGUID : _eruptTiles[section]) if (GameObject* tile = ObjectAccessor::GetGameObject(*me, tileGUID)) { tile->SendCustomAnim(0); tile->CastSpell(nullptr, SPELL_ERUPTION); } if (_safeSection == 0) _danceDirection = true; else if (_safeSection == numSections-1) _danceDirection = false; _danceDirection ? ++_safeSection : --_safeSection; events.Repeat(events.IsInPhase(PHASE_DANCE) ? Seconds(3) : Seconds(10)); break; } } DoMeleeAttackIfReady(); }