Mobile_CreateCorpseHandler() public static method

public static Mobile_CreateCorpseHandler ( Server.Mobile owner, HairInfo hair, FacialHairInfo facialhair, List initialContent, List equipItems ) : Server.Items.Container
owner Server.Mobile
hair Server.HairInfo
facialhair Server.FacialHairInfo
initialContent List
equipItems List
return Server.Items.Container
Example #1
0
        public new static Container Mobile_CreateCorpseHandler(Mobile owner, HairInfo hair, FacialHairInfo facialhair,
                                                               List <Item> initialContent, List <Item> equipItems)
        {
            var pm = owner as PlayerMobile;

            if (pm == null || BountyInformation.GetBounty(pm) <= 0)
            {
                return(Corpse.Mobile_CreateCorpseHandler(owner, hair, facialhair, initialContent, equipItems));
            }

            Corpse c = new BountyCorpse(owner, hair, facialhair, equipItems);

            //UOSI Logging
            //MoreLogging.WriteLine(owner, "A BountyCorpse has been created!");

            owner.Corpse = c;

            for (var i = 0; i < initialContent.Count; ++i)
            {
                var item = initialContent[i];

                if (Core.AOS && item.Parent == owner.Backpack)
                {
                    c.AddItem(item);
                }
                else
                {
                    c.DropItem(item);
                }

                if (Core.AOS)
                {
                    c.SetRestoreInfo(item, item.Location);
                }
            }

            if (Core.AOS)
            {
                c.RestoreEquip = pm.EquipSnapshot;
            }

            var loc = owner.Location;
            var map = owner.Map;

            if (map == null || map == Map.Internal)
            {
                loc = owner.LogoutLocation;
                map = owner.LogoutMap;
            }

            c.MoveToWorld(loc, map);

            return(c);
        }