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

@@ -548,8 +548,8 @@ AiPlayerbot.PvpProhibitedZoneIds = "2255,656,2361,2362,2363,976,35,2268,3425,392
AiPlayerbot.RandomBotSpellIds = "54197" AiPlayerbot.RandomBotSpellIds = "54197"
# Level diff between random bots and nearby creatures for random teleports # Level diff between random bots and nearby creatures for random teleports
AiPlayerbot.randomBotTeleLowerLevel = 3 AiPlayerbot.RandomBotTeleLowerLevel = 3
AiPlayerbot.randomBotTeleHigerLevel = 1 AiPlayerbot.RandomBotTeleHigherLevel = 1
# ID of spell to open lootable chests # ID of spell to open lootable chests
AiPlayerbot.OpenGoSpell = 6477 AiPlayerbot.OpenGoSpell = 6477

View File

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

View File

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

View File

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