mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 17:09:08 +00:00
[Command] Command autogear
This commit is contained in:
@@ -150,9 +150,11 @@ void TrainerAction::TellFooter(uint32 totalCost)
|
||||
|
||||
bool MaintenanceAction::Execute(Event event)
|
||||
{
|
||||
if (!sPlayerbotAIConfig->maintenanceCommand)
|
||||
if (!sPlayerbotAIConfig->maintenanceCommand) {
|
||||
botAI->TellMaster("maintenance command is not allowed, please check the configuration.");
|
||||
return false;
|
||||
botAI->TellMaster("maintenance");
|
||||
}
|
||||
botAI->TellMaster("I'm maintaining");
|
||||
PlayerbotFactory factory(bot, bot->GetLevel());
|
||||
factory.InitBags(false);
|
||||
factory.InitAmmo();
|
||||
@@ -171,4 +173,25 @@ bool MaintenanceAction::Execute(Event event)
|
||||
}
|
||||
bot->DurabilityRepairAll(false, 1.0f, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AutoGearAction::Execute(Event event)
|
||||
{
|
||||
if (!sPlayerbotAIConfig->autoGearCommand) {
|
||||
botAI->TellMaster("autogear command is not allowed, please check the configuration.");
|
||||
return false;
|
||||
}
|
||||
botAI->TellMaster("I'm auto gearing");
|
||||
uint32 gs = sPlayerbotAIConfig->autoGearScoreLimit == 0 ? 0 :
|
||||
PlayerbotFactory::CalcMixedGearScore(sPlayerbotAIConfig->autoGearScoreLimit, sPlayerbotAIConfig->autoGearQualityLimit);
|
||||
PlayerbotFactory factory(bot,
|
||||
bot->GetLevel(),
|
||||
sPlayerbotAIConfig->autoGearQualityLimit,
|
||||
gs);
|
||||
factory.InitEquipment(true);
|
||||
if (bot->getLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) {
|
||||
factory.ApplyEnchantAndGemsNew();
|
||||
}
|
||||
bot->DurabilityRepairAll(false, 1.0f, false);
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user