void WarsongGulch::OnStart() { for(uint32 i = 0; i < 2; ++i) { for(set<Player*>::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr) { (*itr)->RemoveAura(BG_PREPARATION); } } /* open the gates */ for(list<GameObject*>::iterator itr = m_gates.begin(); itr != m_gates.end(); ++itr) { (*itr)->SetUInt32Value(GAMEOBJECT_FLAGS, 64); (*itr)->SetByte(GAMEOBJECT_BYTES_1, 0, 0); } DespawnGates(5000); /* add the flags to the world */ for(int i = 0; i < 2; ++i) { if( !m_homeFlags[i]->IsInWorld() ) m_homeFlags[i]->PushToWorld(m_mapMgr); } SendChatMessage(CHAT_MSG_BG_EVENT_NEUTRAL, 0, "The Alliance's flag is now placed at her base."); SendChatMessage(CHAT_MSG_BG_EVENT_NEUTRAL, 0, "The Horde's flag is now placed at her base."); /* correct? - burlex */ PlaySoundToAll(SOUND_BATTLEGROUND_BEGIN); m_started = true; }
void WarsongGulch::OnStart() { for (uint8 i = 0; i < 2; ++i) { for (std::set<Player*>::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr) { (*itr)->RemoveAura(BG_PREPARATION); } } // open the gates for (std::list<GameObject*>::iterator itr = m_gates.begin(); itr != m_gates.end(); ++itr) { (*itr)->SetFlags(GO_FLAG_TRIGGERED); (*itr)->SetState(GO_STATE_OPEN); } DespawnGates(5000); // add the flags to the world for (uint8 i = 0; i < 2; ++i) { if (!m_homeFlags[i]->IsInWorld()) m_homeFlags[i]->PushToWorld(m_mapMgr); } PlaySoundToAll(SOUND_BATTLEGROUND_BEGIN); SendChatMessage(CHAT_MSG_BG_EVENT_NEUTRAL, 0, "The flags are now placed at their bases."); sEventMgr.AddEvent(this, &WarsongGulch::TimeLeft, EVENT_UNK, 60000, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT); m_started = true; }