From dfa87faf5e6eaddaa440197b4b980115bd440a14 Mon Sep 17 00:00:00 2001 From: kadeshar Date: Sun, 8 Jun 2025 16:23:51 +0200 Subject: [PATCH] Fixed opening trade window while using DBM or Questie addon (#1363) * - Fixed opening trade window while using DBM or Questie addon * - Added excluded prefixes for trade actions to config * -Fixed config description --- conf/playerbots.conf.dist | 3 +++ src/PlayerbotAIConfig.cpp | 2 ++ src/PlayerbotAIConfig.h | 1 + src/strategy/actions/TradeAction.cpp | 5 +++-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 8ec3c48e..c92a1826 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -579,6 +579,9 @@ AiPlayerbot.LimitTalentsExpansion = 0 # Default: 1 (enabled) AiPlayerbot.EnableRandomBotTrading = 1 +# Configure message prefixes which will be excluded in analysis in trade action to open trade window +AiPlayerbot.TradeActionExcludedPrefixes = "RPLL_H_,DBMv4,{звезда} Questie,{rt1} Questie" + # # # diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 326e2f5c..237b75a9 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -484,6 +484,8 @@ bool PlayerbotAIConfig::Initialize() } randomBotAccountPrefix = sConfigMgr->GetOption("AiPlayerbot.RandomBotAccountPrefix", "rndbot"); + tradeActionExcludedPrefixes = sConfigMgr->GetOption("AiPlayerbot.TradeActionExcludedPrefixes", + "RPLL_H_,DBMv4,{звезда} Questie,{rt1} Questie"); randomBotAccountCount = sConfigMgr->GetOption("AiPlayerbot.RandomBotAccountCount", 0); deleteRandomBotAccounts = sConfigMgr->GetOption("AiPlayerbot.DeleteRandomBotAccounts", false); randomBotGuildCount = sConfigMgr->GetOption("AiPlayerbot.RandomBotGuildCount", 20); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index 0045d69e..b29c6af2 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -223,6 +223,7 @@ public: std::string commandPrefix, commandSeparator; std::string randomBotAccountPrefix; + std::string tradeActionExcludedPrefixes; uint32 randomBotAccountCount; bool randomBotRandomPassword; bool deleteRandomBotAccounts; diff --git a/src/strategy/actions/TradeAction.cpp b/src/strategy/actions/TradeAction.cpp index c1388b66..b8adb444 100644 --- a/src/strategy/actions/TradeAction.cpp +++ b/src/strategy/actions/TradeAction.cpp @@ -10,13 +10,14 @@ #include "ItemCountValue.h" #include "ItemVisitors.h" #include "Playerbots.h" +#include bool TradeAction::Execute(Event event) { std::string const text = event.getParam(); - // Table with prefixes to be excluded from analysis - static const std::vector excludedPrefixes = {"RPLL_H_"}; + std::vector excludedPrefixes; + LoadListString>(sPlayerbotAIConfig->tradeActionExcludedPrefixes, excludedPrefixes); // If text starts with any excluded prefix, don't process it further. for (const auto& prefix : excludedPrefixes)