From 23ee2b5a488180ffc6335ebfdbda354f78f1dbe2 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 1 Jan 2022 17:17:39 -0500 Subject: [PATCH] Scripts/Spells: Fix priest Mind Bomb Port From (https://github.com/TrinityCore/TrinityCore/commit/01ac538cd252151f0db16748aa81a813a23b18b7) --- Source/Scripts/Spells/Priest.cs | 24 +++++++++++++++++-- .../2021_12_17_00_world_priest_mind_bomb.sql | 3 +++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/master/2021_12_17_00_world_priest_mind_bomb.sql diff --git a/Source/Scripts/Spells/Priest.cs b/Source/Scripts/Spells/Priest.cs index 58db11744..2c3650715 100644 --- a/Source/Scripts/Spells/Priest.cs +++ b/Source/Scripts/Spells/Priest.cs @@ -50,6 +50,7 @@ namespace Scripts.Spells.Priest public const uint ItemEfficiency = 37595; public const uint LeapOfFaithEffect = 92832; public const uint LevitateEffect = 111759; + public const uint MindBombStun = 226943; public const uint OracularHeal = 26170; public const uint PenanceR1 = 47540; public const uint PenanceR1Damage = 47758; @@ -402,8 +403,27 @@ namespace Scripts.Spells.Priest } } - // 47540 - Penance - [Script] + [Script] // 205369 - Mind Bomb + class spell_pri_mind_bomb : AuraScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.MindBombStun); + } + + void RemoveEffect(AuraEffect aurEff, AuraEffectHandleModes mode) + { + if (GetTargetApplication().GetRemoveMode() == AuraRemoveMode.Death || GetTargetApplication().GetRemoveMode() == AuraRemoveMode.Expire) + GetCaster()?.CastSpell(GetTarget().GetPosition(), SpellIds.MindBombStun, new CastSpellExtraArgs(true)); + } + + public override void Register() + { + AfterEffectRemove.Add(new EffectApplyHandler(RemoveEffect, 0, AuraType.Dummy, AuraEffectHandleModes.Real)); + } + } + + [Script] // 47540 - Penance class spell_pri_penance : SpellScript { public override bool Load() diff --git a/sql/updates/world/master/2021_12_17_00_world_priest_mind_bomb.sql b/sql/updates/world/master/2021_12_17_00_world_priest_mind_bomb.sql new file mode 100644 index 000000000..37190073d --- /dev/null +++ b/sql/updates/world/master/2021_12_17_00_world_priest_mind_bomb.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_pri_mind_bomb'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(205369, 'spell_pri_mind_bomb');