shaman, rogue strategy port, use item action.

This commit is contained in:
Yunfan Li
2023-06-08 10:37:13 +08:00
parent 231b0b51e4
commit 89d24b646c
34 changed files with 664 additions and 109 deletions

View File

@@ -122,6 +122,9 @@ void CasterDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("moonfire", NextAction::array(0, new NextAction("moonfire", ACTION_NORMAL + 4), nullptr)));
triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 5), NULL)));
triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 49.0f), NULL)));
triggers.push_back(new TriggerNode(
"party member remove curse",
NextAction::array(0, new NextAction("remove curse on party", ACTION_DISPEL + 7), NULL)));
}
void CasterDruidAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@@ -253,4 +253,10 @@ class CastPartyNourishAction : public HealPartyMemberAction
public:
CastPartyNourishAction(PlayerbotAI* ai) : HealPartyMemberAction(ai, "nourish") {}
};
class CastDruidRemoveCurseOnPartyAction : public CurePartyMemberAction
{
public:
CastDruidRemoveCurseOnPartyAction(PlayerbotAI* ai) : CurePartyMemberAction(ai, "remove curse", DISPEL_CURSE) {}
};
#endif

View File

@@ -95,6 +95,7 @@ class DruidTriggerFactoryInternal : public NamedObjectContext<Trigger>
creators["eclipse (lunar)"] = &DruidTriggerFactoryInternal::eclipse_lunar;
creators["bash on enemy healer"] = &DruidTriggerFactoryInternal::bash_on_enemy_healer;
creators["nature's swiftness"] = &DruidTriggerFactoryInternal::natures_swiftness;
creators["party member remove curse"] = &DruidTriggerFactoryInternal::party_member_remove_curse;
}
private:
@@ -123,6 +124,7 @@ class DruidTriggerFactoryInternal : public NamedObjectContext<Trigger>
static Trigger* tree_form(PlayerbotAI* botAI) { return new TreeFormTrigger(botAI); }
static Trigger* bash_on_enemy_healer(PlayerbotAI* botAI) { return new BashInterruptEnemyHealerSpellTrigger(botAI); }
static Trigger* omen_of_clarity(PlayerbotAI* botAI) { return new OmenOfClarityTrigger(botAI); }
static Trigger* party_member_remove_curse(PlayerbotAI* ai) { return new DruidPartyMemberRemoveCurseTrigger(ai); }
};
class DruidAiObjectContextInternal : public NamedObjectContext<Action>
@@ -202,6 +204,7 @@ class DruidAiObjectContextInternal : public NamedObjectContext<Action>
creators["wild growth on party"] = &DruidAiObjectContextInternal::wild_growth_on_party;
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;
}
private:
@@ -276,6 +279,7 @@ class DruidAiObjectContextInternal : public NamedObjectContext<Action>
static Action* wild_growth_on_party(PlayerbotAI* ai) { return new CastWildGrowthOnPartyAction(ai); }
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); }
};
DruidAiObjectContext::DruidAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)

View File

@@ -178,4 +178,9 @@ class NaturesSwiftnessTrigger : public BuffTrigger
NaturesSwiftnessTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "nature's swiftness") { }
};
class DruidPartyMemberRemoveCurseTrigger : public PartyMemberNeedCureTrigger
{
public:
DruidPartyMemberRemoveCurseTrigger(PlayerbotAI* ai) : PartyMemberNeedCureTrigger(ai, "druid remove curse", DISPEL_CURSE) {}
};
#endif

View File

@@ -23,7 +23,9 @@ void HealDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), nullptr)));
triggers.push_back(new TriggerNode("tree form", NextAction::array(0, new NextAction("tree form", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode("party member to heal out of spell range", NextAction::array(0, new NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 9), nullptr)));
triggers.push_back(new TriggerNode(
"party member remove curse",
NextAction::array(0, new NextAction("remove curse on party", ACTION_DISPEL + 7), NULL)));
// CRITICAL
triggers.push_back(new TriggerNode(
"party member critical health",