/// <summary>Flags this unit as dead and generates XP and loot.</summary>
        protected virtual void SetDeath(Unit killer)
        {
            Health = 0;

            States.Add((byte)CreatureState.Dead); // Death State

            SendCollatedHit();

            Pet    pet      = (killer as Pet);
            Player credited = (pet != null) ? pet.Owner : (killer as Player);

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(credited?.Oid ?? killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            AbtInterface.Cancel(true);
            ScrInterface.OnDie(this);
            BuffInterface.RemoveBuffsOnDeath();
            AiInterface.OnOwnerDied();

            EvtInterface.Notify(EventName.OnDie, this, credited ?? killer);

            if (credited != null && credited.Zone != null && !credited.PendingDisposal)
            {
                HandleDeathRewards(credited);
            }

            ClearTrackedDamage();
        }