Пример #1
0
        private void InitContents(FruitType type)
        {
            Food item  = null;
            byte count = (byte)Utility.RandomMinMax(10, 30);

            for (byte i = 0; i < count; i++)
            {
                switch (type)
                {
                default:
                case FruitType.Apples: item = new Apple(); break;

                case FruitType.Bananas: item = new Banana(); break;

                case FruitType.Bread: item = new BreadLoaf(); break;

                case FruitType.Gourds: item = new Gourd(); break;

                case FruitType.Grapes: item = new Grapes(); break;

                case FruitType.Lemons: item = new Lemon(); break;

                case FruitType.Tomatoes: item = new Tomato(); break;

                case FruitType.Vegetables1:
                case FruitType.Vegetables2:
                case FruitType.Vegetables3:
                {
                    switch (Utility.Random(4))
                    {
                    case 0: item = new Carrot(); break;

                    case 1: item = new Onion(); break;

                    case 2: item = new Pumpkin(); break;

                    case 3: item = new Gourd(); break;
                    }
                    break;
                }
                }

                if (item != null)
                {
                    DropItem(item);
                }
            }
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
            case 0:
            {
                from.SendMessage("You Have Created Meat.");
                Item o_item = null;

                switch (Utility.Random(3))
                {
                case 0: o_item = new Ham(); break;

                case 1: o_item = new CookedBird(); break;

                case 2: o_item = new Sausage(); break;
                }
                from.AddToBackpack(o_item);
                from.CloseGump(typeof(CreateFoodGump));

                break;
            }

            case 1:
            {
                from.SendMessage("You Have Created Fruits & Vegies.");
                Item o_item = null;

                switch (Utility.Random(3))
                {
                case 0: o_item = new Apple(); break;

                case 1: o_item = new Carrot(); break;

                case 2: o_item = new Grapes(); break;
                }
                from.AddToBackpack(o_item);
                from.CloseGump(typeof(CreateFoodGump));


                break;
            }
            }
        }
Пример #3
0
        private void Restock_Callback()
        {
            if (TotalItems < ItemsMax)
            {
                for (int i = TotalItems; i < ItemsMax; i++)
                {
                    Item item = null;

                    switch (Utility.RandomMinMax(1, 11))
                    {
                    default:
                    case 1: item = new Grapes(); break;

                    case 2: item = new Ham(); break;

                    case 3: item = new CheeseWedge(); break;

                    case 4: item = new Muffins(); break;

                    case 5: item = new FishSteak(); break;

                    case 6: item = new Ribs(); break;

                    case 7: item = new CookedBird(); break;

                    case 8: item = new Sausage(); break;

                    case 9: item = new Apple(); break;

                    case 10: item = new Peach(); break;

                    case 11: item = new Bandage(); break;
                    }

                    if (item != null)
                    {
                        DropItem(item);
                    }
                }
            }
        }
Пример #4
0
		private void InitContents( FruitType type )
		{
			Food item = null;
			byte count = (byte)Utility.RandomMinMax( 10, 30 );

			for( byte i = 0; i < count; i++ )
			{
				switch( type )
				{
					default:
					case FruitType.Apples: item = new Apple(); break;
					case FruitType.Bananas: item = new Banana(); break;
					case FruitType.Bread: item = new BreadLoaf(); break;
					case FruitType.Gourds: item = new Gourd(); break;
					case FruitType.Grapes: item = new Grapes(); break;
					case FruitType.Lemons: item = new Lemon(); break;
					case FruitType.Tomatoes: item = new Tomato(); break;
					case FruitType.Vegetables1:
					case FruitType.Vegetables2:
					case FruitType.Vegetables3:
						{
							switch( Utility.Random( 4 ) )
							{
								case 0: item = new Carrot(); break;
								case 1: item = new Onion(); break;
								case 2: item = new Pumpkin(); break;
								case 3: item = new Gourd(); break;
							}
							break;
						}
				}

				if( item != null )
					DropItem( item );
			}
		} 
Пример #5
0
        public static void GiveGrapes(Mobile m, int pick, GrapeVariety variety)
        {
            switch (variety)
            {
            case GrapeVariety.CabernetSauvignon:
            {
                CabernetSauvignonGrapes cscrop = new CabernetSauvignonGrapes(pick);
                m.AddToBackpack(cscrop);
                break;
            }

            case GrapeVariety.Chardonnay:
            {
                ChardonnayGrapes ccrop = new ChardonnayGrapes(pick);
                m.AddToBackpack(ccrop);
                break;
            }

            case GrapeVariety.CheninBlanc:
            {
                CheninBlancGrapes cbcrop = new CheninBlancGrapes(pick);
                m.AddToBackpack(cbcrop);
                break;
            }

            case GrapeVariety.Merlot:
            {
                MerlotGrapes mcrop = new MerlotGrapes(pick);
                m.AddToBackpack(mcrop);
                break;
            }

            case GrapeVariety.PinotNoir:
            {
                PinotNoirGrapes pncrop = new PinotNoirGrapes(pick);
                m.AddToBackpack(pncrop);
                break;
            }

            case GrapeVariety.Riesling:
            {
                RieslingGrapes rcrop = new RieslingGrapes(pick);
                m.AddToBackpack(rcrop);
                break;                         //Riesling
            }

            case GrapeVariety.Sangiovese:
            {
                SangioveseGrapes scrop = new SangioveseGrapes(pick);
                m.AddToBackpack(scrop);
                break;                         //Sangiovese
            }

            case GrapeVariety.SauvignonBlanc:
            {
                SauvignonBlancGrapes sbcrop = new SauvignonBlancGrapes(pick);
                m.AddToBackpack(sbcrop);
                break;                         //Sauvignon Blanc
            }

            case GrapeVariety.Shiraz:
            {
                ShirazGrapes shcrop = new ShirazGrapes(pick);
                m.AddToBackpack(shcrop);
                break;                         //Shiraz
            }

            case GrapeVariety.Viognier:
            {
                ViognierGrapes vcrop = new ViognierGrapes(pick);
                m.AddToBackpack(vcrop);
                break;                         //Viognier
            }

            case GrapeVariety.Zinfandel:
            {
                ZinfandelGrapes zcrop = new ZinfandelGrapes(pick);
                m.AddToBackpack(zcrop);
                break;                         //Zinfandel
            }

            default:
            {
                Grapes crop = new Grapes(pick);
                m.AddToBackpack(crop);
                break;
            }
            }
        }
Пример #6
0
        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;

                        Grapes crop = new Grapes(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.");
                }
            }
        }