feat(strategy): druid aoe strategy optimize

This commit is contained in:
Yunfan Li
2023-07-05 15:12:23 +08:00
parent b8f580871a
commit e087fb6533
3 changed files with 27 additions and 3 deletions

View File

@@ -106,8 +106,9 @@ NextAction** CasterDruidStrategy::getDefaultActions()
{
return NextAction::array(0,
new NextAction("starfall", ACTION_NORMAL + 3),
new NextAction("starfire", ACTION_NORMAL + 2),
new NextAction("wrath", ACTION_NORMAL + 1), nullptr);
new NextAction("wrath", ACTION_NORMAL + 1),
new NextAction("starfire", ACTION_NORMAL),
nullptr);
}
void CasterDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
@@ -129,7 +130,14 @@ void CasterDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
void CasterDruidAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("high aoe", NextAction::array(0, new NextAction("starfall", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("high aoe", NextAction::array(0, new NextAction("hurricane", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode(
"light aoe",
NextAction::array(0,
new NextAction("starfall", ACTION_NORMAL + 4),
new NextAction("insect swarm on attacker", ACTION_NORMAL + 3),
new NextAction("moonfire on attacker", ACTION_NORMAL + 2),
NULL)));
}
void CasterDruidDebuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@@ -259,4 +259,16 @@ class CastDruidRemoveCurseOnPartyAction : public CurePartyMemberAction
public:
CastDruidRemoveCurseOnPartyAction(PlayerbotAI* ai) : CurePartyMemberAction(ai, "remove curse", DISPEL_CURSE) {}
};
class CastInsectSwarmOnAttackerAction : public CastDebuffSpellOnAttackerAction
{
public:
CastInsectSwarmOnAttackerAction(PlayerbotAI* ai) : CastDebuffSpellOnAttackerAction(ai, "insect swarm") {}
};
class CastMoonfireOnAttackerAction : public CastDebuffSpellOnAttackerAction
{
public:
CastMoonfireOnAttackerAction(PlayerbotAI* ai) : CastDebuffSpellOnAttackerAction(ai, "moonfire") {}
};
#endif

View File

@@ -205,6 +205,8 @@ class DruidAiObjectContextInternal : public NamedObjectContext<Action>
creators["swiftmend on party"] = &DruidAiObjectContextInternal::swiftmend_on_party;
creators["nourish on party"] = &DruidAiObjectContextInternal::nourish_on_party;
creators["remove curse on party"] = &DruidAiObjectContextInternal::remove_curse_on_party;
creators["insect swarm on attacker"] = &DruidAiObjectContextInternal::insect_swarm_on_attacker;
creators["moonfire on attacker"] = &DruidAiObjectContextInternal::moonfire_on_attacker;
}
private:
@@ -280,6 +282,8 @@ class DruidAiObjectContextInternal : public NamedObjectContext<Action>
static Action* swiftmend_on_party(PlayerbotAI *ai) { return new CastPartySwiftmendAction(ai); }
static Action* nourish_on_party(PlayerbotAI *ai) { return new CastPartyNourishAction(ai); }
static Action* remove_curse_on_party(PlayerbotAI *ai) { return new CastDruidRemoveCurseOnPartyAction(ai); }
static Action* insect_swarm_on_attacker(PlayerbotAI* ai) { return new CastInsectSwarmOnAttackerAction(ai); }
static Action* moonfire_on_attacker(PlayerbotAI* ai) { return new CastMoonfireOnAttackerAction(ai); }
};
DruidAiObjectContext::DruidAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)