diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2023-06-27 23:25:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 23:25:19 +0200 |
commit | 27005299dc96167816a4490df90b7721e2633945 (patch) | |
tree | 07659223baa3d2b0f6c180785efb4807b7327be3 /src | |
parent | 07d6eb3a5728b0ce1bc0adf2a01aa3ec7193e487 (diff) |
Scripts/Shaman: Implemented Ascendance (Restoration) (#29097)
Co-authored-by: ModoX <moardox@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 73 |
1 files changed, 72 insertions, 1 deletions
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 324b3cb808d..166b854c33c 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -99,6 +99,7 @@ enum ShamanSpells SPELL_SHAMAN_PATH_OF_FLAMES_SPREAD = 210621, SPELL_SHAMAN_PATH_OF_FLAMES_TALENT = 201909, SPELL_SHAMAN_POWER_SURGE = 40466, + SPELL_SHAMAN_RESTORATIVE_MISTS = 114083, SPELL_SHAMAN_SPIRIT_WOLF_TALENT = 260878, SPELL_SHAMAN_SPIRIT_WOLF_PERIODIC = 260882, SPELL_SHAMAN_SPIRIT_WOLF_AURA = 260881, @@ -124,7 +125,7 @@ enum ShamanSpellLabels enum MiscNpcs { - NPC_HEALING_RAIN_INVISIBLE_STALKER = 73400, + NPC_HEALING_RAIN_INVISIBLE_STALKER = 73400 }; // 273221 - Aftershock @@ -223,6 +224,48 @@ class spell_sha_ancestral_guidance_heal : public SpellScript } }; +// 114052 - Ascendance (Restoration) +class spell_sha_ascendance_restoration : public AuraScript +{ + PrepareAuraScript(spell_sha_ascendance_restoration); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SHAMAN_RESTORATIVE_MISTS }); + } + + bool CheckProc(ProcEventInfo& procInfo) + { + return procInfo.GetHealInfo() && procInfo.GetHealInfo()->GetOriginalHeal(); + } + + void OnProcHeal(AuraEffect* /*aurEff*/, ProcEventInfo& procInfo) + { + _healToDistribute += procInfo.GetHealInfo()->GetOriginalHeal(); + } + + void HandleEffectPeriodic(AuraEffect const* aurEff) + { + if (!_healToDistribute) + return; + + CastSpellExtraArgs args(aurEff); + args.AddSpellBP0(_healToDistribute); + GetTarget()->CastSpell(nullptr, SPELL_SHAMAN_RESTORATIVE_MISTS, args); + _healToDistribute = 0; + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_sha_ascendance_restoration::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_sha_ascendance_restoration::OnProcHeal, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_ascendance_restoration::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY); + } + +private: + uint32 _healToDistribute = 0; +}; + // 188443 - Chain Lightning class spell_sha_chain_lightning : public SpellScript { @@ -1414,6 +1457,32 @@ class spell_sha_path_of_flames_spread : public SpellScript } }; +// 114083 - Restorative Mists +class spell_sha_restorative_mists : public SpellScript +{ + PrepareSpellScript(spell_sha_restorative_mists); + + void FilterTargets(std::list<WorldObject*>& targets) + { + _targetCount = uint32(targets.size()); + } + + void HandleHeal(SpellEffIndex /*effIndex*/) + { + if (_targetCount) + SetHitHeal(GetHitHeal() / _targetCount); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_restorative_mists::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + OnEffectHitTarget += SpellEffectFn(spell_sha_restorative_mists::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + } + +private: + uint32 _targetCount = 0; +}; + // 2645 - Ghost Wolf // 260878 - Spirit Wolf class spell_sha_spirit_wolf : public AuraScript @@ -1878,6 +1947,7 @@ void AddSC_shaman_spell_scripts() RegisterSpellScript(spell_sha_aftershock); RegisterSpellScript(spell_sha_ancestral_guidance); RegisterSpellScript(spell_sha_ancestral_guidance_heal); + RegisterSpellScript(spell_sha_ascendance_restoration); RegisterSpellScript(spell_sha_chain_lightning); RegisterSpellScript(spell_sha_chain_lightning_overload); RegisterSpellScript(spell_sha_crash_lightning); @@ -1914,6 +1984,7 @@ void AddSC_shaman_spell_scripts() RegisterSpellScript(spell_sha_mastery_elemental_overload_proc); RegisterSpellScript(spell_sha_natures_guardian); RegisterSpellScript(spell_sha_path_of_flames_spread); + RegisterSpellScript(spell_sha_restorative_mists); RegisterSpellScript(spell_sha_spirit_wolf); RegisterSpellScript(spell_sha_tidal_waves); RegisterSpellScript(spell_sha_t3_6p_bonus); |