Пример #1
0
        private void ApplyDeath()
        {
            // die.
            Session.Print(this.Name + " has died.");

            this.currentState = ActionState.Dying;

            // drop actor's items to ground.
            RPGDrop drop = new RPGDrop();

            drop.X = this.X + this.Width / 2 - drop.Width / 2;
            drop.Y = this.Y + this.Height / 2;

            for (int i = 0; i < Enum.GetValues(typeof(Inventory.BodySlot)).Length; i++)
            {
                if (inventory.GetBodyItem(i) != null)
                {
                    drop.AddItem(inventory.GetBodyItem(i));
                }
            }
            for (int i = 0; i < Inventory.PACK_SIZE; i++)
            {
                if (inventory.GetPackItem(i) != null)
                {
                    drop.AddItem(inventory.GetPackItem(i));
                }
            }

            Session.thisSession.thisArea.AddObject(drop);

            // now give exp points to killer.
            if (this.AI.lastAttacker != null)
            {
                this.AI.lastAttacker.ExpAdjust(this.ExpForKill);
            }
        }