bots in BWL will now use hourglass-sand to cure affliction-bronze

This commit is contained in:
Fuzz
2024-09-10 12:06:55 +10:00
parent 4b948520d7
commit 16e7cf7ab0
7 changed files with 40 additions and 11 deletions

View File

@@ -17,6 +17,7 @@ public:
{
creators["bwl check onyxia scale cloak"] = &RaidActionContext::bwl_check_onyxia_scale_cloak;
creators["bwl turn off suppression device"] = &RaidActionContext::bwl_turn_off_suppression_device;
creators["bwl use hourglass sand"] = &RaidActionContext::bwl_use_hourglass_sand;
}
private:
@@ -28,6 +29,10 @@ private:
{
return new BwlTurnOffSuppressionDeviceAction(botAI);
}
static Action* bwl_use_hourglass_sand(PlayerbotAI* botAI)
{
return new BwlUseHourglassSandAction(botAI);
}
};
#endif

View File

@@ -14,10 +14,14 @@
class RaidTriggerContext : public NamedObjectContext<Trigger>
{
public:
RaidTriggerContext() { creators["bwl suppression device"] = &RaidTriggerContext::bwl_suppression_device; }
RaidTriggerContext() {
creators["bwl suppression device"] = &RaidTriggerContext::bwl_suppression_device;
creators["bwl affliction bronze"] = &RaidTriggerContext::bwl_affliction_bronze;
}
private:
static Trigger* bwl_suppression_device(PlayerbotAI* ai) { return new BwlSuppressionDeviceTrigger(ai); }
static Trigger* bwl_affliction_bronze(PlayerbotAI* ai) { return new BwlAfflictionBronzeTrigger(ai); }
};
#endif
#endif

View File

@@ -27,4 +27,6 @@ bool BwlTurnOffSuppressionDeviceAction::Execute(Event event)
go->SetGoState(GO_STATE_ACTIVE);
}
return true;
}
}
bool BwlUseHourglassSandAction::Execute(Event event) { return botAI->CastSpell(23645, bot); }

View File

@@ -23,4 +23,11 @@ public:
bool Execute(Event event) override;
};
#endif
class BwlUseHourglassSandAction : public Action
{
public:
BwlUseHourglassSandAction(PlayerbotAI* botAI) : Action(botAI, "bwl use hourglass sand") {}
bool Execute(Event event) override;
};
#endif

View File

@@ -4,10 +4,12 @@
void RaidBwlStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode(
"often", NextAction::array(0, new NextAction("bwl check onyxia scale cloak", ACTION_RAID), NULL)));
triggers.push_back(new TriggerNode("often",
NextAction::array(0, new NextAction("bwl check onyxia scale cloak", ACTION_RAID), NULL)));
triggers.push_back(
new TriggerNode("bwl suppression device",
triggers.push_back(new TriggerNode("bwl suppression device",
NextAction::array(0, new NextAction("bwl turn off suppression device", ACTION_RAID), NULL)));
}
triggers.push_back(new TriggerNode("bwl affliction bronze",
NextAction::array(0, new NextAction("bwl use hourglass sand", ACTION_RAID), NULL)));
}

View File

@@ -19,4 +19,6 @@ bool BwlSuppressionDeviceTrigger::IsActive()
return true;
}
return false;
}
}
bool BwlAfflictionBronzeTrigger::IsActive() { return bot->HasAura(23170); }

View File

@@ -12,4 +12,11 @@ public:
bool IsActive() override;
};
#endif
class BwlAfflictionBronzeTrigger : public Trigger
{
public:
BwlAfflictionBronzeTrigger(PlayerbotAI* botAI) : Trigger(botAI, "bwl affliction bronze") {}
bool IsActive() override;
};
#endif