diff --git a/data/sql/updates/pending_db_world/rev_1736342655634713400.sql b/data/sql/updates/pending_db_world/rev_1736342655634713400.sql new file mode 100644 index 000000000..31f9f2c0e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1736342655634713400.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` IN (7098, 39647); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(7098, 'spell_gen_proc_on_victim'), +(39647, 'spell_gen_proc_on_victim'); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 85fe37b52..3de8d2a55 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9673,8 +9673,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return false; } // Cast positive spell on enemy target - case 7099: // Curse of Mending - case 39703: // Curse of Mending case 20233: // Improved Lay on Hands (cast on target) { target = victim; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index f672ad8b6..8ce23ac5f 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -5379,6 +5379,26 @@ class spell_pet_spellhit_expertise_spellpen_scaling : public AuraScript } }; +// 7098 - Curse of Mending +// 39647 - Curse of Mending +class spell_gen_proc_on_victim : public AuraScript +{ + PrepareAuraScript(spell_gen_proc_on_victim); + + void OnProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + if (Unit* target = eventInfo.GetActionTarget()) + GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_gen_proc_on_victim::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } +}; + void AddSC_generic_spell_scripts() { RegisterSpellScript(spell_silithyst); @@ -5538,4 +5558,5 @@ void AddSC_generic_spell_scripts() RegisterSpellScript(spell_gen_steal_weapon); RegisterSpellScript(spell_gen_set_health); RegisterSpellScript(spell_pet_spellhit_expertise_spellpen_scaling); + RegisterSpellScript(spell_gen_proc_on_victim); }