/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\items\Quest Rewards\TreasureStrongbox.cs
Lines of code: 87
***********************************************************/


using System;
using Server;
using Server.Items;

namespace Server.Items
{
	public class TreasureStrongbox : RarewoodChest
	{
	
		public override int LabelNumber{ get{ return 1072584; } } //A Strongbox
		
		[Constructable]
		public TreasureStrongbox()
		{
			Hue = 0;
			
			for(int i=0;i < Utility.RandomMinMax(20, 30); i++)
			{		
				Item item = Loot.RandomArmorOrShieldOrJewelry(0);
			
				int attributeCount=1+Utility.RandomMinMax(3, 6);
				if(attributeCount<1)attributeCount=1;
				if(attributeCount>6)attributeCount=6;
			
				int min=50+Utility.Random((int)Utility.RandomMinMax(4, 7) * 5);
				int max=50+min+Utility.Random(50+((int)Utility.RandomMinMax(4, 7) * 5));
				if(max>100)max=100;
			
				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 );
			}
			
			switch ( Utility.Random( 30 ))
			{       
				case 0: DropItem( new Board(20+Utility.Random(31))); break; 
				case 1: DropItem( new OakBoard(20+Utility.Random(31))); break;  
				case 2: DropItem( new VeriteIngot(20+Utility.Random(31))); break;
				case 3: DropItem( new Leather(20+Utility.Random(31))); break;   
				case 4: DropItem( new ValoriteIngot(20+Utility.Random(31))); break;  
				case 5: DropItem( new AshBoard(20+Utility.Random(31))); break;	 
				case 6: DropItem( new FrostwoodBoard(20+Utility.Random(31))); break;  
				case 7: DropItem( new BlueDiamond(1,2)); break;
				case 8: DropItem( new DarkSapphire(1,2)); break;  
				case 9: DropItem( new IronIngot(20+Utility.Random(31))); break; 
				case 10: DropItem( new HornedLeather(20+Utility.Random(31))); break;
				case 11: DropItem( new DullCopperIngot(20+Utility.Random(31))); break;  
				case 12: DropItem( new CopperIngot(20+Utility.Random(31))); break;
				case 13: DropItem( new GoldIngot(20+Utility.Random(31))); break;   
				case 14: DropItem( new AgapiteIngot(20+Utility.Random(31))); break;
				case 15: DropItem( new SpinedLeather(20+Utility.Random(31))); break; 
				case 16: DropItem( new YewBoard(20+Utility.Random(31))); break;
				case 17: DropItem( new Cloth(20+Utility.Random(31))); break;   
				case 18: DropItem( new Bone(20+Utility.Random(31))); break;
				case 19: DropItem( new WhitePearl(1,2)); break;  
				case 20: DropItem( new FireRuby(1,2)); break;
				case 21: DropItem( new PerfectEmerald(1,2)); break;
				case 22: DropItem( new BloodwoodBoard(20+Utility.Random(31))); break;    
				case 23: DropItem( new HeartwoodBoard(20+Utility.Random(31))); break;     
				case 24: DropItem( new BronzeIngot(20+Utility.Random(31))); break;   
				case 25: DropItem( new EcruCitrine(1,2)); break;    
				case 26: DropItem( new BrilliantAmber(1,2)); break;   
				case 27: DropItem( new Turquoise(1,2)); break; 
				case 28: DropItem( new BarbedLeather(20+Utility.Random(31))); break; 
				case 29: DropItem( new BarbedLeather(20+Utility.Random(31))); break; 		
			}
			
			DropItem( new Gold( 5000, 7000 ) );
		}

		public TreasureStrongbox( 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();
		}
	}
}