diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 8838e2f0..f294e1e9 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -544,6 +544,8 @@ AiPlayerbot.DisableDeathKnightLogin = 0 # Default: 0 AiPlayerbot.LimitTalentsExpansion = 0 +# Allow random bots to trade +AiPlayerbot.EnableRandomBotTrading = 1 # # # diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 71fd8d62..14b0da87 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -505,6 +505,7 @@ bool PlayerbotAIConfig::Initialize() limitGearExpansion = sConfigMgr->GetOption("AiPlayerbot.LimitGearExpansion", 1); randombotStartingLevel = sConfigMgr->GetOption("AiPlayerbot.RandombotStartingLevel", 5); enablePeriodicOnlineOffline = sConfigMgr->GetOption("AiPlayerbot.EnablePeriodicOnlineOffline", false); + enableRandomBotTrading = sConfigMgr->GetOption("AiPlayerbot.EnableRandomBotTrading", true); periodicOnlineOfflineRatio = sConfigMgr->GetOption("AiPlayerbot.PeriodicOnlineOfflineRatio", 2.0); gearscorecheck = sConfigMgr->GetOption("AiPlayerbot.GearScoreCheck", false); randomBotPreQuests = sConfigMgr->GetOption("AiPlayerbot.PreQuests", true); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index f13178d3..9de6ceee 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -313,6 +313,7 @@ public: bool autoLearnQuestSpells; bool autoTeleportForLevel; bool randomBotGroupNearby; + bool enableRandomBotTrading; uint32 tweakValue; // Debugging config uint32 randomBotArenaTeamCount; diff --git a/src/strategy/actions/TradeStatusAction.cpp b/src/strategy/actions/TradeStatusAction.cpp index d46b842d..4c20b7ce 100644 --- a/src/strategy/actions/TradeStatusAction.cpp +++ b/src/strategy/actions/TradeStatusAction.cpp @@ -32,6 +32,12 @@ bool TradeStatusAction::Execute(Event event) return false; } + if (!sPlayerbotAIConfig->enableRandomBotTrading && sRandomPlayerbotMgr->IsRandomBot(bot)) + { + bot->Whisper("Trading is disabled", LANG_UNIVERSAL, trader); + return false; + } + // Allow trades from group members or bots if ((!bot->GetGroup() || !bot->GetGroup()->IsMember(trader->GetGUID())) && (trader != master || !botAI->GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_ALLOW_ALL, true, master)) &&