Add config option for RND bot trading. (#1132)

* Add config option for RNDbot trading.
This commit is contained in:
Paolo
2025-03-28 08:10:49 -07:00
committed by GitHub
parent 495269bfa0
commit 917c96a281
4 changed files with 10 additions and 0 deletions

View File

@@ -544,6 +544,8 @@ AiPlayerbot.DisableDeathKnightLogin = 0
# Default: 0
AiPlayerbot.LimitTalentsExpansion = 0
# Allow random bots to trade
AiPlayerbot.EnableRandomBotTrading = 1
#
#
#

View File

@@ -505,6 +505,7 @@ bool PlayerbotAIConfig::Initialize()
limitGearExpansion = sConfigMgr->GetOption<int32>("AiPlayerbot.LimitGearExpansion", 1);
randombotStartingLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.RandombotStartingLevel", 5);
enablePeriodicOnlineOffline = sConfigMgr->GetOption<bool>("AiPlayerbot.EnablePeriodicOnlineOffline", false);
enableRandomBotTrading = sConfigMgr->GetOption<bool>("AiPlayerbot.EnableRandomBotTrading", true);
periodicOnlineOfflineRatio = sConfigMgr->GetOption<float>("AiPlayerbot.PeriodicOnlineOfflineRatio", 2.0);
gearscorecheck = sConfigMgr->GetOption<bool>("AiPlayerbot.GearScoreCheck", false);
randomBotPreQuests = sConfigMgr->GetOption<bool>("AiPlayerbot.PreQuests", true);

View File

@@ -313,6 +313,7 @@ public:
bool autoLearnQuestSpells;
bool autoTeleportForLevel;
bool randomBotGroupNearby;
bool enableRandomBotTrading;
uint32 tweakValue; // Debugging config
uint32 randomBotArenaTeamCount;

View File

@@ -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)) &&