Scripts/Spells: Implement monk talent "Save them all" (#30596)

This commit is contained in:
Aqua Deus
2025-01-13 13:35:25 +01:00
committed by GitHub
parent 4e9f344d50
commit faf8efc25d
2 changed files with 34 additions and 0 deletions

View File

@@ -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');

View File

@@ -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);