From 9fffef03889d6f396f073f9cb48c9a37bcb9043b Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 23 Feb 2022 16:03:52 -0500 Subject: [PATCH] Core/Spells: Prevent manual cancelling of channelled spells that have SPELL_ATTR0_CANT_CANCEL Port From (https://github.com/TrinityCore/TrinityCore/commit/1fc9e0172da4018ab24422bee51b025d0fb79701) --- Source/Game/Handlers/SpellHandler.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/Game/Handlers/SpellHandler.cs b/Source/Game/Handlers/SpellHandler.cs index afec967e2..d0f389a0c 100644 --- a/Source/Game/Handlers/SpellHandler.cs +++ b/Source/Game/Handlers/SpellHandler.cs @@ -473,6 +473,18 @@ namespace Game if (mover != _player && mover.IsTypeId(TypeId.Player)) return; + var spellInfo = Global.SpellMgr.GetSpellInfo((uint)cancelChanneling.ChannelSpell, mover.GetMap().GetDifficultyID()); + if (spellInfo == null) + return; + + // not allow remove spells with attr SPELL_ATTR0_CANT_CANCEL + if (spellInfo.HasAttribute(SpellAttr0.CantCancel)) + return; + + var spell = mover.GetCurrentSpell(CurrentSpellTypes.Channeled); + if (spell == null || spell.GetSpellInfo().Id != spellInfo.Id) + return; + mover.InterruptSpell(CurrentSpellTypes.Channeled); }