示例#1
0
        public GiftBag( bool nice )
        {
            Item item = null;

            Hue = Utility.RandomList( 32, 64, 2301 );

            if ( nice )
            {
                Name = "Happy Holidays!";
                DropItem( MakeNewbie( new WristWatch() ) );
                if ( Utility.RandomBool() )
                {
                    item = new Cake();
                    item.ItemID = 4164;
                    item.Hue = 432;
                    item.Name = "fruit cake";
                    DropItem( MakeNewbie( item ) );
                }
                else
                {
                    DropItem( MakeNewbie( new CheesePizza() ) );
                }

                if (Utility.RandomBool())
                    DropItem(MakeNewbie(new BeverageBottle(BeverageType.Champagne)));
                else
                    DropItem(MakeNewbie(new BeverageBottle(BeverageType.EggNog)));

                switch ( Utility.Random( 7 ) )
                {
                    default:
                    case 0:
                        DropItem( MakeNewbie( new Apple() ) );
                        break;
                    case 1:
                        DropItem( MakeNewbie( new Pear() ) );
                        break;
                    case 2:
                        DropItem( MakeNewbie( new Bananas() ) );
                        break;
                    case 3:
                        DropItem( MakeNewbie( new Dates() ) );
                        break;
                    case 4:
                        DropItem( MakeNewbie( new Coconut() ) );
                        break;
                    case 5:
                        DropItem( MakeNewbie( new Peach() ) );
                        break;
                    case 6:
                        DropItem( MakeNewbie( new Grapes() ) );
                        break;
                }

                item = new Goblet();
                item.Name = "a champagne glass";
                item.Hue = 71;
                DropItem( MakeNewbie( item ) );

                item = new Goblet();
                item.Name = "a champagne glass";
                item.Hue = 34;
                DropItem( MakeNewbie( item ) );

                DropItem( MakeNewbie( new FireworksWand( 100 ) ) );

                item = new Item( 5359 );
                item.Hue = Utility.RandomList( 32, 64, 2301 );
                item.Name = "Seasons Greetings";
                DropItem( MakeNewbie( item ) );

                //DropItem( new IrinaFlowers() );
            }
            else
            {
                Name = "You were naughty this year!";

                item = new Bacon();
                item.ItemID = 4164; // spam
                DropItem( MakeNewbie( item ) );

                DropItem( MakeNewbie( new Coal() ) );

                if ( Utility.RandomBool() )
                {
                    item = new Lemon();
                    item.Name = "Sour attitude";
                    DropItem( item );
                }

                item = new Kindling();
                item.Name = "switches";
                DropItem( item ); // not newbied...

                item = new Item( 5359 );
                item.Hue = Utility.RandomList( 32, 64, 2301 );
                item.Name = "Maybe next year you will get a nicer gift.";
                DropItem( MakeNewbie( item ) );
            }
        }
示例#2
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( from.Mounted && !TreeHelper.CanPickMounted )
			{
				from.SendMessage( "You cannot pick fruit while mounted." ); 
				return; 
			}
/* To Kill Tree
			if ( Utility.RandomDouble() <= .05 ) //.5 is 5% Chance
			{ 
			from.SendMessage( "The crop withers away." ); 
			if ( regrowTimer.Running )
				regrowTimer.Stop();

			this.Delete();
			}
*/
			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} Lemon{1}!", pick, ( pick == 1 ? "" : "s" ) ); 

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

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

						if ( !regrowTimer.Running )
						{
							regrowTimer.Start();
						}
					}
				} 
				else 
				{ 
					from.SendLocalizedMessage( 500446 ); // That is too far away. 
				} 
			}
		}
示例#3
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 ) )
					{
						Lemon fruit = new Lemon( (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( LemonTree ) );
						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.
		}
示例#4
0
        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.Peacemaking].Base * 0.1);
                if (from.Mounted)
                    ++lumberValue;

                if (lumberValue < 0) 								//Changed lumberValue == 0 to lv < 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) 									//Changed lumberValue > to lv < 0
                            lumberValue = m_yield + 1;

                        int pick = Utility.Random(lumberValue);
                        if (pick == 0 || ((PlayerMobile)from).Feats.GetFeatLevel(FeatList.Farming) < 1)
                        {
                            from.SendMessage("You do not manage to gather any fruit.");
                            return;
                        }

                        m_yield -= pick;
                        from.SendMessage("You pick {0} lemon{1}!", pick, (pick == 1 ? "" : "s"));
                        Seed.PickCropSeed(from, "LemonTree");

                        if (from is PlayerMobile)
                        {
                            ((PlayerMobile)from).Crafting = true;
                            Misc.LevelSystem.AwardMinimumXP((PlayerMobile)from, 1);
                            ((PlayerMobile)from).Crafting = false;
                        }

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

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

                        if (!regrowTimer.Running)
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500446); // That is too far away.
                }
            }
        }