From 516366a74df2209a7add4d12a7c1f8d92d78db06 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sat, 3 Jun 2023 23:33:39 +0800 Subject: [PATCH] paladin and attackers value --- src/strategy/paladin/PaladinTriggers.cpp | 3 +- src/strategy/priest/GenericPriestStrategy.cpp | 42 +++-- .../GenericPriestStrategyActionNodeFactory.h | 177 ++++++++++++++++-- src/strategy/priest/HealPriestStrategy.cpp | 76 +++++++- src/strategy/priest/PriestActions.h | 37 +++- src/strategy/priest/PriestAiObjectContext.cpp | 14 +- .../priest/PriestNonCombatStrategy.cpp | 54 ++++-- ...PriestNonCombatStrategyActionNodeFactory.h | 137 ++++++++++++-- src/strategy/priest/ShadowPriestStrategy.cpp | 17 +- src/strategy/values/AttackersValue.cpp | 2 +- 10 files changed, 487 insertions(+), 72 deletions(-) diff --git a/src/strategy/paladin/PaladinTriggers.cpp b/src/strategy/paladin/PaladinTriggers.cpp index ad9eec8b..61566047 100644 --- a/src/strategy/paladin/PaladinTriggers.cpp +++ b/src/strategy/paladin/PaladinTriggers.cpp @@ -4,13 +4,14 @@ #include "PaladinActions.h" #include "PaladinTriggers.h" +#include "PlayerbotAIConfig.h" #include "Playerbots.h" 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 righteousness", target) && !botAI->HasAura("seal of light", target) && !botAI->HasAura("seal of wisdom", 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"); } diff --git a/src/strategy/priest/GenericPriestStrategy.cpp b/src/strategy/priest/GenericPriestStrategy.cpp index 6941b3fe..17ed3d2f 100644 --- a/src/strategy/priest/GenericPriestStrategy.cpp +++ b/src/strategy/priest/GenericPriestStrategy.cpp @@ -16,20 +16,38 @@ void GenericPriestStrategy::InitTriggers(std::vector& triggers) { CombatStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("greater heal", 25.0f), nullptr))); - triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("power word: shield", 61.0f), new NextAction("greater heal", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("remove shadowform", 72.0f), new NextAction("power word: shield", 71.0f), new NextAction("flash heal", 70.0f), nullptr))); - triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, new NextAction("remove shadowform", 62.0f), new NextAction("power word: shield on party", 61.0f), new NextAction("flash heal on party", 60.0f), nullptr))); + // triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("greater heal", 25.0f), nullptr))); + // triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("power word: shield", 61.0f), new NextAction("greater heal", 60.0f), nullptr))); + // triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("remove shadowform", 72.0f), new NextAction("power word: shield", 71.0f), new NextAction("flash heal", 70.0f), nullptr))); + // triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, new NextAction("remove shadowform", 62.0f), new NextAction("power word: shield on party", 61.0f), new NextAction("flash heal on party", 60.0f), nullptr))); triggers.push_back(new TriggerNode("medium threat", NextAction::array(0, new NextAction("fade", 55.0f), nullptr))); // triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("psychic scream", 50.0f), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("inner focus", 42.0f), nullptr))); - triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("symbol of hope", ACTION_EMERGENCY), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("consume magic", 10.0f), nullptr))); - triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("desperate prayer", ACTION_EMERGENCY), nullptr))); - triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("elune's grace", ACTION_EMERGENCY), nullptr))); - triggers.push_back(new TriggerNode("chastise", NextAction::array(0, new NextAction("chastise", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("pain suppression", ACTION_EMERGENCY + 1), nullptr))); - triggers.push_back(new TriggerNode("protect party member", NextAction::array(0, new NextAction("pain suppression on party", ACTION_EMERGENCY), nullptr))); + // triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("inner focus", 42.0f), nullptr))); + // triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("symbol of hope", ACTION_EMERGENCY), nullptr))); + // triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("consume magic", 10.0f), nullptr))); + // triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("desperate prayer", ACTION_EMERGENCY), nullptr))); + // triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("elune's grace", ACTION_EMERGENCY), nullptr))); + // triggers.push_back(new TriggerNode("chastise", NextAction::array(0, new NextAction("chastise", ACTION_INTERRUPT), nullptr))); + triggers.push_back(new TriggerNode( + "critical health", + NextAction::array(0, new NextAction("power word: shield", ACTION_NORMAL), NULL))); + + triggers.push_back(new TriggerNode( + "low health", + NextAction::array(0, new NextAction("power word: shield", ACTION_HIGH), NULL))); + + triggers.push_back(new TriggerNode( + "medium mana", + NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH + 1), NULL))); + + triggers.push_back(new TriggerNode( + "low mana", + NextAction::array(0, new NextAction("hymn of hope", ACTION_HIGH), 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("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr))); } diff --git a/src/strategy/priest/GenericPriestStrategyActionNodeFactory.h b/src/strategy/priest/GenericPriestStrategyActionNodeFactory.h index 8717a5ba..cfa3019d 100644 --- a/src/strategy/priest/GenericPriestStrategyActionNodeFactory.h +++ b/src/strategy/priest/GenericPriestStrategyActionNodeFactory.h @@ -13,31 +13,180 @@ class GenericPriestStrategyActionNodeFactory : public NamedObjectFactory diff --git a/src/strategy/priest/HealPriestStrategy.cpp b/src/strategy/priest/HealPriestStrategy.cpp index 342d53d6..06a1acd2 100644 --- a/src/strategy/priest/HealPriestStrategy.cpp +++ b/src/strategy/priest/HealPriestStrategy.cpp @@ -13,20 +13,80 @@ HealPriestStrategy::HealPriestStrategy(PlayerbotAI* botAI) : GenericPriestStrate NextAction** HealPriestStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("reach party member to heal", 1.0f), nullptr); + return NextAction::array(0, new NextAction("shoot", 10.0f), nullptr); } void HealPriestStrategy::InitTriggers(std::vector& triggers) { GenericPriestStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("almost full health", NextAction::array(0, new NextAction("renew", 43.f), nullptr))); - triggers.push_back(new TriggerNode("party member almost full health", NextAction::array(0, new NextAction("heal on party", 41.0f), new NextAction("renew on party", 40.0f), nullptr))); - triggers.push_back(new TriggerNode("party member medium health", NextAction::array(0, new NextAction("greater heal on party", 47.0f), nullptr))); - triggers.push_back(new TriggerNode("party member low health", NextAction::array(0, new NextAction("power word: shield on party", 51.0f), new NextAction("greater heal on party", 50.0f), nullptr))); + triggers.push_back(new TriggerNode( + "enemy out of spell", + NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), NULL))); + + triggers.push_back(new TriggerNode( + "medium aoe heal", + NextAction::array(0, + new NextAction("circle of healing", ACTION_MEDIUM_HEAL + 8), + new NextAction("power word: shield on almost full health below", ACTION_MEDIUM_HEAL + 7), + new NextAction("prayer of healing on party", ACTION_MEDIUM_HEAL + 6), + NULL))); + + triggers.push_back(new TriggerNode( + "group heal occasion", + NextAction::array(0, + new NextAction("circle of healing", ACTION_MEDIUM_HEAL + 8), + new NextAction("power word: shield on almost full health below", ACTION_MEDIUM_HEAL + 7), + NULL))); + + triggers.push_back(new TriggerNode( + "party member critical health", + NextAction::array(0, + new NextAction("power word: shield on party", ACTION_CRITICAL_HEAL + 6), + new NextAction("penance on party", ACTION_CRITICAL_HEAL + 4), + new NextAction("flash heal on party", ACTION_CRITICAL_HEAL + 3), + new NextAction("prayer of mending on party", ACTION_CRITICAL_HEAL + 2), + NULL))); + + triggers.push_back(new TriggerNode( + "party member low health", + NextAction::array(0, + new NextAction("power word: shield on party", ACTION_MEDIUM_HEAL + 4), + new NextAction("penance on party", ACTION_MEDIUM_HEAL + 2), + new NextAction("circle of healing", ACTION_MEDIUM_HEAL + 2), + new NextAction("prayer of mending on party", ACTION_MEDIUM_HEAL + 1), + new NextAction("flash heal on party", ACTION_MEDIUM_HEAL + 0), + NULL))); + + triggers.push_back(new TriggerNode( + "party member medium health", + NextAction::array(0, + new NextAction("power word: shield on party", ACTION_LIGHT_HEAL + 9), + new NextAction("penance on party", ACTION_LIGHT_HEAL + 7), + new NextAction("circle of healing", ACTION_LIGHT_HEAL + 7), + new NextAction("prayer of mending on party", ACTION_LIGHT_HEAL + 6), + new NextAction("flash heal on party", ACTION_LIGHT_HEAL + 5), + // new NextAction("renew on party", ACTION_LIGHT_HEAL + 8), + NULL))); + + triggers.push_back(new TriggerNode( + "party member almost full health", + NextAction::array(0, + // new NextAction("penance on party", ACTION_LIGHT_HEAL + 3), + new NextAction("renew on party", ACTION_LIGHT_HEAL + 2), + NULL))); + + // triggers.push_back(new TriggerNode("almost full health", NextAction::array(0, new NextAction("renew", 43.f), nullptr))); + // triggers.push_back(new TriggerNode("party member almost full health", NextAction::array(0, new NextAction("heal on party", 41.0f), new NextAction("renew on party", 40.0f), nullptr))); + // triggers.push_back(new TriggerNode("party member medium health", NextAction::array(0, new NextAction("greater heal on party", 47.0f), nullptr))); + // triggers.push_back(new TriggerNode("party member low health", NextAction::array(0, new NextAction("power word: shield on party", 51.0f), new NextAction("greater heal on party", 50.0f), 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), nullptr))); - triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("prayer of mending", 49.0f), nullptr))); - triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("circle of healing", 48.0f), nullptr))); + // triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("prayer of mending", 49.0f), nullptr))); + // triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("circle of healing", 48.0f), nullptr))); triggers.push_back(new TriggerNode("binding heal", NextAction::array(0, new NextAction("binding heal", 52.0f), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH), nullptr))); + // triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH), nullptr))); + + triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("pain suppression", ACTION_EMERGENCY + 1), nullptr))); + triggers.push_back(new TriggerNode("protect party member", NextAction::array(0, new NextAction("pain suppression on party", ACTION_EMERGENCY), nullptr))); + } diff --git a/src/strategy/priest/PriestActions.h b/src/strategy/priest/PriestActions.h index 3fe1d4b4..09f6e502 100644 --- a/src/strategy/priest/PriestActions.h +++ b/src/strategy/priest/PriestActions.h @@ -52,7 +52,7 @@ HEAL_PARTY_ACTION(CastRenewOnPartyAction, "renew"); HEAL_PARTY_ACTION(CastPrayerOfMendingAction, "prayer of mending"); HEAL_PARTY_ACTION(CastBindingHealAction, "binding heal"); -BUFF_ACTION(CastPrayerOfHealingAction, "prayer of healing"); +HEAL_PARTY_ACTION(CastPrayerOfHealingAction, "prayer of healing"); AOE_HEAL_ACTION(CastLightwellAction, "lightwell"); AOE_HEAL_ACTION(CastCircleOfHealingAction, "circle of healing"); @@ -68,7 +68,7 @@ CURE_PARTY_ACTION(CastAbolishDiseaseOnPartyAction, "abolish disease", DISPEL_DIS DEBUFF_CHECKISOWNER_ACTION(CastHolyFireAction, "holy fire"); // shadow 2.4.3 -BUFF_ACTION(CastShadowfiendAction, "shadowfiend"); +// BUFF_ACTION(CastShadowfiendAction, "shadowfiend"); SPELL_ACTION(CastShadowWordDeathAction, "shadow word: death"); // shadow @@ -116,4 +116,37 @@ class CastRemoveShadowformAction : public Action bool Execute(Event event) override; }; +class CastDispersionAction : public CastSpellAction +{ +public: + CastDispersionAction(PlayerbotAI* ai) : CastSpellAction(ai, "dispersion") {} + virtual std::string const GetTargetName() { return "self target"; } +}; + +class CastPenanceOnPartyAction : public HealPartyMemberAction +{ +public: + CastPenanceOnPartyAction(PlayerbotAI* ai) : HealPartyMemberAction(ai, "penance") {} +}; + +class CastHymnOfHopeAction : public CastSpellAction +{ +public: + CastHymnOfHopeAction(PlayerbotAI* ai) : CastSpellAction(ai, "hymn of hope") {} + virtual std::string const GetTargetName() { return "self target"; } +}; + +class CastDivineHymnAction : public CastSpellAction +{ +public: + CastDivineHymnAction(PlayerbotAI* ai) : CastSpellAction(ai, "divine hymn") {} + virtual std::string const GetTargetName() { return "self target"; } +}; + +class CastShadowfiendAction : public CastSpellAction +{ +public: + CastShadowfiendAction(PlayerbotAI* ai) : CastSpellAction(ai, "shadowfiend") {} + virtual std::string const GetTargetName() { return "current target"; } +}; #endif diff --git a/src/strategy/priest/PriestAiObjectContext.cpp b/src/strategy/priest/PriestAiObjectContext.cpp index f2fa28a6..687a9c3e 100644 --- a/src/strategy/priest/PriestAiObjectContext.cpp +++ b/src/strategy/priest/PriestAiObjectContext.cpp @@ -182,7 +182,7 @@ class PriestAiObjectContextInternal : public NamedObjectContext creators["psychic scream"] = &PriestAiObjectContextInternal::psychic_scream; creators["vampiric touch"] = &PriestAiObjectContextInternal::vampiric_touch; creators["vampiric embrace"] = &PriestAiObjectContextInternal::vampiric_embrace; - //creators["dispersion"] = &PriestAiObjectContextInternal::dispersion; + creators["dispersion"] = &PriestAiObjectContextInternal::dispersion; creators["shadow protection"] = &PriestAiObjectContextInternal::shadow_protection; creators["shadow protection on party"] = &PriestAiObjectContextInternal::shadow_protection_on_party; creators["shackle undead"] = &PriestAiObjectContextInternal::shackle_undead; @@ -193,7 +193,7 @@ class PriestAiObjectContextInternal : public NamedObjectContext creators["silence on enemy healer"] = &PriestAiObjectContextInternal::silence_on_enemy_healer; creators["mana burn"] = &PriestAiObjectContextInternal::mana_burn; creators["levitate"] = &PriestAiObjectContextInternal::levitate; - creators["prayer of healing"] = &PriestAiObjectContextInternal::prayer_of_healing; + creators["prayer of healing on party"] = &PriestAiObjectContextInternal::prayer_of_healing; creators["lightwell"] = &PriestAiObjectContextInternal::lightwell; creators["mind soothe"] = &PriestAiObjectContextInternal::mind_soothe; creators["touch of weakness"] = &PriestAiObjectContextInternal::touch_of_weakness; @@ -213,8 +213,11 @@ class PriestAiObjectContextInternal : public NamedObjectContext creators["mass dispel"] = &PriestAiObjectContextInternal::mass_dispel; creators["pain suppression"] = &PriestAiObjectContextInternal::pain_suppression; creators["pain suppression on party"] = &PriestAiObjectContextInternal::pain_suppression_on_party; - creators["prayer of mending"] = &PriestAiObjectContextInternal::prayer_of_mending; + creators["prayer of mending on party"] = &PriestAiObjectContextInternal::prayer_of_mending; creators["binding heal"] = &PriestAiObjectContextInternal::binding_heal; + creators["penance on party"] = &PriestAiObjectContextInternal::penance_on_party; + creators["hymn of hope"] = &PriestAiObjectContextInternal::hymn_of_hope; + creators["divine hymn"] = &PriestAiObjectContextInternal::divine_hymn; } private: @@ -222,7 +225,7 @@ class PriestAiObjectContextInternal : public NamedObjectContext static Action* shadow_protection(PlayerbotAI* botAI) { return new CastShadowProtectionAction(botAI); } static Action* power_infusion(PlayerbotAI* botAI) { return new CastPowerInfusionAction(botAI); } static Action* inner_focus(PlayerbotAI* botAI) { return new CastInnerFocusAction(botAI); } - //static Action* dispersion(PlayerbotAI* botAI) { return new CastDispersionAction(botAI); } + static Action* dispersion(PlayerbotAI* botAI) { return new CastDispersionAction(botAI); } static Action* vampiric_embrace(PlayerbotAI* botAI) { return new CastVampiricEmbraceAction(botAI); } static Action* vampiric_touch(PlayerbotAI* botAI) { return new CastVampiricTouchAction(botAI); } static Action* psychic_scream(PlayerbotAI* botAI) { return new CastPsychicScreamAction(botAI); } @@ -293,6 +296,9 @@ class PriestAiObjectContextInternal : public NamedObjectContext static Action* chastise(PlayerbotAI* botAI) { return new CastChastiseAction(botAI); } static Action* consume_magic(PlayerbotAI* botAI) { return new CastConsumeMagicAction(botAI); } static Action* symbol_of_hope(PlayerbotAI* botAI) { return new CastSymbolOfHopeAction(botAI); } + static Action* penance_on_party(PlayerbotAI* ai) { return new CastPenanceOnPartyAction(ai); } + static Action* hymn_of_hope(PlayerbotAI* ai) { return new CastHymnOfHopeAction(ai); } + static Action* divine_hymn(PlayerbotAI* ai) { return new CastDivineHymnAction(ai); } }; PriestAiObjectContext::PriestAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI) diff --git a/src/strategy/priest/PriestNonCombatStrategy.cpp b/src/strategy/priest/PriestNonCombatStrategy.cpp index 84d84c1b..6e858192 100644 --- a/src/strategy/priest/PriestNonCombatStrategy.cpp +++ b/src/strategy/priest/PriestNonCombatStrategy.cpp @@ -15,17 +15,49 @@ void PriestNonCombatStrategy::InitTriggers(std::vector& triggers) { NonCombatStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("power word: fortitude", NextAction::array(0, new NextAction("power word: fortitude", 12.0f), nullptr))); - triggers.push_back(new TriggerNode("divine spirit", NextAction::array(0, new NextAction("divine spirit", 14.0f), nullptr))); + // triggers.push_back(new TriggerNode("power word: fortitude", NextAction::array(0, new NextAction("power word: fortitude", 12.0f), nullptr))); + // triggers.push_back(new TriggerNode("divine spirit", NextAction::array(0, new NextAction("divine spirit", 14.0f), nullptr))); triggers.push_back(new TriggerNode("inner fire", NextAction::array(0, new NextAction("inner fire", 10.0f), nullptr))); - triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("greater heal", 70.0f), nullptr))); - triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, new NextAction("greater heal on party", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("renew", 41.0f), nullptr))); - triggers.push_back(new TriggerNode("party member medium health", NextAction::array(0, new NextAction("renew on party", 40.0f), nullptr))); - triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("lightwell", 42.f), nullptr))); + // triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("greater heal", 70.0f), nullptr))); + // triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, new NextAction("greater heal on party", 60.0f), nullptr))); + // triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("renew", 41.0f), nullptr))); + // triggers.push_back(new TriggerNode("party member medium health", NextAction::array(0, new NextAction("renew on party", 40.0f), nullptr))); + // triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("lightwell", 42.f), nullptr))); triggers.push_back(new TriggerNode("party member dead", NextAction::array(0, new NextAction("remove shadowform", 51.0f), new NextAction("resurrection", 50.0f), nullptr))); //triggers.push_back(new TriggerNode("swimming", NextAction::array(0, new NextAction("levitate", 1.0f), nullptr))); triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr))); + triggers.push_back(new TriggerNode( + "party member critical health", + NextAction::array(0, + new NextAction("renew on party", ACTION_CRITICAL_HEAL + 3), + new NextAction("penance on party", ACTION_CRITICAL_HEAL + 2), + new NextAction("greater heal on party", ACTION_CRITICAL_HEAL + 1), + NULL))); + + triggers.push_back(new TriggerNode( + "party member low health", + NextAction::array(0, + new NextAction("renew on party", ACTION_MEDIUM_HEAL + 3), + new NextAction("penance on party", ACTION_MEDIUM_HEAL + 2), + new NextAction("greater heal on party", ACTION_MEDIUM_HEAL + 1), + NULL))); + + triggers.push_back(new TriggerNode( + "party member medium health", + NextAction::array(0, + new NextAction("renew on party", ACTION_LIGHT_HEAL + 9), + new NextAction("penance on party", ACTION_LIGHT_HEAL + 8), + NULL))); + + triggers.push_back(new TriggerNode( + "party member almost full health", + NextAction::array(0, + new NextAction("renew on party", ACTION_LIGHT_HEAL + 3), + NULL))); + + triggers.push_back(new TriggerNode( + "medium aoe heal", + NextAction::array(0, new NextAction("circle of healing", 27.0f), NULL))); } void PriestBuffStrategy::InitTriggers(std::vector& triggers) @@ -36,9 +68,9 @@ void PriestBuffStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("prayer of spirit on party", NextAction::array(0, new NextAction("prayer of spirit on party", 14.0f), nullptr))); triggers.push_back(new TriggerNode("power word: fortitude on party", NextAction::array(0, new NextAction("power word: fortitude on party", 11.0f), nullptr))); triggers.push_back(new TriggerNode("divine spirit on party", NextAction::array(0, new NextAction("divine spirit on party", 13.0f), nullptr))); - triggers.push_back(new TriggerNode("fear ward", NextAction::array(0, new NextAction("fear ward", 10.0f), nullptr))); - triggers.push_back(new TriggerNode("touch of weakness", NextAction::array(0, new NextAction("touch of weakness", 10.0f), nullptr))); - triggers.push_back(new TriggerNode("shadowguard", NextAction::array(0, new NextAction("shadowguard", 10.0f), nullptr))); + // triggers.push_back(new TriggerNode("fear ward", NextAction::array(0, new NextAction("fear ward", 10.0f), nullptr))); + // triggers.push_back(new TriggerNode("touch of weakness", NextAction::array(0, new NextAction("touch of weakness", 10.0f), nullptr))); + // triggers.push_back(new TriggerNode("shadowguard", NextAction::array(0, new NextAction("shadowguard", 10.0f), nullptr))); } void PriestShadowResistanceStrategy::InitTriggers(std::vector& triggers) @@ -47,5 +79,5 @@ void PriestShadowResistanceStrategy::InitTriggers(std::vector& tri triggers.push_back(new TriggerNode("shadow protection", NextAction::array(0, new NextAction("shadow protection", 12.0f), nullptr))); triggers.push_back(new TriggerNode("shadow protection on party", NextAction::array(0, new NextAction("shadow protection on party", 11.0f), nullptr))); - triggers.push_back(new TriggerNode("shadow protection on party", NextAction::array(0, new NextAction("shadow protection on party", 10.0f), nullptr))); + // triggers.push_back(new TriggerNode("shadow protection on party", NextAction::array(0, new NextAction("shadow protection on party", 10.0f), nullptr))); } diff --git a/src/strategy/priest/PriestNonCombatStrategyActionNodeFactory.h b/src/strategy/priest/PriestNonCombatStrategyActionNodeFactory.h index 490a8d07..3d2bece1 100644 --- a/src/strategy/priest/PriestNonCombatStrategyActionNodeFactory.h +++ b/src/strategy/priest/PriestNonCombatStrategyActionNodeFactory.h @@ -15,27 +15,138 @@ class PriestNonCombatStrategyActionNodeFactory : public NamedObjectFactory& triggers) @@ -26,9 +31,9 @@ void ShadowPriestStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("vampiric embrace", NextAction::array(0, new NextAction("vampiric embrace", 16.0f), nullptr))); triggers.push_back(new TriggerNode("silence", NextAction::array(0, new NextAction("silence", ACTION_INTERRUPT + 1), nullptr))); triggers.push_back(new TriggerNode("silence on enemy healer", NextAction::array(0, new NextAction("silence on enemy healer", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode("shadowfiend", NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH), nullptr))); - triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("mana burn", ACTION_HIGH), nullptr))); + // triggers.push_back(new TriggerNode("shadowfiend", NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH), nullptr))); + // triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH), nullptr))); + // triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("mana burn", ACTION_HIGH), nullptr))); } void ShadowPriestAoeStrategy::InitTriggers(std::vector& triggers) @@ -41,6 +46,6 @@ void ShadowPriestDebuffStrategy::InitTriggers(std::vector& trigger triggers.push_back(new TriggerNode("devouring plague", NextAction::array(0, new NextAction("devouring plague", 13.0f), nullptr))); triggers.push_back(new TriggerNode("vampiric touch", NextAction::array(0, new NextAction("vampiric touch", 11.0f), nullptr))); triggers.push_back(new TriggerNode("shadow word: pain", NextAction::array(0, new NextAction("shadow word: pain", 12.0f), nullptr))); - triggers.push_back(new TriggerNode("feedback", NextAction::array(0, new NextAction("feedback", 80.0f), nullptr))); - triggers.push_back(new TriggerNode("hex of weakness", NextAction::array(0, new NextAction("hex of weakness", 10.0f), nullptr))); + // triggers.push_back(new TriggerNode("feedback", NextAction::array(0, new NextAction("feedback", 80.0f), nullptr))); + // triggers.push_back(new TriggerNode("hex of weakness", NextAction::array(0, new NextAction("hex of weakness", 10.0f), nullptr))); } diff --git a/src/strategy/values/AttackersValue.cpp b/src/strategy/values/AttackersValue.cpp index e83dedea..d661046c 100644 --- a/src/strategy/values/AttackersValue.cpp +++ b/src/strategy/values/AttackersValue.cpp @@ -135,7 +135,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range) bool AttackersValue::IsValidTarget(Unit *attacker, Player *bot) { - return IsPossibleTarget(attacker, bot) && (attacker->GetThreatMgr().getCurrentVictim() || attacker->GetGuidValue(UNIT_FIELD_TARGET) || + return attacker->IsVisible() && IsPossibleTarget(attacker, bot) && (attacker->GetThreatMgr().getCurrentVictim() || attacker->GetGuidValue(UNIT_FIELD_TARGET) || attacker->GetGUID().IsPlayer() || attacker->GetGUID() == GET_PLAYERBOT_AI(bot)->GetAiObjectContext()->GetValue("pull target")->Get()); }