mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
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
This commit is contained in:
@@ -579,6 +579,9 @@ AiPlayerbot.LimitTalentsExpansion = 0
|
|||||||
# Default: 1 (enabled)
|
# Default: 1 (enabled)
|
||||||
AiPlayerbot.EnableRandomBotTrading = 1
|
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"
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -484,6 +484,8 @@ bool PlayerbotAIConfig::Initialize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
randomBotAccountPrefix = sConfigMgr->GetOption<std::string>("AiPlayerbot.RandomBotAccountPrefix", "rndbot");
|
randomBotAccountPrefix = sConfigMgr->GetOption<std::string>("AiPlayerbot.RandomBotAccountPrefix", "rndbot");
|
||||||
|
tradeActionExcludedPrefixes = sConfigMgr->GetOption<std::string>("AiPlayerbot.TradeActionExcludedPrefixes",
|
||||||
|
"RPLL_H_,DBMv4,{звезда} Questie,{rt1} Questie");
|
||||||
randomBotAccountCount = sConfigMgr->GetOption<int32>("AiPlayerbot.RandomBotAccountCount", 0);
|
randomBotAccountCount = sConfigMgr->GetOption<int32>("AiPlayerbot.RandomBotAccountCount", 0);
|
||||||
deleteRandomBotAccounts = sConfigMgr->GetOption<bool>("AiPlayerbot.DeleteRandomBotAccounts", false);
|
deleteRandomBotAccounts = sConfigMgr->GetOption<bool>("AiPlayerbot.DeleteRandomBotAccounts", false);
|
||||||
randomBotGuildCount = sConfigMgr->GetOption<int32>("AiPlayerbot.RandomBotGuildCount", 20);
|
randomBotGuildCount = sConfigMgr->GetOption<int32>("AiPlayerbot.RandomBotGuildCount", 20);
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ public:
|
|||||||
|
|
||||||
std::string commandPrefix, commandSeparator;
|
std::string commandPrefix, commandSeparator;
|
||||||
std::string randomBotAccountPrefix;
|
std::string randomBotAccountPrefix;
|
||||||
|
std::string tradeActionExcludedPrefixes;
|
||||||
uint32 randomBotAccountCount;
|
uint32 randomBotAccountCount;
|
||||||
bool randomBotRandomPassword;
|
bool randomBotRandomPassword;
|
||||||
bool deleteRandomBotAccounts;
|
bool deleteRandomBotAccounts;
|
||||||
|
|||||||
@@ -10,13 +10,14 @@
|
|||||||
#include "ItemCountValue.h"
|
#include "ItemCountValue.h"
|
||||||
#include "ItemVisitors.h"
|
#include "ItemVisitors.h"
|
||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
|
#include <PlayerbotAIConfig.cpp>
|
||||||
|
|
||||||
bool TradeAction::Execute(Event event)
|
bool TradeAction::Execute(Event event)
|
||||||
{
|
{
|
||||||
std::string const text = event.getParam();
|
std::string const text = event.getParam();
|
||||||
|
|
||||||
// Table with prefixes to be excluded from analysis
|
std::vector<std::string> excludedPrefixes;
|
||||||
static const std::vector<std::string> excludedPrefixes = {"RPLL_H_"};
|
LoadListString<std::vector<std::string>>(sPlayerbotAIConfig->tradeActionExcludedPrefixes, excludedPrefixes);
|
||||||
|
|
||||||
// If text starts with any excluded prefix, don't process it further.
|
// If text starts with any excluded prefix, don't process it further.
|
||||||
for (const auto& prefix : excludedPrefixes)
|
for (const auto& prefix : excludedPrefixes)
|
||||||
|
|||||||
Reference in New Issue
Block a user