コード例 #1
0
        public static Container Mobile_CreateCorpseHandler(Mobile owner, ArrayList initialContent, ArrayList equipItems)
        {
            bool shouldFillCorpse = true;

            //if ( owner is BaseCreature )
            //	shouldFillCorpse = !((BaseCreature)owner).IsBonded;

            //if ( owner is BaseCreature )
            //	shouldFillCorpse = !((BaseCreature)owner).IsBonded;

            Corpse c;

            if (owner is MilitiaFighter)
            {
                c = new MilitiaFighterCorpse(owner, shouldFillCorpse ? equipItems : new ArrayList());
            }
            else
            {
                c = new Corpse(owner, shouldFillCorpse ? equipItems : new ArrayList());
            }

            if (shouldFillCorpse)
            {
                for (int i = 0; i < initialContent.Count; ++i)
                {
                    Item item = (Item)initialContent[i];

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

                    if (owner.Player && Core.AOS)
                    {
                        c.SetRestoreInfo(item, item.Location);
                    }
                }
            }
            else
            {
                c.Carved = true;                 // TODO: Is it needed?
            }

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

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

            c.MoveToWorld(loc, map);

            return(c);
        }
コード例 #2
0
ファイル: Corpse.cs プロジェクト: seanrgraff/The-Basement
        public static Container Mobile_CreateCorpseHandler(Mobile owner, HairInfo hair, FacialHairInfo facialhair, List <Item> initialContent, List <Item> equipItems)
        {
            bool shouldFillCorpse = true;

            //if ( owner is BaseCreature )
            //	shouldFillCorpse = !((BaseCreature)owner).IsBonded;

            Corpse c;

            if (owner is MilitiaFighter)
            {
                c = new MilitiaFighterCorpse(owner, hair, facialhair, shouldFillCorpse ? equipItems : new List <Item>());
            }
            else
            {
                c = new Corpse(owner, hair, facialhair, shouldFillCorpse ? equipItems : new List <Item>());
            }

            owner.Corpse = c;

            if (shouldFillCorpse)
            {
                for (int i = 0; i < initialContent.Count; ++i)
                {
                    Item item = initialContent[i];

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

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

                if (!owner.Player)
                {
                    c.AssignInstancedLoot();
                }
                else if (Core.AOS)
                {
                    PlayerMobile pm = owner as PlayerMobile;

                    if (pm != null)
                    {
                        c.RestoreEquip = pm.EquipSnapshot;
                    }
                }
            }
            else
            {
                c.Carved = true;                 // TODO: Is it needed?
            }

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

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

            c.MoveToWorld(loc, map);

            return(c);
        }