示例#1
0
        public override Item GetCropObject()
        {
            Pumpkin pumpkin = new Pumpkin();

            pumpkin.ItemID = Utility.Random(3178, 3);

            return(pumpkin);
        }
示例#2
0
		public override Item GetCropObject()
		{
			Pumpkin pumpkin = new Pumpkin();

			pumpkin.ItemID = Utility.Random( 3178, 3 );

			return pumpkin;
		}
示例#3
0
 public override bool LootItem(Mobile from)
 {
     if (Utility.RandomDouble() <= .05)
     {
         PumpkinSeed item = new PumpkinSeed();
         from.AddToBackpack(item);
         from.SendMessage("You manage to gather 1 pumpkin seed.");
     }
     Pumpkin c = new Pumpkin();
     c.ItemID = 3178;
     from.AddToBackpack(c);
     from.SendMessage("You manage to gather 1 pumpkin.");
     return true;
 }
		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 ) )
					{
						Pumpkin fruit = new Pumpkin( (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( PumpkinCrop ) );
						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.
				}
			}
			else from.SendLocalizedMessage( 500446 );  // That is too far away.
		}
		public override void OnDoubleClick( Mobile from )
		{
			if ( from.Mounted && !TreeHelper.CanPickMounted )
			{
				from.SendMessage( "You cannot pick fruit while mounted." ); 
				return; 
			}

			if ( DateTime.Now > lastpicked.AddSeconds(3) ) // 3 seconds between picking
			{
				lastpicked = DateTime.Now;
			
				int lumberValue = (int)from.Skills[SkillName.Lumberjacking].Value / 20;
				if ( from.Mounted ) 
					++lumberValue;

				if ( lumberValue < 0 )
				{
					from.SendMessage( "You have no idea how to pick this fruit." ); 
					return;
				}

				if ( from.InRange( this.GetWorldLocation(), 2 ) ) 
				{ 
					if ( m_yield < 1 )
					{
						from.SendMessage( "There is nothing here to harvest." ); 
					}
					else //check skill
					{
						from.Direction = from.GetDirectionTo( this );

						from.Animate( from.Mounted ? 26:17, 7, 1, true, false, 0 ); 

						if ( lumberValue < m_yield ) 
							lumberValue = m_yield + 1;

						int pick = Utility.Random( lumberValue );
						if ( pick == 0 )
						{
							from.SendMessage( "You do not manage to gather any fruit." ); 
							return;
						}
					
						m_yield -= pick;
						from.SendMessage( "You pick {0} Pumpkin{1}!", pick, ( pick == 1 ? "" : "s" ) ); 

						//PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield )); 

						Pumpkin crop = new Pumpkin( pick ); 
						from.AddToBackpack( crop );

						if ( !regrowTimer.Running )
						{
							regrowTimer.Start();
						}
					}
				} 
				else 
				{ 
					from.SendLocalizedMessage( 500446 ); // That is too far away. 
				} 
			}
		}
		public override void OnDoubleClick( Mobile from ) 
		{ 
			if ( m_sower == null || m_sower.Deleted ) 
				m_sower = from;

			if ( from.Mounted && !CropHelper.CanWorkMounted )
			{
				from.SendMessage( "You cannot harvest a crop while mounted." ); 
				return; 
			}

			if ( DateTime.Now > lastpicked.AddSeconds(1) ) // 3 seconds between picking changed to 1 sec
			{
				lastpicked = DateTime.Now;
			
				int cookingValue = (int)from.Skills[SkillName.Cooking].Value / 20;  //FUTURE add two skill checks...
				if ( cookingValue == 0 )
				{
					from.SendMessage( "You have no idea how to harvest this crop." ); 
					return;
				}

				if ( from.InRange( this.GetWorldLocation(), 1 ) ) 
				{ 
					if ( m_yield < 1 )
					{
						from.SendMessage( "There is nothing here to harvest." ); 

						if ( PlayerCanDestroy && !( m_sower.AccessLevel > AccessLevel.Counselor ) )
						{  
							UpRootGump g = new UpRootGump( from, this );
							from.SendGump( g );
						}
					}
					else //check skill and sower
					{
						from.Direction = from.GetDirectionTo( this );

						from.Animate( from.Mounted ? 29:32, 5, 1, true, false, 0 ); 

						if ( from == m_sower ) 
						{
							cookingValue *= 2;
							m_lastvisit = DateTime.Now;
						}

						if ( cookingValue > m_yield ) 
							cookingValue = m_yield + 1;

						int pick = Utility.Random( cookingValue );
						if ( pick == 0 )
						{
							from.SendMessage( "You do not manage to harvest any crops." ); 
							return;
						}
					
						m_yield -= pick;
						from.SendMessage( "You harvest {0} crop{1}!", pick, ( pick == 1 ? "" : "s" ) ); 

						//PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield )); 
						((Item)this).ItemID = pickedGraphic;

						Pumpkin crop = new Pumpkin( pick ); //I MODED
						from.AddToBackpack( crop );

						if ( SowerPickTime != TimeSpan.Zero && m_lastvisit + SowerPickTime < DateTime.Now && !( m_sower.AccessLevel > AccessLevel.Counselor ) )
						{
							this.UpRoot( from );
							return;
						}

						if ( !regrowTimer.Running )
						{
							regrowTimer.Start();
						}
					}
				} 
				else 
				{ 
					from.SendMessage( "You are too far away to harvest anything." ); 
				} 
			}
		} 
示例#7
0
        public override Item GetCropObject()
        {
            Pumpkin pumpkin = new Pumpkin();

            return(pumpkin);
        }