diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-01-13 13:35:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-13 13:35:25 +0100 |
commit | faf8efc25d4bb088fc263accba2721ac29efc80a (patch) | |
tree | 87e5f4641395d12d870243be3d1561e2a5de179a | |
parent | 4e9f344d50e42663fed16f8aaac4e04072acf289 (diff) |
Scripts/Spells: Implement monk talent "Save them all" (#30596)
-rw-r--r-- | sql/updates/world/master/2025_01_13_00_world.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_monk.cpp | 31 |
2 files changed, 34 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_01_13_00_world.sql b/sql/updates/world/master/2025_01_13_00_world.sql new file mode 100644 index 00000000000..c2be63bca56 --- /dev/null +++ b/sql/updates/world/master/2025_01_13_00_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_monk_save_them_all'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(389579, 'spell_monk_save_them_all'); diff --git a/src/server/scripts/Spells/spell_monk.cpp b/src/server/scripts/Spells/spell_monk.cpp index 3a17a8bbbf7..371b06184a5 100644 --- a/src/server/scripts/Spells/spell_monk.cpp +++ b/src/server/scripts/Spells/spell_monk.cpp @@ -46,6 +46,7 @@ enum MonkSpells SPELL_MONK_OPEN_PALM_STRIKES_TALENT = 392970, SPELL_MONK_ROLL_BACKWARD = 109131, SPELL_MONK_ROLL_FORWARD = 107427, + SPELL_MONK_SAVE_THEM_ALL_HEAL_BONUS = 390105, SPELL_MONK_SOOTHING_MIST = 115175, SPELL_MONK_STANCE_OF_THE_SPIRITED_CRANE = 154436, SPELL_MONK_STAGGER_DAMAGE_AURA = 124255, @@ -348,6 +349,35 @@ class spell_monk_roll_aura : public AuraScript } }; +// 389579 - Save Them All +class spell_monk_save_them_all : public AuraScript +{ + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ SPELL_MONK_SAVE_THEM_ALL_HEAL_BONUS }) + && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } }); + } + + bool CheckProc(ProcEventInfo const& eventInfo) const + { + return eventInfo.GetActionTarget()->HealthBelowPct(GetEffectInfo(EFFECT_2).CalcValue(eventInfo.GetActor())); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/) const + { + GetTarget()->CastSpell(GetTarget(), SPELL_MONK_SAVE_THEM_ALL_HEAL_BONUS, CastSpellExtraArgsInit{ + .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR, + .TriggeringAura = aurEff + }); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_monk_save_them_all::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_monk_save_them_all::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } +}; + // Utility for stagger scripts Aura* FindExistingStaggerEffect(Unit* unit) { @@ -591,6 +621,7 @@ void AddSC_monk_spell_scripts() RegisterSpellScript(spell_monk_rising_sun_kick); RegisterSpellScript(spell_monk_roll); RegisterSpellScript(spell_monk_roll_aura); + RegisterSpellScript(spell_monk_save_them_all); RegisterSpellScript(spell_monk_stagger); RegisterSpellScript(spell_monk_stagger_damage_aura); RegisterSpellScript(spell_monk_stagger_debuff_aura); |