Merge pull request #591 from hermensbas/feature/BotActiveAlone_SmartScale_Toggle_Min_Max_level

[performance] Added min-max botLevel to apply smartScale on.
This commit is contained in:
bash
2024-10-11 20:01:02 +02:00
committed by GitHub
4 changed files with 11 additions and 1 deletions

View File

@@ -1464,7 +1464,11 @@ AiPlayerbot.BotActiveAlone = 100
# Specify smart scaling is enabled or not.
# The default is 1. When enabled (smart) scales the 'BotActiveAlone' value.
# Only when botLevel is between WhenMinLevel and WhenMaxLevel.
AiPlayerbot.botActiveAloneSmartScale = 1
AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel = 1
AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel = 80
# Premade spell to avoid (undetected spells)
# spellid-radius, ...

View File

@@ -4288,7 +4288,9 @@ bool PlayerbotAI::AllowActive(ActivityType activityType)
// GetPriorityBracket acitivity
float activePerc = 100;
if (sPlayerbotAIConfig->botActiveAloneSmartScale)
if (sPlayerbotAIConfig->botActiveAloneSmartScale &&
bot->GetLevel() >= sPlayerbotAIConfig->botActiveAloneSmartScaleWhenMinLevel &&
bot->GetLevel() <= sPlayerbotAIConfig->botActiveAloneSmartScaleWhenMaxLevel)
{
std::pair<uint8, uint8> priorityBracket = GetPriorityBracket(type);
if (!priorityBracket.second) return true;

View File

@@ -466,6 +466,8 @@ bool PlayerbotAIConfig::Initialize()
disableDeathKnightLogin = sConfigMgr->GetOption<bool>("AiPlayerbot.DisableDeathKnightLogin", 0);
botActiveAlone = sConfigMgr->GetOption<int32>("AiPlayerbot.BotActiveAlone", 100);
botActiveAloneSmartScale = sConfigMgr->GetOption<bool>("AiPlayerbot.botActiveAloneSmartScale", 1);
botActiveAloneSmartScaleWhenMinLevel = sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel", 1);
botActiveAloneSmartScaleWhenMaxLevel = sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel", 80);
enablePrototypePerformanceDiff = sConfigMgr->GetOption<bool>("AiPlayerbot.EnablePrototypePerformanceDiff", false);
diffWithPlayer = sConfigMgr->GetOption<int32>("AiPlayerbot.DiffWithPlayer", 100);

View File

@@ -264,6 +264,8 @@ public:
bool disableDeathKnightLogin;
uint32 botActiveAlone;
bool botActiveAloneSmartScale;
uint32 botActiveAloneSmartScaleWhenMinLevel;
uint32 botActiveAloneSmartScaleWhenMaxLevel;
uint32 enablePrototypePerformanceDiff;
uint32 diffWithPlayer;