Пример #1
0
        public override void Open(Mobile from)
        {
            int amount = 50;

            if (this.Weight > 2.0)
            {
                Item i = null;
                i = new BlackPearl(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new Bloodmoss(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new Garlic(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new Ginseng(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new MandrakeRoot(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new Nightshade(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new SulfurousAsh(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new SpidersSilk(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new Brimstone(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new ButterflyWings(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new EyeOfToad(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new FairyEgg(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new GargoyleEar(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new BeetleShell(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new MoonCrystal(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new PixieSkull(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new RedLotus(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new SeaSalt(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new SilverWidow(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new SwampBerries(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);

                this.Weight = 2.0;
            }

            base.Open(from);
        }
Пример #2
0
        public override void Spawn(Point3D point, Map map)
        {
            base.Spawn(point, map);

            Item item = null;

            int minAmount = 2;
            int maxAmount = 4;

            int amount = Utility.RandomMinMax(minAmount, maxAmount);

            switch (Utility.RandomMinMax(1, 8))
            {
            case 1: item = new BlackPearl(amount); break;

            case 2: item = new Bloodmoss(amount); break;

            case 3: item = new MandrakeRoot(amount); break;

            case 4: item = new Ginseng(amount); break;

            case 5: item = new Garlic(amount); break;

            case 6: item = new SpidersSilk(amount); break;

            case 7: item = new SulfurousAsh(amount); break;

            case 8: item = new Nightshade(amount); break;
            }

            item.MoveToWorld(point, map);
        }
Пример #3
0
        private void SpawnReagents()
        {
            Item reagents;
            int  amount = Utility.RandomMinMax(10, 25);

            switch (Utility.Random(9))
            {
            case 0: reagents = new BlackPearl(amount); break;

            case 1: reagents = new Bloodmoss(amount); break;

            case 2: reagents = new Garlic(amount); break;

            case 3: reagents = new Ginseng(amount); break;

            case 4: reagents = new MandrakeRoot(amount); break;

            case 5: reagents = new Nightshade(amount); break;

            case 6: reagents = new SulfurousAsh(amount); break;

            case 7: reagents = new SpidersSilk(amount); break;

            default: reagents = new FertileDirt(amount); break;
            }

            if (!SpawnItem(reagents))
            {
                reagents.Delete();
            }
        }
Пример #4
0
 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(this.GetWorldLocation(), 2))
     {
         int     pick = Utility.Random(1, 3);
         Ginseng crop = new Ginseng(pick);
         from.AddToBackpack(crop);
         this.Delete();
     }
     else
     {
         from.SendMessage("You are too far away to harvest anything.");
     }
 }
Пример #5
0
 public override bool LootItem(Mobile from)
 {
     if (Utility.RandomDouble() <= .05)
     {
         GinsengSeed item = new GinsengSeed();
         from.AddToBackpack(item);
         from.SendMessage("You manage to gather 1 ginseng seed.");
     }
     Ginseng c = new Ginseng();
     c.ItemID = 3973;
     from.AddToBackpack(c);
     from.SendMessage("You manage to gather 1 ginseng.");
     return true;
 }
Пример #6
0
		public override void OnDoubleClick( Mobile from ) 
		{
		    if ( from.InRange( this.GetWorldLocation(), 2 ) ) 
		    { 
		    int pick = Utility.Random( 1,3 );
			Ginseng crop = new Ginseng( pick ); 
			from.AddToBackpack( crop );
			this.Delete();
		    }
		    else
		    { 
			from.SendMessage( "You are too far away to harvest anything." ); 
		    } 
		}
Пример #7
0
        public override void Open(Mobile from)
        {
            int amount = 50;

            if (this.Weight > 2.0)
            {
                Item i = null;
                i = new BlackPearl(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new Bloodmoss(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new Garlic(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new Ginseng(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new MandrakeRoot(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new Nightshade(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new SulfurousAsh(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);
                i = new SpidersSilk(amount); DropItem(i); BaseContainer.DropItemFix(i, from, ItemID, GumpID);

                this.Weight = 2.0;
            }

            base.Open(from);
        }
Пример #8
0
		private void SpawnReagents()
		{
			Item reagents;
			int amount = Utility.RandomMinMax( 10, 25 );

			switch ( Utility.Random( 9 ) )
			{
				case 0: reagents = new BlackPearl( amount ); break;
				case 1: reagents = new Bloodmoss( amount ); break;
				case 2: reagents = new Garlic( amount ); break;
				case 3: reagents = new Ginseng( amount ); break;
				case 4: reagents = new MandrakeRoot( amount ); break;
				case 5: reagents = new Nightshade( amount ); break;
				case 6: reagents = new SulfurousAsh( amount ); break;
				case 7: reagents = new SpidersSilk( amount ); break;
				default: reagents = new FertileDirt( amount ); break;
			}

			if ( !SpawnItem( reagents ) )
				reagents.Delete();
		}
Пример #9
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(3) ) // 3 seconds between picking
			{
				lastpicked = DateTime.Now;
			
				int mageValue = (int)from.Skills[SkillName.Magery].Value / 20;  //FUTURE add two skill checks...
				if ( mageValue == 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 ) 
						{
							mageValue *= 2;
							m_lastvisit = DateTime.Now;
						}

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

						int pick = Utility.Random( mageValue );
						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;

						Ginseng crop = new Ginseng( pick ); 
						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." ); 
				} 
			}
		} 
Пример #10
0
        public override Item GetCropObject()
        {
            Ginseng reagent = new Ginseng();

            return(reagent);
        }
        public static void CreateItem(ItemInfo info, Mobile m)
        {
            if (m == null)
                return;

            Item item = null;
            BaseCreature bc = null;
            switch (info.IncrID)
            {
                case 0: item = new BlackPearl(999); break;
                case 1: item = new Bloodmoss(999); break;
                case 2: item = new MandrakeRoot(999); break;
                case 3: item = new Garlic(999); break;
                case 4: item = new Ginseng(999); break;
                case 5: item = new Nightshade(999); break;
                case 6: item = new SpidersSilk(999); break;
                case 7: item = new SulfurousAsh(999); break;
                case 8: item = new Bag();
                        ((Bag)item).DropItem( new BlackPearl(100) );
                        ((Bag)item).DropItem( new Bloodmoss(100) );
                        ((Bag)item).DropItem( new MandrakeRoot(100) );
                        ((Bag)item).DropItem( new Garlic(100) );
                        ((Bag)item).DropItem( new Ginseng(100) );
                        ((Bag)item).DropItem( new Nightshade(100) );
                        ((Bag)item).DropItem( new SpidersSilk(100) );
                        ((Bag)item).DropItem( new SulfurousAsh(100) );
                        break;
                case 9: item = new BatWing(999); break;
                case 10: item = new GraveDust(999); break;
                case 11: item = new DaemonBlood(999); break;
                case 12: item = new NoxCrystal(999); break;
                case 13: item = new PigIron(999); break;
                case 14: item = new Bag();
                        ((Bag)item).DropItem( new BatWing(100) );
                        ((Bag)item).DropItem( new GraveDust(100) );
                        ((Bag)item).DropItem( new DaemonBlood(100) );
                        ((Bag)item).DropItem( new NoxCrystal(100) );
                        ((Bag)item).DropItem( new PigIron(100) );
                        break;
                case 15: for (int i=0; i < 2; i++) //The last potion is dropped later
                        {
                            item = new RefreshPotion();
                            m.AddToBackpack(item);
                        }
                        item = new RefreshPotion();
                        break;
                case 16: for (int i=0; i < 2; i++) //The last potion is dropped later
                        {
                            item = new RefreshPotion();
                            m.AddToBackpack(item);
                        }
                        item = new LesserCurePotion();
                        break;
                case 17: for (int i=0; i < 2; i++) //The last potion is dropped later
                        {
                            item = new RefreshPotion();
                            m.AddToBackpack(item);
                        }
                        item = new LesserHealPotion();
                        break;
                case 18: for (int i=0; i < 2; i++) //The last potion is dropped later
                        {
                            item = new RefreshPotion();
                            m.AddToBackpack(item);
                        }
                        item = new NightSightPotion();
                        break;
                case 19: item = new Bandage(50); break;
                case 20: item = new Bandage(200); break;
                case 21: item = new Bandage(1000); break;
                case 22: item = new Arrow(100); break;
                case 23: item = new Arrow(1000); break;
                case 24: item = new Bolt(100); break;
                case 25: item = new Bolt(1000); break;
                case 26: bc = new Horse(); break;
                case 27: bc = new PackLlama(); break;
                case 28: item = new Club();
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 29: item = new WarFork();
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 30: item = new Katana();
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 31: item = new Bow();
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 32: item = new MetalKiteShield();
                        BaseRunicTool.ApplyAttributesTo((BaseShield)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 33: item = new WoodenShield();
                        BaseRunicTool.ApplyAttributesTo((BaseShield)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 34: item = new LeatherChest();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 35: item = new LeatherGloves();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 36: item = new LeatherGorget();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 37: item = new LeatherLegs();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 38: item = new LeatherCap();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 39: item = new LeatherArms();
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80);
                        break;
                case 40: item = new Gold(300); break;
                case 41: item = new Gold(3000); break;
                case 42: item = new Server.Engines.BulkOrders.BulkOrderBook(); break;
                case 43: item = new Drums();
                        ((BaseInstrument)item).Quality = InstrumentQuality.Exceptional;
                        break;
                case 44: item = new TambourineTassel();
                        ((BaseInstrument)item).Quality = InstrumentQuality.Exceptional;
                        break;
                case 45: item = new Server.Multis.SmallDragonBoatDeed(); break;
                case 46: item = new Server.Multis.LargeDragonBoatDeed(); break;
            }

            if (item != null)
            {
                m.AddToBackpack(item);
                m.SendMessage("Here are the goods you requested.");
            }
            else if (bc != null)
            {
                bc.Controlled = true;
                bc.ControlMaster = m;
                bc.MoveToWorld( m.Location, m.Map );
                m.SendMessage("Here is the pet you requested.");
            }
            else
            {
                m.SendMessage("That item is not available. Please report the bug at the site that will open in your browser.");
                m.LaunchBrowser( "http://bug.casiopia.net/" );
                m.AddToBackpack( new VeriteGem(info.Price) );
            }
        }
Пример #12
0
        public static void GiveReagent(Mobile from, int qty)
        {
            string regs = "";

            Item ingredient = new BlackPearl(); ingredient.Delete();

            int mainList  = Utility.RandomList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
            int necroList = Utility.RandomList(8, 9, 10, 11, 12);
            int mixList   = Utility.RandomList(13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24);
            int herbList  = Utility.RandomList(25, 26, 27, 28, 29, 30);

            if (Server.Misc.IntelligentAction.TestForReagent(from, "herbalist") && Utility.RandomMinMax(1, 2) == 1)
            {
                mainList = herbList;
            }

            if (Server.Misc.IntelligentAction.TestForReagent(from, "mixologist") && Utility.RandomMinMax(1, 2) == 1)
            {
                mainList = mixList;
            }

            if (Server.Misc.IntelligentAction.TestForReagent(from, "necromancer") && Utility.RandomMinMax(1, 4) > 1)
            {
                mainList = necroList;
            }

            switch (mainList)
            {
            case 0: ingredient = new BlackPearl(qty); break;

            case 1: ingredient = new Bloodmoss(qty); break;

            case 2: ingredient = new Garlic(qty); break;

            case 3: ingredient = new Ginseng(qty); break;

            case 4: ingredient = new MandrakeRoot(qty); break;

            case 5: ingredient = new Nightshade(qty); break;

            case 6: ingredient = new SpidersSilk(qty); break;

            case 7: ingredient = new SulfurousAsh(qty); break;

            case 8: ingredient = new BatWing(qty); break;

            case 9: ingredient = new GraveDust(qty); break;

            case 10: ingredient = new DaemonBlood(qty); break;

            case 11: ingredient = new PigIron(qty); break;

            case 12: ingredient = new NoxCrystal(qty); break;

            case 13: ingredient = new EyeOfToad(qty); break;

            case 14: ingredient = new FairyEgg(qty); break;

            case 15: ingredient = new GargoyleEar(qty); break;

            case 16: ingredient = new BeetleShell(qty); break;

            case 17: ingredient = new MoonCrystal(qty); break;

            case 18: ingredient = new PixieSkull(qty); break;

            case 19: ingredient = new RedLotus(qty); break;

            case 20: ingredient = new SeaSalt(qty); break;

            case 21: ingredient = new SilverWidow(qty); break;

            case 22: ingredient = new SwampBerries(qty); break;

            case 23: ingredient = new Brimstone(qty); break;

            case 24: ingredient = new ButterflyWings(qty); break;

            case 25: ingredient = new PlantHerbalism_Leaf(); ingredient.Amount = qty; break;

            case 26: ingredient = new PlantHerbalism_Flower(); ingredient.Amount = qty; break;

            case 27: ingredient = new PlantHerbalism_Mushroom(); ingredient.Amount = qty; break;

            case 28: ingredient = new PlantHerbalism_Lilly(); ingredient.Amount = qty; break;

            case 29: ingredient = new PlantHerbalism_Cactus(); ingredient.Amount = qty; break;

            case 30: ingredient = new PlantHerbalism_Grass(); ingredient.Amount = qty; break;
            }

            from.AddToBackpack(ingredient);

            regs = ingredient.Name;

            if (regs == null)
            {
                regs = Server.Misc.MorphingItem.AddSpacesToSentence((ingredient.GetType()).Name);
                regs = regs.ToLower(new CultureInfo("en-US", false));
            }

            if (qty < 2)
            {
                from.SendMessage("This seems to be " + regs + ".");
            }
            else
            {
                from.SendMessage("This seems to be " + qty + " " + regs + ".");
            }
        }
Пример #13
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("This must be in your backpack to use.");
                return;
            }
            else
            {
                if (from.CheckSkill(SkillName.TasteID, -5, 125))
                {
                    int QtyBonus = 0;
                    if (from.Skills[SkillName.Cooking].Value >= 25.0)
                    {
                        QtyBonus = (int)(from.Skills[SkillName.Cooking].Value / 5);
                    }

                    from.PlaySound(Utility.Random(0x3A, 3));

                    if (from.Body.IsHuman && !from.Mounted)
                    {
                        from.Animate(34, 5, 1, true, false, 0);
                    }

                    int RegCount = this.RegAmount + QtyBonus;
                    if (RegCount < 1)
                    {
                        RegCount = 1;
                    }

                    int reagentType = Utility.RandomMinMax(0, 12);

                    Item ingredient = new BlackPearl(); ingredient.Delete();

                    int mainList  = Utility.RandomList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
                    int necroList = Utility.RandomList(8, 9, 10, 11, 12);
                    int mixList   = Utility.RandomList(13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24);
                    int herbList  = Utility.RandomList(25, 26, 27, 28, 29, 30);

                    if (Server.Misc.IntelligentAction.TestForReagent(from, "herbalist") && Utility.RandomMinMax(1, 2) == 1)
                    {
                        mainList = herbList;
                    }

                    if (Server.Misc.IntelligentAction.TestForReagent(from, "mixologist") && Utility.RandomMinMax(1, 2) == 1)
                    {
                        mainList = mixList;
                    }

                    if (Server.Misc.IntelligentAction.TestForReagent(from, "necromancer") && Utility.RandomMinMax(1, 4) > 1)
                    {
                        mainList = necroList;
                    }

                    switch (mainList)
                    {
                    case 0: ingredient = new BlackPearl(RegCount); break;

                    case 1: ingredient = new Bloodmoss(RegCount); break;

                    case 2: ingredient = new Garlic(RegCount); break;

                    case 3: ingredient = new Ginseng(RegCount); break;

                    case 4: ingredient = new MandrakeRoot(RegCount); break;

                    case 5: ingredient = new Nightshade(RegCount); break;

                    case 6: ingredient = new SpidersSilk(RegCount); break;

                    case 7: ingredient = new SulfurousAsh(RegCount); break;

                    case 8: ingredient = new BatWing(RegCount); break;

                    case 9: ingredient = new GraveDust(RegCount); break;

                    case 10: ingredient = new DaemonBlood(RegCount); break;

                    case 11: ingredient = new PigIron(RegCount); break;

                    case 12: ingredient = new NoxCrystal(RegCount); break;

                    case 13: ingredient = new EyeOfToad(RegCount); break;

                    case 14: ingredient = new FairyEgg(RegCount); break;

                    case 15: ingredient = new GargoyleEar(RegCount); break;

                    case 16: ingredient = new BeetleShell(RegCount); break;

                    case 17: ingredient = new MoonCrystal(RegCount); break;

                    case 18: ingredient = new PixieSkull(RegCount); break;

                    case 19: ingredient = new RedLotus(RegCount); break;

                    case 20: ingredient = new SeaSalt(RegCount); break;

                    case 21: ingredient = new SilverWidow(RegCount); break;

                    case 22: ingredient = new SwampBerries(RegCount); break;

                    case 23: ingredient = new Brimstone(RegCount); break;

                    case 24: ingredient = new ButterflyWings(RegCount); break;

                    case 25: ingredient = new PlantHerbalism_Leaf(); ingredient.Amount = RegCount; break;

                    case 26: ingredient = new PlantHerbalism_Flower(); ingredient.Amount = RegCount; break;

                    case 27: ingredient = new PlantHerbalism_Mushroom(); ingredient.Amount = RegCount; break;

                    case 28: ingredient = new PlantHerbalism_Lilly(); ingredient.Amount = RegCount; break;

                    case 29: ingredient = new PlantHerbalism_Cactus(); ingredient.Amount = RegCount; break;

                    case 30: ingredient = new PlantHerbalism_Grass(); ingredient.Amount = RegCount; break;
                    }

                    from.AddToBackpack(ingredient);

                    string iName = ingredient.Name;

                    if (iName == null)
                    {
                        iName = Server.Misc.MorphingItem.AddSpacesToSentence((ingredient.GetType()).Name);
                        iName = iName.ToLower(new CultureInfo("en-US", false));
                    }

                    if (RegCount < 2)
                    {
                        from.SendMessage("This seems to be " + iName + ".");
                    }
                    else
                    {
                        from.SendMessage("This seems to be " + RegCount + " " + iName + ".");
                    }
                }
                else
                {
                    int nReaction = Utility.RandomMinMax(0, 10);

                    if (nReaction < 3)
                    {
                        from.PlaySound(from.Female ? 813 : 1087);
                        from.Say("*vomits*");
                        if (!from.Mounted)
                        {
                            from.Animate(32, 5, 1, true, false, 0);
                        }
                        Vomit puke = new Vomit();
                        puke.Map      = from.Map;
                        puke.Location = from.Location;
                        from.SendMessage("Making you sick to your stomach, you toss it out.");
                    }
                    else if (nReaction > 6)
                    {
                        int nPoison = Utility.RandomMinMax(0, 10);
                        from.Say("Poison!");
                        from.PlaySound(Utility.Random(0x3A, 3));
                        if (nPoison > 9)
                        {
                            from.ApplyPoison(from, Poison.Deadly);
                        }
                        else if (nPoison > 7)
                        {
                            from.ApplyPoison(from, Poison.Greater);
                        }
                        else if (nPoison > 4)
                        {
                            from.ApplyPoison(from, Poison.Regular);
                        }
                        else
                        {
                            from.ApplyPoison(from, Poison.Lesser);
                        }
                        from.SendMessage("Poison!");
                    }
                    else
                    {
                        from.PlaySound(Utility.Random(0x3A, 3));
                        if (from.Body.IsHuman && !from.Mounted)
                        {
                            from.Animate(34, 5, 1, true, false, 0);
                        }
                        from.SendMessage("Failing to identify the reagent, you toss it out.");
                    }
                }

                this.Delete();
            }
        }
Пример #14
0
        public void ReceiveReward(Mobile from)
        {
            int TotalValues = 0;

            Item   item        = null;
            string rewardText  = "";
            int    rewardSound = 0x5AA;

            Dictionary <string, int> DictTemp = new Dictionary <string, int>();

            //Used to Determine Chance of Last Reward Item (GoldSmallAmount)
            int maxRandomValue = 1000;

            int ultraRareValue = 2;
            int rareValue      = 7;
            int uncommonValue  = 20;
            int commonValue    = 150;

            //Ultra Rares
            DictTemp.Add("PlayerCustomizationDeed", ultraRareValue);
            DictTemp.Add("AntiqueStandingClock", ultraRareValue);
            DictTemp.Add("CityLampPost", ultraRareValue);
            DictTemp.Add("LuniteIngots", ultraRareValue);
            DictTemp.Add("AquariumDeed", ultraRareValue);
            DictTemp.Add("LuxuriousFurniture", ultraRareValue);
            DictTemp.Add("MiniatureTownPiece", ultraRareValue);
            DictTemp.Add("UltraRareCloth", ultraRareValue);
            DictTemp.Add("DisplayCaseLargeAddon", ultraRareValue);
            DictTemp.Add("DisplayCaseMediumAddon", ultraRareValue);
            DictTemp.Add("LargeBenchAddon", ultraRareValue);
            DictTemp.Add("BarTopGlassMugs", ultraRareValue);
            DictTemp.Add("BarTopGoblets", ultraRareValue);
            DictTemp.Add("ExplodingBullvore", ultraRareValue);

            //Rares
            DictTemp.Add("UnfinishedFurniture", rareValue);
            DictTemp.Add("SpellHueDeed", rareValue);
            DictTemp.Add("MiniatureHome", rareValue);
            DictTemp.Add("CraftingComponentsLargeAmount", rareValue);
            DictTemp.Add("GoldHugeAmount", rareValue);
            DictTemp.Add("TableWithRunner", rareValue);
            DictTemp.Add("ExplodingLlama", rareValue);
            DictTemp.Add("MagicalWeapon", rareValue);
            DictTemp.Add("MagicalArmor", rareValue);
            DictTemp.Add("RareCloth", rareValue);
            DictTemp.Add("HideRack", rareValue);
            DictTemp.Add("HideRackLargeAddon", rareValue);
            DictTemp.Add("DisplayCaseSmall", rareValue);

            //Uncommon
            DictTemp.Add("CraftingComponentsMediumAmount", uncommonValue);
            DictTemp.Add("SpiderSilkFishingNet", uncommonValue);
            DictTemp.Add("CampingFirepit", uncommonValue);
            DictTemp.Add("GoldLargeAmount", uncommonValue);
            DictTemp.Add("ParagonWand", uncommonValue);
            DictTemp.Add("Lure", uncommonValue);
            DictTemp.Add("ResearchMaterials", uncommonValue);
            DictTemp.Add("AncientMysteryScroll", uncommonValue);
            DictTemp.Add("LavishPillow", uncommonValue);
            DictTemp.Add("VeterinarySalts", uncommonValue);
            DictTemp.Add("ExplodingSheep", uncommonValue);
            DictTemp.Add("DiamondHarvestingTool", uncommonValue);

            //Common
            DictTemp.Add("PrestigeScroll", commonValue);
            DictTemp.Add("GoldMediumAmount", commonValue);
            DictTemp.Add("CraftingComponentsSmallAmount", (int)Math.Round((double)commonValue / 2));
            DictTemp.Add("Reagents", commonValue);

            foreach (KeyValuePair <string, int> pair in DictTemp)
            {
                TotalValues += pair.Value;
            }

            int remainderItemChance = maxRandomValue - TotalValues;

            if (remainderItemChance < 1)
            {
                remainderItemChance = 1;
            }

            //Last Reward Item (Chance = maxRandomValue - Sum of All Item Values Combined)
            DictTemp.Add("GoldSmallAmount", remainderItemChance);

            TotalValues += remainderItemChance;

            double ItemCheck = Utility.RandomDouble();

            double CumulativeAmount = 0.0;
            double AdditionalAmount = 0.0;

            //Determine Reward
            foreach (KeyValuePair <string, int> pair in DictTemp)
            {
                AdditionalAmount = (double)pair.Value / (double)TotalValues;

                if (ItemCheck >= CumulativeAmount && ItemCheck < (CumulativeAmount + AdditionalAmount))
                {
                    Bag bag;

                    switch (pair.Key)
                    {
                    //Ultra Rares
                    case "PlayerCustomizationDeed":
                        item       = new Custom.PlayerCustomizationDeed();
                        rewardText = "You receive a player customization deed.";
                        break;

                    case "AntiqueStandingClock":
                        item       = new AntiqueStandingClock();
                        rewardText = "You receive an antique standing clock.";
                        break;

                    case "CityLampPost":
                        item       = new CityLampPost();
                        rewardText = "You receive a city lamp post.";
                        break;

                    case "LuniteIngots":
                        item       = new LuniteIngot(Utility.RandomMinMax(25, 50));
                        rewardText = "You receive some lunite ingots.";
                        break;

                    case "AquariumDeed":
                        if (Utility.RandomDouble() <= .5)
                        {
                            item = new AquariumEastDeed();
                        }
                        else
                        {
                            item = new AquariumNorthDeed();
                        }

                        rewardText = "You receive an aquarium deed";
                        break;

                    case "LuxuriousFurniture":
                        switch (Utility.RandomMinMax(1, 12))
                        {
                        case 1: item = new LuxuriousBookstand(); break;

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

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

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

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

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

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

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

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

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

                        case 11: item = new LuxuriousReadingDesk(); break;

                        case 12: item = new LuxuriousAlchemyTable(); break;
                        }

                        rewardText = "You receive some luxurious furniture.";
                        break;

                    case "MiniatureTownPiece":
                        item       = new MiniatureTownPiece();
                        rewardText = "You receive a miniature town piece.";
                        break;

                    case "UltraRareCloth":
                        item       = new UltraRareCloth();
                        rewardText = "You receive some ultra rare cloth.";
                        break;

                    case "DisplayCaseLargeAddon":
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: item = new DisplayCaseLargeEastAddonDeed(); break;

                        case 2: item = new DisplayCaseLargeNorthAddonDeed(); break;
                        }

                        rewardText = "You receive a large display case.";
                        break;

                    case "DisplayCaseMediumAddon":
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: item = new DisplayCaseMediumEastAddonDeed(); break;

                        case 2: item = new DisplayCaseMediumNorthAddonDeed(); break;
                        }

                        rewardText = "You receive a medium display case.";
                        break;

                    case "LargeBenchAddon":
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: item = new LargeBenchEastAddonDeed(); break;

                        case 2: item = new LargeBenchNorthAddonDeed(); break;
                        }

                        rewardText = "You receive a large bench.";
                        break;

                    case "BarTopGlassMugs":
                        item       = new BarTopGlassMugs();
                        rewardText = "You receive bar top glass mugs.";
                        break;

                    case "BarTopGoblets":
                        item       = new BarTopGoblets();
                        rewardText = "You receive bar top goblets.";
                        break;

                    case "ExplodingBullvore":
                        item       = new ExplodingBullvore();
                        rewardText = "You receive an exploding bullvore.";
                        break;

                    //Rares
                    case "UnfinishedFurniture":
                        switch (Utility.RandomMinMax(1, 5))
                        {
                        case 1: item = new UnfinishedWoodenChair(); break;

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

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

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

                        case 5: item = new UnfinishedBookshelf(); break;
                        }

                        rewardText = "You receive some unfinished furniture.";
                        break;

                    case "SpellHueDeed":
                        item       = new Custom.SpellHueDeed();
                        rewardText = "You receive a spell hue deed.";
                        break;

                    case "MiniatureHome":
                        item       = new MiniatureHome();
                        rewardText = "You receive a miniature home.";
                        break;

                    case "CraftingComponentsLargeAmount":
                        item       = CraftingComponent.GetRandomCraftingComponent(10);
                        rewardText = "You receive a large number of crafting components.";
                        break;

                    case "GoldHugeAmount":
                        item       = new Gold(Utility.RandomMinMax(2500, 10000));
                        rewardText = "You receive a very large amount of gold.";
                        break;

                    case "TableWithRunner":
                        item       = new TableWithRunner();
                        rewardText = "You receive a small table with runner.";
                        break;

                    case "ExplodingLlama":
                        item       = new ExplodingLlama();
                        rewardText = "You receive an exploding llama.";
                        break;

                    case "MagicalWeapon":
                        BaseWeapon weapon = Loot.RandomWeapon();

                        if (weapon != null)
                        {
                            weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.RandomMinMax(3, 5);
                            weapon.DamageLevel     = (WeaponDamageLevel)Utility.RandomMinMax(3, 5);
                            weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.RandomMinMax(3, 5);
                        }

                        item       = weapon;
                        rewardText = "You receive a magical weapon.";
                        break;

                    case "MagicalArmor":
                        BaseArmor armor = Loot.RandomArmor();

                        if (armor != null)
                        {
                            armor.ProtectionLevel = (ArmorProtectionLevel)Utility.RandomMinMax(4, 5);
                            armor.DurabilityLevel = (ArmorDurabilityLevel)Utility.RandomMinMax(4, 5);
                        }

                        item       = armor;
                        rewardText = "You receive some magical armor.";
                        break;

                    case "RareCloth":
                        item       = new RareCloth();
                        rewardText = "You receive some rare cloth.";
                        break;

                    case "HideRack":
                        item       = new HideRack();
                        rewardText = "You receive a hide rack.";
                        break;

                    case "HideRackLargeAddon":
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: item = new HideRackLargeEastAddonDeed(); break;

                        case 2: item = new HideRackLargeNorthAddonDeed(); break;
                        }

                        rewardText = "You receive a large hide rack.";
                        break;

                    case "DisplayCaseSmall":
                        item       = new DisplayCaseSmall();
                        rewardText = "You receive a small display case.";
                        break;

                    //Uncommon
                    case "CraftingComponentsMediumAmount":
                        item       = CraftingComponent.GetRandomCraftingComponent(6);
                        rewardText = "You receive a moderate number of crafting components.";
                        break;

                    case "SpiderSilkFishingNet":
                        item       = new Custom.SpidersilkFishingNet();
                        rewardText = "You receive a spidersilk fishing net.";
                        break;

                    case "CampingFirepit":
                        item       = new Custom.CampingFirepit();
                        rewardText = "You receive a camping firepit.";
                        break;

                    case "GoldLargeAmount":
                        item       = new Gold(Utility.RandomMinMax(1000, 2500));
                        rewardText = "You receive a large amount of gold.";
                        break;

                    case "ParagonWand":
                        item       = new ParagonWand();
                        rewardText = "You receive a paragon wand.";
                        break;

                    case "Lure":
                        if (Utility.RandomDouble() <= .66)
                        {
                            item = new Custom.FaintLure();
                        }
                        else
                        {
                            item = new Custom.PotentLure();
                        }

                        rewardText = "You receive a lure.";
                        break;

                    case "ResearchMaterials":
                        item       = new Custom.ResearchMaterials();
                        rewardText = "You receive some research materials.";
                        break;

                    case "AncientMysteryScroll":
                        item       = new Custom.AncientMystery.AncientMysteryScroll();
                        rewardText = "You receive an ancient mystery scroll.";
                        break;

                    case "LavishPillow":
                        item       = new LavishPillow();
                        rewardText = "You receive a lavish pillow.";
                        break;

                    case "VeterinarySalts":
                        item       = new Custom.Items.VeterinarySalts();
                        rewardText = "You receive some veterinary salts.";
                        break;

                    case "ExplodingSheep":
                        item       = new ExplodingSheep();
                        rewardText = "You receive an exploding sheep.";
                        break;

                    case "DiamondHarvestingTool":
                        switch (Utility.RandomMinMax(1, 2))
                        {
                        case 1: item = new DiamondPickaxe(); break;

                        case 2: item = new DiamondShovel(); break;
                        }

                        rewardText = "You receive a diamond-coated harvesting tool.";
                        break;

                    //Common
                    case "PrestigeScroll":
                        item       = new PrestigeScroll();
                        rewardText = "You receive a prestige scroll.";
                        break;

                    case "GoldMediumAmount":
                        item       = new Gold(Utility.RandomMinMax(500, 1000));
                        rewardText = "You receive a moderate amount of gold.";
                        break;

                    case "CraftingComponentsSmallAmount":
                        item       = CraftingComponent.GetRandomCraftingComponent(3);
                        rewardText = "You receive a small number of crafting components.";
                        break;

                    case "Reagents":
                        int reagentsAmount = Utility.RandomMinMax(150, 250);

                        switch (Utility.RandomMinMax(1, 8))
                        {
                        case 1: item = new BlackPearl(reagentsAmount); break;

                        case 2: item = new Bloodmoss(reagentsAmount); break;

                        case 3: item = new MandrakeRoot(reagentsAmount); break;

                        case 4: item = new Garlic(reagentsAmount); break;

                        case 5: item = new Ginseng(reagentsAmount); break;

                        case 6: item = new SpidersSilk(reagentsAmount); break;

                        case 7: item = new SulfurousAsh(reagentsAmount); break;

                        case 8: item = new Nightshade(reagentsAmount); break;
                        }

                        rewardText = "You receive some reagents.";
                        break;

                    //Remainder
                    case "GoldSmallAmount":
                        item       = new Gold(Utility.RandomMinMax(250, 500));
                        rewardText = "You receive a small amount of gold.";
                        break;
                    }

                    break;
                }

                CumulativeAmount += AdditionalAmount;
            }

            if (item != null)
            {
                if (from.TotalWeight >= 390 && from.AccessLevel == AccessLevel.Player)
                {
                    item.Delete();
                    from.SendMessage("You are carrying too much weight to be able to accept any rewards.");

                    inUse = false;

                    return;
                }

                if (!from.AddToBackpack(item))
                {
                    item.Delete();
                    from.SendMessage("You don't have enough room in your backpack. Please make room and try again.");

                    inUse = false;

                    return;
                }

                else
                {
                    if (from.NetState != null)
                    {
                        from.PrivateOverheadMessage(MessageType.Regular, 0, false, rewardText, from.NetState);
                    }

                    if (rewardSound != -1)
                    {
                        from.SendSound(rewardSound);
                    }

                    Delete();
                }
            }

            else
            {
                inUse = false;
            }
        }