- Added Blessing of Sanctuary to paladin health buff strategy (#1345)

- Removed Blessing of Sanctuary from paladin dps buff strategy
- Added health buff strategy as default for protection paladin
This commit is contained in:
kadeshar
2025-06-06 12:10:45 +02:00
committed by GitHub
parent 9986469042
commit fc6309c521
7 changed files with 67 additions and 33 deletions

View File

@@ -531,7 +531,7 @@ void AiFactory::AddDefaultNonCombatStrategies(Player* player, PlayerbotAI* const
nonCombatEngine->addStrategiesNoInit("bthreat", "tank assist", "barmor", nullptr);
if (player->GetLevel() >= 20)
{
nonCombatEngine->addStrategy("bstats", false);
nonCombatEngine->addStrategy("bhealth", false);
}
else
{

View File

@@ -39,6 +39,7 @@ public:
creators["blessing of wisdom"] = &blessing_of_wisdom;
creators["blessing of kings on party"] = &blessing_of_kings_on_party;
creators["blessing of wisdom on party"] = &blessing_of_wisdom_on_party;
creators["blessing of sanctuary on party"] = &blessing_of_sanctuary_on_party;
creators["blessing of sanctuary"] = &blessing_of_sanctuary;
creators["seal of command"] = &seal_of_command;
creators["taunt spell"] = &hand_of_reckoning;
@@ -83,6 +84,13 @@ private:
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* blessing_of_sanctuary_on_party(PlayerbotAI* /* ai */)
{
return new ActionNode("blessing of sanctuary on party",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
static ActionNode* retribution_aura(PlayerbotAI* /* ai */)
{
return new ActionNode("retribution aura",

View File

@@ -14,21 +14,13 @@
#include "SharedDefines.h"
#include "../../../../../src/server/scripts/Spells/spell_generic.cpp"
inline std::string const GetActualBlessingOfMight(Unit* target, PlayerbotAI* botAI, Player* bot)
inline std::string const GetActualBlessingOfMight(Unit* target)
{
Player* targetPlayer = target->ToPlayer();
if (!targetPlayer)
if (!target->ToPlayer())
{
return "blessing of might";
}
if (targetPlayer->HasTankSpec() && !targetPlayer->HasAura(SPELL_BLESSING_OF_SANCTUARY) &&
bot->HasSpell(SPELL_BLESSING_OF_SANCTUARY))
{
return "blessing of sanctuary";
}
int tab = AiFactory::GetPlayerSpecTab(target->ToPlayer());
switch (target->getClass())
{
@@ -98,6 +90,23 @@ inline std::string const GetActualBlessingOfWisdom(Unit* target)
return "blessing of wisdom";
}
inline std::string const GetActualBlessingOfSanctuary(Unit* target, Player* bot)
{
Player* targetPlayer = target->ToPlayer();
if (!targetPlayer)
{
return "blessing of sanctuary";
}
if (targetPlayer->HasTankSpec() && bot->HasSpell(SPELL_BLESSING_OF_SANCTUARY))
{
return "blessing of sanctuary";
}
return "blessing of kings";
}
Value<Unit*>* CastBlessingOnPartyAction::GetTargetValue()
{
return context->GetValue<Unit*>("party member without aura", name);
@@ -109,7 +118,7 @@ bool CastBlessingOfMightAction::Execute(Event event)
if (!target)
return false;
return botAI->CastSpell(GetActualBlessingOfMight(target, botAI, bot), target);
return botAI->CastSpell(GetActualBlessingOfMight(target), target);
}
Value<Unit*>* CastBlessingOfMightOnPartyAction::GetTargetValue()
@@ -123,7 +132,7 @@ bool CastBlessingOfMightOnPartyAction::Execute(Event event)
if (!target)
return false;
return botAI->CastSpell(GetActualBlessingOfMight(target, botAI, bot), target);
return botAI->CastSpell(GetActualBlessingOfMight(target), target);
}
bool CastBlessingOfWisdomAction::Execute(Event event)
@@ -149,6 +158,20 @@ bool CastBlessingOfWisdomOnPartyAction::Execute(Event event)
return botAI->CastSpell(GetActualBlessingOfWisdom(target), target);
}
Value<Unit*>* CastBlessingOfSanctuaryOnPartyAction::GetTargetValue()
{
return context->GetValue<Unit*>("party member without aura", "blessing of sanctuary,blessing of kings");
}
bool CastBlessingOfSanctuaryOnPartyAction::Execute(Event event)
{
Unit* target = GetTarget();
if (!target)
return false;
return botAI->CastSpell(GetActualBlessingOfSanctuary(target, bot), target);
}
bool CastSealSpellAction::isUseful() { return AI_VALUE2(bool, "combat", "self target"); }
Value<Unit*>* CastTurnUndeadAction::GetTargetValue() { return context->GetValue<Unit*>("cc target", getName()); }

View File

@@ -149,14 +149,16 @@ public:
CastBlessingOfSanctuaryAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "blessing of sanctuary") {}
};
class CastBlessingOfSanctuaryOnPartyAction : public CastBlessingOnPartyAction
class CastBlessingOfSanctuaryOnPartyAction : public BuffOnPartyAction
{
public:
CastBlessingOfSanctuaryOnPartyAction(PlayerbotAI* botAI) : CastBlessingOnPartyAction(botAI, "blessing of sanctuary")
CastBlessingOfSanctuaryOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "blessing of sanctuary")
{
}
std::string const getName() override { return "blessing of sanctuary on party"; }
Value<Unit*>* GetTargetValue() override;
bool Execute(Event event) override;
};
class CastHolyLightAction : public CastHealingSpellAction

View File

@@ -145,6 +145,7 @@ public:
creators["blessing of kings on party"] = &PaladinTriggerFactoryInternal::blessing_of_kings_on_party;
creators["blessing of wisdom on party"] = &PaladinTriggerFactoryInternal::blessing_of_wisdom_on_party;
creators["blessing of might on party"] = &PaladinTriggerFactoryInternal::blessing_of_might_on_party;
creators["blessing of sanctuary on party"] = &PaladinTriggerFactoryInternal::blessing_of_sanctuary_on_party;
creators["avenging wrath"] = &PaladinTriggerFactoryInternal::avenging_wrath;
}
@@ -206,11 +207,9 @@ private:
static Trigger* sacred_shield_on_main_tank(PlayerbotAI* ai) { return new SacredShieldOnMainTankTrigger(ai); }
static Trigger* blessing_of_kings_on_party(PlayerbotAI* botAI) { return new BlessingOfKingsOnPartyTrigger(botAI); }
static Trigger* blessing_of_wisdom_on_party(PlayerbotAI* botAI)
{
return new BlessingOfWisdomOnPartyTrigger(botAI);
}
static Trigger* blessing_of_wisdom_on_party(PlayerbotAI* botAI) { return new BlessingOfWisdomOnPartyTrigger(botAI); }
static Trigger* blessing_of_might_on_party(PlayerbotAI* botAI) { return new BlessingOfMightOnPartyTrigger(botAI); }
static Trigger* blessing_of_sanctuary_on_party(PlayerbotAI* botAI) { return new BlessingOfSanctuaryOnPartyTrigger(botAI); }
static Trigger* avenging_wrath(PlayerbotAI* botAI) { return new AvengingWrathTrigger(botAI); }
};
@@ -231,6 +230,7 @@ public:
creators["blessing of kings on party"] = &PaladinAiObjectContextInternal::blessing_of_kings_on_party;
creators["blessing of might on party"] = &PaladinAiObjectContextInternal::blessing_of_might_on_party;
creators["blessing of wisdom on party"] = &PaladinAiObjectContextInternal::blessing_of_wisdom_on_party;
creators["blessing of sanctuary on party"] = &PaladinAiObjectContextInternal::blessing_of_sanctuary_on_party;
creators["redemption"] = &PaladinAiObjectContextInternal::redemption;
creators["crusader strike"] = &PaladinAiObjectContextInternal::crusader_strike;
creators["crusader aura"] = &PaladinAiObjectContextInternal::crusader_aura;
@@ -317,18 +317,10 @@ private:
static Action* blessing_of_wisdom(PlayerbotAI* botAI) { return new CastBlessingOfWisdomAction(botAI); }
static Action* blessing_of_kings(PlayerbotAI* botAI) { return new CastBlessingOfKingsAction(botAI); }
static Action* divine_storm(PlayerbotAI* botAI) { return new CastDivineStormAction(botAI); }
static Action* blessing_of_kings_on_party(PlayerbotAI* botAI)
{
return new CastBlessingOfKingsOnPartyAction(botAI);
}
static Action* blessing_of_might_on_party(PlayerbotAI* botAI)
{
return new CastBlessingOfMightOnPartyAction(botAI);
}
static Action* blessing_of_wisdom_on_party(PlayerbotAI* botAI)
{
return new CastBlessingOfWisdomOnPartyAction(botAI);
}
static Action* blessing_of_kings_on_party(PlayerbotAI* botAI) { return new CastBlessingOfKingsOnPartyAction(botAI); }
static Action* blessing_of_might_on_party(PlayerbotAI* botAI) { return new CastBlessingOfMightOnPartyAction(botAI); }
static Action* blessing_of_wisdom_on_party(PlayerbotAI* botAI) { return new CastBlessingOfWisdomOnPartyAction(botAI); }
static Action* blessing_of_sanctuary_on_party(PlayerbotAI* botAI) { return new CastBlessingOfSanctuaryOnPartyAction(botAI); }
static Action* redemption(PlayerbotAI* botAI) { return new CastRedemptionAction(botAI); }
static Action* crusader_strike(PlayerbotAI* botAI) { return new CastCrusaderStrikeAction(botAI); }
static Action* crusader_aura(PlayerbotAI* botAI) { return new CastCrusaderAuraAction(botAI); }

View File

@@ -19,8 +19,8 @@ void PaladinBuffManaStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
void PaladinBuffHealthStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(
new TriggerNode("blessing of kings on party",
NextAction::array(0, new NextAction("blessing of kings on party", 11.0f), nullptr)));
new TriggerNode("blessing of sanctuary on party",
NextAction::array(0, new NextAction("blessing of sanctuary on party", 11.0f), nullptr)));
// triggers.push_back(new TriggerNode("blessing", NextAction::array(0, new NextAction("blessing of kings",
// ACTION_HIGH + 8), nullptr)));
}

View File

@@ -234,6 +234,15 @@ public:
}
};
class BlessingOfSanctuaryOnPartyTrigger : public BuffOnPartyTrigger
{
public:
BlessingOfSanctuaryOnPartyTrigger(PlayerbotAI* botAI)
: BuffOnPartyTrigger(botAI, "blessing of sanctuary,blessing of kings", 2 * 2000)
{
}
};
class AvengingWrathTrigger : public BoostTrigger
{
public: