Ejemplo n.º 1
0
        public CGroundTypeGump(CellarDeed2 Cellar)
            : base(50, 50)
        {
            m_Cellar   = Cellar;
            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            AddBackground(30, 29, 130, 190, 5120);
            AddImageTiled(35, 58, 130, 10, 5121);
            AddHtml(37, 34, 276, 19, @"<BASEFONT COLOR=WHITE>Cellar Ground Type</BASEFONT>", (bool)false, (bool)false);
            AddLabel(65, 65, 1149, @"Grass");
            AddImageTiledButton(45, 65, 11400, 11400, (int)Buttons.Grass, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
            AddLabel(65, 90, 1149, @"Dirt");
            AddImageTiledButton(45, 90, 11400, 11400, (int)Buttons.Dirt, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
            AddLabel(65, 115, 1149, @"Stone");
            AddImageTiledButton(45, 115, 11400, 11400, (int)Buttons.Stone, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
            AddLabel(65, 140, 1149, @"Dark Stone");
            AddImageTiledButton(45, 140, 11400, 11400, (int)Buttons.DStone, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
            AddLabel(65, 165, 1149, @"Flagstone");
            AddImageTiledButton(45, 165, 11400, 11400, (int)Buttons.Flagstone, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
            AddLabel(65, 190, 1149, @"Wood");
            AddImageTiledButton(45, 190, 11400, 11400, (int)Buttons.Wood, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
        }
Ejemplo n.º 2
0
        public override void OnChop(Mobile from)
        {
            CellarDeed2 deed = new CellarDeed2();

            if (from != null)
            {
                from.AddToBackpack(deed);
            }
            this.Delete();
        }
Ejemplo n.º 3
0
        public CGroundTypeGump(CellarDeed2 Cellar)
            : base(50, 50)
        {
            m_Cellar = Cellar;
            Closable = true;
            Disposable = true;
            Dragable = true;
            Resizable = false;

            AddPage(0);

            AddBackground(30, 29, 130, 190, 5120);
            AddImageTiled(35, 58, 130, 10, 5121);
            AddHtml(37, 34, 276, 19, @"<BASEFONT COLOR=WHITE>Cellar Ground Type</BASEFONT>", (bool)false, (bool)false);
            AddLabel(65, 65, 1149, @"Grass");
            AddImageTiledButton(45, 65, 11400, 11400, (int)Buttons.Grass, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
            AddLabel(65, 90, 1149, @"Dirt");
            AddImageTiledButton(45, 90, 11400, 11400, (int)Buttons.Dirt, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
            AddLabel(65, 115, 1149, @"Stone");
            AddImageTiledButton(45, 115, 11400, 11400, (int)Buttons.Stone, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
            AddLabel(65, 140, 1149, @"Dark Stone");
            AddImageTiledButton(45, 140, 11400, 11400, (int)Buttons.DStone, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
            AddLabel(65, 165, 1149, @"Flagstone");
            AddImageTiledButton(45, 165, 11400, 11400, (int)Buttons.Flagstone, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
            AddLabel(65, 190, 1149, @"Wood");
            AddImageTiledButton(45, 190, 11400, 11400, (int)Buttons.Wood, GumpButtonType.Reply, 0, 11400, 0, 10, 10, 0);
        }
Ejemplo n.º 4
0
        public override void OnChop(Mobile from)
		{
            CellarDeed2 deed = new CellarDeed2();
			if ( from != null )
				from.AddToBackpack(deed);
            this.Delete();
		}
Ejemplo n.º 5
0
        private void TryInitialise()
        {
            if (!this.m_initialised &&
                this.Map != Map.Internal &&
                this.Location != Point3D.Zero)
            {
                this.m_initialised = true;
                BaseHouse house = (BaseHouse.FindHouseAt((BaseAddon)this));
                m_House = house;
                n_Map   = ((BaseAddon)this).Map;
                CellarDeed2 gt           = (CellarDeed2)Deed;
                Point3D     hsp          = new Point3D(this.X, this.Y, this.Z);
                Sector      s            = n_Map.GetSector(hsp);
                int         houseYOffset = this.Y - house.Y;
                int         houseXOffset = this.X - house.X;
                int         type         = (int)gt.m_LandType;

                if (null != house.Area &&
                    house.Area.Length > 0)
                {
                    //Find the minimum z value, so we can ensure it is all underground.
                    int minz = 150;
                    for (int i = 0; i < house.Area.Length; ++i)
                    {
                        Rectangle2D area   = house.Area[i];
                        int         width  = area.Width;
                        int         height = area.Height;
                        for (int rx = 0; rx < width; ++rx)
                        {
                            for (int ry = 0; ry < height; ++ry)
                            {
                                int vx = rx + area.X - houseXOffset;
                                int vy = ry + area.Y - houseYOffset;
                                minz = Math.Min(n_Map.GetAverageZ(vx, vy) - 40, minz);
                            }
                        }
                    }

                    minz = minz - this.Z;
                    //Place components
                    for (int i = 0; i < house.Area.Length; ++i)
                    {
                        Rectangle2D area   = house.Area[i];
                        int         width  = area.Width;
                        int         height = area.Height;
                        for (int rx = 0; rx < width; ++rx)
                        {
                            for (int ry = 0; ry < height; ++ry)
                            {
                                int vx = rx + area.X - houseXOffset;
                                int vy = ry + area.Y - houseYOffset;

                                AddComponent(new AddonComponent(type), vx, vy, minz);
                            }
                        }
                    }

                    this.m_topTeleporter.ZOffset = minz;
                    AddComponent(new CellarTeleporter4(-minz), 0, 0, minz);
                }
            }
        }