mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +08:00
Add config option for RND bot trading. (#1132)
* Add config option for RNDbot trading.
This commit is contained in:
@@ -544,6 +544,8 @@ AiPlayerbot.DisableDeathKnightLogin = 0
|
|||||||
# Default: 0
|
# Default: 0
|
||||||
AiPlayerbot.LimitTalentsExpansion = 0
|
AiPlayerbot.LimitTalentsExpansion = 0
|
||||||
|
|
||||||
|
# Allow random bots to trade
|
||||||
|
AiPlayerbot.EnableRandomBotTrading = 1
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -505,6 +505,7 @@ bool PlayerbotAIConfig::Initialize()
|
|||||||
limitGearExpansion = sConfigMgr->GetOption<int32>("AiPlayerbot.LimitGearExpansion", 1);
|
limitGearExpansion = sConfigMgr->GetOption<int32>("AiPlayerbot.LimitGearExpansion", 1);
|
||||||
randombotStartingLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.RandombotStartingLevel", 5);
|
randombotStartingLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.RandombotStartingLevel", 5);
|
||||||
enablePeriodicOnlineOffline = sConfigMgr->GetOption<bool>("AiPlayerbot.EnablePeriodicOnlineOffline", false);
|
enablePeriodicOnlineOffline = sConfigMgr->GetOption<bool>("AiPlayerbot.EnablePeriodicOnlineOffline", false);
|
||||||
|
enableRandomBotTrading = sConfigMgr->GetOption<bool>("AiPlayerbot.EnableRandomBotTrading", true);
|
||||||
periodicOnlineOfflineRatio = sConfigMgr->GetOption<float>("AiPlayerbot.PeriodicOnlineOfflineRatio", 2.0);
|
periodicOnlineOfflineRatio = sConfigMgr->GetOption<float>("AiPlayerbot.PeriodicOnlineOfflineRatio", 2.0);
|
||||||
gearscorecheck = sConfigMgr->GetOption<bool>("AiPlayerbot.GearScoreCheck", false);
|
gearscorecheck = sConfigMgr->GetOption<bool>("AiPlayerbot.GearScoreCheck", false);
|
||||||
randomBotPreQuests = sConfigMgr->GetOption<bool>("AiPlayerbot.PreQuests", true);
|
randomBotPreQuests = sConfigMgr->GetOption<bool>("AiPlayerbot.PreQuests", true);
|
||||||
|
|||||||
@@ -313,6 +313,7 @@ public:
|
|||||||
bool autoLearnQuestSpells;
|
bool autoLearnQuestSpells;
|
||||||
bool autoTeleportForLevel;
|
bool autoTeleportForLevel;
|
||||||
bool randomBotGroupNearby;
|
bool randomBotGroupNearby;
|
||||||
|
bool enableRandomBotTrading;
|
||||||
uint32 tweakValue; // Debugging config
|
uint32 tweakValue; // Debugging config
|
||||||
|
|
||||||
uint32 randomBotArenaTeamCount;
|
uint32 randomBotArenaTeamCount;
|
||||||
|
|||||||
@@ -32,6 +32,12 @@ bool TradeStatusAction::Execute(Event event)
|
|||||||
return false;
|
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
|
// Allow trades from group members or bots
|
||||||
if ((!bot->GetGroup() || !bot->GetGroup()->IsMember(trader->GetGUID())) &&
|
if ((!bot->GetGroup() || !bot->GetGroup()->IsMember(trader->GetGUID())) &&
|
||||||
(trader != master || !botAI->GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_ALLOW_ALL, true, master)) &&
|
(trader != master || !botAI->GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_ALLOW_ALL, true, master)) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user