// Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited. void CastBloodboil() { std::list<Unit* > targets; Map* map = me->GetMap(); if (map->IsDungeon()) { InstanceMap::PlayerList const& PlayerList = ((InstanceMap*)map)->GetPlayers(); for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if (Player* i_pl = i->GetSource()) { if (i_pl && i_pl->IsAlive()) targets.push_back(i_pl); } } } //Sort the list of players targets.sort(Oregon::ObjectDistanceOrderPred(me, false)); //Resize so we only get top 5 targets.resize(5); //Aura each player in the targets list with Bloodboil. for (std::list<Unit* >::iterator itr = targets.begin(); itr != targets.end(); ++itr) { Unit* pTarget = *itr; if (pTarget && pTarget->IsAlive()) me->AddAura(SPELL_BLOODBOIL, pTarget); } targets.clear(); }
uint32 NextStep(uint32 Step) { Unit* arca = Unit::GetUnit((*me), ArcanagosGUID); Map* pMap = me->GetMap(); switch (Step) { case 0: return 9999999; case 1: me->MonsterYell(SAY_DIALOG_MEDIVH_1, LANG_UNIVERSAL, 0); return 10000; case 2: if (arca) CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL, 0); return 20000; case 3: me->MonsterYell(SAY_DIALOG_MEDIVH_3, LANG_UNIVERSAL, 0); return 10000; case 4: if (arca) CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, 0); return 20000; case 5: me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, 0); return 20000; case 6: if (arca) CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, 0); return 10000; case 7: FireArcanagosTimer = 500; return 5000; case 8: FireMedivhTimer = 500; DoCast(me, SPELL_MANA_SHIELD); return 10000; case 9: me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false); return 10000; case 10: if (arca) DoCast(arca, SPELL_CONFLAGRATION_BLAST, false); return 1000; case 11: if (arca) CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, 0); return 5000; case 12: arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f); arca->setActive(true); arca->InterruptNonMeleeSpells(true); arca->SetSpeed(MOVE_FLIGHT, 2.0f); return 10000; case 13: me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, 0); return 10000; case 14: me->SetVisible(false); me->ClearInCombat(); if (pMap->IsDungeon()) { InstanceMap::PlayerList const& PlayerList = pMap->GetPlayers(); for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if (i->GetSource()->IsAlive()) { if (i->GetSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE) i->GetSource()->CompleteQuest(9645); } } } return 50000; case 15: arca->DealDamage(arca, arca->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); return 5000; default : return 9999999; } }