void OutdoorPvPNA::UpdateWorldState(uint32 value) { SendUpdateWorldState(m_zoneWorldState, value); SendUpdateWorldState(m_zoneMapState, value); UpdateWyvernsWorldState(value); }
void WorldPvPNA::UpdateWorldState(uint8 uiValue) { SendUpdateWorldState(m_uiControllerWorldState, uiValue); SendUpdateWorldState(m_uiControllerMapState, uiValue); // Update guards only for positive states if (uiValue) { SendUpdateWorldState(WORLD_STATE_NA_GUARDS_MAX, MAX_NA_GUARDS); SendUpdateWorldState(WORLD_STATE_NA_GUARDS_LEFT, m_uiGuardsLeft); } UpdateWyvernsWorldState(uiValue); }
bool OutdoorPvPNA::HandleGameObjectUse(Player* player, GameObject* go) { if (player->GetTeam() == ALLIANCE) { for (uint8 i = 0; i < MAX_NA_ROOSTS; ++i) { if (go->GetEntry() == nagrandWagonsAlliance[i]) { // update roost states UpdateWyvernsWorldState(WORLD_STATE_REMOVE); m_roostWorldState[i] = nagrandRoostStatesHordeNeutral[i]; UpdateWyvernsWorldState(WORLD_STATE_ADD); // spawn the broken roost and despawn the other one RespawnGO(go, m_roostsHorde[i], false); RespawnGO(go, m_roostsBrokenHorde[i], true); // no need to iterate the other roosts return false; } else if (go->GetEntry() == nagrandRoostsBrokenAlliance[i]) { // update roost states UpdateWyvernsWorldState(WORLD_STATE_REMOVE); m_roostWorldState[i] = nagrandRoostStatesAlliance[i]; UpdateWyvernsWorldState(WORLD_STATE_ADD); // spawn the repaired one along with the explosive wagon - the broken one despawns by self RespawnGO(go, m_wagonsHorde[i], true); RespawnGO(go, m_roostsAlliance[i], true); // no need to iterate the other roosts return false; } else if (go->GetEntry() == nagrandRoostsAlliance[i]) { // mark player as pvp player->UpdatePvP(true, true); player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP); // prevent despawning after go use go->SetRespawnTime(0); // no need to iterate the other roosts return false; } } } else if (player->GetTeam() == HORDE) { for (uint8 i = 0; i < MAX_NA_ROOSTS; ++i) { if (go->GetEntry() == nagrandWagonsHorde[i]) { // update roost states UpdateWyvernsWorldState(WORLD_STATE_REMOVE); m_roostWorldState[i] = nagrandRoostStatesAllianceNeutral[i]; UpdateWyvernsWorldState(WORLD_STATE_ADD); // spawn the broken roost and despawn the other one RespawnGO(go, m_roostsAlliance[i], false); RespawnGO(go, m_roostsBrokenAlliance[i], true); // no need to iterate the other roosts return false; } else if (go->GetEntry() == nagrandRoostsBrokenHorde[i]) { // update roost states UpdateWyvernsWorldState(WORLD_STATE_REMOVE); m_roostWorldState[i] = nagrandRoostStatesHorde[i]; UpdateWyvernsWorldState(WORLD_STATE_ADD); // spawn the repaired one along with the explosive wagon - the broken one despawns by self RespawnGO(go, m_wagonsAlliance[i], true); RespawnGO(go, m_roostsHorde[i], true); // no need to iterate the other roosts return false; } else if (go->GetEntry() == nagrandRoostsHorde[i]) { // mark player as pvp player->UpdatePvP(true, true); player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP); // prevent despawning after go use go->SetRespawnTime(0); // no need to iterate the other roosts return false; } } } return false; }
bool WorldPvPNA::HandleObjectUse(Player* pPlayer, GameObject* pGo) { bool bReturnStatus = false; UpdateWyvernsWorldState(0); if (pPlayer->GetTeam() == ALLIANCE) { for (uint8 i = 0; i < MAX_NA_ROOSTS; ++i) { if (pGo->GetEntry() == aAllianceWagons[i]) { m_uiRoostWorldState[i] = aHordeNeutralStates[i]; DoRespawnObjects(m_HordeRoost[i], false); DoRespawnObjects(m_HordeBrokenRoost[i], true); bReturnStatus = true; } else if (pGo->GetEntry() == aAllianceBrokenRoosts[i]) { m_uiRoostWorldState[i] = aAllianceRoostStates[i]; DoRespawnObjects(m_AllianceBrokenRoost[i], false); DoRespawnObjects(m_AllianceRoost[i], true); bReturnStatus = true; } else if (pGo->GetEntry() == aAllianceRoosts[i]) { // ###### This is hacked in Gameobject.cpp because of the missing custom spells support ##### // if we can't add any bombs don't do anything if (!AddBombsToInventory(pPlayer)) return false; // makr player as pvp first pPlayer->UpdatePvP(true, true); pPlayer->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP); // Send taxi bReturnStatus = HandlePlayerTaxiDrive(pPlayer, i); } } } else if (pPlayer->GetTeam() == HORDE) { for (uint8 i = 0; i < MAX_NA_ROOSTS; ++i) { if (pGo->GetEntry() == aHordeWagons[i]) { m_uiRoostWorldState[i] = aAllianceNeutralStates[i]; DoRespawnObjects(m_AllianceRoost[i], false); DoRespawnObjects(m_AllianceBrokenRoost[i], true); bReturnStatus = true; } else if (pGo->GetEntry() == aHordeBrokenRoosts[i]) { m_uiRoostWorldState[i] = aHordeRoostStates[i]; DoRespawnObjects(m_HordeBrokenRoost[i], false); DoRespawnObjects(m_HordeRoost[i], true); bReturnStatus = true; } else if (pGo->GetEntry() == aHordeRoosts[i]) { // ###### This is hacked in Gameobject.cpp because of the missing custom spells support ##### // if we can't add any bombs don't do anything if (!AddBombsToInventory(pPlayer)) return false; // makr player as pvp first pPlayer->UpdatePvP(true, true); pPlayer->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP); // Send taxi bReturnStatus = HandlePlayerTaxiDrive(pPlayer, i); } } } UpdateWyvernsWorldState(1); return bReturnStatus; }