Inheritance: Server.Items.Item
            public OnOffGump(MonsterStatuette statuette) : base(150, 200)
            {
                m_Statuette = statuette;

                AddBackground(0, 0, 300, 150, 0xA28);

                AddHtmlLocalized(45, 20, 300, 35, statuette.TurnedOn ? 1011035 : 1011034, false, false);                   // [De]Activate this item

                AddButton(40, 53, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(80, 55, 65, 35, 1011036, false, false);                   // OKAY

                AddButton(150, 53, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(190, 55, 100, 35, 1011012, false, false);                   // CANCEL
            }
Exemple #2
0
        public static void SlayerTitleCore_MaxSlayerTitleAchieved(Mobile from, String titleDefinitionName, String titleAwarded)
        {
            if (!from.IsPlayer())
                return;

            // Award a dragon statuette when the maximum Dragon Slayer title is achieved
            if (titleDefinitionName == "Dragon Slayer")
            {
                MonsterStatuette statue = new MonsterStatuette(MonsterStatuetteType.Dragon);

                if (!from.PlaceInBackpack(statue))
                {
                    from.BankBox.AddItem(statue);

                    from.SendMessage("A reward statue has been placed in your bankbox.");
                }
                else
                {
                    from.SendMessage("A reward statue has been placed in your backpack.");
                }
            }
        }
			public OnOffGump( MonsterStatuette statuette ) : base( 150, 200 )
			{
				m_Statuette = statuette;

				AddBackground( 0, 0, 300, 150, 0xA28 );

				AddHtmlLocalized( 45, 20, 300, 35, statuette.TurnedOn ? 1011035 : 1011034, false, false ); // [De]Activate this item

				AddButton( 40, 53, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
				AddHtmlLocalized( 80, 55, 65, 35, 1011036, false, false ); // OKAY

				AddButton( 150, 53, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0 );
				AddHtmlLocalized( 190, 55, 100, 35, 1011012, false, false ); // CANCEL
			}
		public override void OnDoubleClick( Mobile from )
		{
			// Make sure is in pack
			if(from.Backpack == null || !IsChildOf(from.Backpack)) 
			{
				from.SendLocalizedMessage(1042001);  // Must be in pack to use!!
				return;
			}

			//generate all the crap
            Basket basket = new Basket();
			basket.Hue = Utility.RandomList(44,167);
			basket.Name = "basket" + " - " + m_Signature;

			// skull
			CandleSkull skull = new CandleSkull();
			skull.Name = "skull candle" + " - " + m_Signature;
					
			// apple 1
			Item apple1 = new Apple();
			apple1.Hue = 134;
			apple1.Name = "candied apple" + " - " + m_Signature;

			// apple 2
			Item apple2 = new Apple();
			apple2.Hue = 47;
			apple2.Name = "caramel apple" + " - " + m_Signature;

			// apple 3
			if(Utility.RandomDouble() < 0.25)
			{
				Item apple3 = new Apple();
				((Apple)apple3).Poison = Poison.Lesser;
				apple3.Hue = 63;
				apple3.Name = "poisoned apple" + " - " + m_Signature;
				basket.DropItem(apple3);
			}

			// add them
			basket.DropItem(skull);
			basket.DropItem(apple1);
			basket.DropItem(apple2);
		
			if(m_Place == 1)
			{
				Item HangingSkeleton = new Item(Utility.RandomList(6657,6658,6659,6660));
				HangingSkeleton.Hue = 0;
				HangingSkeleton.Light = LightType.Circle225;
				HangingSkeleton.Weight = 6;
				HangingSkeleton.Name = "hanging skeleton" + " - " + m_Signature;
				basket.DropItem(HangingSkeleton);
			}

			if(m_Place == 2)
			{
				Item web = new Item(Utility.RandomList(4306,4307,4308,4309));
				web.Hue = 0;
				web.Light = LightType.Circle225;
				web.Weight = 1;
				web.Name = "spider web" + " - " + m_Signature;
				basket.DropItem(web);
			}
			
			if(m_Place == 3)
			{
				Item skeleton = new MonsterStatuette(MonsterStatuetteType.Skeleton);
				skeleton.Hue = 44;
				skeleton.Light = LightType.Circle225;
				skeleton.Name = "Happy Halloween" + " - " + m_Signature;
				basket.DropItem(skeleton);
			}

			// finish it up
			from.Backpack.DropItem(basket);
			this.Delete();
			from.SendMessage("Your Halloween gift has been placed into your backpack.");
		}
        public bool ReceivePrize(Mobile from, int seed)
        {
            Item   i    = null;
            string text = "";

            if (seed <= 5)
            {
                text = "You win a brown bear rug!";
                i    = new BrownBearRugSouthDeed();
            }
            else if (seed < 10)
            {
                text = "You win a brown bear rug!";
                i    = new BrownBearRugEastDeed();
            }
            else if (seed < 25)
            {
                text  = "You win pet dye!";
                i     = new PetDye();
                i.Hue = Utility.RandomList(2419, 2418, 2413, 2406, 2215, 2425, 2219, 2207);
            }
            else if (seed < 30)
            {
                text = "You win a Monster Statuette!";
                i    = new MonsterStatuette(MonsterStatuetteType.Dragon);
            }
            else if (seed < 35)
            {
                text = "You win a rare artifact!";
                i    = new FullJars3();
            }
            else if (seed < 40)
            {
                text = "You win a rare artifact!";
                i    = new TarotCardsArtifact();
            }
            else if (seed < 45)
            {
                text = "You win a rare artifact!";
                i    = new PottedTree();
            }
            else if (seed < 55)
            {
                text = "You win a pouch with many pockets!";
                i    = new PouchWithManyPockets();
            }

            else if (seed < 65)
            {
            }
            else if (seed < 70)
            {
                text = "You win Town Sandals!";
                i    = new Sandals()
                {
                    Hue = Utility.RandomList(TownCloth.Hues)
                };
            }
            else if (seed < 75)
            {
                text = "You win a rare artifact!";
                i    = new LongFlask();
            }
            else if (seed < 80)
            {
                text = "You win a rare artifact!";
                i    = new FullJars2();
            }
            else if (seed < 85)
            {
                text = "You win a rare title dye!";
                i    = TitleDye.RandomRareTitleDye();
            }
            else if (seed < 95)
            {
                text = "You win an uncommon title dye!";
                i    = TitleDye.RandomUncommonTitleDye();
            }
            else if (seed < 100)
            {
                text = "You win another Dragon Ticket!";
                i    = new DragonLotteryTicket();
            }
            else if (seed < 105)
            {
                text = "You win some rare cloth!";
                i    = new RareCloth();
            }
            else
            {
                text = "Sorry! Try another ticket.";
            }


            if (text.Length > 0)
            {
                from.PublicOverheadMessage(Network.MessageType.Regular, 0, false, text);
            }

            if (i != null)
            {
                if (!from.AddToBackpack(i))
                {
                    i.Delete();
                    from.SendMessage("You don't have enough room in your backpack. Please make room and try again.");
                    return(false);
                }
            }

            return(true);
        }
        public override void OnDoubleClick(Mobile from)
        {
            // Make sure is in pack
            if (from.Backpack == null || !IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                  // Must be in pack to use!!
                return;
            }

            //generate all the crap
            Basket basket = new Basket();

            basket.Hue  = Utility.RandomList(44, 167);
            basket.Name = "basket" + " - " + m_Signature;

            // skull
            CandleSkull skull = new CandleSkull();

            skull.Name = "skull candle" + " - " + m_Signature;

            // apple 1
            Item apple1 = new Apple();

            apple1.Hue  = 134;
            apple1.Name = "candied apple" + " - " + m_Signature;

            // apple 2
            Item apple2 = new Apple();

            apple2.Hue  = 47;
            apple2.Name = "caramel apple" + " - " + m_Signature;

            // apple 3
            if (Utility.RandomDouble() < 0.25)
            {
                Item apple3 = new Apple();
                ((Apple)apple3).Poison = Poison.Lesser;
                apple3.Hue             = 63;
                apple3.Name            = "poisoned apple" + " - " + m_Signature;
                basket.DropItem(apple3);
            }

            // add them
            basket.DropItem(skull);
            basket.DropItem(apple1);
            basket.DropItem(apple2);

            if (m_Place == 1)
            {
                Item HangingSkeleton = new Item(Utility.RandomList(6657, 6658, 6659, 6660));
                HangingSkeleton.Hue    = 0;
                HangingSkeleton.Light  = LightType.Circle225;
                HangingSkeleton.Weight = 6;
                HangingSkeleton.Name   = "hanging skeleton" + " - " + m_Signature;
                basket.DropItem(HangingSkeleton);
            }

            if (m_Place == 2)
            {
                Item web = new Item(Utility.RandomList(4306, 4307, 4308, 4309));
                web.Hue    = 0;
                web.Light  = LightType.Circle225;
                web.Weight = 1;
                web.Name   = "spider web" + " - " + m_Signature;
                basket.DropItem(web);
            }

            if (m_Place == 3)
            {
                Item skeleton = new MonsterStatuette(MonsterStatuetteType.Skeleton);
                skeleton.Hue   = 44;
                skeleton.Light = LightType.Circle225;
                skeleton.Name  = "Happy Halloween" + " - " + m_Signature;
                basket.DropItem(skeleton);
            }

            // finish it up
            from.Backpack.DropItem(basket);
            this.Delete();
            from.SendMessage("Your Halloween gift has been placed into your backpack.");
        }
Exemple #7
0
        public static void Fill(LockableContainer cont, int level)
        {
            cont.Movable   = false;
            cont.TrapType  = Utility.RandomBool() ? TrapType.PoisonTrap : TrapType.ExplosionTrap;
            cont.TrapPower = level * 25;
            cont.TrapLevel = level;
            cont.Locked    = true;

            switch (level)
            {
            // Adam: add level 0 (trainer chests)
            case 0: cont.RequiredSkill = Utility.RandomMinMax(30, 37); break;

            case 1: cont.RequiredSkill = 36; break;

            case 2: cont.RequiredSkill = 76; break;

            case 3: cont.RequiredSkill = 84; break;

            case 4: cont.RequiredSkill = 92; break;

            case 5: cont.RequiredSkill = 100; break;
            }

            cont.LockLevel    = cont.RequiredSkill - 10;
            cont.MaxLockLevel = cont.RequiredSkill + 40;

            // adam: change treasure map chest loot MIN-MAX so as to decrease daily take home
            if (level != 0)
            {
                int amount = Utility.RandomMinMax(
                    (int)(((double)((level * 1000) / 3)) * .75),                             // min is 75% of MAX
                    (level * 1000) / 3);

                //int piles = level * 2;	// cool way but the players whined
                int piles = 1;                                          // sissy way

                // make several piles
                for (int ix = 0; ix < piles; ix++)
                {
                    cont.DropItem(new Gold(Utility.RandomMinMax(amount / piles - 10, amount / piles + 10)));
                }
            }


            // skin tone creme for level 4 & 5 chests
            if (Utility.RandomDouble() < 0.05 && level > 3)
            {
                cont.DropItem(new SkinHueCreme());
            }

            // adam: scrolls * 3 and not 5
            for (int i = 0; i < level * 3; ++i)
            {
                int minCircle = level;
                int maxCircle = (level + 3);
                PackScroll(cont, minCircle, maxCircle);
            }

            // plus "level chances" for magic jewelry & clothing
            switch (level)
            {
            case 0:                     // Adam: trainer chest
            case 1:                     // none
                break;

            case 2:
                PackMagicItem(cont, 1, 1, 0.05);
                break;

            case 3:
                PackMagicItem(cont, 1, 2, 0.10);
                PackMagicItem(cont, 1, 2, 0.05);
                break;

            case 4:
                PackMagicItem(cont, 2, 3, 0.10);
                PackMagicItem(cont, 2, 3, 0.05);
                PackMagicItem(cont, 2, 3, 0.02);
                break;

            case 5:
                PackMagicItem(cont, 3, 3, 0.10);
                PackMagicItem(cont, 3, 3, 0.05);
                PackMagicItem(cont, 3, 3, 0.02);
                break;
            }

            // TreasureMap( int level, Map map
            //	5% chance to get a treasure map
            //  Changed chance for tmap to 1%
            if (level != 0)
            {
                if (Utility.RandomDouble() < 0.01)
                {
                    int mlevel = level;

                    //	20% chance to get a treasure map one level better than the level of this chest
                    if (Utility.RandomDouble() < 0.20)
                    {
                        mlevel += (level < 5) ? 1 : 0;                          // bump up the map level by one
                    }
                    TreasureMap map = new TreasureMap(mlevel, Map.Felucca);
                    cont.DropItem(map);                                                 // drop it baby!
                }
            }

            // if You're doing a level 3, 4, or 5 chest you have a 1.5%, 2%, or 2.5% chance to get a monster statue
            double chance = 0.00 + (((double)level) * 0.005);

            if ((level > 3) && (Utility.RandomDouble() < chance))
            {
                int ndx             = level - 3;
                MonsterStatuette mx =
                    new MonsterStatuette(m_monsters[ndx][Utility.Random(m_monsters[ndx].Length)]);
                mx.LootType = LootType.Regular;                                                 // not blessed
                cont.DropItem(mx);                                                              // drop it baby!
            }

            TreasureMapChest.PackRegs(cont, level * 10);
            TreasureMapChest.PackGems(cont, level * 5);
        }
		private static void AddThemeLoot (LockableContainer cont, int level, ChestThemeType type)
		{
			MonsterStatuette mx = null;

			//switch to add in theme treasures
			switch ( type )
			{
				case ChestThemeType.Solen:
				{

					//drop are special weapon
					QuarterStaff special = new QuarterStaff();
					special.Name = "Chitanous Staff";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					//go into dropping normal loot

					int onlyonedrop = Utility.RandomMinMax(0,1);

					if(onlyonedrop ==0 )cont.DropItem(new Seed(PlantType.Hedge,0,false)); //new solen seed
					if(onlyonedrop ==1 )cont.DropItem(new WaterBucket() ); //new waterbucket

					if (Utility.RandomDouble() <= 0.30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[0]);
						if(whichone == 1)mx = new MonsterStatuette (m_Monster[1]);
						mx.LootType = LootType.Regular;		// not blessed
						cont.DropItem( mx );			// drop it baby!
					}
					break;
				}

				case ChestThemeType.Brigand:
				{
					//drop are special weapon
					Katana special = new Katana();
					special.Name = "Bandit's Blade";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					int onlyonedrop = Utility.RandomMinMax(0,1);

					if(onlyonedrop ==0 )cont.DropItem(new Brazier(true)); //new movable brazier
					if(onlyonedrop ==1 )cont.DropItem(new DecorativeBow(Utility.RandomMinMax(0,3))); //random decorative bow type

					for ( int i = 0; i < level * 5; ++i )
					{
						cont.DropItem (new PowderOfTranslocation() );  //drop powder of translocation
					}

					if (Utility.RandomDouble() <= 0.30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[2]);
						if(whichone == 1)mx = new MonsterStatuette (m_Monster[3]);
						mx.LootType = LootType.Regular;		// not blessed
						cont.DropItem( mx );			// drop it baby!
					}
					break;
				}

				case ChestThemeType.Savage:
				{
					//drop are special weapon
					ShortSpear special = new ShortSpear();
					special.Name = "Ornate Ritual Spear";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					int rug = Utility.RandomMinMax(0,1);
					int onlyonedrop = Utility.RandomMinMax(0,1);

					if(onlyonedrop ==0 )cont.DropItem(new SkullPole() ); //new skull pole

					if(onlyonedrop ==1 )
					{
						if(rug == 0) cont.DropItem(new BrownBearRugEastDeed() ); //new rug east
						if(rug == 1) cont.DropItem(new BrownBearRugSouthDeed() ); //new rug south
					}

					if (Utility.RandomDouble() <= .30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[4]);
						if(whichone == 1)mx = new MonsterStatuette (m_Monster[5]);
						mx.LootType = LootType.Regular;			// not blessed
						cont.DropItem( mx );				// drop it baby!
					}
					break;
				}

				case ChestThemeType.Undead:
				{
					Halberd special = new Halberd();
					special.Name = "Soul Reaver";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					int onlyonedrop = Utility.RandomMinMax(0,1);
					if(onlyonedrop ==0 )cont.DropItem(new BoneContainer(Utility.RandomMinMax(0,2))); //new bone container 3 differnt types 0-2
					int stone = Utility.RandomMinMax(0,3); // get random gravestone type to drop

					if(onlyonedrop ==1 )
					{
						if(stone == 0) cont.DropItem(new GraveStone1());
						if(stone == 1) cont.DropItem(new GraveStone2());
						if(stone == 2) cont.DropItem(new GraveStone3());
						if(stone == 3) cont.DropItem(new GraveStone4());
					}

					for ( int i = 0; i < level * 5; ++i )
					{
						cont.DropItem(new Moonstone()); //drop moonstones
					}

					if (Utility.RandomDouble() <= 0.30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[6]);
						if(whichone == 1)mx = new MonsterStatuette (m_Monster[7]);
						mx.LootType = LootType.Regular;			// not blessed
						cont.DropItem( mx );				// drop it baby!
					}
					break;
				}

				case ChestThemeType.Pirate:
				{

					Bow special = new Bow();
					special.Name = "Bow of the Buccaneer";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					int onlyonedrop = Utility.RandomMinMax(0,1);
					PirateHat hat = new PirateHat();
					hat.Hue = 0x1;
					int oars = Utility.RandomMinMax(0,1); //2 oar types

					if(onlyonedrop ==0 )
					{
						if(oars == 0) cont.DropItem(new Oars1());
						if(oars == 1) cont.DropItem(new Oars2());
					}

					if(onlyonedrop == 1 )cont.DropItem(new GenieBottle(false) ); //lamp currently disabled genie not done
					if (Utility.RandomDouble() <= 0.50 )cont.DropItem(hat); // 50% chance at black piratehat

					if (Utility.RandomDouble() <= 0.30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[8]);
						if(whichone == 1) mx = new MonsterStatuette (m_Monster[9]);
						mx.LootType = LootType.Regular;					// not blessed
						cont.DropItem( mx );						// drop it baby!
					}
					break;
				}

				case ChestThemeType.Dragon:
				{
					WarFork special = new WarFork();
					special.Name = "Claw of the Dragon";
					cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

					int onlyonedrop = Utility.RandomMinMax(0,1);
					//new dragonhead trophydeed type
					if(onlyonedrop ==0 ) cont.DropItem(new TrophyDeed(8757, 8756, "a dragon head trophy", "a dragon head trophy", 10 ));
					int armor = Utility.RandomMinMax(0,2); // drop 1 piece of dragonarmor

					if(onlyonedrop == 1 )
					{
						if(armor == 0) cont.DropItem(new HangingDragonChest());
						if(armor == 1) cont.DropItem(new HangingDragonLegs());
						if(armor == 2) cont.DropItem(new HangingDragonArms());
					}

					if (Utility.RandomDouble() <= 0.30 ) //30% chance to drop a statue
					{
						int whichone = Utility.RandomMinMax(0,1);
						if(whichone == 0)mx = new MonsterStatuette (m_Monster[10]);
						if(whichone == 1)mx = new MonsterStatuette (m_Monster[11]);
						mx.LootType = LootType.Regular;			// not blessed
						cont.DropItem( mx );				// drop it baby!
					}
					break;
				}

				case ChestThemeType.Lizardmen: 
				{
					if (Utility.RandomBool())
						cont.DropItem( new LizardmansStaff() ); 
					else
						cont.DropItem( new LizardmansMace() ); 
				}
					break;
				
				case ChestThemeType.Ettin:
				{
					cont.DropItem( new EttinHammer() ); 
				}
					break;
				
				case ChestThemeType.Ogre: 
				{
					cont.DropItem( new OgresClub() ); 
				}
					break;

				case ChestThemeType.Ophidian:
				{
					cont.DropItem( new OphidianBardiche() ); 
				}
					break;
				
				case ChestThemeType.Skeleton:
				{
					switch (Utility.Random(3))
					{
						case 0: cont.DropItem( new SkeletonScimitar() ); break;
						case 1: cont.DropItem( new SkeletonAxe() ); break;
						case 2: cont.DropItem( new BoneMageStaff() ); break;
					}
				}
					break;

				case ChestThemeType.Ratmen:
				{
					if (Utility.RandomBool())
						cont.DropItem( new RatmanSword() ); 
					else
						cont.DropItem( new RatmanAxe() ); 
				}
					break;

				case ChestThemeType.Orc:
				{
					switch (Utility.Random(3))
					{
						case 0: cont.DropItem( new OrcClub() ); break;
						case 1: cont.DropItem( new OrcMageStaff() ); break;
						case 2: cont.DropItem( new OrcLordBattleaxe() ); break;
					}
				}
					break;

				case ChestThemeType.Terathan:
				{
					switch (Utility.Random(3))
					{
						case 0: cont.DropItem( new TerathanStaff() ); break;
						case 1: cont.DropItem( new TerathanSpear() ); break;
						case 2: cont.DropItem( new TerathanMace() ); break;
					}
				}
					break;

				case ChestThemeType.FrostTroll:
				{
					switch (Utility.Random(3))
					{
						case 0: cont.DropItem( new FrostTrollClub() ); break;
						case 1: cont.DropItem( new TrollAxe() ); break;
						case 2: cont.DropItem( new TrollMaul() ); break;
					}
				}
					break;

			}//end switch

		}
Exemple #9
0
        private void Fill(int level, Mobile mobile)
        {
            TrapType  = TrapType.ExplosionTrap;
            TrapPower = level * 25;
            TrapLevel = level;
            Locked    = true;

            RequiredSkill = level switch
            {
                1 => 36,
                2 => 76,
                3 => 84,
                4 => 92,
                5 => 100,
                _ => RequiredSkill
            };

            LockLevel    = RequiredSkill - 10;
            MaxLockLevel = RequiredSkill + 40;

            DropItem(new Gold(level * 200));

            for (var i = 0; i < level; ++i)
            {
                DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular));
            }

            for (var i = 0; i < level * 2; ++i)
            {
                Item item;

                if (Core.AOS)
                {
                    item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
                }
                else
                {
                    item = Loot.RandomArmorOrShieldOrWeapon();
                }

                if (item is BaseWeapon weapon)
                {
                    if (Core.AOS)
                    {
                        GetRandomAOSStats(out var attributeCount, out var min, out var max);
                        BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                    }
                    else
                    {
                        weapon.DamageLevel     = (WeaponDamageLevel)Utility.Random(6);
                        weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.Random(6);
                        weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
                    }

                    DropItem(weapon);
                }
                else if (item is BaseArmor armor)
                {
                    if (Core.AOS)
                    {
                        GetRandomAOSStats(out var attributeCount, out var min, out var max);
                        BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                    }
                    else
                    {
                        armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                        armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                    }

                    DropItem(armor);
                }
                else if (item is BaseHat hat)
                {
                    if (Core.AOS)
                    {
                        GetRandomAOSStats(out var attributeCount, out var min, out var max);
                        BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                    }

                    DropItem(hat);
                }
                else if (item is BaseJewel jewel)
                {
                    GetRandomAOSStats(out var attributeCount, out var min, out var max);
                    BaseRunicTool.ApplyAttributesTo(jewel, attributeCount, min, max);

                    DropItem(jewel);
                }
            }

            for (var i = 0; i < level; i++)
            {
                var item = Loot.RandomPossibleReagent();
                item.Amount = Utility.RandomMinMax(40, 60);
                DropItem(item);
            }

            for (var i = 0; i < level; i++)
            {
                var item = Loot.RandomGem();
                DropItem(item);
            }

            DropItem(new TreasureMap(level + 1, Utility.RandomBool() ? Map.Felucca : Map.Trammel));

            switch (Utility.Random(24))
            {
            case 0:
            default: DropItem(new MJBofInvisibility()); break;

            case 1:  DropItem(new MJBofAgility()); break;

            case 2:  DropItem(new MJBofCunning()); break;

            case 3:  DropItem(new MJBofStrength()); break;

            case 4:  DropItem(new MJBofTeleport()); break;

            case 5:  DropItem(new MJBofBless()); break;

            case 6:  DropItem(new MJRofInvisibility()); break;

            case 7:  DropItem(new MJRofAgility()); break;

            case 8:  DropItem(new MJRofCunning()); break;

            case 9:  DropItem(new MJRofStrength()); break;

            case 10: DropItem(new MJRofTeleport()); break;

            case 11: DropItem(new MJRofBless()); break;

            case 12: DropItem(new MJNofInvisibility()); break;

            case 13: DropItem(new MJNofAgility()); break;

            case 14: DropItem(new MJNofCunning()); break;

            case 15: DropItem(new MJNofStrength()); break;

            case 16: DropItem(new MJNofTeleport()); break;

            case 17: DropItem(new MJNofBless()); break;

            case 18: DropItem(new MJEofInvisibility()); break;

            case 19: DropItem(new MJEofAgility()); break;

            case 20: DropItem(new MJEofCunning()); break;

            case 21: DropItem(new MJEofStrength()); break;

            case 22: DropItem(new MJEofTeleport()); break;

            case 23: DropItem(new MJEofBless()); break;
            }

            if (0.10 > Utility.RandomDouble())
            {
                if (Enum.IsDefined(typeof(MonsterStatuetteType), mobile.GetType().Name))
                {
                    var statuette = new MonsterStatuette((MonsterStatuetteType)Enum.Parse(typeof(MonsterStatuetteType), mobile.GetType().Name));
                    DropItem(statuette);
                }
            }
        }
        private static void AddThemeLoot(LockableContainer cont, int level, ChestThemeType type)
        {
            MonsterStatuette mx = null;

            //switch to add in theme treasures
            switch (type)
            {
            case ChestThemeType.Solen:
            {
                //drop are special weapon
                QuarterStaff special = new QuarterStaff();
                special.Name = "Chitanous Staff";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                //go into dropping normal loot

                int onlyonedrop = Utility.RandomMinMax(0, 1);

                if (onlyonedrop == 0)
                {
                    cont.DropItem(new Seed(PlantType.Hedge, 0, false));                                       //new solen seed
                }
                if (onlyonedrop == 1)
                {
                    cont.DropItem(new WaterBucket());                        //new waterbucket
                }
                if (Utility.RandomDouble() <= 0.30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[0]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[1]);
                    }
                    mx.LootType = LootType.Regular;                                     // not blessed
                    cont.DropItem(mx);                                                  // drop it baby!
                }
                break;
            }

            case ChestThemeType.Brigand:
            {
                //drop are special weapon
                Katana special = new Katana();
                special.Name = "Bandit's Blade";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                int onlyonedrop = Utility.RandomMinMax(0, 1);

                if (onlyonedrop == 0)
                {
                    cont.DropItem(new Brazier(true));                                         //new movable brazier
                }
                if (onlyonedrop == 1)
                {
                    cont.DropItem(new DecorativeBow(Utility.RandomMinMax(0, 3)));                                        //random decorative bow type
                }
                for (int i = 0; i < level * 5; ++i)
                {
                    cont.DropItem(new PowderOfTranslocation());                                //drop powder of translocation
                }

                if (Utility.RandomDouble() <= 0.30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[2]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[3]);
                    }
                    mx.LootType = LootType.Regular;                                     // not blessed
                    cont.DropItem(mx);                                                  // drop it baby!
                }
                break;
            }

            case ChestThemeType.Savage:
            {
                //drop are special weapon
                ShortSpear special = new ShortSpear();
                special.Name = "Ornate Ritual Spear";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                int rug         = Utility.RandomMinMax(0, 1);
                int onlyonedrop = Utility.RandomMinMax(0, 1);

                if (onlyonedrop == 0)
                {
                    cont.DropItem(new SkullPole());                                          //new skull pole
                }
                if (onlyonedrop == 1)
                {
                    if (rug == 0)
                    {
                        cont.DropItem(new BrownBearRugEastDeed());                                       //new rug east
                    }
                    if (rug == 1)
                    {
                        cont.DropItem(new BrownBearRugSouthDeed());                                       //new rug south
                    }
                }

                if (Utility.RandomDouble() <= .30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[4]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[5]);
                    }
                    mx.LootType = LootType.Regular;                                             // not blessed
                    cont.DropItem(mx);                                                          // drop it baby!
                }
                break;
            }

            case ChestThemeType.Undead:
            {
                Halberd special = new Halberd();
                special.Name = "Soul Reaver";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                int onlyonedrop = Utility.RandomMinMax(0, 1);
                if (onlyonedrop == 0)
                {
                    cont.DropItem(new BoneContainer(Utility.RandomMinMax(0, 2))); //new bone container 3 differnt types 0-2
                }
                int stone = Utility.RandomMinMax(0, 3);                           // get random gravestone type to drop

                if (onlyonedrop == 1)
                {
                    if (stone == 0)
                    {
                        cont.DropItem(new GraveStone1());
                    }
                    if (stone == 1)
                    {
                        cont.DropItem(new GraveStone2());
                    }
                    if (stone == 2)
                    {
                        cont.DropItem(new GraveStone3());
                    }
                    if (stone == 3)
                    {
                        cont.DropItem(new GraveStone4());
                    }
                }

                for (int i = 0; i < level * 5; ++i)
                {
                    cont.DropItem(new Moonstone());                             //drop moonstones
                }

                if (Utility.RandomDouble() <= 0.30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[6]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[7]);
                    }
                    mx.LootType = LootType.Regular;                                             // not blessed
                    cont.DropItem(mx);                                                          // drop it baby!
                }
                break;
            }

            case ChestThemeType.Pirate:
            {
                Bow special = new Bow();
                special.Name = "Bow of the Buccaneer";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                int       onlyonedrop = Utility.RandomMinMax(0, 1);
                PirateHat hat         = new PirateHat();
                hat.Hue = 0x1;
                int oars = Utility.RandomMinMax(0, 1);                        //2 oar types

                if (onlyonedrop == 0)
                {
                    if (oars == 0)
                    {
                        cont.DropItem(new Oars1());
                    }
                    if (oars == 1)
                    {
                        cont.DropItem(new Oars2());
                    }
                }

                if (onlyonedrop == 1)
                {
                    cont.DropItem(new GenieBottle(false));                                           //lamp currently disabled genie not done
                }
                if (Utility.RandomDouble() <= 0.50)
                {
                    cont.DropItem(hat);                                      // 50% chance at black piratehat
                }
                if (Utility.RandomDouble() <= 0.30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[8]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[9]);
                    }
                    mx.LootType = LootType.Regular;                                                             // not blessed
                    cont.DropItem(mx);                                                                          // drop it baby!
                }
                break;
            }

            case ChestThemeType.Dragon:
            {
                WarFork special = new WarFork();
                special.Name = "Claw of the Dragon";
                cont.DropItem(Loot.ImbueWeaponOrArmor(special, 6, 0, true));

                int onlyonedrop = Utility.RandomMinMax(0, 1);
                //new dragonhead trophydeed type
                if (onlyonedrop == 0)
                {
                    cont.DropItem(new TrophyDeed(8757, 8756, "a dragon head trophy", "a dragon head trophy", 10));
                }
                int armor = Utility.RandomMinMax(0, 2);                        // drop 1 piece of dragonarmor

                if (onlyonedrop == 1)
                {
                    if (armor == 0)
                    {
                        cont.DropItem(new HangingDragonChest());
                    }
                    if (armor == 1)
                    {
                        cont.DropItem(new HangingDragonLegs());
                    }
                    if (armor == 2)
                    {
                        cont.DropItem(new HangingDragonArms());
                    }
                }

                if (Utility.RandomDouble() <= 0.30)                          //30% chance to drop a statue
                {
                    int whichone = Utility.RandomMinMax(0, 1);
                    if (whichone == 0)
                    {
                        mx = new MonsterStatuette(m_Monster[10]);
                    }
                    if (whichone == 1)
                    {
                        mx = new MonsterStatuette(m_Monster[11]);
                    }
                    mx.LootType = LootType.Regular;                                             // not blessed
                    cont.DropItem(mx);                                                          // drop it baby!
                }
                break;
            }

            case ChestThemeType.Lizardmen:
            {
                if (Utility.RandomBool())
                {
                    cont.DropItem(new LizardmansStaff());
                }
                else
                {
                    cont.DropItem(new LizardmansMace());
                }
            }
            break;

            case ChestThemeType.Ettin:
            {
                cont.DropItem(new EttinHammer());
            }
            break;

            case ChestThemeType.Ogre:
            {
                cont.DropItem(new OgresClub());
            }
            break;

            case ChestThemeType.Ophidian:
            {
                cont.DropItem(new OphidianBardiche());
            }
            break;

            case ChestThemeType.Skeleton:
            {
                switch (Utility.Random(3))
                {
                case 0: cont.DropItem(new SkeletonScimitar()); break;

                case 1: cont.DropItem(new SkeletonAxe()); break;

                case 2: cont.DropItem(new BoneMageStaff()); break;
                }
            }
            break;

            case ChestThemeType.Ratmen:
            {
                if (Utility.RandomBool())
                {
                    cont.DropItem(new RatmanSword());
                }
                else
                {
                    cont.DropItem(new RatmanAxe());
                }
            }
            break;

            case ChestThemeType.Orc:
            {
                switch (Utility.Random(3))
                {
                case 0: cont.DropItem(new OrcClub()); break;

                case 1: cont.DropItem(new OrcMageStaff()); break;

                case 2: cont.DropItem(new OrcLordBattleaxe()); break;
                }
            }
            break;

            case ChestThemeType.Terathan:
            {
                switch (Utility.Random(3))
                {
                case 0: cont.DropItem(new TerathanStaff()); break;

                case 1: cont.DropItem(new TerathanSpear()); break;

                case 2: cont.DropItem(new TerathanMace()); break;
                }
            }
            break;

            case ChestThemeType.FrostTroll:
            {
                switch (Utility.Random(3))
                {
                case 0: cont.DropItem(new FrostTrollClub()); break;

                case 1: cont.DropItem(new TrollAxe()); break;

                case 2: cont.DropItem(new TrollMaul()); break;
                }
            }
            break;
            }            //end switch
        }
		public static void Fill( LockableContainer cont, int level )
		{
			cont.Movable = false;
            cont.TrapType = Utility.RandomBool() ? TrapType.PoisonTrap : TrapType.ExplosionTrap;
			cont.TrapPower = level * 25;
			cont.Locked = true;

			switch ( level )
			{
					// Adam: add level 0 (trainer chests)
				case 0: cont.RequiredSkill = Utility.RandomMinMax (30, 37) ; break;
				case 1: cont.RequiredSkill = 36; break;
				case 2: cont.RequiredSkill = 76; break;
				case 3: cont.RequiredSkill = 84; break;
				case 4: cont.RequiredSkill = 92; break;
				case 5: cont.RequiredSkill = 100; break;
			}

			cont.LockLevel = cont.RequiredSkill - 10;
			cont.MaxLockLevel = cont.RequiredSkill + 40;

			// adam: change treasure map chest loot MIN-MAX so as to decrease daily take home
			if (level != 0)
				cont.DropItem( 
					new Gold( Utility.RandomMinMax( 
						(int)(((double)((level * 1000) / 3)) * .75), // min is 75% of MAX
						(level * 1000) / 3 ) ) );

            // skin tone creme for level 4 & 5 chests
            if (Utility.RandomDouble() < 0.05 && level > 3)
            {
                cont.DropItem(new SkinHueCreme());
            }

			// adam: scrolls * 3 and not 5
			for ( int i = 0; i < level * 3; ++i )
			{
				int minCircle = level;
				int maxCircle = (level + 3);
				PackScroll( cont, minCircle, maxCircle );
			}

			// plus "level chances" for magic jewelry & clothing
			switch (level)
			{
				case 0:	// Adam: trainer chest
				case 1:	// none
					break;	
				case 2:
					PackMagicItem( cont, 1, 1, 0.05 );
					break;
				case 3:
					PackMagicItem( cont, 1, 2, 0.10 );
					PackMagicItem( cont, 1, 2, 0.05 );
					break;
				case 4:
					PackMagicItem( cont, 2, 3, 0.10 );
					PackMagicItem( cont, 2, 3, 0.05 );
					PackMagicItem( cont, 2, 3, 0.02 );
					break;
				case 5:
                    PackMagicItem(cont, 3, 3, 0.10);
                    PackMagicItem(cont, 3, 3, 0.05);
                    PackMagicItem(cont, 3, 3, 0.02);
					break;
			}

			// TreasureMap( int level, Map map
			//	5% chance to get a treasure map
			//  Changed chance for tmap to 1%
			if (level != 0)
				if (Utility.RandomDouble() < 0.01)
				{
					int mlevel = level;

					//	20% chance to get a treasure map one level better than the level of this chest
					if (Utility.RandomDouble() < 0.20)
						mlevel += (level < 5) ? 1 : 0;	// bump up the map level by one

					TreasureMap map = new TreasureMap (mlevel, Map.Felucca);
					cont.DropItem( map );				// drop it baby!
				}

			// if You're doing a level 3, 4, or 5 chest you have a 1.5%, 2%, or 2.5% chance to get a monster statue
			double chance = 0.00 + (((double)level) * 0.005);
			if ( (level > 3) && (Utility.RandomDouble() < chance) )
			{
				int ndx = level - 3;
				MonsterStatuette mx =
					new MonsterStatuette(m_monsters[ndx][Utility.Random(m_monsters[ndx].Length)]);
				mx.LootType = LootType.Regular;					// not blessed
				cont.DropItem( mx );							// drop it baby!
			}

			TreasureMapChest.PackRegs(cont, level * 10);
			TreasureMapChest.PackGems(cont, level * 5);

		}