mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Spells: Implement monk talent Burst of Life (#31031)
This commit is contained in:
4
sql/updates/world/master/2025_06_06_00_world.sql
Normal file
4
sql/updates/world/master/2025_06_06_00_world.sql
Normal 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');
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user