diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index c12049d66..324cdc457 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -187,6 +187,13 @@ AiPlayerbot.SelfBotLevel = 1 # Default: 0 (non-GM player can use any intialization commands) AiPlayerbot.AutoInitOnly = 0 +# Allow .bot refresh=raid to unbind instances on player-created alt +# bots (non-addclass bots). When 0, refresh=raid is denied on alts +# with "non-addclass bot" error. UnbindInstance is DB-light, no lag +# risk from enabling this. +# Default: 0 +AiPlayerbot.ResetInstanceIdForAltBots = 0 + # The upper limit ratio of bot equipment level for init=auto # Default: 1.0 (same with the player) AiPlayerbot.AutoInitEquipLevelLimitRatio = 1.0 diff --git a/src/Bot/PlayerbotMgr.cpp b/src/Bot/PlayerbotMgr.cpp index d38e7720e..9d9f5688f 100644 --- a/src/Bot/PlayerbotMgr.cpp +++ b/src/Bot/PlayerbotMgr.cpp @@ -732,7 +732,10 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje bool addClassBot = sRandomPlayerbotMgr.IsAddclassBot(guid.GetCounter()); if (!addClassBot) - return "ERROR: You can not use this command on non-addclass bot."; + { + if (!(cmd == "refresh=raid" && sPlayerbotAIConfig.resetInstanceIdForAltBots)) + return "ERROR: You can only use this command on addclass bots."; + } if (!admin) { diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index c01769eb8..fb036e359 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -593,6 +593,7 @@ bool PlayerbotAIConfig::Initialize() reviveBotWhenSummoned = sConfigMgr->GetOption("AiPlayerbot.ReviveBotWhenSummoned", 1); botRepairWhenSummon = sConfigMgr->GetOption("AiPlayerbot.BotRepairWhenSummon", true); autoInitOnly = sConfigMgr->GetOption("AiPlayerbot.AutoInitOnly", false); + resetInstanceIdForAltBots = sConfigMgr->GetOption("AiPlayerbot.ResetInstanceIdForAltBots", false); autoInitEquipLevelLimitRatio = sConfigMgr->GetOption("AiPlayerbot.AutoInitEquipLevelLimitRatio", 1.0); maxAddedBots = sConfigMgr->GetOption("AiPlayerbot.MaxAddedBots", 40); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index 9dc1dcba1..1936d1ca7 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -406,6 +406,7 @@ public: int reviveBotWhenSummoned; bool botRepairWhenSummon; bool autoInitOnly; + bool resetInstanceIdForAltBots; float autoInitEquipLevelLimitRatio; int32 maxAddedBots; int32 addClassCommand;