void Arena::Start() { // Open all the doors for(std::set<GameObject*>::iterator itr = m_Gates.begin(); itr!=m_Gates.end(); ++itr) { (*itr)->SetUInt32Value(GAMEOBJECT_FLAGS, 33); (*itr)->SetUInt32Value(GAMEOBJECT_STATE, 0); } // Send message packet WorldPacket *data = BuildMessageChat(0x52, 0x27, "The Arena Battle has begun!", 0); SendPacketToAll(data); delete data; }
void AlteracValley::Start() { // Open all the doors for(std::set<GameObject*>::iterator itr = m_Gates.begin(); itr!=m_Gates.end(); ++itr) { (*itr)->SetUInt32Value(GAMEOBJECT_FLAGS, 33); (*itr)->SetUInt32Value(GAMEOBJECT_STATE, 0); } // Send message packet WorldPacket *data = BuildMessageChat(0x52, 0x27, "The Battle for Alterac Valley has begun!", 0); SendPacketToAll(data); delete data; WorldPacket pkt; pkt.Initialize(SMSG_PLAY_SOUND); pkt << uint32(SOUND_BATTLEGROUND_BEGIN); // Battleground Sound Begin SendPacketToAll(&pkt); }
void AlteracValley::HandleBanner(Player *p_caster,GameObject *go,uint32 spellid) { int32 bannerslot = go->bannerslot; // spawn contest banner if(bannerslot > -1 && bannerslot < MAXOFBANNERS) { sEventMgr.RemoveEvents(this,EVENT_BATTLEGROUND_AV_CAPTURE_BASE + bannerslot); // If whe contest a horde/alliance flag, he loses the base /*uint32 rbasesfield = p_caster->m_bgTeam ? AB_ALLIANCE_CAPTUREBASE : AB_HORDE_CAPTUREBASE; if(go->GetEntry() == 180078 || go->GetEntry() == 180076) { uint64 guid = p_caster->GetGUID(); std::map<uint64, BattlegroundScore>::iterator itr = m_PlayerScores.find(guid); if(itr == m_PlayerScores.end()) { SendMessageToPlayer(p_caster, "INTERNAL ERROR: Could not find in internal player score map!", true); return; } itr->second.FlagReturns++; UpdatePVPData(); SetWorldStateValue(rbasesfield,WorldStateVars[rbasesfield]-1); }*/ uint32 goentry = 0; if(bannerslot < 6) // outside flags are diferent goentry = p_caster->m_bgTeam ? 180420:180419; else goentry = p_caster->m_bgTeam ? 179435:178940; gcbanner[bannerslot] = SpawnGameObject(goentry, 30, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetOrientation(), 32, 83, 1); GameObject *pcbanner = gcbanner[bannerslot]; pcbanner->SetFloatValue(GAMEOBJECT_ROTATION_02,go->GetFloatValue(GAMEOBJECT_ROTATION_02)); pcbanner->SetFloatValue(GAMEOBJECT_ROTATION_03,go->GetFloatValue(GAMEOBJECT_ROTATION_03)); pcbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pcbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pcbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pcbanner->SetUInt32Value(GAMEOBJECT_DYN_FLAGS,1); pcbanner->bannerslot = bannerslot; pcbanner->AddToWorld(); if(pcbanner->GetInfo()->sound3) { pcbanner->pcbannerAura = SpawnGameObject(pcbanner->GetInfo()->sound3, 30, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetOrientation(), 32, 114, 5); pcbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_02,go->GetFloatValue(GAMEOBJECT_ROTATION_02)); pcbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_03,go->GetFloatValue(GAMEOBJECT_ROTATION_03)); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_STATE, 1); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_TYPE_ID, 6); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pcbanner->pcbannerAura->AddToWorld(); } if(go->pcbannerAura) { if( go->pcbannerAura->IsInWorld() ) go->pcbannerAura->RemoveFromWorld(); delete go->pcbannerAura; } if( go->IsInWorld() ) go->RemoveFromWorld(); delete go; char message[300]; static char *resnames[11] = {"Frostworlf Gravyard","Iceblood Graveyard","Stormpike Gravyard", "Stoneheart gravyard","Relief Hunt","Stormpike Aid Station", "Iceblood Tower","Stoneheart Bunker","Icewing Bunker", "Stormpike North Bunker","Stormpike South Bunker"}; snprintf(message, 300, "$N claims the %s! If left unchallenged, the %s will control it in 1 minute!", resnames[bannerslot] , p_caster->m_bgTeam ? "Horde" : "Alliance" ); WorldPacket *data = BuildMessageChat(p_caster->m_bgTeam ? 0x54:0x53, 0, message, 0,p_caster->GetGUID()); SendPacketToAll(data); delete data; sEventMgr.AddEvent(this, &AlteracValley::EventCaptureBase, p_caster, (uint32)bannerslot, EVENT_BATTLEGROUND_AV_CAPTURE_BASE + bannerslot, 60000, 1); } }
void AlteracValley::EventCaptureBase(Player *src,uint32 bannerslot) { if(!gcbanner[bannerslot]) return; /*uint64 guid = src->GetGUID(); std::map<uint64, BattlegroundScore>::iterator itr = m_PlayerScores.find(guid); if(itr == m_PlayerScores.end()) { SendMessageToPlayer(src, "INTERNAL ERROR: Could not find in internal player score map!", true); return; } itr->second.FlagCaptures++; UpdatePVPData();*/ //uint32 rbasesfield = src->m_bgTeam ? AB_HORDE_CAPTUREBASE : AB_ALLIANCE_CAPTUREBASE; uint32 goentry = 0; if(bannerslot < 6) // outside flags are diferent goentry = src->m_bgTeam ? 178393:178389; else goentry = src->m_bgTeam ? 178946:178935; GameObject *pcbanner = src->GetCurrentBattleground()->SpawnGameObject(goentry, 30, gcbanner[bannerslot]->GetPositionX(), gcbanner[bannerslot]->GetPositionY(), gcbanner[bannerslot]->GetPositionZ(), gcbanner[bannerslot]->GetOrientation(), 32, src->m_bgTeam ?84:83, 1); pcbanner->SetFloatValue(GAMEOBJECT_ROTATION_02,gcbanner[bannerslot]->GetFloatValue(GAMEOBJECT_ROTATION_02)); pcbanner->SetFloatValue(GAMEOBJECT_ROTATION_03,gcbanner[bannerslot]->GetFloatValue(GAMEOBJECT_ROTATION_03)); pcbanner->SetUInt32Value(GAMEOBJECT_STATE, 1); pcbanner->SetUInt32Value(GAMEOBJECT_TYPE_ID, 1); pcbanner->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pcbanner->AddToWorld(); if(pcbanner->GetInfo()->sound3) { pcbanner->pcbannerAura = src->GetCurrentBattleground()->SpawnGameObject(pcbanner->GetInfo()->sound3, 30, pcbanner->GetPositionX(), pcbanner->GetPositionY(), pcbanner->GetPositionZ(), pcbanner->GetOrientation(), 32, 114, 5); pcbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_02,pcbanner->GetFloatValue(GAMEOBJECT_ROTATION_02)); pcbanner->pcbannerAura->SetFloatValue(GAMEOBJECT_ROTATION_03,pcbanner->GetFloatValue(GAMEOBJECT_ROTATION_03)); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_STATE, 1); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_TYPE_ID, 6); pcbanner->pcbannerAura->SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, 100); pcbanner->pcbannerAura->AddToWorld(); } if(gcbanner[bannerslot]->pcbannerAura) { if( gcbanner[bannerslot]->pcbannerAura->IsInWorld() ) gcbanner[bannerslot]->pcbannerAura->RemoveFromWorld(); delete gcbanner[bannerslot]->pcbannerAura; } if( gcbanner[bannerslot]->IsInWorld() ) gcbanner[bannerslot]->RemoveFromWorld(); delete gcbanner[bannerslot]; gcbanner[bannerslot] = NULL; // Play sound WorldPacket pkt; pkt.Initialize(SMSG_PLAY_SOUND); pkt << uint32(src->m_bgTeam ? SOUND_HORDE_CAPTURE : SOUND_ALLIANCE_CAPTURE); SendPacketToAll(&pkt); char message[300]; static char *resnames[11] = {"Frostworlf Gravyard","Iceblood Graveyard","Stormpike Gravyard", "Stoneheart gravyard","Relief Hunt","Stormpike Aid Station", "Iceblood Tower","Stoneheart Bunker","Icewing Bunker", "Stormpike North Bunker","Stormpike South Bunker"}; snprintf(message, 300, "The %s has taken the %s!", src->m_bgTeam ? "Horde" : "Alliance" , resnames[bannerslot] ); WorldPacket *data = BuildMessageChat(src->m_bgTeam ? 0x54:0x53, 0x27, message, 0); SendPacketToAll(data); delete data; }