mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix melee consecration
This commit is contained in:
@@ -43,7 +43,6 @@ class GenericPaladinStrategyActionNodeFactory : public NamedObjectFactory<Action
|
||||
creators["taunt spell"] = &hand_of_reckoning;
|
||||
creators["righteous defense"] = &righteous_defense;
|
||||
creators["avenger's shield"] = &avengers_shield;
|
||||
creators["melee consecration"] = &melee_consecration;
|
||||
}
|
||||
private:
|
||||
static ActionNode* blessing_of_sanctuary(PlayerbotAI* ai)
|
||||
@@ -235,13 +234,6 @@ class GenericPaladinStrategyActionNodeFactory : public NamedObjectFactory<Action
|
||||
/*A*/ NextAction::array(0, new NextAction("seal of righteousness"), NULL),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
static ActionNode* melee_consecration([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("consecration",
|
||||
/*P*/ NextAction::array(0, new NextAction("reach melee"), nullptr),
|
||||
/*A*/ nullptr,
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "AiFactory.h"
|
||||
#include "Event.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "PlayerbotFactory.h"
|
||||
#include "Playerbots.h"
|
||||
#include "SharedDefines.h"
|
||||
@@ -147,3 +148,10 @@ Unit* CastRighteousDefenseAction::GetTarget()
|
||||
}
|
||||
return current_target->GetVictim();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
@@ -207,6 +207,7 @@ class PaladinAiObjectContextInternal : public NamedObjectContext<Action>
|
||||
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<Action>
|
||||
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); }
|
||||
|
||||
Reference in New Issue
Block a user