コード例 #1
0
            public StumpTimer(PearTree Tree, FruitTreeStump Stump, Mobile from) : base(TimeSpan.FromMilliseconds(5500))
            {
                Priority = TimerPriority.TenMS;

                i_tree    = Tree;
                i_stump   = Stump;
                m_chopper = from;
            }
コード例 #2
0
        public static void init(FruitTreeStump plant)
        {
            TimeSpan delay = TreeHelper.StumpTime;

            plant.treeTime = DateTime.Now + delay;

            plant.thisTimer = new TreeHelper.GrowTimer(plant, plant.t_treeType, delay);
            plant.thisTimer.Start();
        }
コード例 #3
0
        public void Chop(Mobile from)
        {
            if (from.InRange(this.GetWorldLocation(), 2))
            {
                if ((chopTimer == null) || (!chopTimer.Running))
                {
                    if ((TreeHelper.TreeOrdinance) && (from.AccessLevel == AccessLevel.Player))
                    {
                        if (from.Region is Regions.GuardedRegion)
                        {
                            from.CriminalAction(true);
                        }
                    }

                    chopTimer = new TreeHelper.ChopAction(from);

                    Point3D pnt = this.Location;
                    Map     map = this.Map;

                    from.Direction = from.GetDirectionTo(this);
                    chopTimer.Start();

                    double lumberValue = from.Skills[SkillName.Lumberjacking].Value / 100;
                    if ((lumberValue > .5) && (Utility.RandomDouble() <= lumberValue))
                    {
                        Apple fruit = new Apple((int)Utility.Random(13) + m_yield);
                        from.AddToBackpack(fruit);

                        int cnt  = Utility.Random((int)(lumberValue * 10) + 1);
                        Log logs = new Log(cnt); // Fruitwood Logs ??
                        from.AddToBackpack(logs);

                        FruitTreeStump i_stump = new FruitTreeStump(typeof(AppleTree));
                        Timer          poof    = new StumpTimer(this, i_stump, from);
                        poof.Start();
                    }
                    else
                    {
                        from.SendLocalizedMessage(500495);  // You hack at the tree for a while, but fail to produce any useable wood.
                    }
                    //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", lumberValue ));
                }
            }
            else
            {
                from.SendLocalizedMessage(500446);   // That is too far away.
            }
        }
コード例 #4
0
        public void Chop(Mobile from)
        {
            if (from.InRange(this.GetWorldLocation(), 2))
            {
                if ((chopTimer == null) || (!chopTimer.Running))
                {
                    if ((TreeHelper.TreeOrdinance) && (from.AccessLevel == AccessLevel.Player))
                    {
                        if (from.Region is Regions.GuardedRegion)
                        {
                            from.CriminalAction(true);
                        }
                    }

                    chopTimer = new TreeHelper.ChopAction(from);

                    Point3D pnt = this.Location;
                    Map     map = this.Map;

                    from.Direction = from.GetDirectionTo(this);
                    chopTimer.Start();

                    double cookValue = from.Skills[SkillName.Lumberjacking].Value / 100;
                    if ((cookValue > .5) && (Utility.RandomDouble() <= cookValue))
                    {
                        Pear fruit = new Pear((int)Utility.Random(13) + m_yield);
                        from.AddToBackpack(fruit);

                        int cnt  = Utility.Random((int)(cookValue * 10) + 1);
                        Log logs = new Log(cnt);
                        from.AddToBackpack(logs);

                        FruitTreeStump i_stump = new FruitTreeStump(typeof(PearTree));
                        Timer          poof    = new StumpTimer(this, i_stump, from);
                        poof.Start();
                    }
                    else
                    {
                        from.SendLocalizedMessage(500495);
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(500446);
            }
        }
コード例 #5
0
            public StumpTimer( BlueberryTree Tree, FruitTreeStump Stump, Mobile from )
                : base(TimeSpan.FromMilliseconds( 5500 ))
            {
                Priority = TimerPriority.TenMS;

                i_tree = Tree;
                i_stump = Stump;
                m_chopper = from;
            }
コード例 #6
0
        public void Chop( Mobile from )
        {
            if ( from.InRange( this.GetWorldLocation(), 1 ) )
            {
                if ( ( chopTimer == null ) || ( !chopTimer.Running ) )
                {
                    if ( ( TreeHelper.TreeOrdinance ) && ( from.AccessLevel == AccessLevel.Player ) )
                    {
                        if ( from.Region is Regions.GuardedRegion )
                            from.CriminalAction( true );
                    }

                    chopTimer = new TreeHelper.ChopAction( from );

                    Point3D pnt = this.Location;
                    Map map =  this.Map;

                    from.Direction = from.GetDirectionTo( this );
                    chopTimer.Start();

                    double lumberValue = from.Skills[SkillName.Lumberjacking].Value / 100;
                    if ( ( lumberValue > .5 ) && ( Utility.RandomDouble() <= lumberValue ) )
                    {
                        Blueberries fruit = new Blueberries( (int)Utility.Random( 13 ) + m_yield );
                        from.AddToBackpack( fruit );

                        int cnt = Utility.Random( (int)( lumberValue * 10 ) + 1 );
                        Log logs = new Log( cnt ); // Fruitwood Logs ??
                        from.AddToBackpack( logs );

                        FruitTreeStump i_stump = new FruitTreeStump( typeof( BlueberryTree ) );
                        Timer poof = new StumpTimer( this, i_stump, from );
                        poof.Start();
                    }
                    else from.SendLocalizedMessage( 500495 ); // You hack at the tree for a while, but fail to produce any useable wood.
                    //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", lumberValue ));
                }
            }
            else from.SendLocalizedMessage( 500446 );  // That is too far away.
        }
コード例 #7
0
		public static void init( FruitTreeStump plant )
		{
			TimeSpan delay = TreeHelper.StumpTime;
			plant.treeTime = DateTime.Now + delay;

			plant.thisTimer = new TreeHelper.GrowTimer( plant, plant.t_treeType, delay ); 
			plant.thisTimer.Start(); 
		}