From c029eab828fb50125c1df620e7355c0a99232990 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Fri, 29 May 2026 00:16:57 -0300 Subject: [PATCH] feat(Core/Wintergrasp): optional Essence buff for both factions (#26017) --- src/server/apps/worldserver/worldserver.conf.dist | 12 ++++++++++++ src/server/game/Battlefield/Zones/BattlefieldWG.cpp | 5 +++++ src/server/game/Spells/SpellMgr.cpp | 4 +++- src/server/game/World/WorldConfig.cpp | 1 + src/server/game/World/WorldConfig.h | 1 + 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index 38225d5422..42051b97cf 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -3688,6 +3688,18 @@ Wintergrasp.SkipBattleSessionCount = 3500 Wintergrasp.KickVoAPlayers = 1 +# +# Wintergrasp.EssenceBothFactions +# Description: Grant the "Essence of Wintergrasp" buff to both factions +# during peacetime, regardless of who controls the keep. +# The wartime suppression still applies; this only affects +# who receives the buff once the battle is over. +# Default: 0 - (Disabled, only the defending faction gets the buff) +# 1 - (Enabled, attackers and defenders both get the buff, +# so both factions can access Vault of Archavon) + +Wintergrasp.EssenceBothFactions = 0 + # ################################################################################################### diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index c0f14fbe55..e931557773 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -479,12 +479,17 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer) } } + bool const grantEssenceToAttackers = sWorld->getBoolConfig(CONFIG_WINTERGRASP_ESSENCE_BOTH_FACTIONS); + for (ObjectGuid const& guid : PlayersInWar[GetAttackerTeam()]) if (Player* player = ObjectAccessor::FindPlayer(guid)) { player->CastSpell(player, SPELL_DEFEAT_REWARD, true); RemoveAurasFromPlayer(player); + if (grantEssenceToAttackers) + player->CastSpell(player, SPELL_ESSENCE_OF_WINTERGRASP, true); + for (uint8 i = 0; i < damagedTowersAtt; ++i) player->CastSpell(player, spellDamagedAtt, true); for (uint8 i = 0; i < brokenTowersAtt; ++i) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 011c8ec19d..82de73802d 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1101,7 +1101,9 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 return false; Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); - if (!Bf || player->GetTeamId() != Bf->GetDefenderTeam() || Bf->IsWarTime()) + if (!Bf || Bf->IsWarTime()) + return false; + if (!sWorld->getBoolConfig(CONFIG_WINTERGRASP_ESSENCE_BOTH_FACTIONS) && player->GetTeamId() != Bf->GetDefenderTeam()) return false; break; } diff --git a/src/server/game/World/WorldConfig.cpp b/src/server/game/World/WorldConfig.cpp index 79050376b1..4d99a309fa 100644 --- a/src/server/game/World/WorldConfig.cpp +++ b/src/server/game/World/WorldConfig.cpp @@ -596,6 +596,7 @@ void WorldConfig::BuildConfigCache() SetConfigValue(CONFIG_WINTERGRASP_SKIP_BATTLE_SESSION_COUNT, "Wintergrasp.SkipBattleSessionCount", 3500); SetConfigValue(CONFIG_WINTERGRASP_KICK_VOA_PLAYERS, "Wintergrasp.KickVoAPlayers", true, ConfigValueCache::Reloadable::No); + SetConfigValue(CONFIG_WINTERGRASP_ESSENCE_BOTH_FACTIONS, "Wintergrasp.EssenceBothFactions", false); SetConfigValue(CONFIG_BIRTHDAY_TIME, "BirthdayTime", 1222964635); SetConfigValue(CONFIG_MINIGOB_MANABONK, "Minigob.Manabonk.Enable", true); diff --git a/src/server/game/World/WorldConfig.h b/src/server/game/World/WorldConfig.h index 6cd12048e3..0f890bfb9b 100644 --- a/src/server/game/World/WorldConfig.h +++ b/src/server/game/World/WorldConfig.h @@ -327,6 +327,7 @@ enum ServerConfigs CONFIG_WINTERGRASP_RESTART_AFTER_CRASH, CONFIG_WINTERGRASP_SKIP_BATTLE_SESSION_COUNT, CONFIG_WINTERGRASP_KICK_VOA_PLAYERS, + CONFIG_WINTERGRASP_ESSENCE_BOTH_FACTIONS, CONFIG_PACKET_SPOOF_BANMODE, CONFIG_PACKET_SPOOF_BANDURATION, CONFIG_WARDEN_CLIENT_RESPONSE_DELAY,