diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 295cdf11..a077805d 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -375,11 +375,6 @@ AiPlayerbot.AggroDistance = 22 # # -# Set XP rate for bots -# Default: 1.0 -# Actual XP Rate will be = Server XP Rate * AiPlayerbot.PlayerbotsXPRate -AiPlayerbot.PlayerbotsXPRate = 1.0 - # Health/Mana levels AiPlayerbot.CriticalHealth = 25 AiPlayerbot.LowHealth = 45 @@ -605,6 +600,10 @@ AiPlayerbot.RandomBotFixedLevel = 0 # Default: 0 (disabled) AiPlayerbot.DowngradeMaxLevelBot = 0 +# Set XP rate for random bots (Default: 1.0) +# Server XP Rate * AiPlayerbot.RandomBotXPRate +AiPlayerbot.RandomBotXPRate = 1.0 + # # # diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index b0d0460b..225f97cb 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -524,7 +524,7 @@ bool PlayerbotAIConfig::Initialize() autoGearQualityLimit = sConfigMgr->GetOption("AiPlayerbot.AutoGearQualityLimit", 3); autoGearScoreLimit = sConfigMgr->GetOption("AiPlayerbot.AutoGearScoreLimit", 0); - playerbotsXPrate = sConfigMgr->GetOption("AiPlayerbot.PlayerbotsXPRate", 1.0); + randomBotXPRate = sConfigMgr->GetOption("AiPlayerbot.RandomBotXPRate", 1.0); randomBotAllianceRatio = sConfigMgr->GetOption("AiPlayerbot.RandomBotAllianceRatio", 50); randomBotHordeRatio = sConfigMgr->GetOption("AiPlayerbot.RandomBotHordeRatio", 50); disableDeathKnightLogin = sConfigMgr->GetOption("AiPlayerbot.DisableDeathKnightLogin", 0); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index 35060e48..17880ad5 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -276,7 +276,7 @@ public: bool randomBotShowCloak; bool randomBotFixedLevel; bool disableRandomLevels; - float playerbotsXPrate; + float randomBotXPRate; uint32 randomBotAllianceRatio; uint32 randomBotHordeRatio; bool disableDeathKnightLogin; diff --git a/src/Playerbots.cpp b/src/Playerbots.cpp index c1bf439e..843a2cb6 100644 --- a/src/Playerbots.cpp +++ b/src/Playerbots.cpp @@ -219,9 +219,12 @@ public: if (!player->GetSession()->IsBot()) return; - if (sPlayerbotAIConfig->playerbotsXPrate != 1.0) + if (!sRandomPlayerbotMgr->IsRandomBot(player)) + return; + + if (sPlayerbotAIConfig->randomBotXPRate != 1.0) { - amount = static_cast(std::round(static_cast(amount) * sPlayerbotAIConfig->playerbotsXPrate)); + amount = static_cast(std::round(static_cast(amount) * sPlayerbotAIConfig->randomBotXPRate)); } } }; diff --git a/src/strategy/actions/XpGainAction.cpp b/src/strategy/actions/XpGainAction.cpp index 9ab40652..9d08d791 100644 --- a/src/strategy/actions/XpGainAction.cpp +++ b/src/strategy/actions/XpGainAction.cpp @@ -40,15 +40,15 @@ bool XpGainAction::Execute(Event event) BroadcastHelper::BroadcastKill(botAI, bot, creature); } - // playerbotsXPrate is now implemented in OnPlayerGiveXP script - // if (!sRandomPlayerbotMgr->IsRandomBot(bot) || sPlayerbotAIConfig->playerbotsXPrate == 1) + // randomBotXPRate is now implemented in OnPlayerGiveXP script + // if (!sRandomPlayerbotMgr->IsRandomBot(bot) || sPlayerbotAIConfig->randomBotXPRate == 1) // return true; // Unit* victim = nullptr; // if (guid) // victim = botAI->GetUnit(guid); - // xpgain = xpgain * (sPlayerbotAIConfig->playerbotsXPrate - 1); + // xpgain = xpgain * (sPlayerbotAIConfig->randomBotXPRate - 1); // GiveXP(xpgain, victim); return true;