Пример #1
0
        protected override void BuffEnded(bool wasRemoved, bool wasManual)
        {
            if (Interlocked.CompareExchange(ref BuffEndLock, 1, 0) != 0)
            {
                return;
            }

            BuffHasExpired     = true;
            WasManuallyRemoved = wasManual;

            if (wasRemoved)
            {
                BuffState = (byte)EBuffState.Removed;
            }
            else
            {
                BuffState = (byte)EBuffState.Ended;
            }

            Interlocked.Exchange(ref BuffEndLock, 0);

            if (_target != null)
            {
                if (wasRemoved)
                {
                    _target.NotifyInteractionBroken(this);
                }
                else
                {
                    _target.NotifyInteractionComplete(this);
                }

                if (!HasSentEnd)
                {
                    PacketOut Out = new PacketOut((byte)Opcodes.F_SET_ABILITY_TIMER, 12);
                    Out.WriteByte(0);
                    Out.WriteByte(1);
                    Out.WriteByte(1);
                    Out.Fill(0, 9);
                    ((Player)Caster).SendPacket(Out);
                }
                ((Player)Caster).KneelDown(_target.Oid, false);
            }

            _buffInterface.RemoveEventSubscription(this, (byte)BuffCombatEvents.ReceivingDamage);
            _buffInterface.RemoveEventSubscription(this, (byte)BuffCombatEvents.AbilityStarted);
        }