Scripts/Spells: Implement monk talent Burst of Life (#31031)

This commit is contained in:
Aqua Deus
2025-06-06 16:11:20 +02:00
committed by GitHub
parent 76c397ed8d
commit 2d34fbd056
2 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_monk_burst_of_life', 'spell_monk_burst_of_life_heal');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(116849, 'spell_monk_burst_of_life'),
(399230, 'spell_monk_burst_of_life_heal');

View File

@@ -34,6 +34,8 @@
enum MonkSpells
{
SPELL_MONK_BURST_OF_LIFE_TALENT = 399226,
SPELL_MONK_BURST_OF_LIFE_HEAL = 399230,
SPELL_MONK_CALMING_COALESCENCE = 388220,
SPELL_MONK_COMBAT_CONDITIONING = 128595,
SPELL_MONK_CRACKLING_JADE_LIGHTNING_CHANNEL = 117952,
@@ -62,6 +64,61 @@ enum MonkSpells
SPELL_MONK_SURGING_MIST_HEAL = 116995,
};
// 399226 - Burst of Life (attached to 116849 - Life Cocoon)
class spell_monk_burst_of_life : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MONK_BURST_OF_LIFE_HEAL })
&& ValidateSpellEffect({ { SPELL_MONK_BURST_OF_LIFE_TALENT, EFFECT_0 } });
}
bool Load() override
{
Unit* caster = GetCaster();
return caster && caster->HasAuraEffect(SPELL_MONK_BURST_OF_LIFE_TALENT, EFFECT_0);
}
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
{
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
if (removeMode != AURA_REMOVE_BY_EXPIRE && (removeMode != AURA_REMOVE_BY_ENEMY_SPELL || aurEff->GetAmount()))
return;
Unit* caster = GetCaster();
if (!caster)
return;
AuraEffect const* burstOfLife = caster->GetAuraEffect(SPELL_MONK_BURST_OF_LIFE_TALENT, EFFECT_0);
if (!burstOfLife)
return;
caster->CastSpell(GetTarget(), SPELL_MONK_BURST_OF_LIFE_HEAL, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
.SpellValueOverrides = { { SPELLVALUE_MAX_TARGETS, burstOfLife->GetAmount() } }
});
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_monk_burst_of_life::AfterRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
}
};
// 399230 - Burst of Life
class spell_monk_burst_of_life_heal : public SpellScript
{
void FilterTargets(std::list<WorldObject*>& targets) const
{
Trinity::SelectRandomInjuredTargets(targets, GetSpellValue()->MaxAffectedTargets, true, GetExplTargetUnit());
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_monk_burst_of_life_heal::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ALLY);
}
};
// 117952 - Crackling Jade Lightning
class spell_monk_crackling_jade_lightning : public AuraScript
{
@@ -700,6 +757,8 @@ class spell_monk_tigers_lust : public SpellScript
void AddSC_monk_spell_scripts()
{
RegisterSpellScript(spell_monk_burst_of_life);
RegisterSpellScript(spell_monk_burst_of_life_heal);
RegisterSpellScript(spell_monk_crackling_jade_lightning);
RegisterSpellScript(spell_monk_crackling_jade_lightning_knockback_proc_aura);
RegisterSpellScript(spell_monk_jade_walk);