mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
random and teleport delay
This commit is contained in:
@@ -797,6 +797,15 @@ bool RandomPlayerbotMgr::ProcessBot(uint32 bot)
|
|||||||
uint32 randomTime = urand(sPlayerbotAIConfig->minRandomBotReviveTime, sPlayerbotAIConfig->maxRandomBotReviveTime);
|
uint32 randomTime = urand(sPlayerbotAIConfig->minRandomBotReviveTime, sPlayerbotAIConfig->maxRandomBotReviveTime);
|
||||||
SetEventValue(bot, "update", 1, randomTime);
|
SetEventValue(bot, "update", 1, randomTime);
|
||||||
|
|
||||||
|
// do not randomize or teleport immediately after server start (prevent lagging)
|
||||||
|
if (!GetEventValue(bot, "randomize")) {
|
||||||
|
randomTime = urand(sPlayerbotAIConfig->randomBotUpdateInterval, sPlayerbotAIConfig->randomBotUpdateInterval * 10);
|
||||||
|
ScheduleRandomize(bot, randomTime);
|
||||||
|
}
|
||||||
|
if (!GetEventValue(bot, "teleport")) {
|
||||||
|
randomTime = urand(sPlayerbotAIConfig->randomBotUpdateInterval, sPlayerbotAIConfig->randomBotUpdateInterval * 10);
|
||||||
|
ScheduleTeleport(bot, randomTime);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -915,7 +924,6 @@ bool RandomPlayerbotMgr::ProcessBot(Player* player)
|
|||||||
uint32 randomize = GetEventValue(bot, "randomize");
|
uint32 randomize = GetEventValue(bot, "randomize");
|
||||||
if (!randomize)
|
if (!randomize)
|
||||||
{
|
{
|
||||||
// if (randomiser)
|
|
||||||
Randomize(player);
|
Randomize(player);
|
||||||
LOG_INFO("playerbots", "Bot #{} {}:{} <{}>: randomized", bot, player->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", player->getLevel(), player->GetName());
|
LOG_INFO("playerbots", "Bot #{} {}:{} <{}>: randomized", bot, player->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", player->getLevel(), player->GetName());
|
||||||
uint32 randomTime = urand(sPlayerbotAIConfig->minRandomBotRandomizeTime, sPlayerbotAIConfig->maxRandomBotRandomizeTime);
|
uint32 randomTime = urand(sPlayerbotAIConfig->minRandomBotRandomizeTime, sPlayerbotAIConfig->maxRandomBotRandomizeTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user