From efa44234b7908e2bd732e0f28ff30182480083b2 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 8 Sep 2021 22:58:55 -0400 Subject: [PATCH] Scripts/Spells: Fixed mage ice block to not heal without aura 320913 Port From (https://github.com/TrinityCore/TrinityCore/commit/7e09deea3a6784c7abd44cb2893ae19dbf95f9f1) --- Source/Scripts/Spells/Mage.cs | 33 +++++++++++++++++-- .../2021_09_05_04_world_mage_ice_block.sql | 3 ++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/master/2021_09_05_04_world_mage_ice_block.sql diff --git a/Source/Scripts/Spells/Mage.cs b/Source/Scripts/Spells/Mage.cs index 84e7f3754..bf226adfe 100644 --- a/Source/Scripts/Spells/Mage.cs +++ b/Source/Scripts/Spells/Mage.cs @@ -45,6 +45,7 @@ namespace Scripts.Spells.Mage public const uint ConjureRefreshment = 116136; public const uint ConjureRefreshmentTable = 167145; public const uint DradonhawkForm = 32818; + public const uint EverwarmSocks = 320913; public const uint FingersOfFrost = 44544; public const uint FrostNova = 122; public const uint GiraffeForm = 32816; @@ -492,6 +493,34 @@ namespace Scripts.Spells.Mage } } + [Script] // 45438 - Ice Block + class spell_mage_ice_block : SpellScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.EverwarmSocks); + } + + void PreventStunWithEverwarmSocks(ref WorldObject target) + { + if (GetCaster().HasAura(SpellIds.EverwarmSocks)) + target = null; + } + + void PreventEverwarmSocks(ref WorldObject target) + { + if (!GetCaster().HasAura(SpellIds.EverwarmSocks)) + target = null; + } + + public override void Register() + { + OnObjectTargetSelect.Add(new ObjectTargetSelectHandler(PreventStunWithEverwarmSocks, 0, Targets.UnitCaster)); + OnObjectTargetSelect.Add(new ObjectTargetSelectHandler(PreventEverwarmSocks, 5, Targets.UnitCaster)); + OnObjectTargetSelect.Add(new ObjectTargetSelectHandler(PreventEverwarmSocks, 6, Targets.UnitCaster)); + } + } + [Script] // Ice Lance - 30455 class spell_mage_ice_lance : SpellScript { @@ -747,7 +776,7 @@ namespace Scripts.Spells.Mage { public override bool Validate(SpellInfo spellInfo) { - return ValidateSpellInfo(SpellIds.RingOfFrostSummon, SpellIds.RingOfFrostFreeze) && !Global.SpellMgr.GetSpellInfo(SpellIds.RingOfFrostSummon, GetCastDifficulty()).GetEffects().Empty(); + return ValidateSpellInfo(SpellIds.RingOfFrostSummon, SpellIds.RingOfFrostFreeze) && !Global.SpellMgr.GetSpellInfo(SpellIds.RingOfFrostSummon, Difficulty.None).GetEffects().Empty(); } void HandleEffectPeriodic(AuraEffect aurEff) @@ -803,7 +832,7 @@ namespace Scripts.Spells.Mage { public override bool Validate(SpellInfo spellInfo) { - return ValidateSpellInfo(SpellIds.RingOfFrostSummon, SpellIds.RingOfFrostFreeze) && !Global.SpellMgr.GetSpellInfo(SpellIds.RingOfFrostSummon, GetCastDifficulty()).GetEffects().Empty(); + return ValidateSpellInfo(SpellIds.RingOfFrostSummon, SpellIds.RingOfFrostFreeze) && !Global.SpellMgr.GetSpellInfo(SpellIds.RingOfFrostSummon, Difficulty.None).GetEffects().Empty(); } void FilterTargets(List targets) diff --git a/sql/updates/world/master/2021_09_05_04_world_mage_ice_block.sql b/sql/updates/world/master/2021_09_05_04_world_mage_ice_block.sql new file mode 100644 index 000000000..586036276 --- /dev/null +++ b/sql/updates/world/master/2021_09_05_04_world_mage_ice_block.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_mage_ice_block'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(45438,'spell_mage_ice_block');