aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorCristian Vintila <127750549+cristianvnt@users.noreply.github.com>2025-12-21 00:12:08 +0200
committerGitHub <noreply@github.com>2025-12-20 23:12:08 +0100
commit3cc3bee57b7e816c92e5856fdad37dabee1e52c4 (patch)
tree747b4b150dec9229e700c012f2233c902bc5f705 /src/server/scripts
parentcf922909f7d951e1c1083bf2169537d73fa0439c (diff)
Scripts/Spells: Implement Holy Priest talent Dispersing Light (#31439)
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 6100943eb12..1cb580810c5 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -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);