From 680e60c68b1864596bf23d427e9f4742c6437b86 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Fri, 4 Mar 2022 02:36:16 -0300 Subject: [PATCH] BREAKING CHANGE(Core/Config): Individual XP rate per bg (#10793) --- .../pendings/changes_1646261203127755100.md | 13 ++++++++ src/server/game/Battlegrounds/Battleground.h | 10 +++++++ src/server/game/Miscellaneous/Formulas.cpp | 30 ++++++++++++++++++- src/server/game/World/IWorld.h | 7 ++++- src/server/game/World/World.cpp | 7 ++++- src/server/worldserver/worldserver.conf.dist | 11 +++++-- 6 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 doc/changelog/pendings/changes_1646261203127755100.md diff --git a/doc/changelog/pendings/changes_1646261203127755100.md b/doc/changelog/pendings/changes_1646261203127755100.md new file mode 100644 index 000000000..21db8b0e1 --- /dev/null +++ b/doc/changelog/pendings/changes_1646261203127755100.md @@ -0,0 +1,13 @@ +### Changed +Removed Rate.XP.BattlegroundKill, added one rate config for each bg. + +### How to upgrade + +Delete Rate.XP.BattlegroundKill, and then set all the battlegroundkill rate for each bg. +Rate.XP.BattlegroundKillAV = 1 +Rate.XP.BattlegroundKillWSG = 1 +Rate.XP.BattlegroundKillAB = 1 +Rate.XP.BattlegroundKillEOTS = 1 +Rate.XP.BattlegroundKillSOTA = 1 +Rate.XP.BattlegroundKillIC = 1 + diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 438c4e26e..5f4b2709a 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -54,6 +54,16 @@ enum BattlegroundDesertionType BG_DESERTION_TYPE_INVITE_LOGOUT = 4, // player is invited to join and logs out }; +enum BattlegroundMaps +{ + MAP_BG_ALTERAC_VALLEY = 30, + MAP_BG_WARSONG_GULCH = 489, + MAP_BG_ARATHI_BASIN = 529, + MAP_BG_EYE_OF_THE_STORM = 566, + MAP_BG_STRAND_OF_THE_ANCIENTS = 607, + MAP_BG_ISLE_OF_CONQUEST = 628 +}; + enum BattlegroundBroadcastTexts { BG_TEXT_ALLIANCE_WINS = 10633, diff --git a/src/server/game/Miscellaneous/Formulas.cpp b/src/server/game/Miscellaneous/Formulas.cpp index 3ea85c28f..3ffb2c3dd 100644 --- a/src/server/game/Miscellaneous/Formulas.cpp +++ b/src/server/game/Miscellaneous/Formulas.cpp @@ -16,6 +16,7 @@ */ #include "Formulas.h" +#include "Battleground.h" #include "Creature.h" #include "Log.h" #include "Player.h" @@ -93,7 +94,34 @@ uint32 Acore::XP::Gain(Player* player, Unit* unit, bool isBattleGround /*= false xpMod *= creature->GetCreatureTemplate()->ModExperience; } - xpMod *= isBattleGround ? sWorld->getRate(RATE_XP_BG_KILL) : sWorld->getRate(RATE_XP_KILL); + if (isBattleGround) + { + switch (player->GetMapId()) + { + case MAP_BG_ALTERAC_VALLEY: + xpMod *= sWorld->getRate(RATE_XP_BG_KILL_AV); + break; + case MAP_BG_WARSONG_GULCH: + xpMod *= sWorld->getRate(RATE_XP_BG_KILL_WSG); + break; + case MAP_BG_ARATHI_BASIN: + xpMod *= sWorld->getRate(RATE_XP_BG_KILL_AB); + break; + case MAP_BG_EYE_OF_THE_STORM: + xpMod *= sWorld->getRate(RATE_XP_BG_KILL_EOTS); + break; + case MAP_BG_STRAND_OF_THE_ANCIENTS: + xpMod *= sWorld->getRate(RATE_XP_BG_KILL_SOTA); + break; + case MAP_BG_ISLE_OF_CONQUEST: + xpMod *= sWorld->getRate(RATE_XP_BG_KILL_IC); + break; + } + } + else + { + xpMod *= sWorld->getRate(RATE_XP_KILL); + } // if players dealt less than 50% of the damage and were credited anyway (due to CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ), scale XP gained appropriately (linear scaling) if (creature && creature->m_PlayerDamageReq) diff --git a/src/server/game/World/IWorld.h b/src/server/game/World/IWorld.h index c23544c2d..27c65e51d 100644 --- a/src/server/game/World/IWorld.h +++ b/src/server/game/World/IWorld.h @@ -440,7 +440,12 @@ enum Rates RATE_DROP_MONEY, RATE_REWARD_BONUS_MONEY, RATE_XP_KILL, - RATE_XP_BG_KILL, + RATE_XP_BG_KILL_AV, + RATE_XP_BG_KILL_WSG, + RATE_XP_BG_KILL_AB, + RATE_XP_BG_KILL_EOTS, + RATE_XP_BG_KILL_SOTA, + RATE_XP_BG_KILL_IC, RATE_XP_QUEST, RATE_XP_QUEST_DF, RATE_XP_EXPLORE, diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index cd2aaf45a..bc0aefb5f 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -505,7 +505,12 @@ void World::LoadConfigSettings(bool reload) rate_values[RATE_DROP_MONEY] = sConfigMgr->GetOption("Rate.Drop.Money", 1.0f); rate_values[RATE_REWARD_BONUS_MONEY] = sConfigMgr->GetOption("Rate.RewardBonusMoney", 1.0f); rate_values[RATE_XP_KILL] = sConfigMgr->GetOption("Rate.XP.Kill", 1.0f); - rate_values[RATE_XP_BG_KILL] = sConfigMgr->GetOption("Rate.XP.BattlegroundKill", 1.0f); + rate_values[RATE_XP_BG_KILL_AV] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillAV", 1.0f); + rate_values[RATE_XP_BG_KILL_WSG] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillWSG", 1.0f); + rate_values[RATE_XP_BG_KILL_AB] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillAB", 1.0f); + rate_values[RATE_XP_BG_KILL_EOTS] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillEOTS", 1.0f); + rate_values[RATE_XP_BG_KILL_SOTA] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillSOTA", 1.0f); + rate_values[RATE_XP_BG_KILL_IC] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillIC", 1.0f); rate_values[RATE_XP_QUEST] = sConfigMgr->GetOption("Rate.XP.Quest", 1.0f); rate_values[RATE_XP_QUEST_DF] = sConfigMgr->GetOption("Rate.XP.Quest.DF", 1.0f); rate_values[RATE_XP_EXPLORE] = sConfigMgr->GetOption("Rate.XP.Explore", 1.0f); diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index b0a3d7885..b35035d58 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2291,12 +2291,17 @@ Rate.XP.Explore = 1 Rate.XP.Pet = 1 # -# Rate.XP.BattlegroundKill -# Description: Experience rate for honorable kills in battlegrounds. Not affected by Rate.XP.Kill +# Rate.XP.BattlegroundKill... +# Description: Experience rate for honorable kills in battlegrounds. Not affected by Rate.XP.Kill. Defined for each battleground. # Only works if Battleground.GiveXPForKills = 1 # Default: 1 -Rate.XP.BattlegroundKill = 1 +Rate.XP.BattlegroundKillAV = 1 +Rate.XP.BattlegroundKillWSG = 1 +Rate.XP.BattlegroundKillAB = 1 +Rate.XP.BattlegroundKillEOTS = 1 +Rate.XP.BattlegroundKillSOTA = 1 +Rate.XP.BattlegroundKillIC = 1 # # Rate.RepairCost