void UpdateAI(uint32 uiDiff) { ScriptedAI::UpdateAI(uiDiff); if (uiTimer <= uiDiff) { switch (uiPhase) { case 1: DoSummonGrandChampion(uiSecondBoss); NextStep(10000, true); break; case 2: DoSummonGrandChampion(uiThirdBoss); NextStep(0, false); break; case 3: if (!Champion1List.empty()) { for (std::list<uint64>::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr) if (Creature* summon = Unit::GetCreature(*me, *itr)) AggroAllPlayers(summon); NextStep(0, false); } break; } } else uiTimer -= uiDiff; if (!UpdateVictim()) return; }
void SetData(uint32 uiType, uint32 uiData) { switch (uiType) { case DATA_START: if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE))) pInstance->HandleGameObject(pGO->GetGUID(),true); if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1))) pInstance->HandleGameObject(pGO->GetGUID(),false); DoScriptText(SAY_START, me); DoSummonGrandChampion(uiFirstBoss); NextStep(10000,false,1); break; case DATA_IN_POSITION: //movement done. me->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); me->GetMotionMaster()->MovePoint(1,735.898, 651.961, 411.93); DoScriptText(SAY_START2, me); if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE))) pInstance->HandleGameObject(pGO->GetGUID(),false); NextStep(20000,false,3); break; case DATA_LESSER_CHAMPIONS_DEFEATED: { ++uiLesserChampions; std::list<uint64> TempList; if (uiLesserChampions == 3 || uiLesserChampions == 6) { switch(uiLesserChampions) { case 3: TempList = Champion2List; break; case 6: TempList = Champion3List; break; } for (std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr) if (Creature* pSummon = Unit::GetCreature(*me, *itr)) AggroAllPlayers(pSummon); }else if (uiLesserChampions == 9) StartGrandChampionsAttack(); break; } } }
void SetData(uint32 uiType, uint32 /*uiData*/) { switch (uiType) { case DATA_START: DoSummonGrandChampion(uiFirstBoss); NextStep(10000, false, 1); break; case DATA_IN_POSITION: //movement done. me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f); if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE))) instance->HandleGameObject(go->GetGUID(), false); NextStep(10000, false, 3); break; case DATA_LESSER_CHAMPIONS_DEFEATED: { ++uiLesserChampions; std::list<uint64> TempList; if (uiLesserChampions == 3 || uiLesserChampions == 6) { switch (uiLesserChampions) { case 3: TempList = Champion2List; break; case 6: TempList = Champion3List; break; } for (std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr) if (Creature* summon = Unit::GetCreature(*me, *itr)) AggroAllPlayers(summon); }else if (uiLesserChampions == 9) StartGrandChampionsAttack(); break; } } }
void SetData(uint32 uiType, uint32 /*uiData*/) override { switch (uiType) { case DATA_START: if (GameObject* gate = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE))) instance->HandleGameObject(gate->GetGUID(),true); if (GameObject* gate = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE1))) instance->HandleGameObject(gate->GetGUID(),false); DoSummonGrandChampion(uiFirstBoss); events.ScheduleEvent(EVENT_SUMMON_FACTION_2, 10000, 0, PHASE_INPROGRESS); break; case DATA_LESSER_CHAMPIONS_DEFEATED: { ++uiLesserChampions; std::list<uint64> TempList; if (uiLesserChampions == 3 || uiLesserChampions == 6) { switch(uiLesserChampions) { case 3: TempList = Champion2List; break; case 6: TempList = Champion3List; break; } for(std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr) if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr)) AggroAllPlayers(summon); } else if (uiLesserChampions == 9) StartGrandChampionsAttack(); break; } } }
void SetData(uint32 type, uint32 data) { if (!instance) return; switch (type) { case DATA_START: if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE))) instance->HandleGameObject(go->GetGUID(), true); if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_PORTCULLIS))) instance->HandleGameObject(go->GetGUID(), false); instance->SetData(DATA_MOVEMENT_DONE, 0); DoScriptText(SAY_START, me); DoSummonGrandChampion(firstBoss); NextStep(10000, false, 1); break; case DATA_IN_POSITION: // movement done. me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f); if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE))) instance->HandleGameObject(go->GetGUID(), false); NextStep(10000, false, 3); break; case DATA_LESSER_CHAMPIONS_DEFEATED: { ++lesserChampions; std::list<uint64> tempList; if (lesserChampions == 3 || lesserChampions == 6) { switch (lesserChampions) { case 3: tempList = Champion2List; break; case 6: tempList = Champion3List; break; } for (std::list<uint64>::const_iterator itr = tempList.begin(); itr != tempList.end(); ++itr) if (Creature* summon = Unit::GetCreature(*me, *itr)) AggroAllPlayers(summon); } else if (lesserChampions == 9) StartGrandChampionsAttack(); break; } case DATA_GRAND_CHAMPIONS_DEFEATED: defeatedGrandChampions = data; if (defeatedGrandChampions == 3) { for (uint8 i = 0; i < 3; ++i) if (Creature* GrandChampion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GRAND_CHAMPION_1 + i))) { switch (i) { case 0: GrandChampion->SetHomePosition(739.678f, 662.541f, 412.393f, 4.6f); break; case 1: GrandChampion->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f); break; case 2: GrandChampion->SetHomePosition(754.34f, 660.70f, 412.39f, 4.6f); break; } GrandChampion->AI()->SetData(10, 0); } instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS); } break; } }
void UpdateAI(uint32 diff) override { if (!(thrallGUID || garroshGUID || varianGUID || proudmooreGUID || tirionGUID)) return; events.Update(diff); while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_INTRO_1: instance->DoCastSpellOnPlayers(SPELL_HERALD_ARGENT); Talk(SAY_INTRO_HERALD_1); events.ScheduleEvent(EVENT_INTRO_2, 5000, 0, PHASE_INTRO); break; case EVENT_INTRO_2: if (Creature* tirion = ObjectAccessor::GetCreature(*me, tirionGUID)) tirion->AI()->Talk(SAY_INTRO_HERALD_2); events.ScheduleEvent(EVENT_INTRO_3, 13000, 0, PHASE_INTRO); break; case EVENT_INTRO_3: if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE) { if (Creature* thrall = ObjectAccessor::GetCreature(*me, thrallGUID)) thrall->AI()->Talk(H_SAY_INTRO_HERALD_3); } else if (Creature* varian = ObjectAccessor::GetCreature(*me, varianGUID)) varian->AI()->Talk(A_SAY_INTRO_HERALD_3); events.ScheduleEvent(EVENT_INTRO_4, 4000, 0, PHASE_INTRO); break; case EVENT_INTRO_4: if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE) { if (Creature* garrosh = ObjectAccessor::GetCreature(*me, garroshGUID)) garrosh->AI()->Talk(H_SAY_INTRO_HERALD_4); } else if (Creature* proudmoore = ObjectAccessor::GetCreature(*me, proudmooreGUID)) proudmoore->AI()->Talk(A_SAY_INTRO_HERALD_4); events.ScheduleEvent(EVENT_INTRO_5, 4000, 0, PHASE_INTRO); break; case EVENT_INTRO_5: if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE) { if (Creature* varian = ObjectAccessor::GetCreature(*me, varianGUID)) varian->AI()->Talk(SAY_INTRO_HERALD_5); } else if (Creature* garrosh = ObjectAccessor::GetCreature(*me, garroshGUID)) garrosh->AI()->Talk(SAY_INTRO_HERALD_5); events.ScheduleEvent(EVENT_INTRO_6, 6000, 0, PHASE_INTRO); break; case EVENT_INTRO_6: if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE) { if (Creature* proudmoore = ObjectAccessor::GetCreature(*me, proudmooreGUID)) proudmoore->AI()->Talk(H_SAY_INTRO_HERALD_6); } else if (Creature* thrall = ObjectAccessor::GetCreature(*me, thrallGUID)) thrall->AI()->Talk(A_SAY_INTRO_HERALD_6); events.ScheduleEvent(EVENT_INTRO_7, 6000, 0, PHASE_INTRO); break; case EVENT_INTRO_7: if (Creature* tirion = ObjectAccessor::GetCreature(*me, tirionGUID)) tirion->AI()->Talk(SAY_INTRO_HERALD_7); events.ScheduleEvent(EVENT_INTRO_8, 1000, 0, PHASE_INTRO); break; case EVENT_INTRO_8: me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); events.SetPhase(PHASE_INPROGRESS); break; case EVENT_SUMMON_FACTION_2: DoSummonGrandChampion(uiSecondBoss); events.ScheduleEvent(EVENT_SUMMON_FACTION_3, 10000, 0, PHASE_INPROGRESS); break; case EVENT_SUMMON_FACTION_3: DoSummonGrandChampion(uiThirdBoss); break; case EVENT_AGGRO_FACTION: if (!Champion1List.empty()) { for(std::list<uint64>::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr) if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr)) AggroAllPlayers(summon); } break; case EVENT_PALETRESS_1: Talk(SAY_PALETRESS_INTRO_1); Talk(SAY_PALETRESS_INTRO_2); events.ScheduleEvent(EVENT_PALETRESS_2, 5000, 0, PHASE_INPROGRESS); break; case EVENT_PALETRESS_2: if (Creature* argentchamp = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ARGENT_CHAMPION))) argentchamp->AI()->Talk(SAY_PALETRESS_INTRO_3); events.ScheduleEvent(EVENT_PALETRESS_3, 5000); case EVENT_PALETRESS_3: if (Creature* argentchamp = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ARGENT_CHAMPION))) argentchamp->AI()->Talk(SAY_PALETRESS_INTRO_4); events.CancelEvent(EVENT_PALETRESS_3); break; case EVENT_EADRIC_1: Talk(SAY_EADRIC_INTRO_1); Talk(SAY_EADRIC_INTRO_2); events.ScheduleEvent(EVENT_EADRIC_2, 5000); break; case EVENT_EADRIC_2: if (Creature* argentchamp = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ARGENT_CHAMPION))) argentchamp->AI()->Talk(SAY_EADRIC_INTRO_3); break; } } }
void SetData(uint32 uiType, uint32 uiData) { switch (uiType) { case DATA_START: if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE))) pInstance->HandleGameObject(pGO->GetGUID(),true); if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1))) pInstance->HandleGameObject(pGO->GetGUID(),false); DoScriptText(SAY_START, me); DoSummonGrandChampion(uiFirstBoss); NextStep(10000,false,1); break; case DATA_IN_POSITION: //movement done. me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING); me->GetMotionMaster()->MovePoint(1, 735.898f, 651.961f, 411.93f); DoScriptText(SAY_START2, me); if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE))) pInstance->HandleGameObject(pGO->GetGUID(),false); NextStep(20000,false,3); break; case DATA_RESET: me->GetMotionMaster()->MovePoint(2, 746.626f, 618.54f, 411.09f); uiSummonTimes = 0; uiPosition = 0; uiLesserChampions = 0; uiFirstBoss = 0; uiSecondBoss = 0; uiThirdBoss = 0; uiArgentChampion = 0; uiPhase = 0; uiTimer = 0; uiVehicle1GUID = 0; uiVehicle2GUID = 0; uiVehicle3GUID = 0; Champion1List.clear(); Champion2List.clear(); Champion3List.clear(); me->SetReactState(REACT_PASSIVE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); SetGrandChampionsForEncounter(); SetArgentChampion(); break; case DATA_LESSER_CHAMPIONS_DEFEATED: { ++uiLesserChampions; std::list<uint64> TempList; if (uiLesserChampions == 3 || uiLesserChampions == 6) { switch(uiLesserChampions) { case 3: TempList = Champion2List; break; case 6: TempList = Champion3List; break; } for(std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr) if (Creature* pSummon = Unit::GetCreature(*me, *itr)) AggroAllPlayers(pSummon); }else if (uiLesserChampions == 9) StartGrandChampionsAttack(); break; } } }