void UpdateAI(uint32 diff) { // World Notify Cooldown if (notifyCooldown >= diff) notifyCooldown -= diff; else notifyCooldown = 0; if (!UpdateVictim()) return; // Defender Quest Credit if (!defenderCredit) if (me->getThreatManager().getThreatList().size() >= 5 && me->GetHealthPct() < 90.f) // Anti-Farming Conditions defenderCredit = true; // Boss rescaling if (rescaleTimer <= diff) { HandleScaling(); rescaleTimer = 10000; } else rescaleTimer -= diff; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case SPELL_BERSERKER_CHARGE: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_BERSERKER_CHARGE); events.ScheduleEvent(SPELL_BERSERKER_CHARGE, 25000); break; case SPELL_UPPERCUT: DoCastVictim(SPELL_UPPERCUT); events.ScheduleEvent(SPELL_UPPERCUT, 20000); break; case SPELL_THUNDERCLAP: DoCastVictim(SPELL_THUNDERCLAP); events.ScheduleEvent(SPELL_THUNDERCLAP, 15000); break; case SPELL_MORTAL_STRIKE: DoCastVictim(SPELL_MORTAL_STRIKE); events.ScheduleEvent(SPELL_MORTAL_STRIKE, 15000); break; case SPELL_CLEAVE: DoCastVictim(SPELL_CLEAVE); events.ScheduleEvent(SPELL_CLEAVE, 7000); break; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { // World Notify Cooldown if (notifyCooldown >= diff) notifyCooldown -= diff; else notifyCooldown = 0; if (!UpdateVictim()) return; // Defender Quest Credit if (!defenderCredit) if (me->getThreatManager().getThreatList().size() >= 5 && me->GetHealthPct() < 90.f) // Anti-Farming Conditions defenderCredit = true; // Boss rescaling if (rescaleTimer <= diff) { HandleScaling(); rescaleTimer = 10000; } else rescaleTimer -= diff; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case SPELL_HOLY_BLAST: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true)) DoCast(target, SPELL_HOLY_BLAST); events.ScheduleEvent(SPELL_HOLY_BLAST, urand(7000, 11000)); break; case SPELL_HOLY_NOVA: DoCast(me, SPELL_HOLY_NOVA); events.ScheduleEvent(SPELL_HOLY_NOVA, urand(12000, 17000)); break; case SPELL_HOLY_SMITE: DoCastVictim(SPELL_HOLY_SMITE); events.ScheduleEvent(SPELL_HOLY_SMITE, urand(8000, 12000)); break; case SPELL_PRAYER_OF_HEALING: DoCast(me, SPELL_PRAYER_OF_HEALING); events.ScheduleEvent(SPELL_PRAYER_OF_HEALING, urand(15000, 22000)); break; case SPELL_STAFF_STRIKE: DoCastVictim(SPELL_STAFF_STRIKE); events.ScheduleEvent(SPELL_STAFF_STRIKE, urand(5000, 8000)); break; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { // World Notify Cooldown if (notifyCooldown >= diff) notifyCooldown -= diff; else notifyCooldown = 0; if (!UpdateVictim()) return; // Defender Quest Credit if (!defenderCredit) if (me->getThreatManager().getThreatList().size() >= 5 && me->GetHealthPct() < 90.f) // Anti-Farming Conditions defenderCredit = true; // Boss rescaling if (rescaleTimer <= diff) { HandleScaling(); rescaleTimer = 10000; } else rescaleTimer -= diff; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case SPELL_ARCANE_SHOCK: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true)) DoCast(target, SPELL_ARCANE_SHOCK); events.ScheduleEvent(SPELL_ARCANE_SHOCK, urand(9000, 11000)); break; case SPELL_CLEAVE_LORTHEMAR: DoCastVictim(SPELL_CLEAVE_LORTHEMAR, true); events.ScheduleEvent(SPELL_CLEAVE_LORTHEMAR, urand(5000, 7000)); break; case SPELL_MANA_BURN: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, ManaBurnTargetSelector())) DoCast(target, SPELL_MANA_BURN); events.ScheduleEvent(SPELL_MANA_BURN, urand(12000, 15000)); break; case SPELL_MASS_CHARM: // currently increases worldserver load by a massive amount until kernel kills it through out of memory // DoCast(me, SPELL_MASS_CHARM); // Results in: WorldSocket::SendPacket enqueue_tail failed events.ScheduleEvent(SPELL_MASS_CHARM, urand(16000, 20000)); break; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { // World Notify Cooldown if (notifyCooldown >= diff) notifyCooldown -= diff; else notifyCooldown = 0; if (!UpdateVictim()) return; // Defender Quest Credit if (!defenderCredit) if (me->getThreatManager().getThreatList().size() >= 5 && me->GetHealthPct() < 90.f) // Anti-Farming Conditions defenderCredit = true; // Boss rescaling if (rescaleTimer <= diff) { HandleScaling(); rescaleTimer = 10000; } else rescaleTimer -= diff; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case SPELL_AVATAR: DoCast(me, SPELL_AVATAR); events.ScheduleEvent(SPELL_AVATAR, 15000 + urand(12000, 15000)); break; case SPELL_KNOCK_AWAY: DoCastVictim(SPELL_KNOCK_AWAY); DoResetThreat(); if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true)) AttackStart(target); events.ScheduleEvent(SPELL_KNOCK_AWAY, urand(28000, 32000)); break; case SPELL_STORM_BOLT: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true)) DoCast(target, SPELL_STORM_BOLT); events.ScheduleEvent(SPELL_STORM_BOLT, urand(7000, 9000)); break; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { // World Notify Cooldown if (notifyCooldown >= diff) notifyCooldown -= diff; else notifyCooldown = 0; if (!UpdateVictim()) return; // Defender Quest Credit if (!defenderCredit) if (me->getThreatManager().getThreatList().size() >= 5 && me->GetHealthPct() < 90.f) // Anti-Farming Conditions defenderCredit = true; // Boss rescaling if (rescaleTimer <= diff) { HandleScaling(); rescaleTimer = 10000; } else rescaleTimer -= diff; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case SPELL_BOMB: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true)) DoCast(target, SPELL_BOMB); events.ScheduleEvent(SPELL_BOMB, urand(8000, 15000)); break; case SPELL_GOBLIN_DRAGON_GUN: DoCastVictim(SPELL_GOBLIN_DRAGON_GUN); events.ScheduleEvent(SPELL_GOBLIN_DRAGON_GUN, urand(15000, 20000)); break; case SPELL_SUPER_SHRINK_RAY: DoCastVictim(SPELL_SUPER_SHRINK_RAY); // needs to target mutiple players, hits only one though... events.ScheduleEvent(SPELL_SUPER_SHRINK_RAY, urand(25000, 35000)); break; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { // World Notify Cooldown if (notifyCooldown >= diff) notifyCooldown -= diff; else notifyCooldown = 0; if (!UpdateVictim()) return; // Defender Quest Credit if (!defenderCredit) if (me->getThreatManager().getThreatList().size() >= 5 && me->GetHealthPct() < 90.f) // Anti-Farming Conditions defenderCredit = true; // Boss rescaling if (rescaleTimer <= diff) { HandleScaling(); rescaleTimer = 10000; } else rescaleTimer -= diff; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case SPELL_BLIZZARD: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true)) DoCast(target, SPELL_BLIZZARD); events.ScheduleEvent(SPELL_BLIZZARD, urand(15000, 18000)); break; case SPELL_FIRE_BLAST: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, true)) DoCast(target, SPELL_FIRE_BLAST); events.ScheduleEvent(SPELL_FIRE_BLAST, urand(5000, 8000)); break; case SPELL_FIREBALL: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true)) DoCast(target, SPELL_FIREBALL); events.ScheduleEvent(SPELL_FIREBALL, urand(7000, 10000)); break; case SPELL_SUMMON_WATER_ELEMENT: if (Summons.size() < 4) DoCast(me, SPELL_SUMMON_WATER_ELEMENT); events.ScheduleEvent(SPELL_SUMMON_WATER_ELEMENT, urand(20000, 30000)); break; case SPELL_TELEPORT: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true)) { DoModifyThreatPercent(target, 100); // Delete Target from Threat List DoCast(target, SPELL_TELEPORT); } events.ScheduleEvent(SPELL_TELEPORT, urand(37000, 52000)); break; } } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (LamentEvent) { if (LamentEventTimer <= diff) { DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN); LamentEventTimer = 2000; if (!me->HasAura(SPELL_SYLVANAS_CAST)) { DoScriptText(SAY_LAMENT_END, me); DoScriptText(EMOTE_LAMENT_END, me); LamentEvent = false; } } else LamentEventTimer -= diff; } // World Notify Cooldown if (notifyCooldown >= diff) notifyCooldown -= diff; else notifyCooldown = 0; if (!UpdateVictim()) return; // Defender Quest Credit if (!defenderCredit) if (me->getThreatManager().getThreatList().size() >= 5 && me->GetHealthPct() < 90.f) // Anti-Farming Conditions defenderCredit = true; // Boss rescaling if (rescaleTimer <= diff) { HandleScaling(); rescaleTimer = 10000; } else rescaleTimer -= diff; events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case SPELL_BLACK_ARROW: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true)) DoCast(target, SPELL_BLACK_ARROW); events.ScheduleEvent(SPELL_BLACK_ARROW, urand(15000, 25000)); break; case SPELL_FADE: DoCast(me, SPELL_FADE); events.ScheduleEvent(SPELL_FADE, urand(25000, 35000)); break; case SPELL_MULTI_SHOT: DoCastVictim(SPELL_MULTI_SHOT); events.ScheduleEvent(SPELL_MULTI_SHOT, urand(11000, 14000)); break; case SPELL_SHOOT_SYLVANAS: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true)) if (me->GetDistance(target) > 5.0f) DoCast(target, SPELL_SHOOT_SYLVANAS); events.ScheduleEvent(SPELL_SHOOT_SYLVANAS, urand(6000, 9000)); break; case SPELL_SUMMON_SKELETON: if (Summons.size() < 7) DoCast(me, SPELL_SUMMON_SKELETON); events.ScheduleEvent(SPELL_SUMMON_SKELETON, urand(17000, 23000)); break; } } DoMeleeAttackIfReady(); }