Skip to content

Commit c029eab

Browse files
authored
feat(Core/Wintergrasp): optional Essence buff for both factions (azerothcore#26017)
1 parent dabb8f7 commit c029eab

5 files changed

Lines changed: 22 additions & 1 deletion

File tree

src/server/apps/worldserver/worldserver.conf.dist

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3688,6 +3688,18 @@ Wintergrasp.SkipBattleSessionCount = 3500
36883688

36893689
Wintergrasp.KickVoAPlayers = 1
36903690

3691+
#
3692+
# Wintergrasp.EssenceBothFactions
3693+
# Description: Grant the "Essence of Wintergrasp" buff to both factions
3694+
# during peacetime, regardless of who controls the keep.
3695+
# The wartime suppression still applies; this only affects
3696+
# who receives the buff once the battle is over.
3697+
# Default: 0 - (Disabled, only the defending faction gets the buff)
3698+
# 1 - (Enabled, attackers and defenders both get the buff,
3699+
# so both factions can access Vault of Archavon)
3700+
3701+
Wintergrasp.EssenceBothFactions = 0
3702+
36913703
#
36923704
###################################################################################################
36933705

src/server/game/Battlefield/Zones/BattlefieldWG.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,12 +479,17 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
479479
}
480480
}
481481

482+
bool const grantEssenceToAttackers = sWorld->getBoolConfig(CONFIG_WINTERGRASP_ESSENCE_BOTH_FACTIONS);
483+
482484
for (ObjectGuid const& guid : PlayersInWar[GetAttackerTeam()])
483485
if (Player* player = ObjectAccessor::FindPlayer(guid))
484486
{
485487
player->CastSpell(player, SPELL_DEFEAT_REWARD, true);
486488
RemoveAurasFromPlayer(player);
487489

490+
if (grantEssenceToAttackers)
491+
player->CastSpell(player, SPELL_ESSENCE_OF_WINTERGRASP, true);
492+
488493
for (uint8 i = 0; i < damagedTowersAtt; ++i)
489494
player->CastSpell(player, spellDamagedAtt, true);
490495
for (uint8 i = 0; i < brokenTowersAtt; ++i)

src/server/game/Spells/SpellMgr.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,9 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
11011101
return false;
11021102

11031103
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
1104-
if (!Bf || player->GetTeamId() != Bf->GetDefenderTeam() || Bf->IsWarTime())
1104+
if (!Bf || Bf->IsWarTime())
1105+
return false;
1106+
if (!sWorld->getBoolConfig(CONFIG_WINTERGRASP_ESSENCE_BOTH_FACTIONS) && player->GetTeamId() != Bf->GetDefenderTeam())
11051107
return false;
11061108
break;
11071109
}

src/server/game/World/WorldConfig.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ void WorldConfig::BuildConfigCache()
596596

597597
SetConfigValue<uint32>(CONFIG_WINTERGRASP_SKIP_BATTLE_SESSION_COUNT, "Wintergrasp.SkipBattleSessionCount", 3500);
598598
SetConfigValue<bool>(CONFIG_WINTERGRASP_KICK_VOA_PLAYERS, "Wintergrasp.KickVoAPlayers", true, ConfigValueCache::Reloadable::No);
599+
SetConfigValue<bool>(CONFIG_WINTERGRASP_ESSENCE_BOTH_FACTIONS, "Wintergrasp.EssenceBothFactions", false);
599600

600601
SetConfigValue<uint32>(CONFIG_BIRTHDAY_TIME, "BirthdayTime", 1222964635);
601602
SetConfigValue<bool>(CONFIG_MINIGOB_MANABONK, "Minigob.Manabonk.Enable", true);

src/server/game/World/WorldConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ enum ServerConfigs
327327
CONFIG_WINTERGRASP_RESTART_AFTER_CRASH,
328328
CONFIG_WINTERGRASP_SKIP_BATTLE_SESSION_COUNT,
329329
CONFIG_WINTERGRASP_KICK_VOA_PLAYERS,
330+
CONFIG_WINTERGRASP_ESSENCE_BOTH_FACTIONS,
330331
CONFIG_PACKET_SPOOF_BANMODE,
331332
CONFIG_PACKET_SPOOF_BANDURATION,
332333
CONFIG_WARDEN_CLIENT_RESPONSE_DELAY,

0 commit comments

Comments
 (0)