mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Prevent autogear on player alt bots (#772)
* prevent autogear on player alt bots * update chat message to match other message format * add config option with default set to 1 * replace end of file blank line * remove extra space
This commit is contained in:
@@ -424,6 +424,10 @@ AiPlayerbot.MaintenanceCommand = 1
|
||||
# default: 1 (enable)
|
||||
AiPlayerbot.AutoGearCommand = 1
|
||||
|
||||
# Enable/Disable autogear command on player alt bots
|
||||
# Default: 1 (enable)
|
||||
AiPlayerbot.AutoGearCommandAltBots = 1
|
||||
|
||||
# Equips quality limitation for auto gear command (1 = normal, 2 = uncommon, 3 = rare, 4 = epic, 5 = legendary)
|
||||
# default: 3 (rare)
|
||||
AiPlayerbot.AutoGearQualityLimit = 3
|
||||
|
||||
@@ -462,6 +462,7 @@ bool PlayerbotAIConfig::Initialize()
|
||||
addClassAccountPoolSize = sConfigMgr->GetOption<int32>("AiPlayerbot.AddClassAccountPoolSize", 50);
|
||||
maintenanceCommand = sConfigMgr->GetOption<int32>("AiPlayerbot.MaintenanceCommand", 1);
|
||||
autoGearCommand = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearCommand", 1);
|
||||
autoGearCommandAltBots = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearCommandAltBots", 1);
|
||||
autoGearQualityLimit = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearQualityLimit", 3);
|
||||
autoGearScoreLimit = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearScoreLimit", 0);
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ public:
|
||||
int32 addClassCommand;
|
||||
int32 addClassAccountPoolSize;
|
||||
int32 maintenanceCommand;
|
||||
int32 autoGearCommand, autoGearQualityLimit, autoGearScoreLimit;
|
||||
int32 autoGearCommand, autoGearCommandAltBots, autoGearQualityLimit, autoGearScoreLimit;
|
||||
|
||||
std::string const GetTimestampStr();
|
||||
bool hasLog(std::string const fileName)
|
||||
|
||||
@@ -202,6 +202,16 @@ bool AutoGearAction::Execute(Event event)
|
||||
botAI->TellError("autogear command is not allowed, please check the configuration.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sPlayerbotAIConfig->autoGearCommandAltBots)
|
||||
{
|
||||
if (!sRandomPlayerbotMgr->IsRandomBot(bot))
|
||||
{
|
||||
botAI->TellError("You cannot use autogear on alt bots.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
botAI->TellMaster("I'm auto gearing");
|
||||
uint32 gs = sPlayerbotAIConfig->autoGearScoreLimit == 0
|
||||
? 0
|
||||
|
||||
Reference in New Issue
Block a user