diff options
Diffstat (limited to 'src')
13 files changed, 96 insertions, 20 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 0051f0698d9..68a61a28708 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1076,6 +1076,12 @@ void Battleground::StartBattleground() TC_LOG_DEBUG("bg.arena", "Arena match type: %u for Team1Id: %u - Team2Id: %u started.", m_ArenaType, m_ArenaTeamIds[TEAM_ALLIANCE], m_ArenaTeamIds[TEAM_HORDE]); } +void Battleground::TeleportPlayerToExploitLocation(Player* player) +{ + if (WorldSafeLocsEntry const* loc = GetExploitTeleportLocation(Team(player->GetBGTeam()))) + player->TeleportTo(loc->MapID, loc->Loc.X, loc->Loc.Y, loc->Loc.Z, loc->Facing); +} + void Battleground::AddPlayer(Player* player) { // remove afk from player diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 2ef7eca4aa1..4d2f5da1a24 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -438,6 +438,10 @@ class TC_GAME_API Battleground // Death related virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); + virtual WorldSafeLocsEntry const* GetExploitTeleportLocation(Team /*team*/) { return nullptr; } + // GetExploitTeleportLocation(TeamId) must be implemented in the battleground subclass. + void TeleportPlayerToExploitLocation(Player* player); + virtual void AddPlayer(Player* player); // must be implemented in BG subclass void AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 911fe259fc3..60e0a5f8db8 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -231,11 +231,13 @@ void BattlegroundAB::RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint3 void BattlegroundAB::HandleAreaTrigger(Player* player, uint32 trigger, bool entered) { - if (GetStatus() != STATUS_IN_PROGRESS) - return; - switch (trigger) { + case 6635: // Horde Start + case 6634: // Alliance Start + if (GetStatus() == STATUS_WAIT_JOIN && !entered) + TeleportPlayerToExploitLocation(player); + break; case 3948: // Arathi Basin Alliance Exit. if (player->GetTeam() != ALLIANCE) player->GetSession()->SendNotification("Only The Alliance can use that portal"); @@ -690,6 +692,11 @@ WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveYard(Player* player) return good_entry; } +WorldSafeLocsEntry const* BattlegroundAB::GetExploitTeleportLocation(Team team) +{ + return sWorldSafeLocsStore.LookupEntry(team == ALLIANCE ? AB_EXPLOIT_TELEPORT_LOCATION_ALLIANCE : AB_EXPLOIT_TELEPORT_LOCATION_HORDE); +} + bool BattlegroundAB::UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor) { if (!Battleground::UpdatePlayerScore(player, type, value, doAddHonor)) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index e4bdf2f16d6..c452ca6fa2f 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -179,6 +179,12 @@ enum BG_AB_Objectives AB_OBJECTIVE_DEFEND_BASE = 123 }; +enum BG_AB_ExploitTeleportLocations +{ + AB_EXPLOIT_TELEPORT_LOCATION_ALLIANCE = 3705, + AB_EXPLOIT_TELEPORT_LOCATION_HORDE = 3706 +}; + #define BG_AB_NotABBGWeekendHonorTicks 260 #define BG_AB_ABBGWeekendHonorTicks 160 #define BG_AB_NotABBGWeekendReputationTicks 160 @@ -288,6 +294,7 @@ class BattlegroundAB : public Battleground void Reset() override; void EndBattleground(uint32 winner) override; WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override; + WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override; /* Scorekeeping */ bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 59d01df8237..031228013ef 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -493,11 +493,13 @@ void BattlegroundAV::RemovePlayer(Player* player, ObjectGuid /*guid*/, uint32 /* void BattlegroundAV::HandleAreaTrigger(Player* player, uint32 trigger, bool entered) { - if (GetStatus() != STATUS_IN_PROGRESS) - return; - switch (trigger) { + case 6633: // Horde Start + case 6632: // Alliance Start + if (GetStatus() == STATUS_WAIT_JOIN && entered) + TeleportPlayerToExploitLocation(player); + break; case 95: case 2608: if (player->GetTeam() != ALLIANCE) @@ -1124,6 +1126,11 @@ WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveYard(Player* player) return pGraveyard; } +WorldSafeLocsEntry const* BattlegroundAV::GetExploitTeleportLocation(Team team) +{ + return sWorldSafeLocsStore.LookupEntry(team == ALLIANCE ? AV_EXPLOIT_TELEPORT_LOCATION_ALLIANCE: AV_EXPLOIT_TELEPORT_LOCATION_HORDE); +} + bool BattlegroundAV::SetupBattleground() { // Create starting objects diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index 8bf97822426..eae03d83bc1 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -1536,6 +1536,12 @@ enum Texts TEXT_SNIVVLE_RANDOM = 0 }; +enum BG_AV_ExploitTeleportLocations +{ + AV_EXPLOIT_TELEPORT_LOCATION_ALLIANCE = 3664, + AV_EXPLOIT_TELEPORT_LOCATION_HORDE = 3665 +}; + struct BG_AV_NodeInfo { BG_AV_States State; @@ -1633,6 +1639,7 @@ class BattlegroundAV : public Battleground void EndBattleground(uint32 winner) override; WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override; + WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override; // Achievement: Av perfection and Everything counts bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target = nullptr, uint32 miscvalue1 = 0) override; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 461420fe962..8bcba2ca204 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -406,14 +406,16 @@ void BattlegroundEY::RemovePlayer(Player* player, ObjectGuid guid, uint32 /*team void BattlegroundEY::HandleAreaTrigger(Player* player, uint32 trigger, bool entered) { - if (GetStatus() != STATUS_IN_PROGRESS) - return; - if (!player->IsAlive()) //hack code, must be removed later return; switch (trigger) { + case 4530: // Horde Start + case 4531: // Alliance Start + if (GetStatus() == STATUS_WAIT_JOIN && !entered) + TeleportPlayerToExploitLocation(player); + break; case TR_BLOOD_ELF_POINT: if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == player->GetTeam()) if (m_FlagState && GetFlagPickerGUID() == player->GetGUID()) @@ -438,8 +440,6 @@ void BattlegroundEY::HandleAreaTrigger(Player* player, uint32 trigger, bool ente case 4515: case 4517: case 4519: - case 4530: - case 4531: case 4568: case 4569: case 4570: @@ -950,6 +950,11 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player) return nearestEntry; } +WorldSafeLocsEntry const* BattlegroundEY::GetExploitTeleportLocation(Team team) +{ + return sWorldSafeLocsStore.LookupEntry(team == ALLIANCE ? EY_EXPLOIT_TELEPORT_LOCATION_ALLIANCE : EY_EXPLOIT_TELEPORT_LOCATION_HORDE); +} + bool BattlegroundEY::IsAllNodesControlledByTeam(uint32 team) const { uint32 count = 0; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index e25601f51b9..a1e63e356b8 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -248,6 +248,12 @@ enum BG_EY_Objectives EY_OBJECTIVE_CAPTURE_FLAG = 183 }; +enum BG_EY_ExploitTeleportLocations +{ + EY_EXPLOIT_TELEPORT_LOCATION_ALLIANCE = 3773, + EY_EXPLOIT_TELEPORT_LOCATION_HORDE = 3772 +}; + struct BattlegroundEYPointIconsStruct { BattlegroundEYPointIconsStruct(uint32 _WorldStateControlIndex, uint32 _WorldStateAllianceControlledIndex, uint32 _WorldStateHordeControlledIndex) @@ -376,6 +382,7 @@ class BattlegroundEY : public Battleground void HandleAreaTrigger(Player* source, uint32 trigger, bool entered) override; void HandleKillPlayer(Player* player, Player* killer) override; WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override; + WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override; bool SetupBattleground() override; void Reset() override; void UpdateTeamScore(uint32 Team); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index d31fd47819f..085da3d6b5a 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -263,11 +263,12 @@ void BattlegroundIC::RemovePlayer(Player* player, ObjectGuid /*guid*/, uint32 /* } } -void BattlegroundIC::HandleAreaTrigger(Player* player, uint32 trigger, bool /*entered*/) +void BattlegroundIC::HandleAreaTrigger(Player* player, uint32 trigger, bool entered) { // this is wrong way to implement these things. On official it done by gameobject spell cast. - if (GetStatus() != STATUS_IN_PROGRESS) - return; + if (GetStatus() == STATUS_WAIT_JOIN && !entered) + if (trigger == 9176 || trigger == 9178) + TeleportPlayerToExploitLocation(player); /// @hack: this spell should be cast by npc 22515 (World Trigger) and not by the player if (trigger == 5555 && player->GetTeamId() == TEAM_HORDE) @@ -884,6 +885,11 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveYard(Player* player) return good_entry; } +WorldSafeLocsEntry const * BattlegroundIC::GetExploitTeleportLocation(Team team) +{ + return sWorldSafeLocsStore.LookupEntry(team == ALLIANCE ? IC_EXPLOIT_TELEPORT_LOCATION_ALLIANCE : IC_EXPLOIT_TELEPORT_LOCATION_HORDE); +} + bool BattlegroundIC::IsAllNodesControlledByTeam(uint32 team) const { uint32 count = 0; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h index f60d9324e48..d65b69e62f4 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h @@ -468,6 +468,12 @@ enum BG_IC_MaxSpawns MAX_CAPTAIN_SPAWNS_PER_FACTION = 2, }; +enum BG_IC_ExploitTeleportLocations +{ + IC_EXPLOIT_TELEPORT_LOCATION_ALLIANCE = 3986, + IC_EXPLOIT_TELEPORT_LOCATION_HORDE = 3983 +}; + const ICNpc BG_IC_NpcSpawnlocs[MAX_NORMAL_NPCS_SPAWNS] = { {BG_IC_NPC_OVERLORD_AGMAR, NPC_OVERLORD_AGMAR, TEAM_HORDE, 1295.44f, -765.733f, 70.0541f, 0.0f}, //Overlord Agmar 1 @@ -940,6 +946,7 @@ class BattlegroundIC : public Battleground void DestroyGate(Player* player, GameObject* go) override; WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override; + WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override; /* Scorekeeping */ void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 0df4fd6f88e..37b39043e42 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -650,13 +650,15 @@ void BattlegroundWS::UpdateTeamScore(uint32 team) void BattlegroundWS::HandleAreaTrigger(Player* player, uint32 trigger, bool entered) { - if (GetStatus() != STATUS_IN_PROGRESS) - return; - //uint32 SpellId = 0; //uint64 buff_guid = 0; switch (trigger) { + case 8965: // Horde Start + case 8966: // Alliance Start + if (GetStatus() == STATUS_WAIT_JOIN && !entered) + TeleportPlayerToExploitLocation(player); + break; case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update(). //buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_1]; break; @@ -851,6 +853,11 @@ WorldSafeLocsEntry const* BattlegroundWS::GetClosestGraveYard(Player* player) } } +WorldSafeLocsEntry const* BattlegroundWS::GetExploitTeleportLocation(Team team) +{ + return sWorldSafeLocsStore.LookupEntry(team == ALLIANCE ? WS_EXPLOIT_TELEPORT_LOCATION_ALLIANCE : WS_EXPLOIT_TELEPORT_LOCATION_HORDE); +} + void BattlegroundWS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) { packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_CAPTURES_ALLIANCE), int32(GetTeamScore(TEAM_ALLIANCE))); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h index 3561d6f2fc3..8731255cd32 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h @@ -125,6 +125,12 @@ enum BG_WS_Graveyards WS_GRAVEYARD_MAIN_HORDE = 772 }; +enum BG_WS_ExploitTeleportLocations +{ + WS_EXPLOIT_TELEPORT_LOCATION_ALLIANCE = 3784, + WS_EXPLOIT_TELEPORT_LOCATION_HORDE = 3785 +}; + enum BG_WS_CreatureTypes { WS_SPIRIT_MAIN_ALLIANCE = 0, @@ -222,6 +228,7 @@ class BattlegroundWS : public Battleground void Reset() override; void EndBattleground(uint32 winner) override; WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override; + WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override; void UpdateFlagState(uint32 team, uint32 value); void SetLastFlagCapture(uint32 team) { _lastFlagCaptureTeam = team; } diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index a43ec6c2202..382b8d70f38 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -485,7 +485,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPackets::Misc::AreaTrigger& pack return; } - if (!player->IsInAreaTriggerRadius(atEntry)) + if (packet.Entered && !player->IsInAreaTriggerRadius(atEntry)) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far, ignore Area Trigger ID: %u", player->GetName().c_str(), player->GetGUID().ToString().c_str(), packet.AreaTriggerID); @@ -535,8 +535,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPackets::Misc::AreaTrigger& pack } if (Battleground* bg = player->GetBattleground()) - if (bg->GetStatus() == STATUS_IN_PROGRESS) - bg->HandleAreaTrigger(player, packet.AreaTriggerID, packet.Entered); + bg->HandleAreaTrigger(player, packet.AreaTriggerID, packet.Entered); if (OutdoorPvP* pvp = player->GetOutdoorPvP()) if (pvp->HandleAreaTrigger(_player, packet.AreaTriggerID, packet.Entered)) |