Пример #1
0
        public YardItem(int itemID, Mobile from, string itemName, Point3D location, int price, BaseHouse house)
            : base(itemID, from.Name + "'s " + itemName)
        {
            Price  = price;
            Placer = from;

            Movable  = false;
            HasMoved = true;
            MoveToWorld(location, from.Map);

            if (house == null)
            {
                FindHouseOfPlacer();
            }
            else
            {
                House = house;
            }

            Pieces         = new List <YardPiece>();
            ParentYardItem = this;
            Pieces.Add(this);

            if (YardRegistry.YardMultiIDs.ContainsKey(ItemID) && YardRegistry.YardMultiIDs[ItemID] != null)
            {
                YardPiece piece;
                foreach (YardMultiInfo info in YardRegistry.YardMultiIDs[ItemID])
                {
                    piece          = new YardPiece(info.ItemID, Name, this);
                    piece.HasMoved = true;
                    piece.MoveToWorld(new Point3D(Location.X + info.Offset.X,
                                                  Location.Y + info.Offset.Y,
                                                  Location.Z + info.Offset.Z),
                                      from.Map);
                    Pieces.Add(piece);
                }
            }

            for (int i = 0; i < Pieces.Count; i++)
            {
                Pieces[i].HasMoved = false;
            }
        }
Пример #2
0
        public YardItem(int itemID, Mobile from, string itemName, Point3D location, int price, BaseHouse house)
            : base(itemID, from.Name + "'s " + itemName)
        {
            Price = price;
            Placer = from;

            Movable = false;
            HasMoved = true;
            MoveToWorld(location, from.Map);

            if (house == null)
            {
                FindHouseOfPlacer();
            }
            else
            {
                House = house;
            }

            Pieces = new List<YardPiece>();
            ParentYardItem = this;
            Pieces.Add(this);

            if (YardRegistry.YardMultiIDs.ContainsKey(ItemID) && YardRegistry.YardMultiIDs[ItemID] != null)
            {
                YardPiece piece;
                foreach (YardMultiInfo info in YardRegistry.YardMultiIDs[ItemID])
                {
                    piece = new YardPiece(info.ItemID, Name, this);
                    piece.HasMoved = true;
                    piece.MoveToWorld(new Point3D(Location.X + info.Offset.X,
                                                  Location.Y + info.Offset.Y,
                                                  Location.Z + info.Offset.Z),
                                                  from.Map);
                    Pieces.Add(piece);
                }
            }

            for (int i = 0; i < Pieces.Count; i++)
            {
                Pieces[i].HasMoved = false;
            }
        }