From fbff4371a016a4c748328db5ef154e0f8b1bc36f Mon Sep 17 00:00:00 2001 From: Oiuv Date: Mon, 1 Apr 2024 00:13:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E7=99=BB=E5=BD=95=E5=85=B6=E5=AE=83=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E4=B8=BA=E6=9C=BA=E5=99=A8=E4=BA=BA=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/playerbots.conf.dist | 3 ++- src/PlayerbotAIConfig.cpp | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index c65b06ed..416931c4 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -18,7 +18,8 @@ AiPlayerbot.DeleteRandomBotAccounts = 0 AiPlayerbot.BotAutologin = 0 # Allow login other players' characters as bots -AiPlayerbot.allowPlayerBots = 0 +# Default: 0 (disabled) +AiPlayerbot.AllowPlayerBots = 0 # Guild Task system AiPlayerbot.EnableGuildTasks = 0 diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 0d86bc4f..28f43817 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -98,6 +98,7 @@ bool PlayerbotAIConfig::Initialize() iterationsPerTick = sConfigMgr->GetOption("AiPlayerbot.IterationsPerTick", 100); allowGuildBots = sConfigMgr->GetOption("AiPlayerbot.AllowGuildBots", true); + allowPlayerBots = sConfigMgr->GetOption("AiPlayerbot.AllowPlayerBots", false); randomBotMapsAsString = sConfigMgr->GetOption("AiPlayerbot.RandomBotMaps", "0,1,530,571"); LoadList>(randomBotMapsAsString, randomBotMaps); @@ -106,7 +107,7 @@ bool PlayerbotAIConfig::Initialize() LoadList>(sConfigMgr->GetOption("AiPlayerbot.RandomBotSpellIds", "54197"), randomBotSpellIds); LoadList>(sConfigMgr->GetOption("AiPlayerbot.PvpProhibitedZoneIds", "2255,656,2361,2362,2363,976,35,2268,3425,392,541,1446,3828,3712,3738,3565,3539,3623,4152,3988,4658,4284,4418,4436,4275,4323,4395"), pvpProhibitedZoneIds); LoadList>(sConfigMgr->GetOption("AiPlayerbot.PvpProhibitedAreaIds", "976,35"), pvpProhibitedAreaIds); - + LoadList>(sConfigMgr->GetOption("AiPlayerbot.RandomBotQuestIds", "7848,3802,5505,6502,7761"), randomBotQuestIds); botAutologin = sConfigMgr->GetOption("AiPlayerbot.BotAutologin", false); @@ -171,7 +172,7 @@ bool PlayerbotAIConfig::Initialize() } for (uint32 spec = 0; spec < MAX_SPECNO; ++spec) { - std::ostringstream os; + std::ostringstream os; os << "AiPlayerbot.PremadeSpecName." << cls << "." << spec; premadeSpecName[cls][spec] = sConfigMgr->GetOption(os.str().c_str(), "", false); os.str(""); @@ -193,7 +194,7 @@ bool PlayerbotAIConfig::Initialize() } for (uint32 spec = 0; spec < 3; ++spec) { - std::ostringstream os; + std::ostringstream os; os << "AiPlayerbot.RandomClassSpecProb." << cls << "." << spec; randomClassSpecProb[cls][spec] = sConfigMgr->GetOption(os.str().c_str(), 33); os.str(""); @@ -298,7 +299,7 @@ bool PlayerbotAIConfig::Initialize() autoUpgradeEquip = sConfigMgr->GetOption("AiPlayerbot.AutoUpgradeEquip", false); autoLearnTrainerSpells = sConfigMgr->GetOption("AiPlayerbot.AutoLearnTrainerSpells", true); autoLearnQuestSpells = sConfigMgr->GetOption("AiPlayerbot.AutoLearnQuestSpells", false); - autoTeleportForLevel = sConfigMgr->GetOption("AiPlayerbot.AutoTeleportForLevel", false); + autoTeleportForLevel = sConfigMgr->GetOption("AiPlayerbot.AutoTeleportForLevel", false); autoDoQuests = sConfigMgr->GetOption("AiPlayerbot.AutoDoQuests", false); syncLevelWithPlayers = sConfigMgr->GetOption("AiPlayerbot.SyncLevelWithPlayers", false); freeFood = sConfigMgr->GetOption("AiPlayerbot.FreeFood", true); @@ -531,7 +532,7 @@ static std::vector split(const std::string &str, const std::string std::vector> PlayerbotAIConfig::ParseTempTalentsOrder(uint32 cls, std::string tab_link) { // check bad link - uint32 classMask = 1 << (cls - 1); + uint32 classMask = 1 << (cls - 1); std::vector> res; std::vector tab_links = split(tab_link, "-"); std::map> spells; @@ -575,4 +576,4 @@ std::vector> PlayerbotAIConfig::ParseTempTalentsOrder(uint32 res.insert(res.end(), order.begin(), order.end()); } return res; -} \ No newline at end of file +}