diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 518ae5ea..a1aa620c 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -728,14 +728,14 @@ AiPlayerbot.FastReactInBG = 1 # # All In seconds -AiPlayerbot.RandomBotUpdateInterval = 20 +AiPlayerbot.RandomBotUpdateInterval = 1 AiPlayerbot.RandomBotCountChangeMinInterval = 1800 AiPlayerbot.RandomBotCountChangeMaxInterval = 7200 AiPlayerbot.MinRandomBotInWorldTime = 3600 -AiPlayerbot.MaxRandomBotInWorldTime = 43200 -AiPlayerbot.MinRandomBotRandomizeTime = 302400 +AiPlayerbot.MaxRandomBotInWorldTime = 1209600 +AiPlayerbot.MinRandomBotRandomizeTime = 7200 AiPlayerbot.MaxRandomBotRandomizeTime = 1209600 -AiPlayerbot.RandomBotsPerInterval = 500 +AiPlayerbot.RandomBotsPerInterval = 60 AiPlayerbot.MinRandomBotReviveTime = 60 AiPlayerbot.MaxRandomBotReviveTime = 300 AiPlayerbot.MinRandomBotTeleportInterval = 3600 diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index 3595190b..3db15397 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -1014,26 +1014,26 @@ bool RandomPlayerbotMgr::ProcessBot(uint32 bot) if (isLogginIn) return false; + uint32 randomTime; if (!player) { AddPlayerBot(botGUID, 0); - SetEventValue(bot, "login", 1, sPlayerbotAIConfig->randomBotUpdateInterval); + SetEventValue(bot, "login", 1, + std::max(1, static_cast(sPlayerbotAIConfig->randomBotUpdateInterval * 0.2))); - uint32 randomTime = - urand(sPlayerbotAIConfig->minRandomBotReviveTime, sPlayerbotAIConfig->maxRandomBotReviveTime); + randomTime = urand(std::max(5, static_cast(sPlayerbotAIConfig->randomBotUpdateInterval)), + std::max(15, static_cast(sPlayerbotAIConfig->randomBotUpdateInterval * 2.2))); SetEventValue(bot, "update", 1, randomTime); // do not randomize or teleport immediately after server start (prevent lagging) if (!GetEventValue(bot, "randomize")) { - randomTime = urand(sPlayerbotAIConfig->randomBotUpdateInterval * 5, - sPlayerbotAIConfig->randomBotUpdateInterval * 20); - ScheduleRandomize(bot, randomTime); + ScheduleRandomize(bot, std::max(3, static_cast(sPlayerbotAIConfig->randomBotUpdateInterval * 0.5))); } if (!GetEventValue(bot, "teleport")) { - randomTime = urand(sPlayerbotAIConfig->randomBotUpdateInterval * 5, - sPlayerbotAIConfig->randomBotUpdateInterval * 20); + randomTime = urand(std::max(7, static_cast(sPlayerbotAIConfig->randomBotUpdateInterval * 0.8)), + std::max(14, static_cast(sPlayerbotAIConfig->randomBotUpdateInterval * 2))); ScheduleTeleport(bot, randomTime); } return true; @@ -1076,8 +1076,9 @@ bool RandomPlayerbotMgr::ProcessBot(uint32 bot) if (update) ProcessBot(player); - uint32 randomTime = - urand(sPlayerbotAIConfig->minRandomBotReviveTime, sPlayerbotAIConfig->maxRandomBotReviveTime); + randomTime = urand( + sPlayerbotAIConfig->minRandomBotReviveTime, + sPlayerbotAIConfig->maxRandomBotReviveTime); SetEventValue(bot, "update", 1, randomTime); return true;