void WorldPvPZM::DoPrepareFactionScouts(uint32 uiFaction) { Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; if (uiFaction == ALLIANCE) { if (Creature* pScout = pPlayer->GetMap()->GetCreature(m_AllianceScoutGUID)) pScout->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); SendUpdateWorldState(m_uiAllianceScoutWorldState, 0); m_uiAllianceScoutWorldState = WORLD_STATE_ALY_FLAG_READY; SendUpdateWorldState(m_uiAllianceScoutWorldState, 1); } else if (uiFaction == HORDE) { if (Creature* pScout = pPlayer->GetMap()->GetCreature(m_HorderScoutGUID)) pScout->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); SendUpdateWorldState(m_uiHordeScoutWorldState, 0); m_uiHordeScoutWorldState = WORLD_STATE_HORDE_FLAG_READY; SendUpdateWorldState(m_uiHordeScoutWorldState, 1); } }
void WorldPvPZM::DoResetScouts(uint32 uiFaction, bool bIncludeWorldStates) { Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; if (uiFaction == ALLIANCE) { if (Creature* pScout = pPlayer->GetMap()->GetCreature(m_AllianceScoutGUID)) pScout->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); // reset world states only if requested if (bIncludeWorldStates) { SendUpdateWorldState(m_uiAllianceScoutWorldState, 0); m_uiAllianceScoutWorldState = WORLD_STATE_ALY_FLAG_NOT_READY; SendUpdateWorldState(m_uiAllianceScoutWorldState, 1); } } else if (uiFaction == HORDE) { if (Creature* pScout = pPlayer->GetMap()->GetCreature(m_HorderScoutGUID)) pScout->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); // reset world states only if requested if (bIncludeWorldStates) { SendUpdateWorldState(m_uiHordeScoutWorldState, 0); m_uiHordeScoutWorldState = WORLD_STATE_HORDE_FLAG_NOT_READY; SendUpdateWorldState(m_uiHordeScoutWorldState, 1); } } }
void WorldPvPNA::DoRespawnSoldiers(uint32 uiFaction) { // neet to use a player as anchor for the map Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; if (uiFaction == ALLIANCE) { // despawn all horde vendors for (std::list<ObjectGuid>::const_iterator itr = lHordeSoldiers.begin(); itr != lHordeSoldiers.end(); ++itr) { if (Creature* pSoldier = pPlayer->GetMap()->GetCreature(*itr)) { // reset respawn time pSoldier->SetRespawnDelay(7 * DAY); pSoldier->ForcedDespawn(); } } // spawn all alliance soldiers and vendors for (std::list<ObjectGuid>::const_iterator itr = lAllianceSoldiers.begin(); itr != lAllianceSoldiers.end(); ++itr) { if (Creature* pSoldier = pPlayer->GetMap()->GetCreature(*itr)) { // lower respawn time pSoldier->SetRespawnDelay(HOUR); pSoldier->Respawn(); } } } else if (uiFaction == HORDE) { // despawn all alliance vendors for (std::list<ObjectGuid>::const_iterator itr = lAllianceSoldiers.begin(); itr != lAllianceSoldiers.end(); ++itr) { if (Creature* pSoldier = pPlayer->GetMap()->GetCreature(*itr)) { // reset respawn time pSoldier->SetRespawnDelay(7 * DAY); pSoldier->ForcedDespawn(); } } // spawn all horde soldiers and vendors for (std::list<ObjectGuid>::const_iterator itr = lHordeSoldiers.begin(); itr != lHordeSoldiers.end(); ++itr) { if (Creature* pSoldier = pPlayer->GetMap()->GetCreature(*itr)) { // lower respawn time pSoldier->SetRespawnDelay(HOUR); pSoldier->Respawn(); } } } }
void WorldPvPTF::DoResetCapturePoints(ObjectGuid BannerGuid) { // neet to use a player as anchor for the map Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; if (GameObject* pBanner = pPlayer->GetMap()->GetGameObject(BannerGuid)) pBanner->ResetCapturePoint(); }
void WorldPvPNA::SetBannerArtKit(uint32 uiArtkit) { // neet to use a player as anchor for the map Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; if (GameObject* pBanner = pPlayer->GetMap()->GetGameObject(m_HalaaBanerGuid)) { pBanner->SetGoArtKit(uiArtkit); pBanner->Refresh(); } }
void WorldPvPEP::SetBannersArtKit(std::list<ObjectGuid> lBannersGuids, uint32 uiArtkit) { // neet to use a player as anchor for the map Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; for (std::list<ObjectGuid>::iterator itr = lBannersGuids.begin(); itr != lBannersGuids.end(); ++itr) { if (GameObject* pBanner = pPlayer->GetMap()->GetGameObject(*itr)) pBanner->SetGoArtKit(uiArtkit); } }
void WorldPvPEP::DoUnsummonSoldiers() { // neet to use a player as anchor for the map Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; for (std::list<ObjectGuid>::iterator itr = m_lSoldiersGuids.begin(); itr != m_lSoldiersGuids.end(); ++itr) { if (Creature* pSoldier = pPlayer->GetMap()->GetCreature(*itr)) pSoldier->ForcedDespawn(); } }
void WorldPvPEP::DoUnsummonFlightMaster() { // neet to use a player as anchor for the map Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; if (!m_uiFlightMasterGUID) return; if (Creature* pFlightMaster = pPlayer->GetMap()->GetCreature(m_uiFlightMasterGUID)) pFlightMaster->ForcedDespawn(); }
void WorldPvPZM::DoSetBeaconArtkit(ObjectGuid BeaconGuid, bool bRespawn) { Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; if (Creature* pBeam = pPlayer->GetMap()->GetCreature(BeaconGuid)) { if (bRespawn) pBeam->Respawn(); else pBeam->ForcedDespawn(); } }
void WorldPvPNA::DoRespawnObjects(ObjectGuid GameObjectGuid, bool bRespawn) { // neet to use a player as anchor for the map Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; if (GameObject* pBanner = pPlayer->GetMap()->GetGameObject(GameObjectGuid)) { if (bRespawn) { pBanner->SetRespawnTime(7 * DAY); pBanner->Refresh(); } else if (pBanner->isSpawned()) pBanner->Delete(); } }
void WorldPvPEP::DoSummonFlightMasterIfCan(uint32 uiFaction) { Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; // return if already summoned if (m_uiFlightMasterGUID) return; // summon the flightmaster if (Creature* pFlightMaster = pPlayer->SummonCreature(NPC_SPECTRAL_FLIGHTMASTER, m_aPlaguelandFlightmasterSpawnLocs[0].m_fX, m_aPlaguelandFlightmasterSpawnLocs[0].m_fY, m_aPlaguelandFlightmasterSpawnLocs[0].m_fZ, m_aPlaguelandFlightmasterSpawnLocs[0].m_fO, TEMPSUMMON_MANUAL_DESPAWN, 0)) { //pFlightMaster->setFaction(uiFaction); pFlightMaster->SetRespawnDelay(7*DAY); m_uiFlightMasterGUID = pFlightMaster->GetObjectGuid(); } }
void WorldPvPEP::DoUpdateShrine(ObjectGuid uiShrineGuid, bool bRemove) { // neet to use a player as anchor for the map Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; // process zones shrine if (GameObject* pShrine = pPlayer->GetMap()->GetGameObject(uiShrineGuid)) { if (!bRemove) { pShrine->SetRespawnTime(DAY); pShrine->Respawn(); } else pShrine->Delete(); } }
void WorldPvPEP::DoSummonSoldiersIfCan(uint32 uiFaction) { Player* pPlayer = GetPlayerInZone(); if (!pPlayer) return; uint32 uiEntry = 0; if (uiFaction == ALLIANCE) { for (uint8 i = 0; i < MAX_TOWERS + 1; i++) { if (i == 0) uiEntry = NPC_LORDAERON_COMMANDER; else uiEntry = NPC_LORDAERON_SOLDIER; if (Creature* pSoldier = pPlayer->SummonCreature(uiEntry, m_aPlaguelandSoldiersSpawnLocs[i].m_fX, m_aPlaguelandSoldiersSpawnLocs[i].m_fY, m_aPlaguelandSoldiersSpawnLocs[i].m_fZ, m_aPlaguelandSoldiersSpawnLocs[i].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0)) { pSoldier->SetRespawnDelay(7*DAY); m_lSoldiersGuids.push_back(pSoldier->GetObjectGuid()); } } } else { for (uint8 i = 0; i < MAX_TOWERS + 1; i++) { if (i == 0) uiEntry = NPC_LORDAERON_VETERAN; else uiEntry = NPC_LORDAERON_FIGHTER; if (Creature* pSoldier = pPlayer->SummonCreature(uiEntry, m_aPlaguelandSoldiersSpawnLocs[i].m_fX, m_aPlaguelandSoldiersSpawnLocs[i].m_fY, m_aPlaguelandSoldiersSpawnLocs[i].m_fZ, m_aPlaguelandSoldiersSpawnLocs[i].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0)) { pSoldier->SetRespawnDelay(7*DAY); m_lSoldiersGuids.push_back(pSoldier->GetObjectGuid()); } } } }