From 70e5851c8a4e3143b3d34709aefe03ffdab81818 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:10:22 -0300 Subject: [PATCH] =?UTF-8?q?feat(Core/Battleground):=20Add=20config=20to=20?= =?UTF-8?q?allow=20giving=20points=20at=20level=207=E2=80=A6=20(#17821)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(Core/Battleground): Add config to allow giving points at level 70 RBG * update * Update Battleground.h --- src/server/apps/worldserver/worldserver.conf.dist | 7 +++++++ src/server/game/Battlegrounds/Battleground.cpp | 2 +- src/server/game/Battlegrounds/Battleground.h | 1 - src/server/game/World/IWorld.h | 1 + src/server/game/World/World.cpp | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index f19ed84c4..f88f82c2d 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -4355,6 +4355,13 @@ TeleportTimeoutNear = 25 TeleportTimeoutFar = 45 +# +# DailyRBGArenaPoints.MinLevel +# Description: Allows gaining arena points on the first RBG win at level 70. +# Default: 71 - (Blizzlike) + +DailyRBGArenaPoints.MinLevel = 71 + # ################################################################################################### diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 0216c5be2..d664f78ee 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -861,7 +861,7 @@ void Battleground::EndBattleground(PvPTeamId winnerTeamId) UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(winner_kills)); // Xinef: check player level and not bracket level if (CanAwardArenaPoints()) - if (player->GetLevel() >= BG_AWARD_ARENA_POINTS_MIN_LEVEL) + if (player->GetLevel() >= sWorld->getIntConfig(CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD)) player->ModifyArenaPoints(winner_arena); if (!player->GetRandomWinner()) diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 710c32412..67544e8b1 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -276,7 +276,6 @@ enum BGHonorMode BG_HONOR_MODE_NUM }; -#define BG_AWARD_ARENA_POINTS_MIN_LEVEL 71 #define ARENA_TIMELIMIT_POINTS_LOSS -16 #define ARENA_READY_MARKER_ENTRY 301337 diff --git a/src/server/game/World/IWorld.h b/src/server/game/World/IWorld.h index 9444fb7f8..3989daac7 100644 --- a/src/server/game/World/IWorld.h +++ b/src/server/game/World/IWorld.h @@ -417,6 +417,7 @@ enum WorldIntConfigs CONFIG_CHANGE_FACTION_MAX_MONEY, CONFIG_WATER_BREATH_TIMER, CONFIG_AUCTION_HOUSE_SEARCH_TIMEOUT, + CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD, INT_CONFIG_VALUE_COUNT }; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index c1e6feec4..1afd4bc47 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1281,6 +1281,8 @@ void World::LoadConfigSettings(bool reload) _bool_configs[CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH] = sConfigMgr->GetOption("Pet.RankMod.Health", true); + _int_configs[CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD] = sConfigMgr->GetOption("DailyRBGArenaPoints.MinLevel", 71); + _int_configs[CONFIG_AUCTION_HOUSE_SEARCH_TIMEOUT] = sConfigMgr->GetOption("AuctionHouse.SearchTimeout", 1000); ///- Read the "Data" directory from the config file