automatically action for random bots

This commit is contained in:
Yunfan Li
2023-08-05 18:41:15 +08:00
parent 9598719801
commit d31fbc0353
12 changed files with 153 additions and 79 deletions

View File

@@ -800,7 +800,7 @@ bool RandomPlayerbotMgr::ProcessBot(uint32 bot)
AddPlayerBot(botGUID, 0);
SetEventValue(bot, "login", 1, sPlayerbotAIConfig->randomBotUpdateInterval);
uint32 randomTime = urand(sPlayerbotAIConfig->minRandomBotReviveTime, sPlayerbotAIConfig->maxRandomBotReviveTime * 5);
uint32 randomTime = urand(sPlayerbotAIConfig->minRandomBotReviveTime, sPlayerbotAIConfig->maxRandomBotReviveTime);
SetEventValue(bot, "update", 1, randomTime);
return true;
@@ -812,7 +812,7 @@ bool RandomPlayerbotMgr::ProcessBot(uint32 bot)
return false;
uint32 update = GetEventValue(bot, "update");
if (!update && !sPlayerbotAIConfig->disableRandomLevels)
if (!update)
{
if (botAI)
botAI->GetAiObjectContext()->GetValue<bool>("random bot update")->Set(true);