diff --git a/src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h b/src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h index 1dadc451..5ed43bd7 100644 --- a/src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h +++ b/src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h @@ -43,7 +43,6 @@ class GenericPaladinStrategyActionNodeFactory : public NamedObjectFactoryGetVictim(); +} + +bool CastMeleeConsecrationAction::isUseful() +{ + Unit* target = GetTarget(); + // float dis = distance + CONTACT_DISTANCE; + return target && bot->IsWithinCombatRange(target, sPlayerbotAIConfig->meleeDistance); // sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", GetTargetName()), distance); } \ No newline at end of file diff --git a/src/strategy/paladin/PaladinActions.h b/src/strategy/paladin/PaladinActions.h index c890e47c..9c764aff 100644 --- a/src/strategy/paladin/PaladinActions.h +++ b/src/strategy/paladin/PaladinActions.h @@ -44,6 +44,13 @@ HEAL_PARTY_ACTION(CastHolyShockOnPartyAction, "holy shock"); // consecration MELEE_ACTION(CastConsecrationAction, "consecration"); +class CastMeleeConsecrationAction : public CastSpellAction +{ + public: + CastMeleeConsecrationAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "consecration") {} + bool isUseful() override; +}; + // repentance SNARE_ACTION(CastRepentanceSnareAction, "repentance"); DEBUFF_ACTION(CastRepentanceAction, "repentance"); diff --git a/src/strategy/paladin/PaladinAiObjectContext.cpp b/src/strategy/paladin/PaladinAiObjectContext.cpp index a4250eaa..c22bdbe3 100644 --- a/src/strategy/paladin/PaladinAiObjectContext.cpp +++ b/src/strategy/paladin/PaladinAiObjectContext.cpp @@ -207,6 +207,7 @@ class PaladinAiObjectContextInternal : public NamedObjectContext creators["concentration aura"] = &PaladinAiObjectContextInternal::concentration_aura; creators["holy wrath"] = &PaladinAiObjectContextInternal::holy_wrath; creators["consecration"] = &PaladinAiObjectContextInternal::consecration; + creators["melee consecration"] = &PaladinAiObjectContextInternal::melee_consecration; creators["cleanse disease"] = &PaladinAiObjectContextInternal::cleanse_disease; creators["cleanse poison"] = &PaladinAiObjectContextInternal::cleanse_poison; creators["cleanse magic"] = &PaladinAiObjectContextInternal::cleanse_magic; @@ -288,6 +289,7 @@ class PaladinAiObjectContextInternal : public NamedObjectContext static Action* concentration_aura(PlayerbotAI* botAI) { return new CastConcentrationAuraAction(botAI); } static Action* holy_wrath(PlayerbotAI* botAI) { return new CastHolyWrathAction(botAI); } static Action* consecration(PlayerbotAI* botAI) { return new CastConsecrationAction(botAI); } + static Action* melee_consecration(PlayerbotAI* botAI) { return new CastMeleeConsecrationAction(botAI); } static Action* cleanse_poison(PlayerbotAI* botAI) { return new CastCleansePoisonAction(botAI); } static Action* cleanse_disease(PlayerbotAI* botAI) { return new CastCleanseDiseaseAction(botAI); } static Action* cleanse_magic(PlayerbotAI* botAI) { return new CastCleanseMagicAction(botAI); }