mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-18 03:05:43 +00:00
Maintenance command
This commit is contained in:
@@ -114,6 +114,7 @@ class ChatActionContext : public NamedObjectContext<Action>
|
||||
creators["nc"] = &ChatActionContext::nc;
|
||||
creators["de"] = &ChatActionContext::dead;
|
||||
creators["trainer"] = &ChatActionContext::trainer;
|
||||
creators["maintenance"] = &ChatActionContext::maintenance;
|
||||
creators["attack my target"] = &ChatActionContext::attack_my_target;
|
||||
creators["chat"] = &ChatActionContext::chat;
|
||||
creators["home"] = &ChatActionContext::home;
|
||||
@@ -211,6 +212,7 @@ class ChatActionContext : public NamedObjectContext<Action>
|
||||
static Action* chat(PlayerbotAI* botAI) { return new ChangeChatAction(botAI); }
|
||||
static Action* attack_my_target(PlayerbotAI* botAI) { return new AttackMyTargetAction(botAI); }
|
||||
static Action* trainer(PlayerbotAI* botAI) { return new TrainerAction(botAI); }
|
||||
static Action* maintenance(PlayerbotAI* botAI) { return new MaintenanceAction(botAI); }
|
||||
static Action* co(PlayerbotAI* botAI) { return new ChangeCombatStrategyAction(botAI); }
|
||||
static Action* nc(PlayerbotAI* botAI) { return new ChangeNonCombatStrategyAction(botAI); }
|
||||
static Action* dead(PlayerbotAI* botAI) { return new ChangeDeadStrategyAction(botAI); }
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -28,4 +28,10 @@ class TrainerAction : public Action
|
||||
void TellFooter(uint32 totalCost);
|
||||
};
|
||||
|
||||
class MaintenanceAction : public Action
|
||||
{
|
||||
public:
|
||||
MaintenanceAction(PlayerbotAI* botAI) : Action(botAI, "maintenance") { }
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -88,6 +88,7 @@ ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : Pas
|
||||
supported.push_back("nc");
|
||||
supported.push_back("de");
|
||||
supported.push_back("trainer");
|
||||
supported.push_back("maintenance");
|
||||
supported.push_back("chat");
|
||||
supported.push_back("home");
|
||||
supported.push_back("destroy");
|
||||
|
||||
@@ -11,8 +11,8 @@ bool SealTrigger::IsActive()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
return !botAI->HasAura("seal of justice", target) && !botAI->HasAura("seal of command", target) && !botAI->HasAura("seal of vengeance", target) &&
|
||||
!botAI->HasAura("seal of corruption", target) && !botAI->HasAura("seal of righteousness", target) && !botAI->HasAura("seal of light", target) && (!botAI->HasAura("seal of wisdom", target) || AI_VALUE2(uint8, "mana", "self target") > 70) &&
|
||||
AI_VALUE2(bool, "combat", "self target");
|
||||
!botAI->HasAura("seal of corruption", target) && !botAI->HasAura("seal of righteousness", target) && !botAI->HasAura("seal of light", target) &&
|
||||
(!botAI->HasAura("seal of wisdom", target) || AI_VALUE2(uint8, "mana", "self target") > 70);
|
||||
}
|
||||
|
||||
bool CrusaderAuraTrigger::IsActive()
|
||||
|
||||
@@ -54,6 +54,7 @@ class ChatTriggerContext : public NamedObjectContext<Trigger>
|
||||
creators["nc"] = &ChatTriggerContext::nc;
|
||||
creators["de"] = &ChatTriggerContext::dead;
|
||||
creators["trainer"] = &ChatTriggerContext::trainer;
|
||||
creators["maintenance"] = &ChatTriggerContext::maintenance;
|
||||
creators["attack"] = &ChatTriggerContext::attack;
|
||||
creators["chat"] = &ChatTriggerContext::chat;
|
||||
creators["accept"] = &ChatTriggerContext::accept;
|
||||
@@ -164,6 +165,7 @@ class ChatTriggerContext : public NamedObjectContext<Trigger>
|
||||
static Trigger* chat(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "chat"); }
|
||||
static Trigger* attack(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "attack"); }
|
||||
static Trigger* trainer(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "trainer"); }
|
||||
static Trigger* maintenance(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "maintenance"); }
|
||||
static Trigger* co(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "co"); }
|
||||
static Trigger* nc(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "nc"); }
|
||||
static Trigger* dead(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "de"); }
|
||||
|
||||
Reference in New Issue
Block a user