mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Make AutoScaleActivity further configurable (#766)
Make AutoScaleActivity configurable
This commit is contained in:
@@ -1530,9 +1530,19 @@ AiPlayerbot.BotActiveAloneForceWhenInGuild = 1
|
|||||||
# Specify smart scaling is enabled or not.
|
# Specify smart scaling is enabled or not.
|
||||||
# The default is 1. When enabled (smart) scales the 'BotActiveAlone' value.
|
# The default is 1. When enabled (smart) scales the 'BotActiveAlone' value.
|
||||||
# Only when botLevel is between WhenMinLevel and WhenMaxLevel.
|
# 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.botActiveAloneSmartScale = 1
|
||||||
AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel = 1
|
AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel = 1
|
||||||
AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel = 80
|
AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel = 80
|
||||||
|
AiPlayerbot.botActiveAloneSmartScaleDiffMethod = 2
|
||||||
|
AiPlayerbot.botActiveAloneSmartScaleDiffLimitFloor = 40
|
||||||
|
AiPlayerbot.botActiveAloneSmartScaleDiffLimitCeiling = 150
|
||||||
|
|
||||||
# Premade spell to avoid (undetected spells)
|
# Premade spell to avoid (undetected spells)
|
||||||
# spellid-radius, ...
|
# spellid-radius, ...
|
||||||
@@ -1543,7 +1553,6 @@ AiPlayerbot.MaxRandomBotsPriceChangeInterval = 172800
|
|||||||
AiPlayerbot.MinRandomBotChangeStrategyTime = 180
|
AiPlayerbot.MinRandomBotChangeStrategyTime = 180
|
||||||
AiPlayerbot.MaxRandomBotChangeStrategyTime = 720
|
AiPlayerbot.MaxRandomBotChangeStrategyTime = 720
|
||||||
|
|
||||||
|
|
||||||
# How often tasks are changed
|
# How often tasks are changed
|
||||||
AiPlayerbot.MinGuildTaskChangeTime = 172800
|
AiPlayerbot.MinGuildTaskChangeTime = 172800
|
||||||
AiPlayerbot.MaxGuildTaskChangeTime = 432000
|
AiPlayerbot.MaxGuildTaskChangeTime = 432000
|
||||||
|
|||||||
@@ -4352,10 +4352,22 @@ bool PlayerbotAI::AllowActivity(ActivityType activityType, bool checkNow)
|
|||||||
|
|
||||||
uint32 PlayerbotAI::AutoScaleActivity(uint32 mod)
|
uint32 PlayerbotAI::AutoScaleActivity(uint32 mod)
|
||||||
{
|
{
|
||||||
uint32 maxDiff = sWorldUpdateTime.GetAverageUpdateTime();
|
uint32 diffLimitFloor = sPlayerbotAIConfig->botActiveAloneSmartScaleDiffLimitFloor;
|
||||||
|
uint32 diffLimitCeil = sPlayerbotAIConfig->botActiveAloneSmartScaleDiffLimitCeiling;
|
||||||
|
uint32 chkDiff = (sPlayerbotAIConfig->botActiveAloneSmartScaleDiffMethod == 2)
|
||||||
|
? sWorldUpdateTime.GetMaxUpdateTime()
|
||||||
|
: sWorldUpdateTime.GetAverageUpdateTime();
|
||||||
|
|
||||||
if (maxDiff > 500) return 0;
|
if (diffLimitFloor > diffLimitCeil)
|
||||||
if (maxDiff > 250)
|
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 (Map* map = bot->GetMap())
|
if (Map* map = bot->GetMap())
|
||||||
{
|
{
|
||||||
@@ -4375,10 +4387,10 @@ uint32 PlayerbotAI::AutoScaleActivity(uint32 mod)
|
|||||||
|
|
||||||
return (mod * 1) / 10;
|
return (mod * 1) / 10;
|
||||||
}
|
}
|
||||||
if (maxDiff > 200) return (mod * 3) / 10;
|
if (chkDiff > diffLimitFloor + (3 * spread)) return (mod * 2) / 10;
|
||||||
if (maxDiff > 150) return (mod * 5) / 10;
|
if (chkDiff > diffLimitFloor + (2 * spread)) return (mod * 4) / 10;
|
||||||
if (maxDiff > 100) return (mod * 6) / 10;
|
if (chkDiff > diffLimitFloor + (1 * spread)) return (mod * 7) / 10;
|
||||||
if (maxDiff > 75) return (mod * 9) / 10;
|
if (chkDiff > diffLimitFloor + (0 * spread)) return (mod * 9) / 10;
|
||||||
|
|
||||||
return mod;
|
return mod;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -476,10 +476,11 @@ bool PlayerbotAIConfig::Initialize()
|
|||||||
BotActiveAloneForceWhenIsFriend = sConfigMgr->GetOption<bool>("AiPlayerbot.BotActiveAloneForceWhenIsFriend", 1);
|
BotActiveAloneForceWhenIsFriend = sConfigMgr->GetOption<bool>("AiPlayerbot.BotActiveAloneForceWhenIsFriend", 1);
|
||||||
BotActiveAloneForceWhenInGuild = sConfigMgr->GetOption<bool>("AiPlayerbot.BotActiveAloneForceWhenInGuild", 1);
|
BotActiveAloneForceWhenInGuild = sConfigMgr->GetOption<bool>("AiPlayerbot.BotActiveAloneForceWhenInGuild", 1);
|
||||||
botActiveAloneSmartScale = sConfigMgr->GetOption<bool>("AiPlayerbot.botActiveAloneSmartScale", 1);
|
botActiveAloneSmartScale = sConfigMgr->GetOption<bool>("AiPlayerbot.botActiveAloneSmartScale", 1);
|
||||||
botActiveAloneSmartScaleWhenMinLevel =
|
botActiveAloneSmartScaleDiffMethod = sConfigMgr->GetOption<int32>("AiPlayerbot.BotActiveAloneSmartScaleDiffMethod", 2);
|
||||||
sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel", 1);
|
botActiveAloneSmartScaleDiffLimitFloor = sConfigMgr->GetOption<int32>("AiPlayerbot.BotActiveAloneSmartScaleDiffLimitFloor", 40);
|
||||||
botActiveAloneSmartScaleWhenMaxLevel =
|
botActiveAloneSmartScaleDiffLimitCeiling = sConfigMgr->GetOption<int32>("AiPlayerbot.BotActiveAloneSmartScaleDiffLimitCeiling", 150);
|
||||||
sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel", 80);
|
botActiveAloneSmartScaleWhenMinLevel = sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel", 1);
|
||||||
|
botActiveAloneSmartScaleWhenMaxLevel = sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel", 80);
|
||||||
|
|
||||||
randombotsWalkingRPG = sConfigMgr->GetOption<bool>("AiPlayerbot.RandombotsWalkingRPG", false);
|
randombotsWalkingRPG = sConfigMgr->GetOption<bool>("AiPlayerbot.RandombotsWalkingRPG", false);
|
||||||
randombotsWalkingRPGInDoors = sConfigMgr->GetOption<bool>("AiPlayerbot.RandombotsWalkingRPG.InDoors", false);
|
randombotsWalkingRPGInDoors = sConfigMgr->GetOption<bool>("AiPlayerbot.RandombotsWalkingRPG.InDoors", false);
|
||||||
|
|||||||
@@ -263,15 +263,20 @@ public:
|
|||||||
bool disableRandomLevels;
|
bool disableRandomLevels;
|
||||||
uint32 playerbotsXPrate;
|
uint32 playerbotsXPrate;
|
||||||
bool disableDeathKnightLogin;
|
bool disableDeathKnightLogin;
|
||||||
|
|
||||||
uint32 botActiveAlone;
|
uint32 botActiveAlone;
|
||||||
uint32 BotActiveAloneForceWhenInRadius;
|
uint32 BotActiveAloneForceWhenInRadius;
|
||||||
bool BotActiveAloneForceWhenInZone;
|
bool BotActiveAloneForceWhenInZone;
|
||||||
bool BotActiveAloneForceWhenInMap;
|
bool BotActiveAloneForceWhenInMap;
|
||||||
bool BotActiveAloneForceWhenIsFriend;
|
bool BotActiveAloneForceWhenIsFriend;
|
||||||
bool BotActiveAloneForceWhenInGuild;
|
bool BotActiveAloneForceWhenInGuild;
|
||||||
|
|
||||||
bool botActiveAloneSmartScale;
|
bool botActiveAloneSmartScale;
|
||||||
uint32 botActiveAloneSmartScaleWhenMinLevel;
|
uint32 botActiveAloneSmartScaleWhenMinLevel;
|
||||||
uint32 botActiveAloneSmartScaleWhenMaxLevel;
|
uint32 botActiveAloneSmartScaleWhenMaxLevel;
|
||||||
|
uint32 botActiveAloneSmartScaleDiffMethod;
|
||||||
|
uint32 botActiveAloneSmartScaleDiffLimitFloor;
|
||||||
|
uint32 botActiveAloneSmartScaleDiffLimitCeiling;
|
||||||
|
|
||||||
bool freeMethodLoot;
|
bool freeMethodLoot;
|
||||||
int32 lootRollLevel;
|
int32 lootRollLevel;
|
||||||
|
|||||||
Reference in New Issue
Block a user