diff options
40 files changed, 825 insertions, 908 deletions
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 909229a1f7d..5b61c876038 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -1150,19 +1150,24 @@ uint32 BattlefieldWG::GetData(uint32 data) const void BattlefieldWG::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(BATTLEFIELD_WG_WORLD_STATE_ATTACKER), int32(GetAttackerTeam())); - packet.Worldstates.emplace_back(uint32(BATTLEFIELD_WG_WORLD_STATE_DEFENDER), int32(GetDefenderTeam())); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_DEFENDED_A, GetData(BATTLEFIELD_WG_DATA_DEF_A)); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_DEFENDED_H, GetData(BATTLEFIELD_WG_DATA_DEF_H)); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ATTACKED_A, GetData(BATTLEFIELD_WG_DATA_WON_A)); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ATTACKED_H, GetData(BATTLEFIELD_WG_DATA_WON_H)); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ATTACKER, GetAttackerTeam()); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, GetDefenderTeam()); + // Note: cleanup these two, their names look awkward - packet.Worldstates.emplace_back(uint32(BATTLEFIELD_WG_WORLD_STATE_ACTIVE), int32(IsWarTime() ? 0 : 1)); - packet.Worldstates.emplace_back(uint32(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE), int32(IsWarTime() ? 1 : 0)); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, IsWarTime() ? 0 : 1); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE, IsWarTime() ? 1 : 0); - for (uint32 i = 0; i < 2; ++i) - packet.Worldstates.emplace_back(ClockWorldState[i], int32(GameTime::GetGameTime() + (m_Timer / 1000))); + for (uint32 itr = 0; itr < 2; ++itr) + packet.Worldstates.emplace_back(ClockWorldState[itr], int32(GameTime::GetGameTime()) + int32(m_Timer) / int32(1000)); - packet.Worldstates.emplace_back(uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H), int32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_H))); - packet.Worldstates.emplace_back(uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H), int32(GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H))); - packet.Worldstates.emplace_back(uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A), int32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_A))); - packet.Worldstates.emplace_back(uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A), int32(GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A))); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H)); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H)); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A)); + packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A)); for (BfWGGameObjectBuilding* building : BuildingsInZone) building->FillInitialWorldStates(packet); @@ -1174,10 +1179,9 @@ void BattlefieldWG::FillInitialWorldStates(WorldPackets::WorldState::InitWorldSt void BattlefieldWG::SendInitWorldStatesTo(Player* player) { WorldPackets::WorldState::InitWorldStates packet; - packet.AreaID = m_ZoneId; packet.MapID = m_MapId; - packet.SubareaID = 0; - + packet.AreaID = m_ZoneId; + packet.SubareaID = player->GetAreaId(); FillInitialWorldStates(packet); player->SendDirectMessage(packet.Write()); @@ -1755,7 +1759,7 @@ void BfWGGameObjectBuilding::UpdateTurretAttack(bool disable) void BfWGGameObjectBuilding::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(_worldState), int32(_state)); + packet.Worldstates.emplace_back(_worldState, _state); } void BfWGGameObjectBuilding::Save() @@ -1840,7 +1844,7 @@ void WintergraspWorkshop::UpdateGraveyardAndWorkshop() void WintergraspWorkshop::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(_staticInfo->WorldStateId), int32(_state)); + packet.Worldstates.emplace_back(_staticInfo->WorldStateId, _state); } void WintergraspWorkshop::Save() diff --git a/src/server/game/Battlegrounds/Arena.cpp b/src/server/game/Battlegrounds/Arena.cpp index 548327a678a..5190b4372df 100644 --- a/src/server/game/Battlegrounds/Arena.cpp +++ b/src/server/game/Battlegrounds/Arena.cpp @@ -24,8 +24,8 @@ #include "ObjectAccessor.h" #include "Player.h" #include "World.h" -#include "WorldStatePackets.h" #include "WorldSession.h" +#include "WorldStatePackets.h" Arena::Arena(BattlegroundTemplate const* battlegroundTemplate) : Battleground(battlegroundTemplate) { @@ -74,8 +74,8 @@ void Arena::RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team* void Arena::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN), int32(GetAlivePlayersCountByTeam(HORDE))); - packet.Worldstates.emplace_back(uint32(ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD), int32(GetAlivePlayersCountByTeam(ALLIANCE))); + packet.Worldstates.emplace_back(ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN, GetAlivePlayersCountByTeam(HORDE)); + packet.Worldstates.emplace_back(ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD, GetAlivePlayersCountByTeam(ALLIANCE)); } void Arena::UpdateArenaWorldState() diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 56dfc065ac9..2e942d5c7a7 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -378,7 +378,7 @@ class TC_GAME_API Battleground // Packet Transfer // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!) - virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& /*data*/) { } + virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& /*packet*/) { } void SendPacketToTeam(uint32 teamId, WorldPacket const* packet, Player* except = nullptr) const; void SendPacketToAll(WorldPacket const* packet) const; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 08dcaabf01e..90ccc50a6b5 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -305,32 +305,32 @@ void BattlegroundAB::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS // Node icons for (uint8 node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node) - packet.Worldstates.emplace_back(uint32(BG_AB_OP_NODEICONS[node]), int32((m_Nodes[node] == 0) ? 1 : 0)); + packet.Worldstates.emplace_back(BG_AB_OP_NODEICONS[node], (m_Nodes[node] == 0) ? 1 : 0); // Node occupied states for (uint8 node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node) - for (uint8 i = 1; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) - packet.Worldstates.emplace_back(uint32(BG_AB_OP_NODESTATES[node] + plusArray[i]), int32((m_Nodes[node] == i) ? 1 : 0)); + for (uint8 itr = 1; itr < BG_AB_DYNAMIC_NODES_COUNT; ++itr) + packet.Worldstates.emplace_back(BG_AB_OP_NODESTATES[node] + plusArray[itr], (m_Nodes[node] == itr) ? 1 : 0); // How many bases each team owns - uint8 ally = 0, horde = 0; + int32 ally = 0, horde = 0; for (uint8 node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node) if (m_Nodes[node] == BG_AB_NODE_STATUS_ALLY_OCCUPIED) ++ally; else if (m_Nodes[node] == BG_AB_NODE_STATUS_HORDE_OCCUPIED) ++horde; - packet.Worldstates.emplace_back(uint32(BG_AB_OP_OCCUPIED_BASES_ALLY), int32(ally)); - packet.Worldstates.emplace_back(uint32(BG_AB_OP_OCCUPIED_BASES_HORDE), int32(horde)); + packet.Worldstates.emplace_back(BG_AB_OP_OCCUPIED_BASES_ALLY, ally); + packet.Worldstates.emplace_back(BG_AB_OP_OCCUPIED_BASES_HORDE, horde); // Team scores - packet.Worldstates.emplace_back(uint32(BG_AB_OP_RESOURCES_MAX), int32(BG_AB_MAX_TEAM_SCORE)); - packet.Worldstates.emplace_back(uint32(BG_AB_OP_RESOURCES_WARNING), int32(BG_AB_WARNING_NEAR_VICTORY_SCORE)); - packet.Worldstates.emplace_back(uint32(BG_AB_OP_RESOURCES_ALLY), int32(m_TeamScores[TEAM_ALLIANCE])); - packet.Worldstates.emplace_back(uint32(BG_AB_OP_RESOURCES_HORDE), int32(m_TeamScores[TEAM_HORDE])); + packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_MAX, BG_AB_MAX_TEAM_SCORE); + packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_WARNING, BG_AB_WARNING_NEAR_VICTORY_SCORE); + packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_ALLY, m_TeamScores[TEAM_ALLIANCE]); + packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_HORDE, m_TeamScores[TEAM_HORDE]); - // other unknown - packet.Worldstates.emplace_back(uint32(0x745), 0x2); + // other unknown BG_AB_UNK_01 + packet.Worldstates.emplace_back(1861, 2); } void BattlegroundAB::_SendNodeUpdate(uint8 node) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index bfd5dd3028c..eab5eada052 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1024,30 +1024,30 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) void BattlegroundAV::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i) + for (uint8 itr = BG_AV_NODES_FIRSTAID_STATION; itr < BG_AV_NODES_MAX; ++itr) { - uint16 owner = m_Nodes[i].Owner; - BG_AV_States state = m_Nodes[i].State; + uint16 owner = m_Nodes[itr].Owner; + BG_AV_States state = m_Nodes[itr].State; - packet.Worldstates.emplace_back(uint32(BGAVNodeInfo[i].WorldStateIds.AllianceAssault), int32(owner == ALLIANCE && state == POINT_ASSAULTED)); - packet.Worldstates.emplace_back(uint32(BGAVNodeInfo[i].WorldStateIds.AllianceControl), int32(owner == ALLIANCE && state >= POINT_DESTROYED)); - packet.Worldstates.emplace_back(uint32(BGAVNodeInfo[i].WorldStateIds.HordeAssault), int32(owner == HORDE && state == POINT_ASSAULTED)); - packet.Worldstates.emplace_back(uint32(BGAVNodeInfo[i].WorldStateIds.HordeControl), int32(owner == HORDE && state >= POINT_DESTROYED)); + packet.Worldstates.emplace_back(BGAVNodeInfo[itr].WorldStateIds.AllianceAssault, (owner == ALLIANCE && state == POINT_ASSAULTED) ? 1 : 0); + packet.Worldstates.emplace_back(BGAVNodeInfo[itr].WorldStateIds.AllianceControl, (owner == ALLIANCE && state >= POINT_DESTROYED) ? 1 : 0); + packet.Worldstates.emplace_back(BGAVNodeInfo[itr].WorldStateIds.HordeAssault, (owner == HORDE && state == POINT_ASSAULTED) ? 1 : 0); + packet.Worldstates.emplace_back(BGAVNodeInfo[itr].WorldStateIds.HordeControl, (owner == HORDE && state >= POINT_DESTROYED) ? 1 : 0); } - packet.Worldstates.emplace_back(uint32(AV_SNOWFALL_N), int32(m_Nodes[BG_AV_NODES_SNOWFALL_GRAVE].Owner == AV_NEUTRAL_TEAM)); - - packet.Worldstates.emplace_back(uint32(AV_Alliance_Score), int32(m_Team_Scores[0])); - packet.Worldstates.emplace_back(uint32(AV_Horde_Score), int32(m_Team_Scores[1])); + packet.Worldstates.emplace_back(AV_SNOWFALL_N, (m_Nodes[BG_AV_NODES_SNOWFALL_GRAVE].Owner == AV_NEUTRAL_TEAM ? 1 : 0)); + packet.Worldstates.emplace_back(AV_Alliance_Score, m_Team_Scores[0]); + packet.Worldstates.emplace_back(AV_Horde_Score, m_Team_Scores[1]); - if (GetStatus() == STATUS_IN_PROGRESS){ //only if game started the teamscores are displayed - packet.Worldstates.emplace_back(uint32(AV_SHOW_A_SCORE), 1); - packet.Worldstates.emplace_back(uint32(AV_SHOW_H_SCORE), 1); + // only if game started the teamscores are displayed + if (GetStatus() == STATUS_IN_PROGRESS) { + packet.Worldstates.emplace_back(AV_SHOW_A_SCORE, 1); + packet.Worldstates.emplace_back(AV_SHOW_H_SCORE, 1); } else { - packet.Worldstates.emplace_back(uint32(AV_SHOW_A_SCORE), 0); - packet.Worldstates.emplace_back(uint32(AV_SHOW_H_SCORE), 0); + packet.Worldstates.emplace_back(AV_SHOW_A_SCORE, 0); + packet.Worldstates.emplace_back(AV_SHOW_H_SCORE, 0); } SendMineWorldStates(AV_NORTH_MINE); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp index cff1ecf3f66..57b77332ff2 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp @@ -61,7 +61,8 @@ void BattlegroundBE::HandleAreaTrigger(Player* player, uint32 trigger, bool ente void BattlegroundBE::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(0x9f3, 1); + packet.Worldstates.emplace_back(2547, 1); // BATTLEGROUND_BLADES_EDGE_ARENA_SHOW + Arena::FillInitialWorldStates(packet); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index e5bc13db919..a07d32017dc 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -147,7 +147,8 @@ void BattlegroundDS::HandleAreaTrigger(Player* player, uint32 trigger, bool ente void BattlegroundDS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(3610, 1); + packet.Worldstates.emplace_back(3610, 1); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW + Arena::FillInitialWorldStates(packet); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index bffbddfeb6c..803b7a4e46c 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -857,43 +857,41 @@ bool BattlegroundEY::UpdatePlayerScore(Player* player, uint32 type, uint32 value void BattlegroundEY::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(EY_HORDE_BASE), int32(m_TeamPointsCount[TEAM_HORDE])); - packet.Worldstates.emplace_back(uint32(EY_ALLIANCE_BASE), int32(m_TeamPointsCount[TEAM_ALLIANCE])); - packet.Worldstates.emplace_back(0xAB6, 0x0); - packet.Worldstates.emplace_back(0xAB5, 0x0); - packet.Worldstates.emplace_back(0xAB4, 0x0); - packet.Worldstates.emplace_back(0xAB3, 0x0); - packet.Worldstates.emplace_back(0xAB2, 0x0); - packet.Worldstates.emplace_back(0xAB1, 0x0); - packet.Worldstates.emplace_back(0xAB0, 0x0); - packet.Worldstates.emplace_back(0xAAF, 0x0); - - packet.Worldstates.emplace_back(uint32(DRAENEI_RUINS_HORDE_CONTROL), int32(m_PointOwnedByTeam[DRAENEI_RUINS] == HORDE && m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(DRAENEI_RUINS_ALLIANCE_CONTROL), int32(m_PointOwnedByTeam[DRAENEI_RUINS] == ALLIANCE && m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(DRAENEI_RUINS_UNCONTROL), int32(m_PointState[DRAENEI_RUINS] != EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(MAGE_TOWER_ALLIANCE_CONTROL), int32(m_PointOwnedByTeam[MAGE_TOWER] == ALLIANCE && m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(MAGE_TOWER_HORDE_CONTROL), int32(m_PointOwnedByTeam[MAGE_TOWER] == HORDE && m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(MAGE_TOWER_UNCONTROL), int32(m_PointState[MAGE_TOWER] != EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(FEL_REAVER_HORDE_CONTROL), int32(m_PointOwnedByTeam[FEL_REAVER] == HORDE && m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(FEL_REAVER_ALLIANCE_CONTROL), int32(m_PointOwnedByTeam[FEL_REAVER] == ALLIANCE && m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(FEL_REAVER_UNCONTROL), int32(m_PointState[FEL_REAVER] != EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(BLOOD_ELF_HORDE_CONTROL), int32(m_PointOwnedByTeam[BLOOD_ELF] == HORDE && m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(BLOOD_ELF_ALLIANCE_CONTROL), int32(m_PointOwnedByTeam[BLOOD_ELF] == ALLIANCE && m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(BLOOD_ELF_UNCONTROL), int32(m_PointState[BLOOD_ELF] != EY_POINT_UNDER_CONTROL)); - packet.Worldstates.emplace_back(uint32(NETHERSTORM_FLAG), int32(m_FlagState == BG_EY_FLAG_STATE_ON_BASE)); - - packet.Worldstates.emplace_back(0xAD2, 0x1); - packet.Worldstates.emplace_back(0xAD1, 0x1); - - packet.Worldstates.emplace_back(int32(EY_HORDE_RESOURCES), int32(GetTeamScore(TEAM_HORDE))); - packet.Worldstates.emplace_back(int32(EY_ALLIANCE_RESOURCES), int32(GetTeamScore(TEAM_ALLIANCE))); - packet.Worldstates.emplace_back(int32(EY_MAX_RESOURCES), int32(BG_EY_MAX_TEAM_SCORE)); - - packet.Worldstates.emplace_back(0xA05, 0x8E); - packet.Worldstates.emplace_back(0xAA0, 0x0); - packet.Worldstates.emplace_back(0xA9F, 0x0); - packet.Worldstates.emplace_back(0xA9E, 0x0); - packet.Worldstates.emplace_back(0xC0D, 0x17B); + packet.Worldstates.emplace_back(EY_HORDE_BASE, m_TeamPointsCount[TEAM_HORDE]); + packet.Worldstates.emplace_back(EY_ALLIANCE_BASE, m_TeamPointsCount[TEAM_ALLIANCE]); + packet.Worldstates.emplace_back(2742, 0); // Mage Tower - Horde conflict + packet.Worldstates.emplace_back(2741, 0); // Mage Tower - Alliance conflict + packet.Worldstates.emplace_back(2740, 0); // Fel Reaver - Horde conflict + packet.Worldstates.emplace_back(2739, 0); // Fel Reaver - Alliance conflict + packet.Worldstates.emplace_back(2738, 0); // Draenei - Alliance conflict + packet.Worldstates.emplace_back(2737, 0); // Draenei - Horde conflict + packet.Worldstates.emplace_back(2736, 0); // unk (0 at start) + packet.Worldstates.emplace_back(2735, 0); // unk (0 at start) + + packet.Worldstates.emplace_back(DRAENEI_RUINS_HORDE_CONTROL, (m_PointOwnedByTeam[DRAENEI_RUINS] == HORDE && m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(DRAENEI_RUINS_ALLIANCE_CONTROL, (m_PointOwnedByTeam[DRAENEI_RUINS] == ALLIANCE && m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(DRAENEI_RUINS_UNCONTROL, (m_PointState[DRAENEI_RUINS] != EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(MAGE_TOWER_ALLIANCE_CONTROL, (m_PointOwnedByTeam[MAGE_TOWER] == ALLIANCE && m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(MAGE_TOWER_HORDE_CONTROL, (m_PointOwnedByTeam[MAGE_TOWER] == HORDE && m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(MAGE_TOWER_UNCONTROL, (m_PointState[MAGE_TOWER] != EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(FEL_REAVER_HORDE_CONTROL, (m_PointOwnedByTeam[FEL_REAVER] == HORDE && m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(FEL_REAVER_ALLIANCE_CONTROL, (m_PointOwnedByTeam[FEL_REAVER] == ALLIANCE && m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(FEL_REAVER_UNCONTROL, (m_PointState[FEL_REAVER] != EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(BLOOD_ELF_HORDE_CONTROL, (m_PointOwnedByTeam[BLOOD_ELF] == HORDE && m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(BLOOD_ELF_ALLIANCE_CONTROL, (m_PointOwnedByTeam[BLOOD_ELF] == ALLIANCE && m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(BLOOD_ELF_UNCONTROL, (m_PointState[BLOOD_ELF] != EY_POINT_UNDER_CONTROL) ? 1 : 0); + packet.Worldstates.emplace_back(NETHERSTORM_FLAG, (m_FlagState == BG_EY_FLAG_STATE_ON_BASE) ? 1 : 0); + + packet.Worldstates.emplace_back(NETHERSTORM_FLAG_STATE_HORDE, 1); // Horde top-stats (1 - show, 0 - hide) // 02 -> horde picked up the flag + packet.Worldstates.emplace_back(NETHERSTORM_FLAG_STATE_ALLIANCE, 1); // Alliance top-stats (1 - show, 0 - hide) // 02 -> alliance picked up the flag + packet.Worldstates.emplace_back(EY_HORDE_RESOURCES, GetTeamScore(TEAM_HORDE)); // Horde resources + packet.Worldstates.emplace_back(EY_ALLIANCE_RESOURCES, GetTeamScore(TEAM_ALLIANCE)); // Alliance resources + packet.Worldstates.emplace_back(EY_MAX_RESOURCES, BG_EY_MAX_TEAM_SCORE); // Max resources + packet.Worldstates.emplace_back(2565, 142); // unk, constant? + packet.Worldstates.emplace_back(PROGRESS_BAR_PERCENT_GREY, 0); // Capturing progress-bar (100 -> empty (only grey), 0 -> blue|red (no grey), default 0) + packet.Worldstates.emplace_back(PROGRESS_BAR_STATUS, 0); // Capturing progress-bar (0 - left, 100 - right) + packet.Worldstates.emplace_back(PROGRESS_BAR_SHOW, 0); // Capturing progress-bar (1 - show, 0 - hide) + packet.Worldstates.emplace_back(3085, 379); // unk, constant? for (uint8 point = 0; point < EY_POINTS_MAX; ++point) { diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index 925419f9be0..dde0034909c 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -287,19 +287,19 @@ void BattlegroundIC::HandleAreaTrigger(Player* player, uint32 trigger, bool ente void BattlegroundIC::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(BG_IC_ALLIANCE_RENFORT_SET), 1); - packet.Worldstates.emplace_back(uint32(BG_IC_HORDE_RENFORT_SET), 1); - packet.Worldstates.emplace_back(uint32(BG_IC_ALLIANCE_RENFORT), int32(factionReinforcements[TEAM_ALLIANCE])); - packet.Worldstates.emplace_back(uint32(BG_IC_HORDE_RENFORT), int32(factionReinforcements[TEAM_HORDE])); + packet.Worldstates.emplace_back(BG_IC_ALLIANCE_RENFORT_SET, 1); + packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT_SET, 1); + packet.Worldstates.emplace_back(BG_IC_ALLIANCE_RENFORT, factionReinforcements[TEAM_ALLIANCE]); + packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT, factionReinforcements[TEAM_HORDE]); - for (uint8 i = 0; i < MAX_FORTRESS_GATES_SPAWNS; ++i) + for (uint8 itr = 0; itr < MAX_FORTRESS_GATES_SPAWNS; ++itr) { - uint32 uws = GetWorldStateFromGateEntry(BG_IC_ObjSpawnlocs[i].entry, (GateStatus[GetGateIDFromEntry(BG_IC_ObjSpawnlocs[i].entry)] == BG_IC_GATE_DESTROYED ? true : false)); - packet.Worldstates.emplace_back(uint32(uws), 1); + int32 worldState = GetWorldStateFromGateEntry(BG_IC_ObjSpawnlocs[itr].entry, (GateStatus[GetGateIDFromEntry(BG_IC_ObjSpawnlocs[itr].entry)] == BG_IC_GATE_DESTROYED ? true : false)); + packet.Worldstates.emplace_back(worldState, 1); } - for (uint8 i = 0; i < MAX_NODE_TYPES; ++i) - packet.Worldstates.emplace_back(uint32(nodePoint[i].worldStates[nodePoint[i].nodeState]), 1); + for (uint8 itr = 0; itr < MAX_NODE_TYPES; ++itr) + packet.Worldstates.emplace_back(nodePoint[itr].worldStates[nodePoint[itr].nodeState], 1); } bool BattlegroundIC::SetupBattleground() diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp index 846578dfc98..16d9f272361 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp @@ -58,7 +58,8 @@ void BattlegroundNA::HandleAreaTrigger(Player* player, uint32 trigger, bool ente void BattlegroundNA::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(0xa11, 1); + packet.Worldstates.emplace_back(2577, 1); // BATTLEGROUND_NAGRAND_ARENA_SHOW + Arena::FillInitialWorldStates(packet); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp index 4b657a69b11..4a31fd302d5 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp @@ -58,7 +58,8 @@ void BattlegroundRL::HandleAreaTrigger(Player* player, uint32 trigger, bool ente void BattlegroundRL::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(0xbba, 1); + packet.Worldstates.emplace_back(3002, 1); // BATTELGROUND_RUINS_OF_LORDAERNON_SHOW + Arena::FillInitialWorldStates(packet); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index c927f4109d3..143bb9231d7 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -102,7 +102,8 @@ void BattlegroundRV::HandleAreaTrigger(Player* player, uint32 trigger, bool ente void BattlegroundRV::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(BG_RV_WORLD_STATE), 1); + packet.Worldstates.emplace_back(BG_RV_WORLD_STATE, 1); + Arena::FillInitialWorldStates(packet); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 9c14dd3af32..cf5615ad3bf 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -439,42 +439,39 @@ void BattlegroundSA::StartingEventOpenDoors() { } void BattlegroundSA::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - bool allyAttacks = Attackers == TEAM_ALLIANCE; - bool hordeAttacks = Attackers == TEAM_HORDE; + bool const allyAttacks = Attackers == TEAM_ALLIANCE; + bool const hordeAttacks = Attackers == TEAM_HORDE; - packet.Worldstates.emplace_back(uint32(BG_SA_ANCIENT_GATEWS), int32(GateStatus[BG_SA_ANCIENT_GATE])); - packet.Worldstates.emplace_back(uint32(BG_SA_YELLOW_GATEWS), int32(GateStatus[BG_SA_YELLOW_GATE])); - packet.Worldstates.emplace_back(uint32(BG_SA_GREEN_GATEWS), int32(GateStatus[BG_SA_GREEN_GATE])); - packet.Worldstates.emplace_back(uint32(BG_SA_BLUE_GATEWS), int32(GateStatus[BG_SA_BLUE_GATE])); - packet.Worldstates.emplace_back(uint32(BG_SA_RED_GATEWS), int32(GateStatus[BG_SA_RED_GATE])); - packet.Worldstates.emplace_back(uint32(BG_SA_PURPLE_GATEWS), int32(GateStatus[BG_SA_PURPLE_GATE])); + packet.Worldstates.emplace_back(BG_SA_ANCIENT_GATEWS, GateStatus[BG_SA_ANCIENT_GATE]); + packet.Worldstates.emplace_back(BG_SA_YELLOW_GATEWS, GateStatus[BG_SA_YELLOW_GATE]); + packet.Worldstates.emplace_back(BG_SA_GREEN_GATEWS, GateStatus[BG_SA_GREEN_GATE]); + packet.Worldstates.emplace_back(BG_SA_BLUE_GATEWS, GateStatus[BG_SA_BLUE_GATE]); + packet.Worldstates.emplace_back(BG_SA_RED_GATEWS, GateStatus[BG_SA_RED_GATE]); + packet.Worldstates.emplace_back(BG_SA_PURPLE_GATEWS, GateStatus[BG_SA_PURPLE_GATE]); - packet.Worldstates.emplace_back(uint32(BG_SA_BONUS_TIMER), 0); - - packet.Worldstates.emplace_back(uint32(BG_SA_HORDE_ATTACKS), int32(hordeAttacks)); - packet.Worldstates.emplace_back(uint32(BG_SA_ALLY_ATTACKS), int32(allyAttacks)); + packet.Worldstates.emplace_back(BG_SA_BONUS_TIMER, 0); + packet.Worldstates.emplace_back(BG_SA_HORDE_ATTACKS, hordeAttacks); + packet.Worldstates.emplace_back(BG_SA_ALLY_ATTACKS, allyAttacks); // Time will be sent on first update... - packet.Worldstates.emplace_back(uint32(BG_SA_ENABLE_TIMER), int32(TimerEnabled)); - packet.Worldstates.emplace_back(uint32(BG_SA_TIMER_MINS), 0); - packet.Worldstates.emplace_back(uint32(BG_SA_TIMER_SEC_TENS), 0); - packet.Worldstates.emplace_back(uint32(BG_SA_TIMER_SEC_DECS), 0); - - packet.Worldstates.emplace_back(uint32(BG_SA_RIGHT_GY_HORDE), int32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE)); - packet.Worldstates.emplace_back(uint32(BG_SA_LEFT_GY_HORDE), int32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE)); - packet.Worldstates.emplace_back(uint32(BG_SA_CENTER_GY_HORDE), int32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE)); - - packet.Worldstates.emplace_back(uint32(BG_SA_RIGHT_GY_ALLIANCE), int32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE)); - packet.Worldstates.emplace_back(uint32(BG_SA_LEFT_GY_ALLIANCE), int32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE)); - packet.Worldstates.emplace_back(uint32(BG_SA_CENTER_GY_ALLIANCE), int32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE)); - - packet.Worldstates.emplace_back(uint32(BG_SA_HORDE_DEFENCE_TOKEN), int32(allyAttacks)); - packet.Worldstates.emplace_back(uint32(BG_SA_ALLIANCE_DEFENCE_TOKEN), int32(hordeAttacks)); - - packet.Worldstates.emplace_back(uint32(BG_SA_LEFT_ATT_TOKEN_HRD), int32(hordeAttacks)); - packet.Worldstates.emplace_back(uint32(BG_SA_RIGHT_ATT_TOKEN_HRD), int32(hordeAttacks)); - packet.Worldstates.emplace_back(uint32(BG_SA_RIGHT_ATT_TOKEN_ALL), int32(allyAttacks)); - packet.Worldstates.emplace_back(uint32(BG_SA_LEFT_ATT_TOKEN_ALL), int32(allyAttacks)); + packet.Worldstates.emplace_back(BG_SA_ENABLE_TIMER, TimerEnabled); + packet.Worldstates.emplace_back(BG_SA_TIMER_MINS, 0); + packet.Worldstates.emplace_back(BG_SA_TIMER_SEC_TENS, 0); + packet.Worldstates.emplace_back(BG_SA_TIMER_SEC_DECS, 0); + + packet.Worldstates.emplace_back(BG_SA_RIGHT_GY_HORDE, (GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE) ? 1 : 0); + packet.Worldstates.emplace_back(BG_SA_LEFT_GY_HORDE, (GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE) ? 1 : 0); + packet.Worldstates.emplace_back(BG_SA_CENTER_GY_HORDE, (GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE) ? 1 : 0); + packet.Worldstates.emplace_back(BG_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE) ? 1 : 0); + packet.Worldstates.emplace_back(BG_SA_LEFT_GY_ALLIANCE, (GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE) ? 1 : 0); + packet.Worldstates.emplace_back(BG_SA_CENTER_GY_ALLIANCE, (GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE) ? 1 : 0); + + packet.Worldstates.emplace_back(BG_SA_HORDE_DEFENCE_TOKEN, allyAttacks); + packet.Worldstates.emplace_back(BG_SA_ALLIANCE_DEFENCE_TOKEN, hordeAttacks); + packet.Worldstates.emplace_back(BG_SA_LEFT_ATT_TOKEN_HRD, hordeAttacks); + packet.Worldstates.emplace_back(BG_SA_RIGHT_ATT_TOKEN_HRD, hordeAttacks); + packet.Worldstates.emplace_back(BG_SA_RIGHT_ATT_TOKEN_ALL, allyAttacks); + packet.Worldstates.emplace_back(BG_SA_LEFT_ATT_TOKEN_ALL, allyAttacks); } void BattlegroundSA::AddPlayer(Player* player) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 5e33f441530..48e3f63e64d 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -821,42 +821,42 @@ WorldSafeLocsEntry const* BattlegroundWS::GetExploitTeleportLocation(Team team) void BattlegroundWS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_CAPTURES_ALLIANCE), int32(GetTeamScore(TEAM_ALLIANCE))); - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_CAPTURES_HORDE), int32(GetTeamScore(TEAM_HORDE))); + packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(TEAM_ALLIANCE)); + packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(TEAM_HORDE)); if (_flagState[TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND) - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), -1); + packet.Worldstates.emplace_back(BG_WS_FLAG_UNK_ALLIANCE, uint32(-1)); // ?? else if (_flagState[TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_PLAYER) - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), 1); + packet.Worldstates.emplace_back(BG_WS_FLAG_UNK_ALLIANCE, 1); else - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), 0); + packet.Worldstates.emplace_back(BG_WS_FLAG_UNK_ALLIANCE, 0); if (_flagState[TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND) - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), -1); + packet.Worldstates.emplace_back(BG_WS_FLAG_UNK_HORDE, uint32(-1)); // ?? else if (_flagState[TEAM_HORDE] == BG_WS_FLAG_STATE_ON_PLAYER) - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), 1); + packet.Worldstates.emplace_back(BG_WS_FLAG_UNK_HORDE, 1); else - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), 0); + packet.Worldstates.emplace_back(BG_WS_FLAG_UNK_HORDE, 0); - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_CAPTURES_MAX), int32(BG_WS_MAX_TEAM_SCORE)); + packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_MAX, BG_WS_MAX_TEAM_SCORE); if (GetStatus() == STATUS_IN_PROGRESS) { - packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER_ACTIVE), 1); - packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER), int32(25 - _minutesElapsed)); + packet.Worldstates.emplace_back(BG_WS_STATE_TIMER_ACTIVE, 1); + packet.Worldstates.emplace_back(BG_WS_STATE_TIMER, 25 - _minutesElapsed); } else - packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER_ACTIVE), 0); + packet.Worldstates.emplace_back(BG_WS_STATE_TIMER_ACTIVE, 0); if (_flagState[TEAM_HORDE] == BG_WS_FLAG_STATE_ON_PLAYER) - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_HORDE), 2); + packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_HORDE, 2); else - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_HORDE), 1); + packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_HORDE, 1); if (_flagState[TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_PLAYER) - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_ALLIANCE), 2); + packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_ALLIANCE, 2); else - packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_ALLIANCE), 1); + packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_ALLIANCE, 1); } uint32 BattlegroundWS::GetPrematureWinner() diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f9fe83239d4..94a464de412 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9170,598 +9170,592 @@ void Player::SendUpdateWorldState(uint32 variable, uint32 value, bool hidden /*= SendDirectMessage(worldstate.Write()); } -void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) +// TODO - InitWorldStates should NOT always send the same states +// Some should keep the same value between different zoneIds and areaIds on the same map +void Player::SendInitWorldStates(uint32 zoneId, uint32 areaId) { - // data depends on zoneid/mapid... - Battleground* bg = GetBattleground(); - uint32 mapid = GetMapId(); - OutdoorPvP* pvp = sOutdoorPvPMgr->GetOutdoorPvPToZoneId(zoneid); + uint32 mapId = GetMapId(); + Battleground* battleground = GetBattleground(); + OutdoorPvP* outdoorPvP = sOutdoorPvPMgr->GetOutdoorPvPToZoneId(zoneId); InstanceScript* instance = GetInstanceScript(); - Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(zoneid); + Battlefield* battlefield = sBattlefieldMgr->GetBattlefieldToZoneId(zoneId); + + TC_LOG_DEBUG("network", "Player::SendInitWorldStates: Sending SMSG_INIT_WORLD_STATES for Map: %u, Zone: %u", mapId, zoneId); WorldPackets::WorldState::InitWorldStates packet; - packet.MapID = mapid; - packet.AreaID = zoneid; - packet.SubareaID = areaid; - packet.Worldstates.emplace_back(2264, 0); // 1 - packet.Worldstates.emplace_back(2263, 0); // 2 - packet.Worldstates.emplace_back(2262, 0); // 3 - packet.Worldstates.emplace_back(2261, 0); // 4 - packet.Worldstates.emplace_back(2260, 0); // 5 - packet.Worldstates.emplace_back(2259, 0); // 6 - - packet.Worldstates.emplace_back(3191, int32(sWorld->getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS) ? sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) : 0)); // 7 Current Season - Arena season in progress - // 0 - End of season - packet.Worldstates.emplace_back(3901, int32(sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) - sWorld->getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS))); // 8 PreviousSeason - - if (mapid == 530) // Outland - { - packet.Worldstates.emplace_back(2495, 0); // 7 - packet.Worldstates.emplace_back(2493, 0xF); // 8 - packet.Worldstates.emplace_back(2491, 0xF); // 9 - } - - // insert <field> <value> - switch (zoneid) - { - case 1: // Dun Morogh - case 11: // Wetlands - case 12: // Elwynn Forest - case 38: // Loch Modan - case 40: // Westfall - case 51: // Searing Gorge - case 1519: // Stormwind City - case 1537: // Ironforge - case 2257: // Deeprun Tram - case 3703: // Shattrath City}); + packet.MapID = mapId; + packet.AreaID = zoneId; + packet.SubareaID = areaId; + + packet.Worldstates.emplace_back(2264, 0); // SCOURGE_EVENT_WORLDSTATE_EASTERN_PLAGUELANDS + packet.Worldstates.emplace_back(2263, 0); // SCOURGE_EVENT_WORLDSTATE_TANARIS + packet.Worldstates.emplace_back(2262, 0); // SCOURGE_EVENT_WORLDSTATE_BURNING_STEPPES + packet.Worldstates.emplace_back(2261, 0); // SCOURGE_EVENT_WORLDSTATE_BLASTED_LANDS + packet.Worldstates.emplace_back(2260, 0); // SCOURGE_EVENT_WORLDSTATE_AZSHARA + packet.Worldstates.emplace_back(2259, 0); // SCOURGE_EVENT_WORLDSTATE_WINTERSPRING + + // ARENA_SEASON_IN_PROGRESS + // 7 - arena season in progress + // 0 - end of season + packet.Worldstates.emplace_back(3191, sWorld->getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS) ? sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) : 0); + + // Previous arena season id + int32 previousArenaSeason = 0; + if (sWorld->getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS) && sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) > 0) + previousArenaSeason = sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) - 1; + packet.Worldstates.emplace_back(3901, previousArenaSeason); + + if (mapId == 530) // Outland + { + packet.Worldstates.emplace_back(2495, 0); // NA_UI_OUTLAND_01 "Progress: %2494w" + packet.Worldstates.emplace_back(2493, 15); // NA_UI_GUARDS_MAX + packet.Worldstates.emplace_back(2491, 15); // NA_UI_GUARDS_LEFT + } + + switch (zoneId) + { + case 1: // Dun Morogh + case 11: // Wetlands + case 12: // Elwynn Forest + case 38: // Loch Modan + case 40: // Westfall + case 51: // Searing Gorge + case 1519: // Stormwind City + case 1537: // Ironforge + case 2257: // Deeprun Tram + case 3703: // Shattrath City break; - case 1377: // Silithus - if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_SI) - pvp->FillInitialWorldStates(packet); + case 1377: // Silithus + if (outdoorPvP && outdoorPvP->GetTypeId() == OUTDOOR_PVP_SI) + outdoorPvP->FillInitialWorldStates(packet); else { - // states are always shown - packet.Worldstates.emplace_back(2313, 0x0); // 7 ally silityst gathered - packet.Worldstates.emplace_back(2314, 0x0); // 8 horde silityst gathered - packet.Worldstates.emplace_back(2317, 0x0); // 9 max silithyst + packet.Worldstates.emplace_back(2313, 0); // SI_GATHERED_A + packet.Worldstates.emplace_back(2314, 0); // SI_GATHERED_H + packet.Worldstates.emplace_back(2317, 0); // SI_SILITHYST_MAX } - // dunno about these... aq opening event maybe? - packet.Worldstates.emplace_back(2322, 0x0); // 10 sandworm N - packet.Worldstates.emplace_back(2323, 0x0); // 11 sandworm S - packet.Worldstates.emplace_back(2324, 0x0); // 12 sandworm SW - packet.Worldstates.emplace_back(2325, 0x0); // 13 sandworm E + // unknown, aq opening? + packet.Worldstates.emplace_back(2322, 0); // AQ_SANDWORM_N + packet.Worldstates.emplace_back(2323, 0); // AQ_SANDWORM_S + packet.Worldstates.emplace_back(2324, 0); // AQ_SANDWORM_SW + packet.Worldstates.emplace_back(2325, 0); // AQ_SANDWORM_E break; - case 2597: // Alterac Valley - if (bg && bg->GetTypeID(true) == BATTLEGROUND_AV) - bg->FillInitialWorldStates(packet); + case 2597: // Alterac Valley + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_AV) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0x7ae, 0x1); // 7 snowfall n - packet.Worldstates.emplace_back(0x532, 0x1); // 8 frostwolfhut hc - packet.Worldstates.emplace_back(0x531, 0x0); // 9 frostwolfhut ac - packet.Worldstates.emplace_back(0x52e, 0x0); // 10 stormpike firstaid a_a - packet.Worldstates.emplace_back(0x571, 0x0); // 11 east frostwolf tower horde assaulted -unused - packet.Worldstates.emplace_back(0x570, 0x0); // 12 west frostwolf tower horde assaulted - unused - packet.Worldstates.emplace_back(0x567, 0x1); // 13 frostwolfe c - packet.Worldstates.emplace_back(0x566, 0x1); // 14 frostwolfw c - packet.Worldstates.emplace_back(0x550, 0x1); // 15 irondeep (N) ally - packet.Worldstates.emplace_back(0x544, 0x0); // 16 ice grave a_a - packet.Worldstates.emplace_back(0x536, 0x0); // 17 stormpike grave h_c - packet.Worldstates.emplace_back(0x535, 0x1); // 18 stormpike grave a_c - packet.Worldstates.emplace_back(0x518, 0x0); // 19 stoneheart grave a_a - packet.Worldstates.emplace_back(0x517, 0x0); // 20 stoneheart grave h_a - packet.Worldstates.emplace_back(0x574, 0x0); // 21 1396 unk - packet.Worldstates.emplace_back(0x573, 0x0); // 22 iceblood tower horde assaulted -unused - packet.Worldstates.emplace_back(0x572, 0x0); // 23 towerpoint horde assaulted - unused - packet.Worldstates.emplace_back(0x56f, 0x0); // 24 1391 unk - packet.Worldstates.emplace_back(0x56e, 0x0); // 25 iceblood a - packet.Worldstates.emplace_back(0x56d, 0x0); // 26 towerp a - packet.Worldstates.emplace_back(0x56c, 0x0); // 27 frostwolfe a - packet.Worldstates.emplace_back(0x56b, 0x0); // 28 froswolfw a - packet.Worldstates.emplace_back(0x56a, 0x1); // 29 1386 unk - packet.Worldstates.emplace_back(0x569, 0x1); // 30 iceblood c - packet.Worldstates.emplace_back(0x568, 0x1); // 31 towerp c - packet.Worldstates.emplace_back(0x565, 0x0); // 32 stoneh tower a - packet.Worldstates.emplace_back(0x564, 0x0); // 33 icewing tower a - packet.Worldstates.emplace_back(0x563, 0x0); // 34 dunn a - packet.Worldstates.emplace_back(0x562, 0x0); // 35 duns a - packet.Worldstates.emplace_back(0x561, 0x0); // 36 stoneheart bunker alliance assaulted - unused - packet.Worldstates.emplace_back(0x560, 0x0); // 37 icewing bunker alliance assaulted - unused - packet.Worldstates.emplace_back(0x55f, 0x0); // 38 dunbaldar south alliance assaulted - unused - packet.Worldstates.emplace_back(0x55e, 0x0); // 39 dunbaldar north alliance assaulted - unused - packet.Worldstates.emplace_back(0x55d, 0x0); // 40 stone tower d - packet.Worldstates.emplace_back(0x3c6, 0x0); // 41 966 unk - packet.Worldstates.emplace_back(0x3c4, 0x0); // 42 964 unk - packet.Worldstates.emplace_back(0x3c2, 0x0); // 43 962 unk - packet.Worldstates.emplace_back(0x516, 0x1); // 44 stoneheart grave a_c - packet.Worldstates.emplace_back(0x515, 0x0); // 45 stonheart grave h_c - packet.Worldstates.emplace_back(0x3b6, 0x0); // 46 950 unk - packet.Worldstates.emplace_back(0x55c, 0x0); // 47 icewing tower d - packet.Worldstates.emplace_back(0x55b, 0x0); // 48 dunn d - packet.Worldstates.emplace_back(0x55a, 0x0); // 49 duns d - packet.Worldstates.emplace_back(0x559, 0x0); // 50 1369 unk - packet.Worldstates.emplace_back(0x558, 0x0); // 51 iceblood d - packet.Worldstates.emplace_back(0x557, 0x0); // 52 towerp d - packet.Worldstates.emplace_back(0x556, 0x0); // 53 frostwolfe d - packet.Worldstates.emplace_back(0x555, 0x0); // 54 frostwolfw d - packet.Worldstates.emplace_back(0x554, 0x1); // 55 stoneh tower c - packet.Worldstates.emplace_back(0x553, 0x1); // 56 icewing tower c - packet.Worldstates.emplace_back(0x552, 0x1); // 57 dunn c - packet.Worldstates.emplace_back(0x551, 0x1); // 58 duns c - packet.Worldstates.emplace_back(0x54f, 0x0); // 59 irondeep (N) horde - packet.Worldstates.emplace_back(0x54e, 0x0); // 60 irondeep (N) ally - packet.Worldstates.emplace_back(0x54d, 0x1); // 61 mine (S) neutral - packet.Worldstates.emplace_back(0x54c, 0x0); // 62 mine (S) horde - packet.Worldstates.emplace_back(0x54b, 0x0); // 63 mine (S) ally - packet.Worldstates.emplace_back(0x545, 0x0); // 64 iceblood h_a - packet.Worldstates.emplace_back(0x543, 0x1); // 65 iceblod h_c - packet.Worldstates.emplace_back(0x542, 0x0); // 66 iceblood a_c - packet.Worldstates.emplace_back(0x540, 0x0); // 67 snowfall h_a - packet.Worldstates.emplace_back(0x53f, 0x0); // 68 snowfall a_a - packet.Worldstates.emplace_back(0x53e, 0x0); // 69 snowfall h_c - packet.Worldstates.emplace_back(0x53d, 0x0); // 70 snowfall a_c - packet.Worldstates.emplace_back(0x53c, 0x0); // 71 frostwolf g h_a - packet.Worldstates.emplace_back(0x53b, 0x0); // 72 frostwolf g a_a - packet.Worldstates.emplace_back(0x53a, 0x1); // 73 frostwolf g h_c - packet.Worldstates.emplace_back(0x539, 0x0); // 74 frostwolf g a_c - packet.Worldstates.emplace_back(0x538, 0x0); // 75 stormpike grave h_a - packet.Worldstates.emplace_back(0x537, 0x0); // 76 stormpike grave a_a - packet.Worldstates.emplace_back(0x534, 0x0); // 77 frostwolf hut h_a - packet.Worldstates.emplace_back(0x533, 0x0); // 78 frostwolf hut a_a - packet.Worldstates.emplace_back(0x530, 0x0); // 79 stormpike first aid h_a - packet.Worldstates.emplace_back(0x52f, 0x0); // 80 stormpike first aid h_c - packet.Worldstates.emplace_back(0x52d, 0x1); // 81 stormpike first aid a_c + packet.Worldstates.emplace_back(1966, 1); // AV_SNOWFALL_N + packet.Worldstates.emplace_back(1330, 1); // AV_FROSTWOLFHUT_H_C + packet.Worldstates.emplace_back(1329, 0); // AV_FROSTWOLFHUT_A_C + packet.Worldstates.emplace_back(1326, 0); // AV_AID_A_A + packet.Worldstates.emplace_back(1393, 0); // East Frostwolf Tower Horde Assaulted - UNUSED + packet.Worldstates.emplace_back(1392, 0); // West Frostwolf Tower Horde Assaulted - UNUSED + packet.Worldstates.emplace_back(1383, 1); // AV_FROSTWOLFE_CONTROLLED + packet.Worldstates.emplace_back(1382, 1); // AV_FROSTWOLFW_CONTROLLED + packet.Worldstates.emplace_back(1360, 1); // AV_N_MINE_N + packet.Worldstates.emplace_back(1348, 0); // AV_ICEBLOOD_A_A + packet.Worldstates.emplace_back(1334, 0); // AV_PIKEGRAVE_H_C + packet.Worldstates.emplace_back(1333, 1); // AV_PIKEGRAVE_A_C + packet.Worldstates.emplace_back(1304, 0); // AV_STONEHEART_A_A + packet.Worldstates.emplace_back(1303, 0); // AV_STONEHEART_H_A + packet.Worldstates.emplace_back(1396, 0); // unk + packet.Worldstates.emplace_back(1395, 0); // Iceblood Tower Horde Assaulted - UNUSED + packet.Worldstates.emplace_back(1394, 0); // Towerpoint Horde Assaulted - UNUSED + packet.Worldstates.emplace_back(1391, 0); // unk + packet.Worldstates.emplace_back(1390, 0); // AV_ICEBLOOD_ASSAULTED + packet.Worldstates.emplace_back(1389, 0); // AV_TOWERPOINT_ASSAULTED + packet.Worldstates.emplace_back(1388, 0); // AV_FROSTWOLFE_ASSAULTED + packet.Worldstates.emplace_back(1387, 0); // AV_FROSTWOLFW_ASSAULTED + packet.Worldstates.emplace_back(1386, 1); // unk + packet.Worldstates.emplace_back(1385, 1); // AV_ICEBLOOD_CONTROLLED + packet.Worldstates.emplace_back(1384, 1); // AV_TOWERPOINT_CONTROLLED + packet.Worldstates.emplace_back(1381, 0); // AV_STONEH_ASSAULTED + packet.Worldstates.emplace_back(1380, 0); // AV_ICEWING_ASSAULTED + packet.Worldstates.emplace_back(1379, 0); // AV_DUNN_ASSAULTED + packet.Worldstates.emplace_back(1378, 0); // AV_DUNS_ASSAULTED + packet.Worldstates.emplace_back(1377, 0); // Stoneheart Bunker Alliance Assaulted - UNUSED + packet.Worldstates.emplace_back(1376, 0); // Icewing Bunker Alliance Assaulted - UNUSED + packet.Worldstates.emplace_back(1375, 0); // Dunbaldar South Alliance Assaulted - UNUSED + packet.Worldstates.emplace_back(1374, 0); // Dunbaldar North Alliance Assaulted - UNUSED + packet.Worldstates.emplace_back(1373, 0); // AV_STONEH_DESTROYED + packet.Worldstates.emplace_back(966, 0); // AV_UNK_02 + packet.Worldstates.emplace_back(964, 0); // AV_UNK_01 + packet.Worldstates.emplace_back(962, 0); // AV_STORMPIKE_COMMANDERS + packet.Worldstates.emplace_back(1302, 1); // AV_STONEHEART_A_C + packet.Worldstates.emplace_back(1301, 0); // AV_STONEHEART_H_C + packet.Worldstates.emplace_back(950, 0); // AV_STORMPIKE_LIEUTENANTS + packet.Worldstates.emplace_back(1372, 0); // AV_ICEWING_DESTROYED + packet.Worldstates.emplace_back(1371, 0); // AV_DUNN_DESTROYED + packet.Worldstates.emplace_back(1370, 0); // AV_DUNS_DESTROYED + packet.Worldstates.emplace_back(1369, 0); // unk + packet.Worldstates.emplace_back(1368, 0); // AV_ICEBLOOD_DESTROYED + packet.Worldstates.emplace_back(1367, 0); // AV_TOWERPOINT_DESTROYED + packet.Worldstates.emplace_back(1366, 0); // AV_FROSTWOLFE_DESTROYED + packet.Worldstates.emplace_back(1365, 0); // AV_FROSTWOLFW_DESTROYED + packet.Worldstates.emplace_back(1364, 1); // AV_STONEH_CONTROLLED + packet.Worldstates.emplace_back(1363, 1); // AV_ICEWING_CONTROLLED + packet.Worldstates.emplace_back(1362, 1); // AV_DUNN_CONTROLLED + packet.Worldstates.emplace_back(1361, 1); // AV_DUNS_CONTROLLED + packet.Worldstates.emplace_back(1359, 0); // AV_N_MINE_H + packet.Worldstates.emplace_back(1358, 0); // AV_N_MINE_A + packet.Worldstates.emplace_back(1357, 1); // AV_S_MINE_N + packet.Worldstates.emplace_back(1356, 0); // AV_S_MINE_H + packet.Worldstates.emplace_back(1355, 0); // AV_S_MINE_A + packet.Worldstates.emplace_back(1349, 0); // AV_ICEBLOOD_H_A + packet.Worldstates.emplace_back(1347, 1); // AV_ICEBLOOD_H_C + packet.Worldstates.emplace_back(1346, 0); // AV_ICEBLOOD_A_C + packet.Worldstates.emplace_back(1344, 0); // AV_SNOWFALL_H_A + packet.Worldstates.emplace_back(1343, 0); // AV_SNOWFALL_A_A + packet.Worldstates.emplace_back(1342, 0); // AV_SNOWFALL_H_C + packet.Worldstates.emplace_back(1341, 0); // AV_SNOWFALL_A_C + packet.Worldstates.emplace_back(1340, 0); // AV_FROSTWOLF_H_A + packet.Worldstates.emplace_back(1339, 0); // AV_FROSTWOLF_A_A + packet.Worldstates.emplace_back(1338, 1); // AV_FROSTWOLF_H_C + packet.Worldstates.emplace_back(1337, 0); // AV_FROSTWOLF_A_C + packet.Worldstates.emplace_back(1336, 0); // AV_PIKEGRAVE_H_A + packet.Worldstates.emplace_back(1335, 0); // AV_PIKEGRAVE_A_A + packet.Worldstates.emplace_back(1332, 0); // AV_FROSTWOLFHUT_H_A + packet.Worldstates.emplace_back(1331, 0); // AV_FROSTWOLFHUT_A_A + packet.Worldstates.emplace_back(1328, 0); // AV_AID_H_A + packet.Worldstates.emplace_back(1327, 0); // AV_AID_H_C + packet.Worldstates.emplace_back(1325, 1); // AV_AID_A_C } break; - case 3277: // Warsong Gulch - if (bg && bg->GetTypeID(true) == BATTLEGROUND_WS) - bg->FillInitialWorldStates(packet); + case 3277: // Warsong Gulch + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_WS) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0x62d, 0x0); // 7 1581 alliance flag captures - packet.Worldstates.emplace_back(0x62e, 0x0); // 8 1582 horde flag captures - packet.Worldstates.emplace_back(0x609, 0x0); // 9 1545 unk, set to 1 on alliance flag pickup... - packet.Worldstates.emplace_back(0x60a, 0x0); // 10 1546 unk, set to 1 on horde flag pickup, after drop it's -1 - packet.Worldstates.emplace_back(0x60b, 0x2); // 11 1547 unk - packet.Worldstates.emplace_back(0x641, 0x3); // 12 1601 unk (max flag captures?) - packet.Worldstates.emplace_back(0x922, 0x1); // 13 2338 horde (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) - packet.Worldstates.emplace_back(0x923, 0x1); // 14 2339 alliance (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) + packet.Worldstates.emplace_back(1581, 0); // alliance flag captures + packet.Worldstates.emplace_back(1582, 0); // horde flag captures + packet.Worldstates.emplace_back(1545, 0); // unk, set to 1 on alliance flag pickup... + packet.Worldstates.emplace_back(1546, 0); // unk, set to 1 on horde flag pickup, after drop it's -1 + packet.Worldstates.emplace_back(1547, 2); // unk + packet.Worldstates.emplace_back(1601, 3); // unk (max flag captures?) + packet.Worldstates.emplace_back(2338, 1); // horde (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) + packet.Worldstates.emplace_back(2339, 1); // alliance (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) } break; - case 3358: // Arathi Basin - if (bg && bg->GetTypeID(true) == BATTLEGROUND_AB) - bg->FillInitialWorldStates(packet); + case 3358: // Arathi Basin + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_AB) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0x6e7, 0x0); // 7 1767 stables alliance - packet.Worldstates.emplace_back(0x6e8, 0x0); // 8 1768 stables horde - packet.Worldstates.emplace_back(0x6e9, 0x0); // 9 1769 unk, ST? - packet.Worldstates.emplace_back(0x6ea, 0x0); // 10 1770 stables (show/hide) - packet.Worldstates.emplace_back(0x6ec, 0x0); // 11 1772 farm (0 - horde controlled, 1 - alliance controlled) - packet.Worldstates.emplace_back(0x6ed, 0x0); // 12 1773 farm (show/hide) - packet.Worldstates.emplace_back(0x6ee, 0x0); // 13 1774 farm color - packet.Worldstates.emplace_back(0x6ef, 0x0); // 14 1775 gold mine color, may be FM? - packet.Worldstates.emplace_back(0x6f0, 0x0); // 15 1776 alliance resources - packet.Worldstates.emplace_back(0x6f1, 0x0); // 16 1777 horde resources - packet.Worldstates.emplace_back(0x6f2, 0x0); // 17 1778 horde bases - packet.Worldstates.emplace_back(0x6f3, 0x0); // 18 1779 alliance bases - packet.Worldstates.emplace_back(0x6f4, 0x7d0); // 19 1780 max resources (2000) - packet.Worldstates.emplace_back(0x6f6, 0x0); // 20 1782 blacksmith color - packet.Worldstates.emplace_back(0x6f7, 0x0); // 21 1783 blacksmith (show/hide) - packet.Worldstates.emplace_back(0x6f8, 0x0); // 22 1784 unk, bs? - packet.Worldstates.emplace_back(0x6f9, 0x0); // 23 1785 unk, bs? - packet.Worldstates.emplace_back(0x6fb, 0x0); // 24 1787 gold mine (0 - horde contr, 1 - alliance contr) - packet.Worldstates.emplace_back(0x6fc, 0x0); // 25 1788 gold mine (0 - conflict, 1 - horde) - packet.Worldstates.emplace_back(0x6fd, 0x0); // 26 1789 gold mine (1 - show/0 - hide) - packet.Worldstates.emplace_back(0x6fe, 0x0); // 27 1790 gold mine color - packet.Worldstates.emplace_back(0x700, 0x0); // 28 1792 gold mine color, wtf?, may be LM? - packet.Worldstates.emplace_back(0x701, 0x0); // 29 1793 lumber mill color (0 - conflict, 1 - horde contr) - packet.Worldstates.emplace_back(0x702, 0x0); // 30 1794 lumber mill (show/hide) - packet.Worldstates.emplace_back(0x703, 0x0); // 31 1795 lumber mill color color - packet.Worldstates.emplace_back(0x732, 0x1); // 32 1842 stables (1 - uncontrolled) - packet.Worldstates.emplace_back(0x733, 0x1); // 33 1843 gold mine (1 - uncontrolled) - packet.Worldstates.emplace_back(0x734, 0x1); // 34 1844 lumber mill (1 - uncontrolled) - packet.Worldstates.emplace_back(0x735, 0x1); // 35 1845 farm (1 - uncontrolled) - packet.Worldstates.emplace_back(0x736, 0x1); // 36 1846 blacksmith (1 - uncontrolled) - packet.Worldstates.emplace_back(0x745, 0x2); // 37 1861 unk - packet.Worldstates.emplace_back(0x7a3, 0x708); // 38 1955 warning limit (1800) + packet.Worldstates.emplace_back(1767, 0); // stables alliance + packet.Worldstates.emplace_back(1768, 0); // stables horde + packet.Worldstates.emplace_back(1769, 0); // stables alliance controlled + packet.Worldstates.emplace_back(1770, 0); // stables horde controlled + packet.Worldstates.emplace_back(1772, 0); // farm alliance + packet.Worldstates.emplace_back(1773, 0); // farm horde + packet.Worldstates.emplace_back(1774, 0); // farm alliance controlled + packet.Worldstates.emplace_back(1775, 0); // farm horde controlled + packet.Worldstates.emplace_back(1776, 0); // alliance resources + packet.Worldstates.emplace_back(1777, 0); // horde resources + packet.Worldstates.emplace_back(1778, 0); // horde bases + packet.Worldstates.emplace_back(1779, 0); // alliance bases + packet.Worldstates.emplace_back(1780, 2000); // max resources (2000) + packet.Worldstates.emplace_back(1782, 0); // blacksmith alliance + packet.Worldstates.emplace_back(1783, 0); // blacksmith horde + packet.Worldstates.emplace_back(1784, 0); // blacksmith alliance controlled + packet.Worldstates.emplace_back(1785, 0); // blacksmith horde controlled + packet.Worldstates.emplace_back(1787, 0); // gold mine alliance + packet.Worldstates.emplace_back(1788, 0); // gold mine horde + packet.Worldstates.emplace_back(1789, 0); // gold mine alliance controlled + packet.Worldstates.emplace_back(1790, 0); // gold mine horde controlled + packet.Worldstates.emplace_back(1792, 0); // lumber mill alliance + packet.Worldstates.emplace_back(1793, 0); // lumber mill horde + packet.Worldstates.emplace_back(1794, 0); // lumber mill alliance controlled + packet.Worldstates.emplace_back(1795, 0); // lumber mill horde controlled + packet.Worldstates.emplace_back(1842, 1); // stables (1 - uncontrolled) + packet.Worldstates.emplace_back(1843, 1); // gold mine (1 - uncontrolled) + packet.Worldstates.emplace_back(1844, 1); // lumber mill (1 - uncontrolled) + packet.Worldstates.emplace_back(1845, 1); // farm (1 - uncontrolled) + packet.Worldstates.emplace_back(1846, 1); // blacksmith (1 - uncontrolled) + packet.Worldstates.emplace_back(1861, 2); // unk + packet.Worldstates.emplace_back(1955, 1800); // warning limit (1800) } break; - case 3820: // Eye of the Storm - if (bg && bg->GetTypeID(true) == BATTLEGROUND_EY) - bg->FillInitialWorldStates(packet); + case 3820: // Eye of the Storm + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_EY) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0xac1, 0x0); // 7 2753 Horde Bases - packet.Worldstates.emplace_back(0xac0, 0x0); // 8 2752 Alliance Bases - packet.Worldstates.emplace_back(0xab6, 0x0); // 9 2742 Mage Tower - Horde conflict - packet.Worldstates.emplace_back(0xab5, 0x0); // 10 2741 Mage Tower - Alliance conflict - packet.Worldstates.emplace_back(0xab4, 0x0); // 11 2740 Fel Reaver - Horde conflict - packet.Worldstates.emplace_back(0xab3, 0x0); // 12 2739 Fel Reaver - Alliance conflict - packet.Worldstates.emplace_back(0xab2, 0x0); // 13 2738 Draenei - Alliance conflict - packet.Worldstates.emplace_back(0xab1, 0x0); // 14 2737 Draenei - Horde conflict - packet.Worldstates.emplace_back(0xab0, 0x0); // 15 2736 unk // 0 at start - packet.Worldstates.emplace_back(0xaaf, 0x0); // 16 2735 unk // 0 at start - packet.Worldstates.emplace_back(0xaad, 0x0); // 17 2733 Draenei - Horde control - packet.Worldstates.emplace_back(0xaac, 0x0); // 18 2732 Draenei - Alliance control - packet.Worldstates.emplace_back(0xaab, 0x1); // 19 2731 Draenei uncontrolled (1 - yes, 0 - no) - packet.Worldstates.emplace_back(0xaaa, 0x0); // 20 2730 Mage Tower - Alliance control - packet.Worldstates.emplace_back(0xaa9, 0x0); // 21 2729 Mage Tower - Horde control - packet.Worldstates.emplace_back(0xaa8, 0x1); // 22 2728 Mage Tower uncontrolled (1 - yes, 0 - no) - packet.Worldstates.emplace_back(0xaa7, 0x0); // 23 2727 Fel Reaver - Horde control - packet.Worldstates.emplace_back(0xaa6, 0x0); // 24 2726 Fel Reaver - Alliance control - packet.Worldstates.emplace_back(0xaa5, 0x1); // 25 2725 Fel Reaver uncontrolled (1 - yes, 0 - no) - packet.Worldstates.emplace_back(0xaa4, 0x0); // 26 2724 Boold Elf - Horde control - packet.Worldstates.emplace_back(0xaa3, 0x0); // 27 2723 Boold Elf - Alliance control - packet.Worldstates.emplace_back(0xaa2, 0x1); // 28 2722 Boold Elf uncontrolled (1 - yes, 0 - no) - packet.Worldstates.emplace_back(0xac5, 0x1); // 29 2757 Flag (1 - show, 0 - hide) - doesn't work exactly this way! - packet.Worldstates.emplace_back(0xad2, 0x1); // 30 2770 Horde top-stats (1 - show, 0 - hide) // 02 -> horde picked up the flag - packet.Worldstates.emplace_back(0xad1, 0x1); // 31 2769 Alliance top-stats (1 - show, 0 - hide) // 02 -> alliance picked up the flag - packet.Worldstates.emplace_back(0xabe, 0x0); // 32 2750 Horde resources - packet.Worldstates.emplace_back(0xabd, 0x0); // 33 2749 Alliance resources - packet.Worldstates.emplace_back(0xa05, 0x8e); // 34 2565 unk, constant? - packet.Worldstates.emplace_back(0xaa0, 0x0); // 35 2720 Capturing progress-bar (100 -> empty (only grey), 0 -> blue|red (no grey), default 0) - packet.Worldstates.emplace_back(0xa9f, 0x0); // 36 2719 Capturing progress-bar (0 - left, 100 - right) - packet.Worldstates.emplace_back(0xa9e, 0x0); // 37 2718 Capturing progress-bar (1 - show, 0 - hide) - packet.Worldstates.emplace_back(0xc0d, 0x17b); // 38 3085 unk - // and some more ... unknown + packet.Worldstates.emplace_back(2753, 0); // Horde Bases + packet.Worldstates.emplace_back(2752, 0); // Alliance Bases + packet.Worldstates.emplace_back(2742, 0); // Mage Tower - Horde conflict + packet.Worldstates.emplace_back(2741, 0); // Mage Tower - Alliance conflict + packet.Worldstates.emplace_back(2740, 0); // Fel Reaver - Horde conflict + packet.Worldstates.emplace_back(2739, 0); // Fel Reaver - Alliance conflict + packet.Worldstates.emplace_back(2738, 0); // Draenei - Alliance conflict + packet.Worldstates.emplace_back(2737, 0); // Draenei - Horde conflict + packet.Worldstates.emplace_back(2736, 0); // unk (0 at start) + packet.Worldstates.emplace_back(2735, 0); // unk (0 at start) + packet.Worldstates.emplace_back(2733, 0); // Draenei - Horde control + packet.Worldstates.emplace_back(2732, 0); // Draenei - Alliance control + packet.Worldstates.emplace_back(2731, 1); // Draenei uncontrolled (1 - yes, 0 - no) + packet.Worldstates.emplace_back(2730, 0); // Mage Tower - Alliance control + packet.Worldstates.emplace_back(2729, 0); // Mage Tower - Horde control + packet.Worldstates.emplace_back(2728, 1); // Mage Tower uncontrolled (1 - yes, 0 - no) + packet.Worldstates.emplace_back(2727, 0); // Fel Reaver - Horde control + packet.Worldstates.emplace_back(2726, 0); // Fel Reaver - Alliance control + packet.Worldstates.emplace_back(2725, 1); // Fel Reaver uncontrolled (1 - yes, 0 - no) + packet.Worldstates.emplace_back(2724, 0); // Boold Elf - Horde control + packet.Worldstates.emplace_back(2723, 0); // Boold Elf - Alliance control + packet.Worldstates.emplace_back(2722, 1); // Boold Elf uncontrolled (1 - yes, 0 - no) + packet.Worldstates.emplace_back(2757, 1); // Flag (1 - show, 0 - hide) - doesn't work exactly this way! + packet.Worldstates.emplace_back(2770, 1); // Horde top-stats (1 - show, 0 - hide) // 02 -> horde picked up the flag + packet.Worldstates.emplace_back(2769, 1); // Alliance top-stats (1 - show, 0 - hide) // 02 -> alliance picked up the flag + packet.Worldstates.emplace_back(2750, 0); // Horde resources + packet.Worldstates.emplace_back(2749, 0); // Alliance resources + packet.Worldstates.emplace_back(2565, 142); // unk, constant? + packet.Worldstates.emplace_back(2720, 0); // Capturing progress-bar (100 -> empty (only grey), 0 -> blue|red (no grey), default 0) + packet.Worldstates.emplace_back(2719, 0); // Capturing progress-bar (0 - left, 100 - right) + packet.Worldstates.emplace_back(2718, 0); // Capturing progress-bar (1 - show, 0 - hide) + packet.Worldstates.emplace_back(3085, 379); // unk, constant? + // missing unknowns } break; - // any of these needs change! the client remembers the prev setting! - // ON EVERY ZONE LEAVE, RESET THE OLD ZONE'S WORLD STATE, BUT AT LEAST THE UI STUFF! - case 3483: // Hellfire Peninsula - if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_HP) - pvp->FillInitialWorldStates(packet); + case 3483: // Hellfire Peninsula + if (outdoorPvP && outdoorPvP->GetTypeId() == OUTDOOR_PVP_HP) + outdoorPvP->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0x9ba, 0x1); // 10 // add ally tower main gui icon // maybe should be sent only on login? - packet.Worldstates.emplace_back(0x9b9, 0x1); // 11 // add horde tower main gui icon // maybe should be sent only on login? - packet.Worldstates.emplace_back(0x9b5, 0x0); // 12 // show neutral broken hill icon // 2485 - packet.Worldstates.emplace_back(0x9b4, 0x1); // 13 // show icon above broken hill // 2484 - packet.Worldstates.emplace_back(0x9b3, 0x0); // 14 // show ally broken hill icon // 2483 - packet.Worldstates.emplace_back(0x9b2, 0x0); // 15 // show neutral overlook icon // 2482 - packet.Worldstates.emplace_back(0x9b1, 0x1); // 16 // show the overlook arrow // 2481 - packet.Worldstates.emplace_back(0x9b0, 0x0); // 17 // show ally overlook icon // 2480 - packet.Worldstates.emplace_back(0x9ae, 0x0); // 18 // horde pvp objectives captured // 2478 - packet.Worldstates.emplace_back(0x9ac, 0x0); // 19 // ally pvp objectives captured // 2476 - packet.Worldstates.emplace_back(2475, 100); //: ally / horde slider grey area // show only in direct vicinity! - packet.Worldstates.emplace_back(2474, 50); //: ally / horde slider percentage, 100 for ally, 0 for horde // show only in direct vicinity! - packet.Worldstates.emplace_back(2473, 0); //: ally / horde slider display // show only in direct vicinity! - packet.Worldstates.emplace_back(0x9a8, 0x0); // 20 // show the neutral stadium icon // 2472 - packet.Worldstates.emplace_back(0x9a7, 0x0); // 21 // show the ally stadium icon // 2471 - packet.Worldstates.emplace_back(0x9a6, 0x1); // 22 // show the horde stadium icon // 2470 + packet.Worldstates.emplace_back(2490, 1); // add ally tower main gui icon + packet.Worldstates.emplace_back(2489, 1); // add horde tower main gui icon + packet.Worldstates.emplace_back(2485, 0); // show neutral broken hill icon + packet.Worldstates.emplace_back(2484, 1); // show icon above broken hill + packet.Worldstates.emplace_back(2483, 0); // show ally broken hill icon + packet.Worldstates.emplace_back(2482, 0); // show neutral overlook icon + packet.Worldstates.emplace_back(2481, 1); // show the overlook arrow + packet.Worldstates.emplace_back(2480, 0); // show ally overlook icon + packet.Worldstates.emplace_back(2478, 0); // horde pvp objectives captured + packet.Worldstates.emplace_back(2476, 0); // ally pvp objectives captured + packet.Worldstates.emplace_back(2475, 100); // horde slider grey area + packet.Worldstates.emplace_back(2474, 50); // horde slider percentage, 100 for ally, 0 for horde + packet.Worldstates.emplace_back(2473, 0); // horde slider display + packet.Worldstates.emplace_back(2472, 0); // show the neutral stadium icon + packet.Worldstates.emplace_back(2471, 0); // show the ally stadium icon + packet.Worldstates.emplace_back(2470, 1); // show the horde stadium icon } break; - case 3518: // Nagrand - if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_NA) - pvp->FillInitialWorldStates(packet); + case 3518: // Nagrand + if (outdoorPvP && outdoorPvP->GetTypeId() == OUTDOOR_PVP_NA) + outdoorPvP->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(2503, 0x0); // 10 - packet.Worldstates.emplace_back(2502, 0x0); // 11 - packet.Worldstates.emplace_back(2493, 0x0); // 12 - packet.Worldstates.emplace_back(2491, 0x0); // 13 - - packet.Worldstates.emplace_back(2495, 0x0); // 14 - packet.Worldstates.emplace_back(2494, 0x0); // 15 - packet.Worldstates.emplace_back(2497, 0x0); // 16 - - packet.Worldstates.emplace_back(2762, 0x0); // 17 - packet.Worldstates.emplace_back(2662, 0x0); // 18 - packet.Worldstates.emplace_back(2663, 0x0); // 19 - packet.Worldstates.emplace_back(2664, 0x0); // 20 - - packet.Worldstates.emplace_back(2760, 0x0); // 21 - packet.Worldstates.emplace_back(2670, 0x0); // 22 - packet.Worldstates.emplace_back(2668, 0x0); // 23 - packet.Worldstates.emplace_back(2669, 0x0); // 24 - - packet.Worldstates.emplace_back(2761, 0x0); // 25 - packet.Worldstates.emplace_back(2667, 0x0); // 26 - packet.Worldstates.emplace_back(2665, 0x0); // 27 - packet.Worldstates.emplace_back(2666, 0x0); // 28 - - packet.Worldstates.emplace_back(2763, 0x0); // 29 - packet.Worldstates.emplace_back(2659, 0x0); // 30 - packet.Worldstates.emplace_back(2660, 0x0); // 31 - packet.Worldstates.emplace_back(2661, 0x0); // 32 - - packet.Worldstates.emplace_back(2671, 0x0); // 33 - packet.Worldstates.emplace_back(2676, 0x0); // 34 - packet.Worldstates.emplace_back(2677, 0x0); // 35 - packet.Worldstates.emplace_back(2672, 0x0); // 36 - packet.Worldstates.emplace_back(2673, 0x0); // 37 + packet.Worldstates.emplace_back(2503, 0); // NA_UI_HORDE_GUARDS_SHOW + packet.Worldstates.emplace_back(2502, 0); // NA_UI_ALLIANCE_GUARDS_SHOW + packet.Worldstates.emplace_back(2493, 0); // NA_UI_GUARDS_MAX + packet.Worldstates.emplace_back(2491, 0); // NA_UI_GUARDS_LEFT + packet.Worldstates.emplace_back(2495, 0); // NA_UI_OUTLAND_01 + packet.Worldstates.emplace_back(2494, 0); // NA_UI_UNK_1 + packet.Worldstates.emplace_back(2497, 0); // NA_UI_UNK_2 + packet.Worldstates.emplace_back(2762, 0); // NA_MAP_WYVERN_NORTH_NEU_H + packet.Worldstates.emplace_back(2662, 0); // NA_MAP_WYVERN_NORTH_NEU_A + packet.Worldstates.emplace_back(2663, 0); // NA_MAP_WYVERN_NORTH_H + packet.Worldstates.emplace_back(2664, 0); // NA_MAP_WYVERN_NORTH_A + packet.Worldstates.emplace_back(2760, 0); // NA_MAP_WYVERN_SOUTH_NEU_H + packet.Worldstates.emplace_back(2670, 0); // NA_MAP_WYVERN_SOUTH_NEU_A + packet.Worldstates.emplace_back(2668, 0); // NA_MAP_WYVERN_SOUTH_H + packet.Worldstates.emplace_back(2669, 0); // NA_MAP_WYVERN_SOUTH_A + packet.Worldstates.emplace_back(2761, 0); // NA_MAP_WYVERN_WEST_NEU_H + packet.Worldstates.emplace_back(2667, 0); // NA_MAP_WYVERN_WEST_NEU_A + packet.Worldstates.emplace_back(2665, 0); // NA_MAP_WYVERN_WEST_H + packet.Worldstates.emplace_back(2666, 0); // NA_MAP_WYVERN_WEST_A + packet.Worldstates.emplace_back(2763, 0); // NA_MAP_WYVERN_EAST_NEU_H + packet.Worldstates.emplace_back(2659, 0); // NA_MAP_WYVERN_EAST_NEU_A + packet.Worldstates.emplace_back(2660, 0); // NA_MAP_WYVERN_EAST_H + packet.Worldstates.emplace_back(2661, 0); // NA_MAP_WYVERN_EAST_A + packet.Worldstates.emplace_back(2671, 0); // NA_MAP_HALAA_NEUTRAL + packet.Worldstates.emplace_back(2676, 0); // NA_MAP_HALAA_NEU_A + packet.Worldstates.emplace_back(2677, 0); // NA_MAP_HALAA_NEU_H + packet.Worldstates.emplace_back(2672, 0); // NA_MAP_HALAA_HORDE + packet.Worldstates.emplace_back(2673, 0); // NA_MAP_HALAA_ALLIANCE } break; - case 3519: // Terokkar Forest - if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_TF) - pvp->FillInitialWorldStates(packet); + case 3519: // Terokkar Forest + if (outdoorPvP && outdoorPvP->GetTypeId() == OUTDOOR_PVP_TF) + outdoorPvP->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0xa41, 0x0); // 10 // 2625 capture bar pos - packet.Worldstates.emplace_back(0xa40, 0x14); // 11 // 2624 capture bar neutral - packet.Worldstates.emplace_back(0xa3f, 0x0); // 12 // 2623 show capture bar - packet.Worldstates.emplace_back(0xa3e, 0x0); // 13 // 2622 horde towers controlled - packet.Worldstates.emplace_back(0xa3d, 0x5); // 14 // 2621 ally towers controlled - packet.Worldstates.emplace_back(0xa3c, 0x0); // 15 // 2620 show towers controlled - packet.Worldstates.emplace_back(0xa88, 0x0); // 16 // 2696 SE Neu - packet.Worldstates.emplace_back(0xa87, 0x0); // 17 // SE Horde - packet.Worldstates.emplace_back(0xa86, 0x0); // 18 // SE Ally - packet.Worldstates.emplace_back(0xa85, 0x0); // 19 //S Neu - packet.Worldstates.emplace_back(0xa84, 0x0); // 20 S Horde - packet.Worldstates.emplace_back(0xa83, 0x0); // 21 S Ally - packet.Worldstates.emplace_back(0xa82, 0x0); // 22 NE Neu - packet.Worldstates.emplace_back(0xa81, 0x0); // 23 NE Horde - packet.Worldstates.emplace_back(0xa80, 0x0); // 24 NE Ally - packet.Worldstates.emplace_back(0xa7e, 0x0); // 25 // 2686 N Neu - packet.Worldstates.emplace_back(0xa7d, 0x0); // 26 N Horde - packet.Worldstates.emplace_back(0xa7c, 0x0); // 27 N Ally - packet.Worldstates.emplace_back(0xa7b, 0x0); // 28 NW Ally - packet.Worldstates.emplace_back(0xa7a, 0x0); // 29 NW Horde - packet.Worldstates.emplace_back(0xa79, 0x0); // 30 NW Neutral - packet.Worldstates.emplace_back(0x9d0, 0x5); // 31 // 2512 locked time remaining seconds first digit - packet.Worldstates.emplace_back(0x9ce, 0x0); // 32 // 2510 locked time remaining seconds second digit - packet.Worldstates.emplace_back(0x9cd, 0x0); // 33 // 2509 locked time remaining minutes - packet.Worldstates.emplace_back(0x9cc, 0x0); // 34 // 2508 neutral locked time show - packet.Worldstates.emplace_back(0xad0, 0x0); // 35 // 2768 horde locked time show - packet.Worldstates.emplace_back(0xacf, 0x1); // 36 // 2767 ally locked time show + packet.Worldstates.emplace_back(2625, 0); // TF_UI_CAPTURE_BAR_POS + packet.Worldstates.emplace_back(2624, 20); // TF_UI_CAPTURE_BAR_NEUTRAL + packet.Worldstates.emplace_back(2623, 0); // TF_UI_SHOW CAPTURE BAR + packet.Worldstates.emplace_back(2622, 0); // TF_UI_TOWER_COUNT_H + packet.Worldstates.emplace_back(2621, 5); // TF_UI_TOWER_COUNT_A + packet.Worldstates.emplace_back(2620, 0); // TF_UI_TOWERS_CONTROLLED_DISPLAY + packet.Worldstates.emplace_back(2696, 0); // TF_TOWER_NUM_15 - SE Neutral + packet.Worldstates.emplace_back(2695, 0); // TF_TOWER_NUM_14 - SE Horde + packet.Worldstates.emplace_back(2694, 0); // TF_TOWER_NUM_13 - SE Alliance + packet.Worldstates.emplace_back(2693, 0); // TF_TOWER_NUM_12 - S Neutral + packet.Worldstates.emplace_back(2692, 0); // TF_TOWER_NUM_11 - S Horde + packet.Worldstates.emplace_back(2691, 0); // TF_TOWER_NUM_10 - S Alliance + packet.Worldstates.emplace_back(2690, 0); // TF_TOWER_NUM_09 - NE Neutral + packet.Worldstates.emplace_back(2689, 0); // TF_TOWER_NUM_08 - NE Horde + packet.Worldstates.emplace_back(2688, 0); // TF_TOWER_NUM_07 - NE Alliance + packet.Worldstates.emplace_back(2687, 0); // TF_TOWER_NUM_16 - unk + packet.Worldstates.emplace_back(2686, 0); // TF_TOWER_NUM_06 - N Neutral + packet.Worldstates.emplace_back(2685, 0); // TF_TOWER_NUM_05 - N Horde + packet.Worldstates.emplace_back(2684, 0); // TF_TOWER_NUM_04 - N Alliance + packet.Worldstates.emplace_back(2683, 0); // TF_TOWER_NUM_03 - NW Alliance + packet.Worldstates.emplace_back(2682, 0); // TF_TOWER_NUM_02 - NW Horde + packet.Worldstates.emplace_back(2681, 0); // TF_TOWER_NUM_01 - NW Neutral + packet.Worldstates.emplace_back(2512, 5); // TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT + packet.Worldstates.emplace_back(2510, 0); // TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT + packet.Worldstates.emplace_back(2509, 0); // TF_UI_LOCKED_TIME_HOURS + packet.Worldstates.emplace_back(2508, 0); // TF_UI_LOCKED_DISPLAY_NEUTRAL + packet.Worldstates.emplace_back(2768, 0); // TF_UI_LOCKED_DISPLAY_HORDE + packet.Worldstates.emplace_back(2767, 1); // TF_UI_LOCKED_DISPLAY_ALLIANCE } break; - case 3521: // Zangarmarsh - if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_ZM) - pvp->FillInitialWorldStates(packet); + case 3521: // Zangarmarsh + if (outdoorPvP && outdoorPvP->GetTypeId() == OUTDOOR_PVP_ZM) + outdoorPvP->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0x9e1, 0x0); // 10 //2529 - packet.Worldstates.emplace_back(0x9e0, 0x0); // 11 - packet.Worldstates.emplace_back(0x9df, 0x0); // 12 - packet.Worldstates.emplace_back(0xa5d, 0x1); // 13 //2653 - packet.Worldstates.emplace_back(0xa5c, 0x0); // 14 //2652 east beacon neutral - packet.Worldstates.emplace_back(0xa5b, 0x1); // 15 horde - packet.Worldstates.emplace_back(0xa5a, 0x0); // 16 ally - packet.Worldstates.emplace_back(0xa59, 0x1); // 17 // 2649 Twin spire graveyard horde 12??? - packet.Worldstates.emplace_back(0xa58, 0x0); // 18 ally 14 ??? - packet.Worldstates.emplace_back(0xa57, 0x0); // 19 neutral 7??? - packet.Worldstates.emplace_back(0xa56, 0x0); // 20 // 2646 west beacon neutral - packet.Worldstates.emplace_back(0xa55, 0x1); // 21 horde - packet.Worldstates.emplace_back(0xa54, 0x0); // 22 ally - packet.Worldstates.emplace_back(0x9e7, 0x0); // 23 // 2535 - packet.Worldstates.emplace_back(0x9e6, 0x0); // 24 - packet.Worldstates.emplace_back(0x9e5, 0x0); // 25 - packet.Worldstates.emplace_back(0xa00, 0x0); // 26 // 2560 - packet.Worldstates.emplace_back(0x9ff, 0x1); // 27 - packet.Worldstates.emplace_back(0x9fe, 0x0); // 28 - packet.Worldstates.emplace_back(0x9fd, 0x0); // 29 - packet.Worldstates.emplace_back(0x9fc, 0x1); // 30 - packet.Worldstates.emplace_back(0x9fb, 0x0); // 31 - packet.Worldstates.emplace_back(0xa62, 0x0); // 32 // 2658 - packet.Worldstates.emplace_back(0xa61, 0x1); // 33 - packet.Worldstates.emplace_back(0xa60, 0x1); // 34 - packet.Worldstates.emplace_back(0xa5f, 0x0); // 35 + packet.Worldstates.emplace_back(2529, 0); // ZM_UNK_1 + packet.Worldstates.emplace_back(2528, 0); // ZM_UNK_2 + packet.Worldstates.emplace_back(2527, 0); // ZM_UNK_3 + packet.Worldstates.emplace_back(2653, 1); // ZM_WORLDSTATE_UNK_1 + packet.Worldstates.emplace_back(2652, 0); // ZM_MAP_TOWER_EAST_N + packet.Worldstates.emplace_back(2651, 1); // ZM_MAP_TOWER_EAST_H + packet.Worldstates.emplace_back(2650, 0); // ZM_MAP_TOWER_EAST_A + packet.Worldstates.emplace_back(2649, 1); // ZM_MAP_GRAVEYARD_H - Twin spire graveyard horde + packet.Worldstates.emplace_back(2648, 0); // ZM_MAP_GRAVEYARD_A + packet.Worldstates.emplace_back(2647, 0); // ZM_MAP_GRAVEYARD_N + packet.Worldstates.emplace_back(2646, 0); // ZM_MAP_TOWER_WEST_N + packet.Worldstates.emplace_back(2645, 1); // ZM_MAP_TOWER_WEST_H + packet.Worldstates.emplace_back(2644, 0); // ZM_MAP_TOWER_WEST_A + packet.Worldstates.emplace_back(2535, 0); // ZM_UNK_4 + packet.Worldstates.emplace_back(2534, 0); // ZM_UNK_5 + packet.Worldstates.emplace_back(2533, 0); // ZM_UNK_6 + packet.Worldstates.emplace_back(2560, 0); // ZM_UI_TOWER_EAST_N + packet.Worldstates.emplace_back(2559, 1); // ZM_UI_TOWER_EAST_H + packet.Worldstates.emplace_back(2558, 0); // ZM_UI_TOWER_EAST_A + packet.Worldstates.emplace_back(2557, 0); // ZM_UI_TOWER_WEST_N + packet.Worldstates.emplace_back(2556, 1); // ZM_UI_TOWER_WEST_H + packet.Worldstates.emplace_back(2555, 0); // ZM_UI_TOWER_WEST_A + packet.Worldstates.emplace_back(2658, 0); // ZM_MAP_HORDE_FLAG_READY + packet.Worldstates.emplace_back(2657, 1); // ZM_MAP_HORDE_FLAG_NOT_READY + packet.Worldstates.emplace_back(2656, 1); // ZM_MAP_ALLIANCE_FLAG_NOT_READY + packet.Worldstates.emplace_back(2655, 0); // ZM_MAP_ALLIANCE_FLAG_READY } break; - case 3698: // Nagrand Arena - if (bg && bg->GetTypeID(true) == BATTLEGROUND_NA) - bg->FillInitialWorldStates(packet); + case 3698: // Nagrand Arena + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_NA) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0xa0f, 0x0); // 7 - packet.Worldstates.emplace_back(0xa10, 0x0); // 8 - packet.Worldstates.emplace_back(0xa11, 0x0); // 9 show + packet.Worldstates.emplace_back(2575, 0); // BATTLEGROUND_NAGRAND_ARENA_GOLD + packet.Worldstates.emplace_back(2576, 0); // BATTLEGROUND_NAGRAND_ARENA_GREEN + packet.Worldstates.emplace_back(2577, 0); // BATTLEGROUND_NAGRAND_ARENA_SHOW } break; - case 3702: // Blade's Edge Arena - if (bg && bg->GetTypeID(true) == BATTLEGROUND_BE) - bg->FillInitialWorldStates(packet); + case 3702: // Blade's Edge Arena + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_BE) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0x9f0, 0x0); // 7 gold - packet.Worldstates.emplace_back(0x9f1, 0x0); // 8 green - packet.Worldstates.emplace_back(0x9f3, 0x0); // 9 show + packet.Worldstates.emplace_back(2544, 0); // BATTLEGROUND_BLADES_EDGE_ARENA_GOLD + packet.Worldstates.emplace_back(2545, 0); // BATTLEGROUND_BLADES_EDGE_ARENA_GREEN + packet.Worldstates.emplace_back(2547, 0); // BATTLEGROUND_BLADES_EDGE_ARENA_SHOW } break; - case 3968: // Ruins of Lordaeron - if (bg && bg->GetTypeID(true) == BATTLEGROUND_RL) - bg->FillInitialWorldStates(packet); + case 3968: // Ruins of Lordaeron + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_RL) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0xbb8, 0x0); // 7 gold - packet.Worldstates.emplace_back(0xbb9, 0x0); // 8 green - packet.Worldstates.emplace_back(0xbba, 0x0); // 9 show + packet.Worldstates.emplace_back(3000, 0); // BATTELGROUND_RUINS_OF_LORDAERNON_GOLD + packet.Worldstates.emplace_back(3001, 0); // BATTELGROUND_RUINS_OF_LORDAERNON_GREEN + packet.Worldstates.emplace_back(3002, 0); // BATTELGROUND_RUINS_OF_LORDAERNON_SHOW } break; - case 4378: // Dalaran Sewers - if (bg && bg->GetTypeID(true) == BATTLEGROUND_DS) - bg->FillInitialWorldStates(packet); + case 4378: // Dalaran Sewers + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_DS) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(3601, 0x0); // 7 gold - packet.Worldstates.emplace_back(3600, 0x0); // 8 green - packet.Worldstates.emplace_back(3610, 0x0); // 9 show + packet.Worldstates.emplace_back(3601, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD + packet.Worldstates.emplace_back(3600, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN + packet.Worldstates.emplace_back(3610, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW } break; - case 4384: // Strand of the Ancients - if (bg && bg->GetTypeID(true) == BATTLEGROUND_SA) - bg->FillInitialWorldStates(packet); + case 4384: // Strand of the Ancients + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_SA) + battleground->FillInitialWorldStates(packet); else { - // 1-3 A defend, 4-6 H defend, 7-9 unk defend, 1 - ok, 2 - half destroyed, 3 - destroyed - packet.Worldstates.emplace_back(0xf09, 0x0); // 7 3849 Gate of Temple - packet.Worldstates.emplace_back(0xe36, 0x0); // 8 3638 Gate of Yellow Moon - packet.Worldstates.emplace_back(0xe27, 0x0); // 9 3623 Gate of Green Emerald - packet.Worldstates.emplace_back(0xe24, 0x0); // 10 3620 Gate of Blue Sapphire - packet.Worldstates.emplace_back(0xe21, 0x0); // 11 3617 Gate of Red Sun - packet.Worldstates.emplace_back(0xe1e, 0x0); // 12 3614 Gate of Purple Ametyst - - packet.Worldstates.emplace_back(0xdf3, 0x0); // 13 3571 bonus timer (1 - on, 0 - off) - packet.Worldstates.emplace_back(0xded, 0x0); // 14 3565 Horde Attacker - packet.Worldstates.emplace_back(0xdec, 0x0); // 15 3564 Alliance Attacker - // End Round (timer), better explain this by example, eg. ends in 19:59 -> A:BC - packet.Worldstates.emplace_back(0xde9, 0x0); // 16 3561 C - packet.Worldstates.emplace_back(0xde8, 0x0); // 17 3560 B - packet.Worldstates.emplace_back(0xde7, 0x0); // 18 3559 A - packet.Worldstates.emplace_back(0xe35, 0x0); // 19 3637 East g - Horde control - packet.Worldstates.emplace_back(0xe34, 0x0); // 20 3636 West g - Horde control - packet.Worldstates.emplace_back(0xe33, 0x0); // 21 3635 South g - Horde control - packet.Worldstates.emplace_back(0xe32, 0x0); // 22 3634 East g - Alliance control - packet.Worldstates.emplace_back(0xe31, 0x0); // 23 3633 West g - Alliance control - packet.Worldstates.emplace_back(0xe30, 0x0); // 24 3632 South g - Alliance control - packet.Worldstates.emplace_back(0xe2f, 0x0); // 25 3631 Chamber of Ancients - Horde control - packet.Worldstates.emplace_back(0xe2e, 0x0); // 26 3630 Chamber of Ancients - Alliance control - packet.Worldstates.emplace_back(0xe2d, 0x0); // 27 3629 Beach1 - Horde control - packet.Worldstates.emplace_back(0xe2c, 0x0); // 28 3628 Beach2 - Horde control - packet.Worldstates.emplace_back(0xe2b, 0x0); // 29 3627 Beach1 - Alliance control - packet.Worldstates.emplace_back(0xe2a, 0x0); // 30 3626 Beach2 - Alliance control - // and many unks... + packet.Worldstates.emplace_back(3849, 0); // Gate of Temple + packet.Worldstates.emplace_back(3638, 0); // Gate of Yellow Moon + packet.Worldstates.emplace_back(3623, 0); // Gate of Green Emerald + packet.Worldstates.emplace_back(3620, 0); // Gate of Blue Sapphire + packet.Worldstates.emplace_back(3617, 0); // Gate of Red Sun + packet.Worldstates.emplace_back(3614, 0); // Gate of Purple Ametyst + packet.Worldstates.emplace_back(3571, 0); // bonus timer (1 - on, 0 - off) + packet.Worldstates.emplace_back(3565, 0); // Horde Attacker + packet.Worldstates.emplace_back(3564, 0); // Alliance Attacker + + // End Round timer, example: 19:59 -> A:BC + packet.Worldstates.emplace_back(3561, 0); // C + packet.Worldstates.emplace_back(3560, 0); // B + packet.Worldstates.emplace_back(3559, 0); // A + + packet.Worldstates.emplace_back(3637, 0); // BG_SA_CENTER_GY_ALLIANCE + packet.Worldstates.emplace_back(3636, 0); // BG_SA_RIGHT_GY_ALLIANCE + packet.Worldstates.emplace_back(3635, 0); // BG_SA_LEFT_GY_ALLIANCE + packet.Worldstates.emplace_back(3634, 0); // BG_SA_CENTER_GY_HORDE + packet.Worldstates.emplace_back(3633, 0); // BG_SA_LEFT_GY_HORDE + packet.Worldstates.emplace_back(3632, 0); // BG_SA_RIGHT_GY_HORDE + packet.Worldstates.emplace_back(3631, 0); // BG_SA_HORDE_DEFENCE_TOKEN + packet.Worldstates.emplace_back(3630, 0); // BG_SA_ALLIANCE_DEFENCE_TOKEN + packet.Worldstates.emplace_back(3629, 0); // BG_SA_LEFT_ATT_TOKEN_HRD + packet.Worldstates.emplace_back(3628, 0); // BG_SA_RIGHT_ATT_TOKEN_HRD + packet.Worldstates.emplace_back(3627, 0); // BG_SA_RIGHT_ATT_TOKEN_ALL + packet.Worldstates.emplace_back(3626, 0); // BG_SA_LEFT_ATT_TOKEN_ALL + // missing unknowns } break; - case 4406: // Ring of Valor - if (bg && bg->GetTypeID(true) == BATTLEGROUND_RV) - bg->FillInitialWorldStates(packet); + case 4406: // Ring of Valor + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_RV) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0xe10, 0x0); // 7 gold - packet.Worldstates.emplace_back(0xe11, 0x0); // 8 green - packet.Worldstates.emplace_back(0xe1a, 0x0); // 9 show + packet.Worldstates.emplace_back(3600, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN + packet.Worldstates.emplace_back(3601, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD + packet.Worldstates.emplace_back(3610, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW } break; - case 4710: - if (bg && bg->GetTypeID(true) == BATTLEGROUND_IC) - bg->FillInitialWorldStates(packet); + case 4710: // Isle of Conquest + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_IC) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(4221, 1); // 7 BG_IC_ALLIANCE_RENFORT_SET - packet.Worldstates.emplace_back(4222, 1); // 8 BG_IC_HORDE_RENFORT_SET - packet.Worldstates.emplace_back(4226, 300); // 9 BG_IC_ALLIANCE_RENFORT - packet.Worldstates.emplace_back(4227, 300); // 10 BG_IC_HORDE_RENFORT - packet.Worldstates.emplace_back(4322, 1); // 11 BG_IC_GATE_FRONT_H_WS_OPEN - packet.Worldstates.emplace_back(4321, 1); // 12 BG_IC_GATE_WEST_H_WS_OPEN - packet.Worldstates.emplace_back(4320, 1); // 13 BG_IC_GATE_EAST_H_WS_OPEN - packet.Worldstates.emplace_back(4323, 1); // 14 BG_IC_GATE_FRONT_A_WS_OPEN - packet.Worldstates.emplace_back(4324, 1); // 15 BG_IC_GATE_WEST_A_WS_OPEN - packet.Worldstates.emplace_back(4325, 1); // 16 BG_IC_GATE_EAST_A_WS_OPEN - packet.Worldstates.emplace_back(4317, 1); // 17 unknown - - packet.Worldstates.emplace_back(4301, 1); // 18 BG_IC_DOCKS_UNCONTROLLED - packet.Worldstates.emplace_back(4296, 1); // 19 BG_IC_HANGAR_UNCONTROLLED - packet.Worldstates.emplace_back(4306, 1); // 20 BG_IC_QUARRY_UNCONTROLLED - packet.Worldstates.emplace_back(4311, 1); // 21 BG_IC_REFINERY_UNCONTROLLED - packet.Worldstates.emplace_back(4294, 1); // 22 BG_IC_WORKSHOP_UNCONTROLLED - packet.Worldstates.emplace_back(4243, 1); // 23 unknown - packet.Worldstates.emplace_back(4345, 1); // 24 unknown + packet.Worldstates.emplace_back(4221, 1); // BG_IC_ALLIANCE_RENFORT_SET + packet.Worldstates.emplace_back(4222, 1); // BG_IC_HORDE_RENFORT_SET + packet.Worldstates.emplace_back(4226, 300); // BG_IC_ALLIANCE_RENFORT + packet.Worldstates.emplace_back(4227, 300); // BG_IC_HORDE_RENFORT + packet.Worldstates.emplace_back(4322, 1); // BG_IC_GATE_FRONT_H_WS_OPEN + packet.Worldstates.emplace_back(4321, 1); // BG_IC_GATE_WEST_H_WS_OPEN + packet.Worldstates.emplace_back(4320, 1); // BG_IC_GATE_EAST_H_WS_OPEN + packet.Worldstates.emplace_back(4323, 1); // BG_IC_GATE_FRONT_A_WS_OPEN + packet.Worldstates.emplace_back(4324, 1); // BG_IC_GATE_WEST_A_WS_OPEN + packet.Worldstates.emplace_back(4325, 1); // BG_IC_GATE_EAST_A_WS_OPEN + packet.Worldstates.emplace_back(4317, 1); // unk + packet.Worldstates.emplace_back(4301, 1); // BG_IC_DOCKS_UNCONTROLLED + packet.Worldstates.emplace_back(4296, 1); // BG_IC_HANGAR_UNCONTROLLED + packet.Worldstates.emplace_back(4306, 1); // BG_IC_QUARRY_UNCONTROLLED + packet.Worldstates.emplace_back(4311, 1); // BG_IC_REFINERY_UNCONTROLLED + packet.Worldstates.emplace_back(4294, 1); // BG_IC_WORKSHOP_UNCONTROLLED + packet.Worldstates.emplace_back(4243, 1); // unk + packet.Worldstates.emplace_back(4345, 1); // unk } break; - // The Ruby Sanctum - case 4987: - if (instance && mapid == 724) + case 4987: // The Ruby Sanctum + if (instance) instance->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(5049, 50); // 9 WORLDSTATE_CORPOREALITY_MATERIAL - packet.Worldstates.emplace_back(5050, 50); // 10 WORLDSTATE_CORPOREALITY_TWILIGHT - packet.Worldstates.emplace_back(5051, 0); // 11 WORLDSTATE_CORPOREALITY_TOGGLE + packet.Worldstates.emplace_back(5049, 50); // WORLDSTATE_CORPOREALITY_MATERIAL + packet.Worldstates.emplace_back(5050, 50); // WORLDSTATE_CORPOREALITY_TWILIGHT + packet.Worldstates.emplace_back(5051, 0); // WORLDSTATE_CORPOREALITY_TOGGLE } break; - // Icecrown Citadel - case 4812: - if (instance && mapid == 631) + case 4812: // Icecrown Citadel + if (instance) instance->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(4903, 0); // 9 WORLDSTATE_SHOW_TIMER (Blood Quickening weekly) - packet.Worldstates.emplace_back(4904, 30); // 10 WORLDSTATE_EXECUTION_TIME - packet.Worldstates.emplace_back(4940, 0); // 11 WORLDSTATE_SHOW_ATTEMPTS - packet.Worldstates.emplace_back(4941, 50); // 12 WORLDSTATE_ATTEMPTS_REMAINING - packet.Worldstates.emplace_back(4942, 50); // 13 WORLDSTATE_ATTEMPTS_MAX + packet.Worldstates.emplace_back(4903, 0); // WORLDSTATE_SHOW_TIMER (Blood Quickening weekly) + packet.Worldstates.emplace_back(4904, 30); // WORLDSTATE_EXECUTION_TIME + packet.Worldstates.emplace_back(4940, 0); // WORLDSTATE_SHOW_ATTEMPTS + packet.Worldstates.emplace_back(4941, 50); // WORLDSTATE_ATTEMPTS_REMAINING + packet.Worldstates.emplace_back(4942, 50); // WORLDSTATE_ATTEMPTS_MAX } break; - // The Culling of Stratholme - case 4100: - if (instance && mapid == 595) + case 4100: // The Culling of Stratholme + if (instance) instance->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(3479, 0); // 9 WORLDSTATE_SHOW_CRATES - packet.Worldstates.emplace_back(3480, 0); // 10 WORLDSTATE_CRATES_REVEALED - packet.Worldstates.emplace_back(3504, 0); // 11 WORLDSTATE_WAVE_COUNT - packet.Worldstates.emplace_back(3931, 25); // 12 WORLDSTATE_TIME_GUARDIAN - packet.Worldstates.emplace_back(3932, 0); // 13 WORLDSTATE_TIME_GUARDIAN_SHOW + packet.Worldstates.emplace_back(3479, 0); // WORLDSTATE_SHOW_CRATES + packet.Worldstates.emplace_back(3480, 0); // WORLDSTATE_CRATES_REVEALED + packet.Worldstates.emplace_back(3504, 0); // WORLDSTATE_WAVE_COUNT + packet.Worldstates.emplace_back(3931, 25); // WORLDSTATE_TIME_GUARDIAN + packet.Worldstates.emplace_back(3932, 0); // WORLDSTATE_TIME_GUARDIAN_SHOW } break; - // The Oculus - case 4228: - if (instance && mapid == 578) + case 4228: // The Oculus + if (instance) instance->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(3524, 0); // 9 WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW - packet.Worldstates.emplace_back(3486, 0); // 10 WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT + packet.Worldstates.emplace_back(3524, 0); // WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW + packet.Worldstates.emplace_back(3486, 0); // WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT } break; - // Ulduar - case 4273: - if (instance && mapid == 603) + case 4273: // Ulduar + if (instance) instance->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(4132, 0); // 9 WORLDSTATE_ALGALON_TIMER_ENABLED - packet.Worldstates.emplace_back(4131, 0); // 10 WORLDSTATE_ALGALON_DESPAWN_TIMER + packet.Worldstates.emplace_back(4132, 0); // WORLDSTATE_ALGALON_TIMER_ENABLED + packet.Worldstates.emplace_back(4131, 0); // WORLDSTATE_ALGALON_DESPAWN_TIMER } break; - // Violet Hold - case 4415: - if (instance && mapid == 608) + case 4415: // Violet Hold + if (instance) instance->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(3816, 0); // 9 WORLD_STATE_VH_SHOW - packet.Worldstates.emplace_back(3815, 100); // 10 WORLD_STATE_VH_PRISON_STATE - packet.Worldstates.emplace_back(3810, 0); // 11 WORLD_STATE_VH_WAVE_COUNT + packet.Worldstates.emplace_back(3816, 0); // WORLD_STATE_VH_SHOW + packet.Worldstates.emplace_back(3815, 100); // WORLD_STATE_VH_PRISON_STATE + packet.Worldstates.emplace_back(3810, 0); // WORLD_STATE_VH_WAVE_COUNT } break; - // Halls of Refection - case 4820: - if (instance && mapid == 668) + case 4820: // Halls of Refection + if (instance) instance->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(4884, 0); // 9 WORLD_STATE_HOR_WAVES_ENABLED - packet.Worldstates.emplace_back(4882, 0); // 10 WORLD_STATE_HOR_WAVE_COUNT + packet.Worldstates.emplace_back(4884, 0); // WORLD_STATE_HOR_WAVES_ENABLED + packet.Worldstates.emplace_back(4882, 0); // WORLD_STATE_HOR_WAVE_COUNT } break; - // Zul Aman - case 3805: - if (instance && mapid == 568) + case 4197: // Wintergrasp + if (battlefield && battlefield->GetTypeId() == BATTLEFIELD_WG) + battlefield->FillInitialWorldStates(packet); + break; + case 3805: // Zul Aman + if (instance) instance->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(3104, 0); // 9 WORLD_STATE_ZULAMAN_TIMER_ENABLED - packet.Worldstates.emplace_back(3106, 0); // 10 WORLD_STATE_ZULAMAN_TIMER + packet.Worldstates.emplace_back(3104, 0); // WORLD_STATE_ZULAMAN_TIMER_ENABLED + packet.Worldstates.emplace_back(3106, 0); // WORLD_STATE_ZULAMAN_TIMER } break; - // Twin Peaks - case 5031: - if (bg && bg->GetTypeID(true) == BATTLEGROUND_TP) - bg->FillInitialWorldStates(packet); + case 5031: // Twin Peaks + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_TP) + battleground->FillInitialWorldStates(packet); else { - packet.Worldstates.emplace_back(0x62d, 0x0); // 7 1581 alliance flag captures - packet.Worldstates.emplace_back(0x62e, 0x0); // 8 1582 horde flag captures - packet.Worldstates.emplace_back(0x609, 0x0); // 9 1545 unk - packet.Worldstates.emplace_back(0x60a, 0x0); // 10 1546 unk - packet.Worldstates.emplace_back(0x60b, 0x2); // 11 1547 unk - packet.Worldstates.emplace_back(0x641, 0x3); // 12 1601 unk - packet.Worldstates.emplace_back(0x922, 0x1); // 13 2338 horde (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) - packet.Worldstates.emplace_back(0x923, 0x1); // 14 2339 alliance (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) + packet.Worldstates.emplace_back(1581, 0x0); // alliance flag captures + packet.Worldstates.emplace_back(1582, 0x0); // horde flag captures + packet.Worldstates.emplace_back(1545, 0x0); // unk + packet.Worldstates.emplace_back(1546, 0x0); // unk + packet.Worldstates.emplace_back(1547, 0x2); // unk + packet.Worldstates.emplace_back(1601, 0x3); // unk + packet.Worldstates.emplace_back(2338, 0x1); // horde (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) + packet.Worldstates.emplace_back(2339, 0x1); // alliance (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) } break; - // Battle for Gilneas - case 5449: - if (bg && bg->GetTypeID(true) == BATTLEGROUND_BFG) - bg->FillInitialWorldStates(packet); + case 5449: // Battle for Gilneas + if (battleground && battleground->GetTypeID(true) == BATTLEGROUND_BFG) + battleground->FillInitialWorldStates(packet); break; - // Tol Barad Peninsula - case 5389: + case 5389: // Tol Barad Peninsula if (sWorld->getBoolConfig(CONFIG_TOLBARAD_ENABLE)) { packet.Worldstates.emplace_back(5385u, sWorld->getWorldState(5385)); // TB_WS_ALLIANCE_CONTROLS_SHOW @@ -9771,21 +9765,11 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) packet.Worldstates.emplace_back(5547u, sWorld->getWorldState(5547)); // TB_WS_HORDE_ATTACKING_SHOW } break; - // Tol Barad - case 5095: - if (bf && bf->GetTypeId() == BATTLEFIELD_TB) - bf->FillInitialWorldStates(packet); + case 5095: // Tol Barad + if (battlefield && battlefield->GetTypeId() == BATTLEFIELD_TB) + battlefield->FillInitialWorldStates(packet); break; - // Wintergrasp - case 4197: - if (bf && bf->GetTypeId() == BATTLEFIELD_WG) - bf->FillInitialWorldStates(packet); - /* fallthrough */ default: - packet.Worldstates.emplace_back(0x914, 0x0); // 7 - packet.Worldstates.emplace_back(0x913, 0x0); // 8 - packet.Worldstates.emplace_back(0x912, 0x0); // 9 - packet.Worldstates.emplace_back(0x915, 0x0); // 10 break; } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index bf3598c8acf..7cd807e6e53 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2279,7 +2279,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player> void SetEquipmentSet(EquipmentSetInfo::EquipmentSetData const& newEqSet); void DeleteEquipmentSet(uint64 id); - void SendInitWorldStates(uint32 zone, uint32 area); + void SendInitWorldStates(uint32 zoneId, uint32 areaId); void SendUpdateWorldState(uint32 variable, uint32 value, bool hidden = false) const; void SendDirectMessage(WorldPacket const* data) const; void SendBGWeekendWorldStates() const; diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index 8283caeb442..532d81c3915 100644 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -257,6 +257,10 @@ class TC_GAME_API InstanceScript : public ZoneScript // Returns completed encounters mask for packets uint32 GetCompletedEncounterMask() const { return completedEncounters; } + virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& /*packet*/) { } + + uint32 GetEncounterCount() const { return uint32(bosses.size()); } + // Sets the entrance location (WorldSafeLoc) id void SetEntranceLocation(uint32 worldSafeLocationId); @@ -277,13 +281,9 @@ class TC_GAME_API InstanceScript : public ZoneScript void SendBossKillCredit(uint32 encounterId); - virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& /*packet*/) { } - // ReCheck PhaseTemplate related conditions void UpdatePhasing(); - uint32 GetEncounterCount() const { return uint32(bosses.size()); } - void InitializeCombatResurrections(uint8 charges = 1, uint32 interval = 0); void AddCombatResurrectionCharge(); void UseCombatResurrection(); diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h index e5a01706cbf..28d0a7b4f66 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.h +++ b/src/server/game/OutdoorPvP/OutdoorPvP.h @@ -198,7 +198,7 @@ class TC_GAME_API OutdoorPvP : public ZoneScript typedef std::map<ObjectGuid::LowType/*spawnId*/, OPvPCapturePoint*> OPvPCapturePointMap; - virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates & /*packet*/) { } + virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& /*packet*/) { } // called when a player triggers an areatrigger virtual bool HandleAreaTrigger(Player* /*player*/, uint32 /*trigger*/, bool /*entered*/) { return false; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index 5714aa88b0a..a16cfdf95ea 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -15,15 +15,15 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" +#include "culling_of_stratholme.h" #include "Creature.h" #include "CreatureAI.h" -#include "culling_of_stratholme.h" #include "EventMap.h" #include "GameObject.h" #include "InstanceScript.h" #include "Map.h" #include "MotionMaster.h" +#include "ScriptMgr.h" #include "TemporarySummon.h" #include "WorldStatePackets.h" @@ -72,11 +72,11 @@ class instance_culling_of_stratholme : public InstanceMapScript void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override { - packet.Worldstates.emplace_back(uint32(WORLDSTATE_SHOW_CRATES), 1); - packet.Worldstates.emplace_back(uint32(WORLDSTATE_CRATES_REVEALED), int32(_crateCount)); - packet.Worldstates.emplace_back(uint32(WORLDSTATE_WAVE_COUNT), 0); - packet.Worldstates.emplace_back(uint32(WORLDSTATE_TIME_GUARDIAN), 25); - packet.Worldstates.emplace_back(uint32(WORLDSTATE_TIME_GUARDIAN_SHOW), 0); + packet.Worldstates.emplace_back(WORLDSTATE_SHOW_CRATES, 1); + packet.Worldstates.emplace_back(WORLDSTATE_CRATES_REVEALED, _crateCount); + packet.Worldstates.emplace_back(WORLDSTATE_WAVE_COUNT, 0); + packet.Worldstates.emplace_back(WORLDSTATE_TIME_GUARDIAN, 25); + packet.Worldstates.emplace_back(WORLDSTATE_TIME_GUARDIAN_SHOW, 0); } void OnCreatureCreate(Creature* creature) override diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 40cd1ab08aa..82884269013 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -220,9 +220,15 @@ class spell_skeram_arcane_explosion : public SpellScriptLoader void FilterTargets(std::list<WorldObject*>& targets) { - targets.remove_if([](WorldObject* target) + targets.remove_if([](WorldObject* object) -> bool { - return target->GetTypeId() != TYPEID_PLAYER && (target->GetTypeId() != TYPEID_UNIT || !target->ToUnit()->IsPet()); + if (object->GetTypeId() == TYPEID_PLAYER) + return false; + + if (Creature* creature = object->ToCreature()) + return !creature->IsPet(); + + return true; }); } diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp index 5302117a7e6..c298e93ffee 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp @@ -15,13 +15,13 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" +#include "ruby_sanctum.h" #include "AreaBoundary.h" #include "CreatureAI.h" #include "GameObject.h" #include "InstanceScript.h" #include "Map.h" -#include "ruby_sanctum.h" +#include "ScriptMgr.h" #include "TemporarySummon.h" #include "WorldStatePackets.h" @@ -199,9 +199,9 @@ class instance_ruby_sanctum : public InstanceMapScript void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override { - packet.Worldstates.emplace_back(uint32(WORLDSTATE_CORPOREALITY_MATERIAL), 50); - packet.Worldstates.emplace_back(uint32(WORLDSTATE_CORPOREALITY_TWILIGHT), 50); - packet.Worldstates.emplace_back(uint32(WORLDSTATE_CORPOREALITY_TOGGLE), 0); + packet.Worldstates.emplace_back(WORLDSTATE_CORPOREALITY_MATERIAL, 50); + packet.Worldstates.emplace_back(WORLDSTATE_CORPOREALITY_TWILIGHT, 50); + packet.Worldstates.emplace_back(WORLDSTATE_CORPOREALITY_TOGGLE, 0); } protected: diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp index 9dd60470569..1dceae62f90 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp @@ -15,13 +15,13 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" #include "halls_of_reflection.h" #include "InstanceScript.h" #include "Map.h" #include "PhasingHandler.h" #include "Player.h" #include "ScriptedCreature.h" +#include "ScriptMgr.h" #include "TemporarySummon.h" #include "Transport.h" #include "WorldStatePackets.h" @@ -296,8 +296,8 @@ class instance_halls_of_reflection : public InstanceMapScript void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override { - packet.Worldstates.emplace_back(uint32(WORLD_STATE_HOR_WAVES_ENABLED), int32(_introState == DONE && GetBossState(DATA_MARWYN) != DONE)); - packet.Worldstates.emplace_back(uint32(WORLD_STATE_HOR_WAVE_COUNT), int32(_waveCount)); + packet.Worldstates.emplace_back(WORLD_STATE_HOR_WAVES_ENABLED, (_introState == DONE && GetBossState(DATA_MARWYN) != DONE) ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_HOR_WAVE_COUNT, _waveCount); } bool SetBossState(uint32 type, EncounterState state) override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index e8946cadb07..e671efb4b80 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -168,11 +168,11 @@ class instance_icecrown_citadel : public InstanceMapScript void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override { - packet.Worldstates.emplace_back(uint32(WORLDSTATE_SHOW_TIMER), int32(BloodQuickeningState == IN_PROGRESS)); - packet.Worldstates.emplace_back(uint32(WORLDSTATE_EXECUTION_TIME), int32(BloodQuickeningMinutes)); - packet.Worldstates.emplace_back(uint32(WORLDSTATE_SHOW_ATTEMPTS), int32(instance->IsHeroic())); - packet.Worldstates.emplace_back(uint32(WORLDSTATE_ATTEMPTS_REMAINING), int32(HeroicAttempts)); - packet.Worldstates.emplace_back(uint32(WORLDSTATE_ATTEMPTS_MAX), int32(MaxHeroicAttempts)); + packet.Worldstates.emplace_back(WORLDSTATE_SHOW_TIMER, BloodQuickeningState == IN_PROGRESS ? 1 : 0); + packet.Worldstates.emplace_back(WORLDSTATE_EXECUTION_TIME, BloodQuickeningMinutes); + packet.Worldstates.emplace_back(WORLDSTATE_SHOW_ATTEMPTS, instance->IsHeroic() ? 1 : 0); + packet.Worldstates.emplace_back(WORLDSTATE_ATTEMPTS_REMAINING, HeroicAttempts); + packet.Worldstates.emplace_back(WORLDSTATE_ATTEMPTS_MAX, MaxHeroicAttempts); } void OnPlayerEnter(Player* player) override diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp index 8250298c4be..0b7e8e890f0 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp @@ -15,14 +15,14 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" +#include "oculus.h" #include "Creature.h" #include "CreatureAI.h" #include "GameObject.h" #include "InstanceScript.h" #include "Map.h" #include "MotionMaster.h" -#include "oculus.h" +#include "ScriptMgr.h" #include "PhasingHandler.h" #include "TemporarySummon.h" #include "WorldStatePackets.h" @@ -155,13 +155,13 @@ class instance_oculus : public InstanceMapScript { if (GetBossState(DATA_DRAKOS) == DONE && GetBossState(DATA_VAROS) != DONE) { - packet.Worldstates.emplace_back(uint32(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW), 1); - packet.Worldstates.emplace_back(uint32(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT), int32(CentrifugueConstructCounter)); + packet.Worldstates.emplace_back(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 1); + packet.Worldstates.emplace_back(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, CentrifugueConstructCounter); } else { - packet.Worldstates.emplace_back(uint32(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW), 0); - packet.Worldstates.emplace_back(uint32(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT), 0); + packet.Worldstates.emplace_back(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 0); + packet.Worldstates.emplace_back(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, 0); } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 80942896008..bbe5b03e5c1 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -526,11 +526,17 @@ class spell_auriaya_sentinel_blast : public SpellScript { PrepareSpellScript(spell_auriaya_sentinel_blast); - void FilterTargets(std::list<WorldObject*>& unitList) + void FilterTargets(std::list<WorldObject*>& targets) { - unitList.remove_if([](WorldObject* target) + targets.remove_if([](WorldObject* object) -> bool { - return target->GetTypeId() != TYPEID_PLAYER && (target->GetTypeId() != TYPEID_UNIT || !target->ToUnit()->IsPet()); + if (object->GetTypeId() == TYPEID_PLAYER) + return false; + + if (Creature* creature = object->ToCreature()) + return !creature->IsPet(); + + return true; }); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index e1b931e0991..54b31a8a812 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -615,11 +615,17 @@ class spell_kologarn_stone_shout : public SpellScriptLoader { PrepareSpellScript(spell_kologarn_stone_shout_SpellScript); - void FilterTargets(std::list<WorldObject*>& unitList) + void FilterTargets(std::list<WorldObject*>& targets) { - unitList.remove_if([](WorldObject* target) + targets.remove_if([](WorldObject* object) -> bool { - return target->GetTypeId() != TYPEID_PLAYER && (target->GetTypeId() != TYPEID_UNIT || !target->ToUnit()->IsPet()); + if (object->GetTypeId() == TYPEID_PLAYER) + return false; + + if (Creature* creature = object->ToCreature()) + return !creature->IsPet(); + + return true; }); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index 5904d93ccfc..eff9c455cd0 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -580,7 +580,7 @@ class boss_thorim : public CreatureScript events.ScheduleEvent(EVENT_OUTRO_2, _hardMode ? 8000 : 11000); events.ScheduleEvent(EVENT_OUTRO_3, _hardMode ? 19000 : 21000); - me->m_Events.AddEvent(new KeeperDespawnEvent(me), me->m_Events.CalculateTime(35000)); + me->m_Events.AddEvent(new UlduarKeeperDespawnEvent(me), me->m_Events.CalculateTime(35000)); } void MovementInform(uint32 type, uint32 id) override @@ -1711,12 +1711,18 @@ class spell_thorim_frostbolt_volley : public SpellScriptLoader { PrepareSpellScript(spell_thorim_frostbolt_volley_SpellScript); - void FilterTargets(std::list<WorldObject*>& unitList) + void FilterTargets(std::list<WorldObject*>& targets) { - unitList.remove_if([](WorldObject* target) - { - return target->GetTypeId() != TYPEID_PLAYER && (target->GetTypeId() != TYPEID_UNIT || !target->ToUnit()->IsPet()); - }); + targets.remove_if([](WorldObject* object) -> bool + { + if (object->GetTypeId() == TYPEID_PLAYER) + return false; + + if (Creature* creature = object->ToCreature()) + return !creature->IsPet(); + + return true; + }); } void Register() override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 9260d5307b6..690bb6e053b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -15,7 +15,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" +#include "ulduar.h" #include "AreaBoundary.h" #include "CreatureAI.h" #include "GameObject.h" @@ -23,10 +23,10 @@ #include "Item.h" #include "Map.h" #include "Player.h" +#include "ScriptMgr.h" #include "Spell.h" #include "SpellScript.h" #include "TemporarySummon.h" -#include "ulduar.h" #include "Vehicle.h" #include "WorldStatePackets.h" #include <sstream> @@ -143,6 +143,17 @@ ObjectData const objectData[] = { 0, 0 } }; +UlduarKeeperDespawnEvent::UlduarKeeperDespawnEvent(Creature* owner, uint32 despawnTimerOffset) : _owner(owner), _despawnTimer(despawnTimerOffset) +{ +} + +bool UlduarKeeperDespawnEvent::Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) +{ + _owner->CastSpell(_owner, SPELL_TELEPORT_KEEPER_VISUAL); + _owner->DespawnOrUnsummon(1000 + _despawnTimer); + return true; +} + class instance_ulduar : public InstanceMapScript { public: @@ -218,8 +229,8 @@ class instance_ulduar : public InstanceMapScript void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override { - packet.Worldstates.emplace_back(uint32(WORLD_STATE_ALGALON_TIMER_ENABLED), int32(_algalonTimer && _algalonTimer <= 60)); - packet.Worldstates.emplace_back(uint32(WORLD_STATE_ALGALON_DESPAWN_TIMER), int32(std::min<uint32>(_algalonTimer, 60))); + packet.Worldstates.emplace_back(WORLD_STATE_ALGALON_TIMER_ENABLED, (_algalonTimer && _algalonTimer <= 60) ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_ALGALON_DESPAWN_TIMER, std::min<int32>(_algalonTimer, 60)); } void OnPlayerEnter(Player* player) override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index d332dad74a4..6875d6c4a65 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -19,6 +19,7 @@ #define DEF_ULDUAR_H #include "CreatureAIImpl.h" +#include "EventProcessor.h" struct Position; @@ -508,17 +509,14 @@ enum YoggSaronIllusions STORMWIND_ILLUSION = 2, }; -class KeeperDespawnEvent : public BasicEvent +class Creature; + +class UlduarKeeperDespawnEvent : public BasicEvent { -public: - KeeperDespawnEvent(Creature* owner, uint32 despawnTimerOffset = 500) : _owner(owner), _despawnTimer(despawnTimerOffset) { } - - bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override - { - _owner->CastSpell(_owner, SPELL_TELEPORT_KEEPER_VISUAL); - _owner->DespawnOrUnsummon(1000 + _despawnTimer); - return true; - } + public: + UlduarKeeperDespawnEvent(Creature* owner, uint32 despawnTimerOffset = 500); + + bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override; private: Creature* _owner; diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index b321c3ebfec..233b3d7f301 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -15,7 +15,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" +#include "violet_hold.h" #include "Creature.h" #include "CreatureAI.h" #include "GameObject.h" @@ -24,8 +24,8 @@ #include "MotionMaster.h" #include "Player.h" #include "TaskScheduler.h" +#include "ScriptMgr.h" #include "TemporarySummon.h" -#include "violet_hold.h" #include "WorldStatePackets.h" #include <sstream> @@ -293,11 +293,11 @@ class instance_violet_hold : public InstanceMapScript } } - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& data) override + void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override { - data.Worldstates.emplace_back(uint32(WORLD_STATE_VH_SHOW), uint32(EventState == IN_PROGRESS ? 1 : 0)); - data.Worldstates.emplace_back(uint32(WORLD_STATE_VH_PRISON_STATE), uint32(DoorIntegrity)); - data.Worldstates.emplace_back(uint32(WORLD_STATE_VH_WAVE_COUNT), uint32(WaveCount)); + packet.Worldstates.emplace_back(WORLD_STATE_VH_SHOW, EventState == IN_PROGRESS ? 1 : 0); + packet.Worldstates.emplace_back(WORLD_STATE_VH_PRISON_STATE, DoorIntegrity); + packet.Worldstates.emplace_back(WORLD_STATE_VH_WAVE_COUNT, WaveCount); } bool CheckRequiredBosses(uint32 bossId, Player const* player = nullptr) const override diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp index 3a52febaafd..91ffbaca3ec 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp @@ -15,28 +15,21 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" +#include "OutdoorPvPHP.h" #include "GameObject.h" #include "MapManager.h" -#include "OutdoorPvPHP.h" #include "Player.h" +#include "ScriptMgr.h" #include "WorldStatePackets.h" uint32 const OutdoorPvPHPBuffZonesNum = 6; - // HP, citadel, ramparts, blood furnace, shattered halls, mag's lair -uint32 const OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum] = { 3483, 3563, 3562, 3713, 3714, 3836 }; - +uint32 const OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum] = { 3483, 3563, 3562, 3713, 3714, 3836 }; // HP, citadel, ramparts, blood furnace, shattered halls, mag's lair uint32 const HP_CREDITMARKER[HP_TOWER_NUM] = { 19032, 19028, 19029 }; - -/* -uint32 const HP_CapturePointEvent_Enter[HP_TOWER_NUM] = { 11404, 11396, 11388 }; -uint32 const HP_CapturePointEvent_Leave[HP_TOWER_NUM] = { 11403, 11395, 11387 }; -*/ - +//uint32 const HP_CapturePointEvent_Enter[HP_TOWER_NUM] = { 11404, 11396, 11388 }; +//uint32 const HP_CapturePointEvent_Leave[HP_TOWER_NUM] = { 11403, 11395, 11387 }; uint32 const HP_MAP_N[HP_TOWER_NUM] = { 0x9b5, 0x9b2, 0x9a8 }; uint32 const HP_MAP_A[HP_TOWER_NUM] = { 0x9b3, 0x9b0, 0x9a7 }; uint32 const HP_MAP_H[HP_TOWER_NUM] = { 0x9b4, 0x9b1, 0x9a6 }; - uint32 const HP_TowerArtKit_A[HP_TOWER_NUM] = { 65, 62, 67 }; uint32 const HP_TowerArtKit_H[HP_TOWER_NUM] = { 64, 61, 68 }; uint32 const HP_TowerArtKit_N[HP_TOWER_NUM] = { 66, 63, 69 }; @@ -58,13 +51,11 @@ go_type const HPTowerFlags[HP_TOWER_NUM] = uint32 const HP_LANG_CAPTURE_A[HP_TOWER_NUM] = { TEXT_BROKEN_HILL_TAKEN_ALLIANCE, TEXT_OVERLOOK_TAKEN_ALLIANCE, TEXT_STADIUM_TAKEN_ALLIANCE }; uint32 const HP_LANG_CAPTURE_H[HP_TOWER_NUM] = { TEXT_BROKEN_HILL_TAKEN_HORDE, TEXT_OVERLOOK_TAKEN_HORDE, TEXT_STADIUM_TAKEN_HORDE }; -OPvPCapturePointHP::OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType type) -: OPvPCapturePoint(pvp), m_TowerType(type) +OPvPCapturePointHP::OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType type) : OPvPCapturePoint(pvp), m_TowerType(type) { SetCapturePointData(HPCapturePoints[type].entry, HPCapturePoints[type].map, HPCapturePoints[type].pos, HPCapturePoints[type].rot); AddObject(type, HPTowerFlags[type].entry, HPTowerFlags[type].map, HPTowerFlags[type].pos, HPTowerFlags[type].rot); } - OutdoorPvPHP::OutdoorPvPHP() { m_TypeId = OUTDOOR_PVP_HP; @@ -158,10 +149,10 @@ void OutdoorPvPHP::SendRemoveWorldStates(Player* player) void OutdoorPvPHP::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(HP_UI_TOWER_DISPLAY_A), 1); - packet.Worldstates.emplace_back(uint32(HP_UI_TOWER_DISPLAY_H), 1); - packet.Worldstates.emplace_back(uint32(HP_UI_TOWER_COUNT_A), int32(m_AllianceTowersControlled)); - packet.Worldstates.emplace_back(uint32(HP_UI_TOWER_COUNT_H), int32(m_HordeTowersControlled)); + packet.Worldstates.emplace_back(HP_UI_TOWER_DISPLAY_A, 1); + packet.Worldstates.emplace_back(HP_UI_TOWER_DISPLAY_H, 1); + packet.Worldstates.emplace_back(HP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); + packet.Worldstates.emplace_back(HP_UI_TOWER_COUNT_H, m_HordeTowersControlled); for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr) itr->second->FillInitialWorldStates(packet); @@ -276,23 +267,23 @@ void OPvPCapturePointHP::FillInitialWorldStates(WorldPackets::WorldState::InitWo { case OBJECTIVESTATE_ALLIANCE: case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: - packet.Worldstates.emplace_back(uint32(HP_MAP_N[m_TowerType]), 0); - packet.Worldstates.emplace_back(uint32(HP_MAP_A[m_TowerType]), 1); - packet.Worldstates.emplace_back(uint32(HP_MAP_H[m_TowerType]), 0); + packet.Worldstates.emplace_back(HP_MAP_N[m_TowerType], 0); + packet.Worldstates.emplace_back(HP_MAP_A[m_TowerType], 1); + packet.Worldstates.emplace_back(HP_MAP_H[m_TowerType], 0); break; case OBJECTIVESTATE_HORDE: case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: - packet.Worldstates.emplace_back(uint32(HP_MAP_N[m_TowerType]), 0); - packet.Worldstates.emplace_back(uint32(HP_MAP_A[m_TowerType]), 0); - packet.Worldstates.emplace_back(uint32(HP_MAP_H[m_TowerType]), 1); + packet.Worldstates.emplace_back(HP_MAP_N[m_TowerType], 0); + packet.Worldstates.emplace_back(HP_MAP_A[m_TowerType], 0); + packet.Worldstates.emplace_back(HP_MAP_H[m_TowerType], 1); break; case OBJECTIVESTATE_NEUTRAL: case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: default: - packet.Worldstates.emplace_back(uint32(HP_MAP_N[m_TowerType]), 1); - packet.Worldstates.emplace_back(uint32(HP_MAP_A[m_TowerType]), 0); - packet.Worldstates.emplace_back(uint32(HP_MAP_H[m_TowerType]), 0); + packet.Worldstates.emplace_back(HP_MAP_N[m_TowerType], 1); + packet.Worldstates.emplace_back(HP_MAP_A[m_TowerType], 0); + packet.Worldstates.emplace_back(HP_MAP_H[m_TowerType], 0); break; } } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h index f02d46b99af..a6d3b4e5c93 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h @@ -61,7 +61,6 @@ class OPvPCapturePointHP : public OPvPCapturePoint OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType type); void ChangeState() override; - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; private: @@ -79,22 +78,17 @@ class OutdoorPvPHP : public OutdoorPvP void HandlePlayerLeaveZone(Player* player, uint32 zone) override; bool Update(uint32 diff) override; - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; - void SendRemoveWorldStates(Player* player) override; - void HandleKillImpl(Player* player, Unit* killed) override; uint32 GetAllianceTowersControlled() const; void SetAllianceTowersControlled(uint32 count); - uint32 GetHordeTowersControlled() const; void SetHordeTowersControlled(uint32 count); private: - // how many towers are controlled - uint32 m_AllianceTowersControlled; + uint32 m_AllianceTowersControlled; // how many towers are controlled uint32 m_HordeTowersControlled; }; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp index 5c85f1e6213..55c78d1826d 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp @@ -15,32 +15,23 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" +#include "OutdoorPvPNA.h" #include "Creature.h" #include "GameObject.h" -#include "ObjectMgr.h" -#include "OutdoorPvPNA.h" #include "Map.h" +#include "ObjectMgr.h" #include "Player.h" +#include "ScriptMgr.h" #include "WorldStatePackets.h" - // kill credit for pks -uint32 const NA_CREDIT_MARKER = 24867; - +uint32 const NA_CREDIT_MARKER = 24867; // kill credit for pks uint32 const NA_GUARDS_MAX = 15; - uint32 const NA_BUFF_ZONE = 3518; - uint32 const NA_HALAA_GRAVEYARD = 993; - uint32 const NA_HALAA_GRAVEYARD_ZONE = 3518; // need to add zone id, not area id - uint32 const NA_RESPAWN_TIME = 3600000; // one hour to capture after defeating all guards - uint32 const NA_GUARD_CHECK_TIME = 500; // every half second - uint32 const FLIGHT_NODES_NUM = 4; - uint32 const FlightPathStartNodes[FLIGHT_NODES_NUM] = { 103, 105, 107, 109 }; uint32 const FlightPathEndNodes[FLIGHT_NODES_NUM] = { 104, 106, 108, 110 }; @@ -284,10 +275,8 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team) UpdateWyvernRoostWorldState(NA_ROOST_E); } -OPvPCapturePointNA::OPvPCapturePointNA(OutdoorPvP* pvp) : -OPvPCapturePoint(pvp), m_capturable(true), m_GuardsAlive(0), m_ControllingFaction(0), -m_WyvernStateNorth(0), m_WyvernStateSouth(0), m_WyvernStateEast(0), m_WyvernStateWest(0), -m_HalaaState(HALAA_N), m_RespawnTimer(NA_RESPAWN_TIME), m_GuardCheckTimer(NA_GUARD_CHECK_TIME) +OPvPCapturePointNA::OPvPCapturePointNA(OutdoorPvP* pvp) : OPvPCapturePoint(pvp), m_capturable(true), m_GuardsAlive(0), m_ControllingFaction(0), m_WyvernStateNorth(0), m_WyvernStateSouth(0), m_WyvernStateEast(0), + m_WyvernStateWest(0), m_HalaaState(HALAA_N), m_RespawnTimer(NA_RESPAWN_TIME), m_GuardCheckTimer(NA_GUARD_CHECK_TIME) { SetCapturePointData(182210, 530, { -1572.57f, 7945.3f, -22.475f, 2.05949f }, { 0.0f, 0.0f, 0.857167f, 0.515038f }); } @@ -330,48 +319,43 @@ void OPvPCapturePointNA::FillInitialWorldStates(WorldPackets::WorldState::InitWo { if (m_ControllingFaction == ALLIANCE) { - packet.Worldstates.emplace_back(uint32(NA_UI_HORDE_GUARDS_SHOW), 0); - packet.Worldstates.emplace_back(uint32(NA_UI_ALLIANCE_GUARDS_SHOW), 1); + packet.Worldstates.emplace_back(NA_UI_HORDE_GUARDS_SHOW, 0); + packet.Worldstates.emplace_back(NA_UI_ALLIANCE_GUARDS_SHOW, 1); } else if (m_ControllingFaction == HORDE) { - packet.Worldstates.emplace_back(uint32(NA_UI_HORDE_GUARDS_SHOW), 1); - packet.Worldstates.emplace_back(uint32(NA_UI_ALLIANCE_GUARDS_SHOW), 1); + packet.Worldstates.emplace_back(NA_UI_HORDE_GUARDS_SHOW, 1); + packet.Worldstates.emplace_back(NA_UI_ALLIANCE_GUARDS_SHOW, 0); } else { - packet.Worldstates.emplace_back(uint32(NA_UI_HORDE_GUARDS_SHOW), 0); - packet.Worldstates.emplace_back(uint32(NA_UI_ALLIANCE_GUARDS_SHOW), 0); + packet.Worldstates.emplace_back(NA_UI_HORDE_GUARDS_SHOW, 0); + packet.Worldstates.emplace_back(NA_UI_ALLIANCE_GUARDS_SHOW, 0); } - packet.Worldstates.emplace_back(uint32(NA_UI_GUARDS_MAX), int32(NA_GUARDS_MAX)); - packet.Worldstates.emplace_back(uint32(NA_UI_GUARDS_LEFT), int32(m_GuardsAlive)); - - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_NORTH_NEU_A), int32((m_WyvernStateNorth & WYVERN_NEU_HORDE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_NORTH_NEU_A), int32((m_WyvernStateNorth & WYVERN_NEU_ALLIANCE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_NORTH_H), int32((m_WyvernStateNorth & WYVERN_HORDE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_NORTH_A), int32((m_WyvernStateNorth & WYVERN_ALLIANCE) != 0)); - - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_SOUTH_NEU_H), int32((m_WyvernStateSouth & WYVERN_NEU_HORDE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_SOUTH_NEU_A), int32((m_WyvernStateSouth & WYVERN_NEU_ALLIANCE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_SOUTH_H), int32((m_WyvernStateSouth & WYVERN_HORDE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_SOUTH_A), int32((m_WyvernStateSouth & WYVERN_ALLIANCE) != 0)); - - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_WEST_NEU_H), int32((m_WyvernStateWest & WYVERN_NEU_HORDE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_WEST_NEU_A), int32((m_WyvernStateWest & WYVERN_NEU_ALLIANCE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_WEST_H), int32((m_WyvernStateWest & WYVERN_HORDE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_WEST_A), int32((m_WyvernStateWest & WYVERN_ALLIANCE) != 0)); - - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_EAST_NEU_H), int32((m_WyvernStateEast & WYVERN_NEU_HORDE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_EAST_NEU_A), int32((m_WyvernStateEast & WYVERN_NEU_ALLIANCE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_EAST_H), int32((m_WyvernStateEast & WYVERN_HORDE) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_EAST_A), int32((m_WyvernStateEast & WYVERN_ALLIANCE) != 0)); - - packet.Worldstates.emplace_back(uint32(NA_MAP_HALAA_NEUTRAL), int32((m_HalaaState & HALAA_N) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_HALAA_NEU_A), int32((m_HalaaState & HALAA_N_A) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_HALAA_NEU_H), int32((m_HalaaState & HALAA_N_H) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_HALAA_HORDE), int32((m_HalaaState & HALAA_H) != 0)); - packet.Worldstates.emplace_back(uint32(NA_MAP_HALAA_ALLIANCE), int32((m_HalaaState & HALAA_A) != 0)); + packet.Worldstates.emplace_back(NA_UI_GUARDS_MAX, NA_GUARDS_MAX); + packet.Worldstates.emplace_back(NA_UI_GUARDS_LEFT, m_GuardsAlive); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_NORTH_NEU_H, (m_WyvernStateNorth & WYVERN_NEU_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_NORTH_NEU_A, (m_WyvernStateNorth & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_NORTH_H, (m_WyvernStateNorth & WYVERN_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_NORTH_A, (m_WyvernStateNorth & WYVERN_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_SOUTH_NEU_H, (m_WyvernStateSouth & WYVERN_NEU_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_SOUTH_NEU_A, (m_WyvernStateSouth & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_SOUTH_H, (m_WyvernStateSouth & WYVERN_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_SOUTH_A, (m_WyvernStateSouth & WYVERN_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_WEST_NEU_H, (m_WyvernStateWest & WYVERN_NEU_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_WEST_NEU_A, (m_WyvernStateWest & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_WEST_H, (m_WyvernStateWest & WYVERN_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_WEST_A, (m_WyvernStateWest & WYVERN_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_EAST_NEU_H, (m_WyvernStateEast & WYVERN_NEU_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_EAST_NEU_A, (m_WyvernStateEast & WYVERN_NEU_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_EAST_H, (m_WyvernStateEast & WYVERN_HORDE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_WYVERN_EAST_A, (m_WyvernStateEast & WYVERN_ALLIANCE) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_HALAA_NEUTRAL, (m_HalaaState & HALAA_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_HALAA_NEU_A, (m_HalaaState & HALAA_N_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_HALAA_NEU_H, (m_HalaaState & HALAA_N_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_HALAA_HORDE, (m_HalaaState & HALAA_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(NA_MAP_HALAA_ALLIANCE, (m_HalaaState & HALAA_A) != 0 ? 1 : 0); } void OutdoorPvPNA::SendRemoveWorldStates(Player* player) diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h index 3769bb5f850..593d5c9d730 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h @@ -148,7 +148,6 @@ enum HalaaStates class Unit; class Creature; -class OutdoorPvPNA; class OPvPCapturePointNA : public OPvPCapturePoint { @@ -156,47 +155,31 @@ class OPvPCapturePointNA : public OPvPCapturePoint OPvPCapturePointNA(OutdoorPvP* pvp); bool Update(uint32 diff) override; - void ChangeState() override; - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; - bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go) override; - int32 HandleOpenGo(Player* player, GameObject* go) override; uint32 GetAliveGuardsCount(); uint32 GetControllingFaction() const; - - protected: - // called when a faction takes control - void FactionTakeOver(uint32 team); - + void FactionTakeOver(uint32 team); // called when a faction takes control void DeSpawnNPCs(); void DeSpawnGOs(); - void SpawnNPCsForTeam(uint32 team); void SpawnGOsForTeam(uint32 team); - void UpdateWyvernRoostWorldState(uint32 roost); void UpdateHalaaWorldState(); private: bool m_capturable; - uint32 m_GuardsAlive; - uint32 m_ControllingFaction; - uint32 m_WyvernStateNorth; uint32 m_WyvernStateSouth; uint32 m_WyvernStateEast; uint32 m_WyvernStateWest; - uint32 m_HalaaState; - uint32 m_RespawnTimer; - uint32 m_GuardCheckTimer; }; @@ -206,20 +189,15 @@ class OutdoorPvPNA : public OutdoorPvP OutdoorPvPNA(); bool SetupOutdoorPvP() override; - void HandlePlayerEnterZone(Player* player, uint32 zone) override; void HandlePlayerLeaveZone(Player* player, uint32 zone) override; - bool Update(uint32 diff) override; - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; - void SendRemoveWorldStates(Player* player) override; - void HandleKillImpl(Player* player, Unit* killed) override; private: - OPvPCapturePointNA * m_obj; + OPvPCapturePointNA* m_obj; }; #endif diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index 56957a53e9a..304088585cb 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -15,29 +15,25 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" +#include "OutdoorPvPSI.h" #include "DB2Stores.h" #include "GameObject.h" #include "Language.h" #include "Map.h" #include "ObjectMgr.h" -#include "OutdoorPvPSI.h" #include "PhasingHandler.h" #include "Player.h" #include "ReputationMgr.h" +#include "ScriptMgr.h" #include "World.h" #include "WorldStatePackets.h" uint32 const SI_MAX_RESOURCES = 200; - uint32 const SI_AREATRIGGER_H = 4168; uint32 const SI_AREATRIGGER_A = 4162; - uint32 const SI_TURNIN_QUEST_CM_A = 17090; uint32 const SI_TURNIN_QUEST_CM_H = 18199; - uint32 const SI_SILITHYST_MOUND = 181597; - uint8 const OutdoorPvPSIBuffZonesNum = 3; uint32 const OutdoorPvPSIBuffZones[OutdoorPvPSIBuffZonesNum] = { 1377, 3428, 3429 }; @@ -51,9 +47,9 @@ OutdoorPvPSI::OutdoorPvPSI() void OutdoorPvPSI::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(SI_GATHERED_A), int32(m_Gathered_A)); - packet.Worldstates.emplace_back(uint32(SI_GATHERED_H), int32(m_Gathered_H)); - packet.Worldstates.emplace_back(uint32(SI_SILITHYST_MAX), int32(SI_MAX_RESOURCES)); + packet.Worldstates.emplace_back(SI_GATHERED_A, m_Gathered_A); + packet.Worldstates.emplace_back(SI_GATHERED_H, m_Gathered_H); + packet.Worldstates.emplace_back(SI_SILITHYST_MAX, SI_MAX_RESOURCES); } void OutdoorPvPSI::SendRemoveWorldStates(Player* player) diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h index e3b72535123..3f21b407086 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h @@ -41,28 +41,19 @@ class OutdoorPvPSI : public OutdoorPvP OutdoorPvPSI(); bool SetupOutdoorPvP() override; - void HandlePlayerEnterZone(Player* player, uint32 zone) override; void HandlePlayerLeaveZone(Player* player, uint32 zone) override; - bool Update(uint32 diff) override; - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; - void SendRemoveWorldStates(Player* player) override; - bool HandleAreaTrigger(Player* player, uint32 trigger, bool entered) override; - bool HandleDropFlag(Player* player, uint32 spellId) override; - bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go) override; - void UpdateWorldState(); private: uint32 m_Gathered_A; uint32 m_Gathered_H; - uint32 m_LastController; }; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp index 639ab1cd704..b99aa96816f 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp @@ -15,12 +15,12 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" #include "GameObject.h" #include "Map.h" #include "ObjectAccessor.h" #include "OutdoorPvPTF.h" #include "Player.h" +#include "ScriptMgr.h" #include "WorldStatePackets.h" uint8 const OutdoorPvPTFBuffZonesNum = 5; @@ -93,44 +93,39 @@ uint32 const TFTowerPlayerLeaveEvents[TF_TOWER_NUM] = OutdoorPvPTF::OutdoorPvPTF() { m_TypeId = OUTDOOR_PVP_TF; - m_IsLocked = false; m_LockTimer = TF_LOCK_TIME; m_LockTimerUpdate = 0; - m_AllianceTowersControlled = 0; m_HordeTowersControlled = 0; - hours_left = 6; second_digit = 0; first_digit = 0; } -OPvPCapturePointTF::OPvPCapturePointTF(OutdoorPvP* pvp, OutdoorPvPTF_TowerType type) -: OPvPCapturePoint(pvp), m_TowerType(type), m_TowerState(TF_TOWERSTATE_N) +OPvPCapturePointTF::OPvPCapturePointTF(OutdoorPvP* pvp, OutdoorPvPTF_TowerType type) : OPvPCapturePoint(pvp), m_TowerType(type), m_TowerState(TF_TOWERSTATE_N) { SetCapturePointData(TFCapturePoints[type].entry, TFCapturePoints[type].map, TFCapturePoints[type].pos, TFCapturePoints[type].rot); } void OPvPCapturePointTF::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(TFTowerWorldStates[m_TowerType].n), int32((m_TowerState & TF_TOWERSTATE_N) != 0)); - packet.Worldstates.emplace_back(uint32(TFTowerWorldStates[m_TowerType].h), int32((m_TowerState & TF_TOWERSTATE_H) != 0)); - packet.Worldstates.emplace_back(uint32(TFTowerWorldStates[m_TowerType].a), int32((m_TowerState & TF_TOWERSTATE_A) != 0)); + packet.Worldstates.emplace_back(TFTowerWorldStates[m_TowerType].n, (m_TowerState & TF_TOWERSTATE_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(TFTowerWorldStates[m_TowerType].h, (m_TowerState & TF_TOWERSTATE_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(TFTowerWorldStates[m_TowerType].a, (m_TowerState & TF_TOWERSTATE_A) != 0 ? 1 : 0); } void OutdoorPvPTF::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(TF_UI_TOWER_COUNT_H), int32(m_HordeTowersControlled)); - packet.Worldstates.emplace_back(uint32(TF_UI_TOWER_COUNT_A), int32(m_AllianceTowersControlled)); - packet.Worldstates.emplace_back(uint32(TF_UI_TOWERS_CONTROLLED_DISPLAY), int32(!m_IsLocked)); - packet.Worldstates.emplace_back(uint32(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT), int32(first_digit)); - packet.Worldstates.emplace_back(uint32(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT), int32(second_digit)); - packet.Worldstates.emplace_back(uint32(TF_UI_LOCKED_TIME_HOURS), int32(hours_left)); - - packet.Worldstates.emplace_back(uint32(TF_UI_LOCKED_DISPLAY_NEUTRAL), int32(m_IsLocked && !m_HordeTowersControlled && !m_AllianceTowersControlled)); - packet.Worldstates.emplace_back(uint32(TF_UI_LOCKED_DISPLAY_HORDE), int32(m_IsLocked && (m_HordeTowersControlled > m_AllianceTowersControlled))); - packet.Worldstates.emplace_back(uint32(TF_UI_LOCKED_DISPLAY_ALLIANCE), int32(m_IsLocked && (m_HordeTowersControlled < m_AllianceTowersControlled))); + packet.Worldstates.emplace_back(TF_UI_TOWER_COUNT_H, m_HordeTowersControlled); + packet.Worldstates.emplace_back(TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled); + packet.Worldstates.emplace_back(TF_UI_TOWERS_CONTROLLED_DISPLAY, !m_IsLocked); + packet.Worldstates.emplace_back(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, first_digit); + packet.Worldstates.emplace_back(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, second_digit); + packet.Worldstates.emplace_back(TF_UI_LOCKED_TIME_HOURS, hours_left); + packet.Worldstates.emplace_back(TF_UI_LOCKED_DISPLAY_NEUTRAL, (m_IsLocked && !m_HordeTowersControlled && !m_AllianceTowersControlled) ? 1 : 0); + packet.Worldstates.emplace_back(TF_UI_LOCKED_DISPLAY_HORDE, (m_IsLocked && (m_HordeTowersControlled > m_AllianceTowersControlled)) ? 1 : 0); + packet.Worldstates.emplace_back(TF_UI_LOCKED_DISPLAY_ALLIANCE, (m_IsLocked && (m_HordeTowersControlled < m_AllianceTowersControlled)) ? 1 : 0); for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr) itr->second->FillInitialWorldStates(packet); diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h index 22865c5a8b0..d7c384627d1 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h @@ -67,16 +67,13 @@ class OPvPCapturePointTF : public OPvPCapturePoint OPvPCapturePointTF(OutdoorPvP* pvp, OutdoorPvPTF_TowerType type); bool Update(uint32 diff) override; - void ChangeState() override; - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; void UpdateTowerState(); protected: OutdoorPvPTF_TowerType m_TowerType; - uint32 m_TowerState; }; @@ -86,32 +83,24 @@ class OutdoorPvPTF : public OutdoorPvP OutdoorPvPTF(); bool SetupOutdoorPvP() override; - void HandlePlayerEnterZone(Player* player, uint32 zone) override; void HandlePlayerLeaveZone(Player* player, uint32 zone) override; - bool Update(uint32 diff) override; - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; - void SendRemoveWorldStates(Player* player) override; uint32 GetAllianceTowersControlled() const; void SetAllianceTowersControlled(uint32 count); - uint32 GetHordeTowersControlled() const; void SetHordeTowersControlled(uint32 count); - bool IsLocked() const; private: bool m_IsLocked; uint32 m_LockTimer; uint32 m_LockTimerUpdate; - uint32 m_AllianceTowersControlled; uint32 m_HordeTowersControlled; - uint32 hours_left, second_digit, first_digit; }; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp index c181fd53902..5c60a49e569 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp @@ -15,13 +15,14 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" +#include "OutdoorPvPZM.h" #include "Creature.h" #include "GossipDef.h" +#include "MapManager.h" #include "ObjectAccessor.h" #include "ObjectMgr.h" -#include "OutdoorPvPZM.h" #include "Player.h" +#include "ScriptMgr.h" #include "WorldStatePackets.h" uint8 const OutdoorPvPZMBuffZonesNum = 5; @@ -83,20 +84,19 @@ go_type const ZMCapturePoints[ZM_NUM_BEACONS] = { 182522, 530, { 336.466f, 7340.26f, 41.4984f, -1.58825f }, { 0.0f, 0.0f, 0.71325f, -0.700909f } } }; -OPvPCapturePointZM_Beacon::OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type) -: OPvPCapturePoint(pvp), m_TowerType(type), m_TowerState(ZM_TOWERSTATE_N) +OPvPCapturePointZM_Beacon::OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type) : OPvPCapturePoint(pvp), m_TowerType(type), m_TowerState(ZM_TOWERSTATE_N) { SetCapturePointData(ZMCapturePoints[type].entry, ZMCapturePoints[type].map, ZMCapturePoints[type].pos, ZMCapturePoints[type].rot); } void OPvPCapturePointZM_Beacon::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].ui_tower_n, (m_TowerState & ZM_TOWERSTATE_N) != 0); - packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].map_tower_n, (m_TowerState & ZM_TOWERSTATE_N) != 0); - packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].ui_tower_a, (m_TowerState & ZM_TOWERSTATE_A) != 0); - packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].map_tower_a, 0); - packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].ui_tower_h, (m_TowerState & ZM_TOWERSTATE_H) != 0); - packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].map_tower_h, (m_TowerState & ZM_TOWERSTATE_H) != 0); + packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].ui_tower_n, (m_TowerState & ZM_TOWERSTATE_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].map_tower_n, (m_TowerState & ZM_TOWERSTATE_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].ui_tower_a, (m_TowerState & ZM_TOWERSTATE_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].map_tower_a, (m_TowerState & ZM_TOWERSTATE_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].ui_tower_h, (m_TowerState & ZM_TOWERSTATE_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].map_tower_h, (m_TowerState & ZM_TOWERSTATE_H) != 0 ? 1 : 0); } void OPvPCapturePointZM_Beacon::UpdateTowerState() @@ -273,8 +273,7 @@ int32 OPvPCapturePointZM_Graveyard::HandleOpenGo(Player* player, GameObject* go) return retval; } -OPvPCapturePointZM_Graveyard::OPvPCapturePointZM_Graveyard(OutdoorPvP* pvp) -: OPvPCapturePoint(pvp) +OPvPCapturePointZM_Graveyard::OPvPCapturePointZM_Graveyard(OutdoorPvP* pvp) : OPvPCapturePoint(pvp) { m_BothControllingFaction = 0; m_GraveyardState = ZM_GRAVEYARD_N; @@ -300,14 +299,13 @@ void OPvPCapturePointZM_Graveyard::UpdateTowerState() void OPvPCapturePointZM_Graveyard::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(ZM_MAP_GRAVEYARD_N), int32((m_GraveyardState & ZM_GRAVEYARD_N) != 0)); - packet.Worldstates.emplace_back(uint32(ZM_MAP_GRAVEYARD_H), int32((m_GraveyardState & ZM_GRAVEYARD_H) != 0)); - packet.Worldstates.emplace_back(uint32(ZM_MAP_GRAVEYARD_A), int32((m_GraveyardState & ZM_GRAVEYARD_A) != 0)); - - packet.Worldstates.emplace_back(uint32(ZM_MAP_ALLIANCE_FLAG_READY), int32(m_BothControllingFaction == ALLIANCE)); - packet.Worldstates.emplace_back(uint32(ZM_MAP_ALLIANCE_FLAG_NOT_READY), int32(m_BothControllingFaction != ALLIANCE)); - packet.Worldstates.emplace_back(uint32(ZM_MAP_HORDE_FLAG_READY), int32(m_BothControllingFaction == HORDE)); - packet.Worldstates.emplace_back(uint32(ZM_MAP_HORDE_FLAG_NOT_READY), int32(m_BothControllingFaction != HORDE)); + packet.Worldstates.emplace_back(ZM_MAP_GRAVEYARD_N, (m_GraveyardState & ZM_GRAVEYARD_N) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(ZM_MAP_GRAVEYARD_H, (m_GraveyardState & ZM_GRAVEYARD_H) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(ZM_MAP_GRAVEYARD_A, (m_GraveyardState & ZM_GRAVEYARD_A) != 0 ? 1 : 0); + packet.Worldstates.emplace_back(ZM_MAP_ALLIANCE_FLAG_READY, m_BothControllingFaction == ALLIANCE ? 1 : 0); + packet.Worldstates.emplace_back(ZM_MAP_ALLIANCE_FLAG_NOT_READY, m_BothControllingFaction != ALLIANCE ? 1 : 0); + packet.Worldstates.emplace_back(ZM_MAP_HORDE_FLAG_READY, m_BothControllingFaction == HORDE ? 1 : 0); + packet.Worldstates.emplace_back(ZM_MAP_HORDE_FLAG_NOT_READY, m_BothControllingFaction != HORDE ? 1 : 0); } void OPvPCapturePointZM_Graveyard::SetBeaconState(uint32 controlling_faction) @@ -434,7 +432,8 @@ void OutdoorPvPZM::SetHordeTowersControlled(uint32 count) void OutdoorPvPZM::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { - packet.Worldstates.emplace_back(uint32(ZM_WORLDSTATE_UNK_1), 1); + packet.Worldstates.emplace_back(ZM_WORLDSTATE_UNK_1, 1); + for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr) itr->second->FillInitialWorldStates(packet); } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h index 0b6e144af2a..db7c455b532 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h @@ -96,15 +96,12 @@ enum ZM_TowerStateMask ZM_TOWERSTATE_H = 4 }; -class OutdoorPvPZM; - class OPvPCapturePointZM_Beacon : public OPvPCapturePoint { public: OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type); void ChangeState() override; - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; void UpdateTowerState(); @@ -127,64 +124,46 @@ class OPvPCapturePointZM_Graveyard : public OPvPCapturePoint OPvPCapturePointZM_Graveyard(OutdoorPvP* pvp); bool Update(uint32 diff) override; - void ChangeState() override { } - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; - - void UpdateTowerState(); - int32 HandleOpenGo(Player* player, GameObject* go) override; - - void SetBeaconState(uint32 controlling_team); // not good atm - bool HandleGossipOption(Player* player, Creature* creature, uint32 gossipid) override; - bool HandleDropFlag(Player* player, uint32 spellId) override; - bool CanTalkTo(Player* player, Creature* creature, GossipMenuItems const& gso) override; + void UpdateTowerState(); + void SetBeaconState(uint32 controlling_team); // not good atm uint32 GetGraveyardState() const; - private: - uint32 m_GraveyardState; - protected: uint32 m_BothControllingFaction; - ObjectGuid m_FlagCarrierGUID; + uint32 m_GraveyardState; }; +/// @todo flag carrier death/leave/mount/activitychange should give back the gossip options class OutdoorPvPZM : public OutdoorPvP { public: OutdoorPvPZM(); bool SetupOutdoorPvP() override; - void HandlePlayerEnterZone(Player* player, uint32 zone) override; void HandlePlayerLeaveZone(Player* player, uint32 zone) override; - bool Update(uint32 diff) override; - void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; - void SendRemoveWorldStates(Player* player) override; - void HandleKillImpl(Player* player, Unit* killed) override; uint32 GetAllianceTowersControlled() const; void SetAllianceTowersControlled(uint32 count); - uint32 GetHordeTowersControlled() const; void SetHordeTowersControlled(uint32 count); private: - OPvPCapturePointZM_Graveyard * m_Graveyard; - + OPvPCapturePointZM_Graveyard* m_Graveyard; uint32 m_AllianceTowersControlled; uint32 m_HordeTowersControlled; }; -/// @todo flag carrier death/leave/mount/activitychange should give back the gossip options #endif |