/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\items\leviathan artifacts\BlackheartTreasure.cs
Lines of code: 273
***********************************************************/


using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Gumps;
using Server.Multis;
using Server.Network;
using Server.ContextMenus;
using Server.Engines.PartySystem;

//TODO: create a flag in container.cs to make sure this chest as well as heirlooms cannot be opened
//using the mage's "unlock" spell 

namespace Server.Items
{
	[FlipableAttribute( 0xe41, 0xe40 )] 
	public class BlackheartTreasure : LockableContainer
	{
	
	public override bool BlockMageryUnlock{ get{ return true; } }
	
		[Constructable] 
		public BlackheartTreasure() : base( 0xE41 ) 
		{ 
			Name = "Blackheart's Treasure";
			Hue = 2406; 
		
			this.Locked = true;
			this.LockLevel = Utility.Random(40,50);
			this.TrapType = TrapType.ExplosionTrap;
			this.TrapPower = 999;
			this.TrapLevel = 999;
		
			this.DropItem( new Rope() );
			this.DropItem( new Gold( Utility.RandomMinMax( 2000, 4000 ) ) );
			
			switch ( Utility.Random( 17 ) ) //Random uncommon deco
				{
					default:
					case 0: this.DropItem( new Whip() ); break;
					case 1: this.DropItem( new FruitBasket() ); break;
					case 2: this.DropItem( new HorseShoes() ); break;
					case 3: this.DropItem( new PottedCactus4() ); break;
					case 4: this.DropItem( new ThickRope() ); break;
					case 5: this.DropItem( new PierPost() ); break;
					case 6: this.DropItem( new RoseVase() ); break;
					case 7: this.DropItem( new WaterBasin() ); break;
					case 8: this.DropItem( new FlowerPot() ); break;
					case 9: this.DropItem( new HitchingPost() ); break;
					case 10: this.DropItem( new BirdNest() ); break;
					case 11: this.DropItem( new LogStack() ); break;
					case 12: this.DropItem( new Bell() ); break;
					case 13: this.DropItem( new WaterBucket() ); break;
					case 14: this.DropItem( new MiniTree() ); break;
					case 15: this.DropItem( new MiniFountain() ); break;
					case 16: this.DropItem( new Plough()); break;
				}		
				
			if( Utility.RandomDouble() < 0.1 )
			{
			switch ( Utility.Random( 15 ) ) //Random martie chance
				{
					default:
					case 0: this.DropItem( new GoldBricks() ); break;
					case 1: this.DropItem( new PhillipsWoodenSteed() ); break;
					case 2: this.DropItem( new AlchemistsBauble() ); break;
					case 3: this.DropItem( new ArcticDeathDealer() ); break;
					case 4: this.DropItem( new BlazeOfDeath() ); break;
					case 5: this.DropItem( new BurglarsBandana() ); break;
					case 6: this.DropItem( new CavortingClub () ); break;
					case 7: this.DropItem( new EnchantedTitanLegBone() ); break;
					case 8: this.DropItem( new GwennosHarp() ); break;
					case 9: this.DropItem( new IolosLute() ); break;
					case 10: this.DropItem( new LunaLance() ); break;
					case 11: this.DropItem( new NightsKiss() ); break;
					case 12: this.DropItem( new NoxRangersHeavyCrossbow() ); break;
					case 13: this.DropItem( new PolarBearMask() ); break;
					case 14: this.DropItem( new VioletCourage() ); break;
				}
			}
			
			for(int i=0;i< Utility.RandomMinMax(15, 22);i++)
			{		
			Item item = Loot.RandomArmorOrShieldOrJewelry(0);
			
			int attributeCount=Utility.Random(1,5);
			int min=Utility.Random(10,25);
			int max=50+Utility.Random(50);
			
				if ( item is BaseWeapon )
				{
					BaseWeapon weapon = (BaseWeapon)item;

				BaseRunicTool.ApplyAttributesTo( weapon,true,0, attributeCount, min, max );
				}
				else if ( item is BaseArmor )
				{
					BaseArmor armor = (BaseArmor)item;

				BaseRunicTool.ApplyAttributesTo( armor,true,0, attributeCount, min, max );
				}
				else if ( item is BaseJewel )
				{
					BaseRunicTool.ApplyAttributesTo( (BaseJewel)item,true,0, attributeCount, min, max );
				}
				
		DropItem( item );
		}	
			
			for (int i = 0; i < 2; i++)
			{	
				if( Utility.RandomDouble() < 0.4 )
					this.DropItem( new MessageInABottle() );
			}
						
			for (int j = 0; j < 6; j++)
			{	
		
				if( Utility.RandomDouble() < 0.7 )
					this.DropItem( new SpecialFishingNet() );
			}		
			
			for (int k = 0; k < 9; k++)
			{	
		
				if( Utility.RandomDouble() < 0.5 )
					this.DropItem( new CursedJugOfRum() );
				else
				{
					if( Utility.RandomDouble() < 0.5 )
						this.DropItem( new BeverageBottle( BeverageType.Ale ));
					else
						this.DropItem( new BeverageBottle( BeverageType.Liquor ));
				}
			}
			
			for (int l = 0; l < 19; l++)
			{	
		
				switch ( Utility.Random( 9 ) )
				{
					default:
					case 0: this.DropItem( new Citrine() ); break;
					case 1: this.DropItem( new Diamond() ); break;
					case 2: this.DropItem( new Amethyst() ); break;
					case 3: this.DropItem( new Emerald() ); break;
					case 4: this.DropItem( new Ruby() ); break;
					case 5: this.DropItem( new Sapphire() ); break;
					case 6: this.DropItem( new StarSapphire() ); break;
					case 7: this.DropItem( new Amber() ); break;
					case 8: this.DropItem( new Tourmaline() ); break;
				}
			}		
			
			for (int v = 0; v < 7; v++)
			{	
		
				switch ( Utility.Random( 8 ) )
				{
					default:
					case 0: this.DropItem( new EcruCitrine() ); break;
					case 1: this.DropItem( new BlueDiamond() ); break;
					case 2: this.DropItem( new BrilliantAmber() ); break;
					case 3: this.DropItem( new PerfectEmerald() ); break;
					case 4: this.DropItem( new FireRuby() ); break;
					case 5: this.DropItem( new DarkSapphire() ); break;
					case 6: this.DropItem( new Turquoise() ); break;
					case 7: this.DropItem( new WhitePearl() ); break;
				}
			}						
		
			for (int m = 0; m < 8; m++)
			{	
		
				switch ( Utility.Random( 8 ) )
				{
					default:
					case 0: this.DropItem( new GoldRing() ); break;
					case 1: this.DropItem( new SilverRing() ); break;
					case 2: this.DropItem( new GoldNecklace() ); break;
					case 3: this.DropItem( new SilverNecklace() ); break;
					case 4: this.DropItem( new GoldBracelet() ); break;
					case 5: this.DropItem( new SilverBracelet() ); break;
					case 6: this.DropItem( new GoldEarrings() ); break;
					case 7: this.DropItem( new SilverEarrings() ); break;
				}
			}							
		
			for (int n = 0; n < 5; n++)
			{	
		
				switch ( Utility.Random( 5 ) )
				{
					default:
					case 0: this.DropItem( new Candelabra() ); break;
					case 1: this.DropItem( new CandleLarge() ); break;
					case 2: this.DropItem( new Plate() ); break;
					case 3: this.DropItem( new Goblet() ); break;
					case 4: this.DropItem( new CandleLong() ); break;
				}
			}							
		
			for (int o = 0; o < 2; o++)
			{	
		
				switch ( Utility.Random( 4 ) )
				{
					default:
					case 0: this.DropItem( new BagOfSending() ); break;
					case 1: this.DropItem( new PowderOfTranslocation(Utility.RandomMinMax( 5, 20) ) ); break;
					case 2: this.DropItem( new PowderOfTemperament() ); break;
					case 3: this.DropItem( new BallOfSummoning() ); break;
				}
			}	
			
			if( Utility.RandomDouble() < 0.2 )
					this.DropItem( new FabledFishingNet() );	
			for (int x = 0; x < 15; x++)
			{		
			switch ( Utility.Random( 18 ))
			{                                   
				case 0: this.DropItem( new LesserDetriment( Utility.Random(2,8) )); break;   
				case 1: this.DropItem( new GreaterDetriment( Utility.Random(2,8) )); break;
				case 2: this.DropItem( new VolcanicAura( Utility.Random(1,5) )); break;
				case 3: this.DropItem( new ContaminatingSlime( Utility.Random(1,5) )); break;    
				case 4: this.DropItem( new WitheringCold( Utility.Random(1,5) )); break;   
				case 5: this.DropItem( new IronForce( Utility.Random(1,5) )); break;  
				case 6: this.DropItem( new ElectricStorm( Utility.Random(1,5) )); break;
				case 7: this.DropItem( new ShimmeringLight()); break;    
				case 8: this.DropItem( new MythrilIngot());break;   
				case 9: this.DropItem( new SoulOfFire()); break;  
				case 10: this.DropItem( new EssenceOfFrost()); break;
				case 11: this.DropItem( new SpectreOfNox()); break;    
				case 12: this.DropItem( new SpiritOfRock());break;   
				case 13: this.DropItem( new GhostOfEnergy()); break;  
				case 14: this.DropItem( new LuckyClovers( Utility.Random(1,8) )); break;
				case 15: this.DropItem( new SurrenderingAttack( Utility.Random(1,4) )); break;  
				case 16: this.DropItem( new SurrenderingDefense( Utility.Random(1,4) )); break;
				case 17: this.DropItem( new DraughtOfAlchemy( Utility.Random(1,5) )); break;
			}	
			}
			
			for(int y = 0; y < 10; y++)
			{
			switch ( Utility.Random( 18 ))
			{                                   
				case 0: this.DropItem( new CapturedDarkSoul( Utility.Random(1,5) ));break;  
				case 1: this.DropItem( new CapturedMageSoul( Utility.Random(1,5) ));break; 
				case 2: this.DropItem( new CapturedLightSoul( Utility.Random(1,5) ));break; 
				case 3: this.DropItem( new ConflagrantArrow( Utility.Random(1,5) ));break;  
				case 4: this.DropItem( new RagingThunderstorm( Utility.Random(1,5) ));break; 
				case 5: this.DropItem( new BlazingInferno( Utility.Random(1,5) ));break; 
				case 6: this.DropItem( new PiercingFrostbite( Utility.Random(1,5) ));break; 
				case 7: this.DropItem( new SpeedPearls( Utility.Random(1,5) )); break;    
				case 8: this.DropItem( new EtherealShielding( Utility.Random(1,2) ));break; 
				case 9: this.DropItem( new EtherealWeaponry( Utility.Random(1,2) ));break; 
				case 10: this.DropItem( new ScalesOfBalance()); break;
				case 11: this.DropItem( new OrbOfElements()); break;
				case 12: this.DropItem( new MagesWisdom( Utility.Random(1,2) )); break;
				case 13: this.DropItem( new HealthyPearls( Utility.Random(1,2) )); break;
				case 14: this.DropItem( new HerbsOfStamina( Utility.Random(1,2) )); break;
				case 15: this.DropItem( new PotionOfRepair( Utility.Random(1,5) )); break;
				case 16: this.DropItem( new EssenceOfDispelling( Utility.Random(1,5) )); break;
				case 17: this.DropItem( new ReagentPowder( Utility.Random(1,4))); break; 
			}	
			}
			
			if (Utility.RandomDouble() < 0.2) {
			switch ( Utility.Random( 18 ))
			{                                   
				case 0: this.DropItem( new MagesMind( Utility.Random(1,2) )); break; 
				case 1: this.DropItem( new MagesWrath( Utility.Random(1,2) )); break;  
				case 2: this.DropItem( new MagesPower( Utility.Random(1,2) )); break;  
				case 3: this.DropItem( new MagesRest( Utility.Random(1,2) )); break;      
				case 4: this.DropItem( new GuidingLight()); break; 
				case 5: this.DropItem( new SpellcastersWeaponry()); break;  
				case 6: this.DropItem( new ScrollOfLesserKnowledge()); break;  
				case 7: this.DropItem( new ScrollOfKnowledge()); break;  
				case 8: this.DropItem( new ScrollOfGreaterKnowledge()); break;   
				case 9: this.DropItem( new TotemOfEradication()); break;  
				case 10: this.DropItem( new ChunkOfMyridium()); break;  
				case 11: this.DropItem( new MagesWisdom( Utility.Random(1,2) )); break;
				case 12: this.DropItem( new OrbsOfPower( Utility.Random(1,2) )); break;
				case 13: this.DropItem( new PowderOfAgility( Utility.Random(1,2) )); break; 
				case 14: this.DropItem( new EssenceOfStamina()); break;
				case 15: this.DropItem( new EssenceOfRejuvenation()); break;
				case 16: this.DropItem( new MagesRegeneration()); break;
				case 17: this.DropItem( new MagicPowder(Utility.Random(1,2) )); break;
			}		
			}
								
		} 
		

		public BlackheartTreasure( Serial serial ) : base( serial ) 
		{ 
		} 

		public override void Serialize( GenericWriter writer ) 
		{ 
			base.Serialize( writer ); 

			writer.Write( (int) 0 ); // version 
		} 

		public override void Deserialize( GenericReader reader ) 
		{ 
			base.Deserialize( reader ); 

			int version = reader.ReadInt(); 
		} 
	} 
}