Maintenance command

This commit is contained in:
Yunfan Li
2024-03-04 17:13:05 +08:00
parent 6ea696d8a1
commit 3db6f05eb7
11 changed files with 58 additions and 11 deletions

View File

@@ -5,6 +5,7 @@
#include "TrainerAction.h"
#include "BudgetValues.h"
#include "Event.h"
#include "PlayerbotFactory.h"
#include "Playerbots.h"
void TrainerAction::Learn(uint32 cost, TrainerSpell const* tSpell, std::ostringstream& msg)
@@ -146,3 +147,24 @@ void TrainerAction::TellFooter(uint32 totalCost)
botAI->TellMaster(out);
}
}
bool MaintenanceAction::Execute(Event event)
{
if (!sPlayerbotAIConfig->maintenanceCommand)
return false;
botAI->TellMaster("maintenance");
PlayerbotFactory factory(bot, bot->GetLevel());
factory.InitBags(false);
factory.InitAmmo();
factory.InitFood();
factory.InitReagents();
factory.InitTalentsTree(true);
factory.InitPet();
factory.InitPetTalents();
factory.InitClassSpells();
factory.InitAvailableSpells();
factory.InitSkills();
factory.InitMounts();
bot->DurabilityRepairAll(false, 1.0f, false);
return true;
}