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:
xSparky911x
2024-12-15 16:37:13 -06:00
committed by GitHub
parent 9fed6bc73a
commit cbadb5765f
4 changed files with 16 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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