From 52e1b6de31d14572ad234545e437147541ab18b3 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 4 Jul 2022 00:51:14 -0400 Subject: [PATCH] Scripts/Spells: Fix damage on primart target of mage talent Supernova Port From (https://github.com/TrinityCore/TrinityCore/commit/19a627b23ee2fb00d48fdf24fbdcefeae775455e) --- Source/Scripts/Spells/Mage.cs | 19 +++++++++++++++++++ .../2022_07_03_01_world_mage_supernova.sql | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 sql/updates/world/master/2022_07_03_01_world_mage_supernova.sql diff --git a/Source/Scripts/Spells/Mage.cs b/Source/Scripts/Spells/Mage.cs index 80e2d4f95..1d76526ae 100644 --- a/Source/Scripts/Spells/Mage.cs +++ b/Source/Scripts/Spells/Mage.cs @@ -1123,6 +1123,25 @@ namespace Scripts.Spells.Mage } } + [Script] // 157980 - Supernova + class spell_mage_supernova : SpellScript + { + void HandleDamage(uint effIndex) + { + if (GetExplTargetUnit() == GetHitUnit()) + { + int damage = GetHitDamage(); + MathFunctions.AddPct(ref damage, GetEffectInfo(0).CalcValue()); + SetHitDamage(damage); + } + } + + public override void Register() + { + OnEffectHitTarget.Add(new EffectHandler(HandleDamage, 1, SpellEffectName.SchoolDamage)); + } + } + [Script] // 80353 - Time Warp class spell_mage_time_warp : SpellScript { diff --git a/sql/updates/world/master/2022_07_03_01_world_mage_supernova.sql b/sql/updates/world/master/2022_07_03_01_world_mage_supernova.sql new file mode 100644 index 000000000..8ee80f0f6 --- /dev/null +++ b/sql/updates/world/master/2022_07_03_01_world_mage_supernova.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 157980; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(157980, 'spell_mage_supernova');