diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 1e881ce8..71c3a051 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -1530,19 +1530,9 @@ AiPlayerbot.BotActiveAloneForceWhenInGuild = 1 # 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.botActiveAloneDiff -# Method: 1 - Check against average Diff -# Method: 2 - Check against Max Diff (spikes) -# -# LimitFloor - No active bot decrease below this DIFF -# LimitCeiling - Max active bot decrease above this DIFF AiPlayerbot.botActiveAloneSmartScale = 1 AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel = 1 AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel = 80 -AiPlayerbot.botActiveAloneSmartScaleDiffMethod = 2 -AiPlayerbot.botActiveAloneSmartScaleDiffLimitFloor = 40 -AiPlayerbot.botActiveAloneSmartScaleDiffLimitCeiling = 150 # Premade spell to avoid (undetected spells) # spellid-radius, ... @@ -1553,6 +1543,7 @@ AiPlayerbot.MaxRandomBotsPriceChangeInterval = 172800 AiPlayerbot.MinRandomBotChangeStrategyTime = 180 AiPlayerbot.MaxRandomBotChangeStrategyTime = 720 + # How often tasks are changed AiPlayerbot.MinGuildTaskChangeTime = 172800 AiPlayerbot.MaxGuildTaskChangeTime = 432000 diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index fea6197f..00c84c57 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -4352,22 +4352,10 @@ bool PlayerbotAI::AllowActivity(ActivityType activityType, bool checkNow) uint32 PlayerbotAI::AutoScaleActivity(uint32 mod) { - uint32 diffLimitFloor = sPlayerbotAIConfig->botActiveAloneSmartScaleDiffLimitFloor; - uint32 diffLimitCeil = sPlayerbotAIConfig->botActiveAloneSmartScaleDiffLimitCeiling; - uint32 chkDiff = (sPlayerbotAIConfig->botActiveAloneSmartScaleDiffMethod == 2) - ? sWorldUpdateTime.GetMaxUpdateTime() - : sWorldUpdateTime.GetAverageUpdateTime(); + uint32 maxDiff = sWorldUpdateTime.GetAverageUpdateTime(); - if (diffLimitFloor > diffLimitCeil) - diffLimitFloor = diffLimitCeil; - - if (chkDiff <= diffLimitFloor) return mod; - if (chkDiff >= diffLimitCeil) return 0; - - uint32 diffRange = diffLimitCeil - diffLimitFloor; - double spread = (double)diffRange / 5; // Calculate the equal spread between each number /w 5 steps - - if (chkDiff > diffLimitFloor + (4 * spread)) + if (maxDiff > 500) return 0; + if (maxDiff > 250) { if (Map* map = bot->GetMap()) { @@ -4387,10 +4375,10 @@ uint32 PlayerbotAI::AutoScaleActivity(uint32 mod) return (mod * 1) / 10; } - if (chkDiff > diffLimitFloor + (3 * spread)) return (mod * 2) / 10; - if (chkDiff > diffLimitFloor + (2 * spread)) return (mod * 4) / 10; - if (chkDiff > diffLimitFloor + (1 * spread)) return (mod * 7) / 10; - if (chkDiff > diffLimitFloor + (0 * spread)) return (mod * 9) / 10; + if (maxDiff > 200) return (mod * 3) / 10; + if (maxDiff > 150) return (mod * 5) / 10; + if (maxDiff > 100) return (mod * 6) / 10; + if (maxDiff > 75) return (mod * 9) / 10; return mod; } diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index ef913533..df0dd650 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -476,11 +476,10 @@ bool PlayerbotAIConfig::Initialize() BotActiveAloneForceWhenIsFriend = sConfigMgr->GetOption("AiPlayerbot.BotActiveAloneForceWhenIsFriend", 1); BotActiveAloneForceWhenInGuild = sConfigMgr->GetOption("AiPlayerbot.BotActiveAloneForceWhenInGuild", 1); botActiveAloneSmartScale = sConfigMgr->GetOption("AiPlayerbot.botActiveAloneSmartScale", 1); - botActiveAloneSmartScaleDiffMethod = sConfigMgr->GetOption("AiPlayerbot.BotActiveAloneSmartScaleDiffMethod", 2); - botActiveAloneSmartScaleDiffLimitFloor = sConfigMgr->GetOption("AiPlayerbot.BotActiveAloneSmartScaleDiffLimitFloor", 40); - botActiveAloneSmartScaleDiffLimitCeiling = sConfigMgr->GetOption("AiPlayerbot.BotActiveAloneSmartScaleDiffLimitCeiling", 150); - botActiveAloneSmartScaleWhenMinLevel = sConfigMgr->GetOption("AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel", 1); - botActiveAloneSmartScaleWhenMaxLevel = sConfigMgr->GetOption("AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel", 80); + botActiveAloneSmartScaleWhenMinLevel = + sConfigMgr->GetOption("AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel", 1); + botActiveAloneSmartScaleWhenMaxLevel = + sConfigMgr->GetOption("AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel", 80); randombotsWalkingRPG = sConfigMgr->GetOption("AiPlayerbot.RandombotsWalkingRPG", false); randombotsWalkingRPGInDoors = sConfigMgr->GetOption("AiPlayerbot.RandombotsWalkingRPG.InDoors", false); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index 919cc21d..f8d36152 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -263,20 +263,15 @@ public: bool disableRandomLevels; uint32 playerbotsXPrate; bool disableDeathKnightLogin; - uint32 botActiveAlone; uint32 BotActiveAloneForceWhenInRadius; bool BotActiveAloneForceWhenInZone; bool BotActiveAloneForceWhenInMap; bool BotActiveAloneForceWhenIsFriend; - bool BotActiveAloneForceWhenInGuild; - + bool BotActiveAloneForceWhenInGuild; bool botActiveAloneSmartScale; uint32 botActiveAloneSmartScaleWhenMinLevel; uint32 botActiveAloneSmartScaleWhenMaxLevel; - uint32 botActiveAloneSmartScaleDiffMethod; - uint32 botActiveAloneSmartScaleDiffLimitFloor; - uint32 botActiveAloneSmartScaleDiffLimitCeiling; bool freeMethodLoot; int32 lootRollLevel;