Exemple #1
0
        void HandleCancelChanneling(CancelChannelling cancelChanneling)
        {
            // ignore for remote control state (for player case)
            Unit mover = _player.GetUnitBeingMoved();

            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);
        }
        void HandleCancelChanneling(CancelChannelling cancelChanneling)
        {
            // ignore for remote control state (for player case)
            Unit mover = _player.m_unitMovedByMe;

            if (mover != _player && mover.IsTypeId(TypeId.Player))
            {
                return;
            }

            mover.InterruptSpell(CurrentSpellTypes.Channeled);
        }