Example #1
0
        public void Placement_OnTarget(Mobile from, object targeted, HolidayTreeType type)
        {
            if (!(targeted is IPoint3D p))
            {
                return;
            }

            var loc = new Point3D(p);

            if (p is StaticTarget target)

            /* NOTE: OSI does not properly normalize Z positioning here.
             * A side affect is that you can only place on floors (due to the CanFit call).
             * That functionality may be desired. And so, it's included in this script.
             */
            {
                loc.Z -= TileData.ItemTable[target.ItemID]
                         .CalcHeight;
            }

            if (ValidatePlacement(from, loc))
            {
                EndPlace(from, type, loc);
            }
        }
Example #2
0
        public void Placement_OnTarget(Mobile from, object targeted, object state)
        {
            IPoint3D        p    = targeted as IPoint3D;
            HolidayTreeType type = (HolidayTreeType)state;

            if (p == null)
            {
                return;
            }

            Point3D loc = new Point3D(p);

            if (p is StaticTarget)
            {
                loc.Z -= TileData.ItemTable[((StaticTarget)p).ItemID & TileData.MaxItemValue].CalcHeight;
            }             /* NOTE: OSI does not properly normalize Z positioning here.
                           * A side affect is that you can only place on floors (due to the CanFit call).
                           * That functionality may be desired. And so, it's included in this script.
                           */

            if (ValidatePlacement(from, loc, type))
            {
                EndPlace(from, (HolidayTreeType)state, loc);
            }
        }
Example #3
0
        public void EndPlace(Mobile from, HolidayTreeType type, Point3D loc)
        {
            Delete();
            HolidayTree tree = new HolidayTree(from, type, loc);

            BaseHouse.FindHouseAt(tree)?.Addons.Add(tree);
        }
Example #4
0
        public void EndPlace(Mobile from, HolidayTreeType type, Point3D loc)
        {
            this.Delete();
            HolidayTree tree  = new HolidayTree(from, type, loc);
            var         house = HousingHelper.FindHouseAt(tree);

            if (house != null)
            {
                house.Addons.Add(tree);
            }
        }
Example #5
0
        public void EndPlace(Mobile from, HolidayTreeType type, Point3D loc)
        {
            Delete();
            HolidayTree tree  = new HolidayTree(from, type, loc);
            BaseHouse   house = BaseHouse.FindHouseAt(tree);

            if (house != null)
            {
                house.Addons[tree] = from;
            }
        }
Example #6
0
        public void EndPlace(Mobile from, HolidayTreeType type, Point3D loc)
        {
            this.Delete();
            HolidayTree temp = new HolidayTree(from, type, loc);

            BaseHouse house = BaseHouse.FindHouseAt(loc, from.Map, 20);

            if (house != null)
            {
                house.Addons.Add(temp);
            }
        }
Example #7
0
        public bool ValidatePlacement(Mobile from, Point3D loc, HolidayTreeType type)
        {
            if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                return(true);
            }

            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return(false);
            }


            if (type != HolidayTreeType.ClassicBare && type != HolidayTreeType.ModernBare && DateTime.UtcNow.Month != 12)
            {
                from.SendLocalizedMessage(1005700);                   // You will have to wait till next December to put your tree back up for display.
                return(false);
            }



            Map map = from.Map;

            if (map == null)
            {
                return(false);
            }

            var house = HousingHelper.FindHouseAt(loc, map, 20);

            if (house == null || !house.IsFriend(from))
            {
                from.SendLocalizedMessage(1005701);                   // The holiday tree can only be placed in your house.
                return(false);
            }

            if (!map.CanFit(loc, 20))
            {
                from.SendLocalizedMessage(500269);                   // You cannot build that there.
                return(false);
            }

            return(true);
        }
Example #8
0
 public void BeginPlace(Mobile from, HolidayTreeType type)
 {
     from.BeginTarget(-1, true, TargetFlags.None, Placement_OnTarget, type);
 }
Example #9
0
        public bool ValidatePlacement( Mobile from, Point3D loc, HolidayTreeType type )
        {
            if ( from.AccessLevel >= AccessLevel.GameMaster )
            {
                return true;
            }

            if ( !from.InRange( this.GetWorldLocation(), 1 ) )
            {
                from.SendLocalizedMessage( 500446 ); // That is too far away.
                return false;
            }

            if ( type != HolidayTreeType.ClassicBare && type != HolidayTreeType.ModernBare && DateTime.Now.Month != 12 )
            {
                from.SendLocalizedMessage( 1005700 ); // You will have to wait till next December to put your tree back up for display.
                return false;
            }

            Map map = from.Map;

            if ( map == null )
            {
                return false;
            }

            var house = HousingHelper.FindHouseAt( loc, map, 20 );

            if ( house == null || !house.IsFriend( from ) )
            {
                from.SendLocalizedMessage( 1005701 ); // The holiday tree can only be placed in your house.
                return false;
            }

            if ( !map.CanFit( loc, 20 ) )
            {
                from.SendLocalizedMessage( 500269 ); // You cannot build that there.
                return false;
            }

            return true;
        }
Example #10
0
        public HolidayTree(Mobile from, HolidayTreeType type, Point3D loc) : base(1)
        {
            Movable = false;
            MoveToWorld(loc, from.Map);

            Placer       = from;
            m_Components = new List <Item>();

            switch (type)
            {
            case HolidayTreeType.Classic:
            {
                ItemID = 0xCD7;

                AddItem(0, 0, 0, new TreeTrunk(this, 0xCD6));

                AddOrnament(0, 0, 2, 0xF22);
                AddOrnament(0, 0, 9, 0xF18);
                AddOrnament(0, 0, 15, 0xF20);
                AddOrnament(0, 0, 19, 0xF17);
                AddOrnament(0, 0, 20, 0xF24);
                AddOrnament(0, 0, 20, 0xF1F);
                AddOrnament(0, 0, 20, 0xF19);
                AddOrnament(0, 0, 21, 0xF1B);
                AddOrnament(0, 0, 28, 0xF2F);
                AddOrnament(0, 0, 30, 0xF23);
                AddOrnament(0, 0, 32, 0xF2A);
                AddOrnament(0, 0, 33, 0xF30);
                AddOrnament(0, 0, 34, 0xF29);
                AddOrnament(0, 1, 7, 0xF16);
                AddOrnament(0, 1, 7, 0xF1E);
                AddOrnament(0, 1, 12, 0xF0F);
                AddOrnament(0, 1, 13, 0xF13);
                AddOrnament(0, 1, 18, 0xF12);
                AddOrnament(0, 1, 19, 0xF15);
                AddOrnament(0, 1, 25, 0xF28);
                AddOrnament(0, 1, 29, 0xF1A);
                AddOrnament(0, 1, 37, 0xF2B);
                AddOrnament(1, 0, 13, 0xF10);
                AddOrnament(1, 0, 14, 0xF1C);
                AddOrnament(1, 0, 16, 0xF14);
                AddOrnament(1, 0, 17, 0xF26);
                AddOrnament(1, 0, 22, 0xF27);

                break;
            }

            case HolidayTreeType.Modern:
            {
                ItemID = 0x1B7E;

                AddOrnament(0, 0, 2, 0xF2F);
                AddOrnament(0, 0, 2, 0xF20);
                AddOrnament(0, 0, 2, 0xF22);
                AddOrnament(0, 0, 5, 0xF30);
                AddOrnament(0, 0, 5, 0xF15);
                AddOrnament(0, 0, 5, 0xF1F);
                AddOrnament(0, 0, 5, 0xF2B);
                AddOrnament(0, 0, 6, 0xF0F);
                AddOrnament(0, 0, 7, 0xF1E);
                AddOrnament(0, 0, 7, 0xF24);
                AddOrnament(0, 0, 8, 0xF29);
                AddOrnament(0, 0, 9, 0xF18);
                AddOrnament(0, 0, 14, 0xF1C);
                AddOrnament(0, 0, 15, 0xF13);
                AddOrnament(0, 0, 15, 0xF20);
                AddOrnament(0, 0, 16, 0xF26);
                AddOrnament(0, 0, 17, 0xF12);
                AddOrnament(0, 0, 18, 0xF17);
                AddOrnament(0, 0, 20, 0xF1B);
                AddOrnament(0, 0, 23, 0xF28);
                AddOrnament(0, 0, 25, 0xF18);
                AddOrnament(0, 0, 25, 0xF2A);
                AddOrnament(0, 1, 7, 0xF16);

                break;
            }
            }
        }
Example #11
0
 public void EndPlace( Mobile from, HolidayTreeType type, Point3D loc )
 {
     this.Delete();
     new HolidayTree( from, type, loc );
 }
Example #12
0
		public void EndPlace( Mobile from, HolidayTreeType type, Point3D loc )
		{
			this.Delete();
			HolidayTree tree = new HolidayTree( from, type, loc );
			BaseHouse house = BaseHouse.FindHouseAt( tree );
			if ( house != null ) 
				house.Addons.Add( tree );
		}
        }                                                                 // a tree for the holidays

        public HolidayTreeAddon(HolidayTreeType type) : base()
        {
            switch (type)
            {
            case HolidayTreeType.Classic:
            {
                AddComponent(new TreeTrunkComponent(0xCD6), 0, 0, 0);
                AddComponent(new TreeTrunkComponent(0xCD7), 0, 0, 0);

                AddOrnamentComponent(0, 0, 2, 0xF22);
                AddOrnamentComponent(0, 0, 9, 0xF18);
                AddOrnamentComponent(0, 0, 15, 0xF20);
                AddOrnamentComponent(0, 0, 19, 0xF17);
                AddOrnamentComponent(0, 0, 20, 0xF24);
                AddOrnamentComponent(0, 0, 20, 0xF1F);
                AddOrnamentComponent(0, 0, 20, 0xF19);
                AddOrnamentComponent(0, 0, 21, 0xF1B);
                AddOrnamentComponent(0, 0, 28, 0xF2F);
                AddOrnamentComponent(0, 0, 30, 0xF23);
                AddOrnamentComponent(0, 0, 32, 0xF2A);
                AddOrnamentComponent(0, 0, 33, 0xF30);
                AddOrnamentComponent(0, 0, 34, 0xF29);
                AddOrnamentComponent(0, 1, 7, 0xF16);
                AddOrnamentComponent(0, 1, 7, 0xF1E);
                AddOrnamentComponent(0, 1, 12, 0xF0F);
                AddOrnamentComponent(0, 1, 13, 0xF13);
                AddOrnamentComponent(0, 1, 18, 0xF12);
                AddOrnamentComponent(0, 1, 19, 0xF15);
                AddOrnamentComponent(0, 1, 25, 0xF28);
                AddOrnamentComponent(0, 1, 29, 0xF1A);
                AddOrnamentComponent(0, 1, 37, 0xF2B);
                AddOrnamentComponent(1, 0, 13, 0xF10);
                AddOrnamentComponent(1, 0, 14, 0xF1C);
                AddOrnamentComponent(1, 0, 16, 0xF14);
                AddOrnamentComponent(1, 0, 17, 0xF26);
                AddOrnamentComponent(1, 0, 22, 0xF27);

                break;
            }

            case HolidayTreeType.Modern:
            {
                AddComponent(new TreeTrunkComponent(0x1B7E), 0, 0, 0);

                AddOrnamentComponent(0, 0, 2, 0xF2F);
                AddOrnamentComponent(0, 0, 2, 0xF20);
                AddOrnamentComponent(0, 0, 2, 0xF22);
                AddOrnamentComponent(0, 0, 5, 0xF30);
                AddOrnamentComponent(0, 0, 5, 0xF15);
                AddOrnamentComponent(0, 0, 5, 0xF1F);
                AddOrnamentComponent(0, 0, 5, 0xF2B);
                AddOrnamentComponent(0, 0, 6, 0xF0F);
                AddOrnamentComponent(0, 0, 7, 0xF1E);
                AddOrnamentComponent(0, 0, 7, 0xF24);
                AddOrnamentComponent(0, 0, 8, 0xF29);
                AddOrnamentComponent(0, 0, 9, 0xF18);
                AddOrnamentComponent(0, 0, 14, 0xF1C);
                AddOrnamentComponent(0, 0, 15, 0xF13);
                AddOrnamentComponent(0, 0, 15, 0xF20);
                AddOrnamentComponent(0, 0, 16, 0xF26);
                AddOrnamentComponent(0, 0, 17, 0xF12);
                AddOrnamentComponent(0, 0, 18, 0xF17);
                AddOrnamentComponent(0, 0, 20, 0xF1B);
                AddOrnamentComponent(0, 0, 23, 0xF28);
                AddOrnamentComponent(0, 0, 25, 0xF18);
                AddOrnamentComponent(0, 0, 25, 0xF2A);
                AddOrnamentComponent(0, 1, 7, 0xF16);

                break;
            }
            }
        }
		public void BeginPlace( Mobile from, HolidayTreeType type )
		{
			m_TreeType = type;
			base.OnDoubleClick( from );
			//from.BeginTarget( -1, true, TargetFlags.None, new TargetStateCallback( Placement_OnTarget ), type );
		}
Example #15
0
 public void BeginPlace( Mobile from, HolidayTreeType type )
 {
     from.BeginTarget( -1, true, TargetFlags.None, new TargetStateCallback( Placement_OnTarget ), type );
 }
Example #16
0
 public void BeginPlace(Mobile from, HolidayTreeType type)
 {
     from.BeginTarget(-1, true, TargetFlags.None, new TargetStateCallback(Placement_OnTarget), type);
 }
 public void EndPlace(Mobile from, HolidayTreeType type, Point3D loc)
 {
     this.Delete();
     new HolidayTree(from, type, loc);
 }
Example #18
0
		public override int LabelNumber{ get{ return 1041117; } } // a tree for the holidays

		public HolidayTree( Mobile from, HolidayTreeType type, Point3D loc ) : base( 1 )
		{
			Movable = false;
			MoveToWorld( loc, from.Map );

			m_Placer = from;
			m_Components = new ArrayList();

			switch ( type )
			{
				case HolidayTreeType.Classic:
				{
					ItemID = 0xCD7;

					AddItem( 0, 0, 0, new TreeTrunk( this, 0xCD6 ) );

					AddOrnament( 0, 0,  2, 0xF22 );
					AddOrnament( 0, 0,  9, 0xF18 );
					AddOrnament( 0, 0, 15, 0xF20 );
					AddOrnament( 0, 0, 19, 0xF17 );
					AddOrnament( 0, 0, 20, 0xF24 );
					AddOrnament( 0, 0, 20, 0xF1F );
					AddOrnament( 0, 0, 20, 0xF19 );
					AddOrnament( 0, 0, 21, 0xF1B );
					AddOrnament( 0, 0, 28, 0xF2F );
					AddOrnament( 0, 0, 30, 0xF23 );
					AddOrnament( 0, 0, 32, 0xF2A );
					AddOrnament( 0, 0, 33, 0xF30 );
					AddOrnament( 0, 0, 34, 0xF29 );
					AddOrnament( 0, 1,  7, 0xF16 );
					AddOrnament( 0, 1,  7, 0xF1E );
					AddOrnament( 0, 1, 12, 0xF0F );
					AddOrnament( 0, 1, 13, 0xF13 );
					AddOrnament( 0, 1, 18, 0xF12 );
					AddOrnament( 0, 1, 19, 0xF15 );
					AddOrnament( 0, 1, 25, 0xF28 );
					AddOrnament( 0, 1, 29, 0xF1A );
					AddOrnament( 0, 1, 37, 0xF2B );
					AddOrnament( 1, 0, 13, 0xF10 );
					AddOrnament( 1, 0, 14, 0xF1C );
					AddOrnament( 1, 0, 16, 0xF14 );
					AddOrnament( 1, 0, 17, 0xF26 );
					AddOrnament( 1, 0, 22, 0xF27 );

					break;
				}
				case HolidayTreeType.Modern:
				{
					ItemID = 0x1B7E;

					AddOrnament( 0, 0,  2, 0xF2F );
					AddOrnament( 0, 0,  2, 0xF20 );
					AddOrnament( 0, 0,  2, 0xF22 );
					AddOrnament( 0, 0,  5, 0xF30 );
					AddOrnament( 0, 0,  5, 0xF15 );
					AddOrnament( 0, 0,  5, 0xF1F );
					AddOrnament( 0, 0,  5, 0xF2B );
					AddOrnament( 0, 0,  6, 0xF0F );
					AddOrnament( 0, 0,  7, 0xF1E );
					AddOrnament( 0, 0,  7, 0xF24 );
					AddOrnament( 0, 0,  8, 0xF29 );
					AddOrnament( 0, 0,  9, 0xF18 );
					AddOrnament( 0, 0, 14, 0xF1C );
					AddOrnament( 0, 0, 15, 0xF13 );
					AddOrnament( 0, 0, 15, 0xF20 );
					AddOrnament( 0, 0, 16, 0xF26 );
					AddOrnament( 0, 0, 17, 0xF12 );
					AddOrnament( 0, 0, 18, 0xF17 );
					AddOrnament( 0, 0, 20, 0xF1B );
					AddOrnament( 0, 0, 23, 0xF28 );
					AddOrnament( 0, 0, 25, 0xF18 );
					AddOrnament( 0, 0, 25, 0xF2A );
					AddOrnament( 0, 1,  7, 0xF16 );

					break;
				}
			}
		}
Example #19
0
 public void BeginPlace(Mobile from, HolidayTreeType type)
 {
     m_TreeType = type;
     base.OnDoubleClick(from);
     //from.BeginTarget( -1, true, TargetFlags.None, new TargetStateCallback( Placement_OnTarget ), type );
 }