mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Spells: Implement Holy Priest talent Dispersing Light (#31439)
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include "SpellScript.h"
|
||||
#include "TaskScheduler.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "CommonPredicates.h"
|
||||
|
||||
enum PriestSpells
|
||||
{
|
||||
@@ -70,6 +71,8 @@ enum PriestSpells
|
||||
SPELL_PRIEST_DARK_REPRIMAND_DAMAGE = 373130,
|
||||
SPELL_PRIEST_DARK_REPRIMAND_HEALING = 400187,
|
||||
SPELL_PRIEST_DAZZLING_LIGHT = 196810,
|
||||
SPELL_PRIEST_DISPERSING_LIGHT = 1215265,
|
||||
SPELL_PRIEST_DISPERSING_LIGHT_HEAL = 1215266,
|
||||
SPELL_PRIEST_DIVINE_AEGIS = 47515,
|
||||
SPELL_PRIEST_DIVINE_AEGIS_ABSORB = 47753,
|
||||
SPELL_PRIEST_DIVINE_BLESSING = 40440,
|
||||
@@ -796,6 +799,67 @@ class spell_pri_dark_indulgence : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 1215265 - Dispersing Light
|
||||
class spell_pri_dispersing_light : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_DISPERSING_LIGHT_HEAL })
|
||||
&& ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
|
||||
{
|
||||
HealInfo* healInfo = eventInfo.GetHealInfo();
|
||||
if (!healInfo || !healInfo->GetHeal())
|
||||
return;
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
Unit* target = eventInfo.GetActionTarget();
|
||||
|
||||
caster->CastSpell(nullptr, SPELL_PRIEST_DISPERSING_LIGHT_HEAL, CastSpellExtraArgsInit
|
||||
{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.TriggeringAura = aurEff,
|
||||
.SpellValueOverrides =
|
||||
{
|
||||
{ SPELLVALUE_BASE_POINT0, int32(CalculatePct(healInfo->GetHeal(), aurEff->GetAmount())) },
|
||||
{ SPELLVALUE_MAX_TARGETS, GetEffectInfo(EFFECT_1).CalcValue(caster) }
|
||||
},
|
||||
.CustomArg = TriggerArgs{ .TargetToExclude = target->GetGUID() }
|
||||
});
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_dispersing_light::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
|
||||
public:
|
||||
struct TriggerArgs
|
||||
{
|
||||
ObjectGuid TargetToExclude;
|
||||
};
|
||||
};
|
||||
|
||||
// 1215266 - Dispersing Light (Heal)
|
||||
class spell_pri_dispersing_light_heal : public SpellScript
|
||||
{
|
||||
void FilterTargets(std::list<WorldObject*>& targets) const
|
||||
{
|
||||
spell_pri_dispersing_light::TriggerArgs const* args = std::any_cast<spell_pri_dispersing_light::TriggerArgs>(&GetSpell()->m_customArg);
|
||||
if (!args || args->TargetToExclude.IsEmpty())
|
||||
return;
|
||||
|
||||
targets.remove_if(Trinity::ObjectGUIDCheck(args->TargetToExclude));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_dispersing_light_heal::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
namespace DivineImageHelpers
|
||||
{
|
||||
Unit* GetSummon(Unit const* owner)
|
||||
@@ -3681,6 +3745,8 @@ void AddSC_priest_spell_scripts()
|
||||
RegisterSpellScript(spell_pri_circle_of_healing);
|
||||
RegisterSpellScript(spell_pri_crystalline_reflection);
|
||||
RegisterSpellScript(spell_pri_dark_indulgence);
|
||||
RegisterSpellScript(spell_pri_dispersing_light);
|
||||
RegisterSpellScript(spell_pri_dispersing_light_heal);
|
||||
RegisterSpellScript(spell_pri_divine_aegis);
|
||||
RegisterSpellScript(spell_pri_divine_image);
|
||||
RegisterSpellScript(spell_pri_divine_image_spell_triggered);
|
||||
|
||||
Reference in New Issue
Block a user