fix RandomBotTeleLevel

This commit is contained in:
Yunfan Li
2023-08-02 23:39:34 +08:00
parent 46b94824e4
commit 1d423e4820
4 changed files with 5 additions and 5 deletions

View File

@@ -138,7 +138,7 @@ bool PlayerbotAIConfig::Initialize()
randomBotMaxLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.RandomBotMaxLevel", 80);
randomBotLoginAtStartup = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotLoginAtStartup", true);
randomBotTeleLowerLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.RandomBotTeleLowerLevel", 3);
randomBotTeleHigerLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.RandomBotTeleHigerLevel", 1);
randomBotTeleHigherLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.RandomBotTeleHigherLevel", 1);
openGoSpell = sConfigMgr->GetOption<int32>("AiPlayerbot.OpenGoSpell", 6477);
randomChangeMultiplier = sConfigMgr->GetOption<float>("AiPlayerbot.RandomChangeMultiplier", 1.0);

View File

@@ -76,7 +76,7 @@ class PlayerbotAIConfig
bool randomBotJoinBG;
bool randomBotAutoJoinBG;
bool randomBotLoginAtStartup;
uint32 randomBotTeleLowerLevel, randomBotTeleHigerLevel;
uint32 randomBotTeleLowerLevel, randomBotTeleHigherLevel;
bool logInGroupOnly, logValuesPerTick;
bool fleeingEnabled;
bool summonAtInnkeepersEnabled;

View File

@@ -1156,7 +1156,7 @@ void RandomPlayerbotMgr::PrepareTeleportCache()
uint32 avg_level = fields[4].Get<uint32>();
WorldLocation loc(mapId, x, y, z, 0);
collected_locs++;
for (int32 level = (int32)avg_level - (int32)sPlayerbotAIConfig->randomBotTeleHigerLevel; level <= (int32)avg_level + (int32)sPlayerbotAIConfig->randomBotTeleLowerLevel; level++) {
for (int32 level = (int32)avg_level - (int32)sPlayerbotAIConfig->randomBotTeleHigherLevel; level <= (int32)avg_level + (int32)sPlayerbotAIConfig->randomBotTeleLowerLevel; level++) {
if (level < 1 || level > maxLevel) {
continue;
}