void BattleGroundSA::ResetBattle(uint32 winner, Team teamDefending) { Phase = SA_ROUND_TWO; shipsTimer = BG_SA_BOAT_START; shipsStarted = false; for (int32 i = 0; i < BG_SA_GATE_MAX; ++i) GateStatus[i] = BG_SA_GO_GATES_NORMAL; SetStartTime(0); defender = (teamDefending == ALLIANCE) ? HORDE : ALLIANCE; relicGateDestroyed = false; ToggleTimer(); SetupShips(); for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) { Player *plr = sObjectMgr.GetPlayer(itr->first); if (!plr) continue; TeleportPlayerToCorrectLoc(plr, true); if (plr->GetBGTeam() == defender && plr->GetItemByEntry(39213) != NULL) plr->DestroyItemCount(39213, 1, true); } UpdatePhase(); ResetWorldStates(); }
void EnterCombat(Unit *who) { DoZoneInCombat(); DoCast(m_creature, HEROIC(SPELL_HIGH_VOLTAGE, SPELL_HIGH_VOLTAGE_H)); events.ScheduleEvent(EVENT_ENRAGE, 900000); UpdatePhase(); }
void BattleGroundSA::Reset() { //call parent's class reset BattleGround::Reset(); defender = ((urand(0,1)) ? ALLIANCE : HORDE); relicGateDestroyed = false; for (uint8 i = 0; i <= SA_EVENT_ADD_YELLOW_SIGIL; ++i) m_ActiveEvents[i] = BG_EVENT_NONE; UpdatePhase(); }
void Reset() { events.Reset(); me->SetReactState(REACT_AGGRESSIVE); abberationsLeft = 18; withoutGreenPhase = 0; wasInBlackPhase = true; spellsLocked = false; UpdatePhase(PHASE_NON); DespawnMinions(); _Reset(); }
void Aggro(Unit* pWho) { if (Creature* Brundir = GET_CREATURE(DATA_BRUNDIR)) if(Brundir->isAlive()) Brundir->AddThreat(pWho); if (Creature* Molgeim = GET_CREATURE(DATA_MOLGEIM)) if(Molgeim->isAlive()) Molgeim->AddThreat(pWho); DoCast(m_creature, HEROIC(SPELL_HIGH_VOLTAGE, SPELL_HIGH_VOLTAGE_H), true); events.RescheduleEvent(EVENT_BERSERK, BERSERK_TIMER); UpdatePhase(); DoScriptText(SAY_STEEL_AGGRO, m_creature); if (m_pInstance) m_pInstance->SetData(m_uiBossEncounterId, IN_PROGRESS); }
void BattleGroundSA::Reset() { //call parent's class reset BattleGround::Reset(); defender = ((urand(0,1)) ? ALLIANCE : HORDE); relicGateDestroyed = false; m_ActiveEvents[SA_EVENT_ADD_GO] = BG_EVENT_NONE; m_ActiveEvents[SA_EVENT_ADD_NPC] = BG_EVENT_NONE; m_ActiveEvents[SA_EVENT_ADD_SPIR] = BG_EVENT_NONE; m_ActiveEvents[SA_EVENT_ADD_BOMB] = BG_EVENT_NONE; m_ActiveEvents[SA_EVENT_ADD_VECH_E] = BG_EVENT_NONE; m_ActiveEvents[SA_EVENT_ADD_VECH_W] = BG_EVENT_NONE; // spiritguides and flags not spawned at beginning UpdatePhase(); }
void BattleGroundSA::ResetBattle(uint32 winner, Team teamDefending) { Phase = SA_ROUND_TWO; shipsTimer = 60000; shipsStarted = false; for (int32 i = 0; i <= BG_SA_GATE_MAX; ++i) GateStatus[i] = 1; SetStartTime(0); defender = (teamDefending == ALLIANCE) ? HORDE : ALLIANCE; relicGateDestroyed = false; ToggleTimer(); SetupShips(); for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) { if (Player *plr = sObjectMgr.GetPlayer(itr->first)) TeleportPlayerToCorrectLoc(plr, true); } UpdatePhase(); }
void SpellHit(Unit *from, const SpellEntry *spell) { if(spell->Id == SPELL_SUPERCHARGE) UpdatePhase(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_CASTING)) return; events.Update(diff); _DoAggroPulse(diff); if(me->GetHealthPct() < 25 && phase != PHASE_FINAL) { // Enter Final Phase uint32 uiBerserker = events.GetNextEventTime(EVENT_BERSERK); events.Reset(); events.ScheduleEvent(EVENT_BERSERK, uiBerserker); phase = PHASE_FINAL; me->InterruptNonMeleeSpells(true); DoCast(SPELL_RELEASE_ALL_ABBERATIONS); DoScriptText(SAY_LOW_HEALTH, me); }; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { // General and Phase Switching case EVENT_NEW_PHASE: UpdatePhase(urand(PHASE_RED, PHASE_BLUE)); spellsLocked = true; events.ScheduleEvent(EVENT_NEW_PHASE, TIMER_PHASE); break; case EVENT_DRINK_BOTTLE: if(GameObject* cauldron = me->FindNearestGameObject(GOB_MALORIAKS_CAULDRON,100.f)) { switch(phase) { case PHASE_RED: DoCast(cauldron->ToCreature(), SPELL_THROW_RED_BOTTLE); break; case PHASE_BLUE: DoCast(cauldron->ToCreature(), SPELL_THROW_BLUE_BOTTLE); break; case PHASE_GREEN: DoCast(cauldron->ToCreature(), SPELL_THROW_GREEN_BOTTLE); break; case PHASE_BLACK: DoCast(cauldron->ToCreature(), SPELL_THROW_BLACK_BOTTLE); me->AddAura(SPELL_SHADOW_IMBUED, me); break; } } events.ScheduleEvent(EVENT_WAIT_SWITCH_PHASE, 1000); break; case EVENT_WAIT_SWITCH_PHASE: me->SetReactState(REACT_AGGRESSIVE); me->GetMotionMaster()->MoveChase(me->getVictim()); // Intialize Phase Events switch(phase) { case PHASE_RED: events.ScheduleEvent(EVENT_SCORCHING_BLAST, 7000); events.ScheduleEvent(EVENT_CONSUMING_FLAMES, 3000); break; case PHASE_BLUE: events.ScheduleEvent(EVENT_BITING_CHILL, 7000); events.ScheduleEvent(EVENT_FLASH_FREEZE, 9000); break; case PHASE_GREEN: events.ScheduleEvent(EVENT_CAULDRON_EXPLODE, 2000); break; case PHASE_BLACK: events.ScheduleEvent(EVENT_SUMMON_VILE_SWILL, urand(4000,6000)); events.ScheduleEvent(EVENT_ENGULFING_DARKNESS, 9000); break; } if(phase != PHASE_BLACK) { events.ScheduleEvent(EVENT_RELEASE_ABBERATIONS, urand(12000,17000)); DoScriptText(SAY_VIAL-phase, me); } events.ScheduleEvent(EVENT_UNLOCK_SPELLS, 1500); break; // Misc case EVENT_UNLOCK_SPELLS: spellsLocked = false; break; case EVENT_BERSERK: DoCast(me,SPELL_BERSERK); break; case EVENT_REMEDY: if(spellsLocked) events.ScheduleEvent(EVENT_REMEDY, 1500); else { DoCast(me,SPELL_REMEDY); events.ScheduleEvent(EVENT_REMEDY, urand(15000,18000)); } break; case EVENT_ARCANE_STORM: if(spellsLocked) events.ScheduleEvent(EVENT_ARCANE_STORM, 1500); else { me->AttackStop(); DoCastAOE(SPELL_ARCANE_STORM); events.ScheduleEvent(EVENT_ARCANE_STORM, urand(27000,29000)); } break; // Red Phase case EVENT_SCORCHING_BLAST: DoCastAOE(SPELL_SCORCHING_BLAST); events.ScheduleEvent(EVENT_SCORCHING_BLAST, urand(15000, 17000)); break; case EVENT_CONSUMING_FLAMES: if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true)) DoCast(target, SPELL_CONSUMING_FLAMES); events.ScheduleEvent(EVENT_CONSUMING_FLAMES, urand(7000, 8500)); break; // Blue Phase case EVENT_BITING_CHILL: if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true)) DoCast(target, SPELL_BITING_CHILL); events.ScheduleEvent(EVENT_BITING_CHILL, urand(8000, 10000)); break; case EVENT_FLASH_FREEZE: if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true)) target->CastSpell(target, SPELL_FLASH_FREEZE_SUMMON, true); events.ScheduleEvent(EVENT_FLASH_FREEZE, urand(11000, 13000)); break; // Green Phase case EVENT_CAULDRON_EXPLODE: me->FindNearestCreature(NPC_SLIME_TRIGGER, 100.f)->AI()->DoCastAOE(SPELL_DEBILITATING_SLIME); DoCastCausticSlime(); events.ScheduleEvent(EVENT_CAULDRON_EXPLODE, 15000); break; case EVENT_RELEASE_ABBERATIONS: DoCast(SPELL_RELEASE_ABBERATIONS); break; // Black Phase case EVENT_SUMMON_VILE_SWILL: me->SummonCreature(NPC_VILE_SWILL, MaloriakPositions[urand(1,4)]); events.ScheduleEvent(EVENT_SUMMON_VILE_SWILL, urand(4000,5000)); break; case EVENT_ENGULFING_DARKNESS: DoCastAOE(SPELL_ENGULFING_DARKNESS); events.ScheduleEvent(EVENT_ENGULFING_DARKNESS, 16000); break; // Final Phase default: break; } } DoMeleeAttackIfReady(); }