From 5e22c92a87592de52c9f81a95e9a5b43c932d10d Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 7 Sep 2022 13:04:59 -0400 Subject: [PATCH] Core/Battlegrounds: Capture flags immediately when standing on capture point and your team's flag gets returned Port From (https://github.com/TrinityCore/TrinityCore/commit/bd74524d4c150c5dbaac850a8965d2953953a8f6) --- Source/Game/BattleGrounds/Zones/WarsongGluch.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Source/Game/BattleGrounds/Zones/WarsongGluch.cs b/Source/Game/BattleGrounds/Zones/WarsongGluch.cs index a7e527ee4..8c5874c67 100644 --- a/Source/Game/BattleGrounds/Zones/WarsongGluch.cs +++ b/Source/Game/BattleGrounds/Zones/WarsongGluch.cs @@ -18,6 +18,8 @@ using Framework.Constants; using Game.Entities; using Game.Networking.Packets; +using Game.DataStorage; +using System.Collections.Generic; namespace Game.BattleGrounds.Zones { @@ -486,6 +488,12 @@ namespace Game.BattleGrounds.Zones PlaySoundToAll(WSGSound.FlagReturned); UpdatePlayerScore(player, ScoreType.FlagReturns, 1); _bothFlagsKept = false; + + // Check Horde flag if it is in capture zone; if so, capture it + Player hordeFlagCarrier = Global.ObjAccessor.GetPlayer(GetBgMap(), GetFlagPickerGUID(TeamId.Horde)); + if (hordeFlagCarrier != null) + if (hordeFlagCarrier.IsInAreaTriggerRadius(CliDB.AreaTriggerStorage.LookupByKey(3646))) + EventPlayerCapturedFlag(hordeFlagCarrier); } else { @@ -518,6 +526,12 @@ namespace Game.BattleGrounds.Zones PlaySoundToAll(WSGSound.FlagReturned); UpdatePlayerScore(player, ScoreType.FlagReturns, 1); _bothFlagsKept = false; + + // Check Alliance flag if it is in capture zone; if so, capture it + Player allianceFlagCarrier = Global.ObjAccessor.GetPlayer(GetBgMap(), GetFlagPickerGUID(TeamId.Alliance)); + if (allianceFlagCarrier != null) + if (allianceFlagCarrier.IsInAreaTriggerRadius(CliDB.AreaTriggerStorage.LookupByKey(3647))) + EventPlayerCapturedFlag(allianceFlagCarrier); } else {