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


using System;
using Server;
using Server.Items;

namespace Server.Items
{
	public class BagOfTrinkets : Bag
	{
	
		public override int LabelNumber{ get{ return 1072341; } } //A bag of trinkets
		
		[Constructable]
		public BagOfTrinkets()
		{
		
			Hue = 2217;
			
			for(int i=0;i < Utility.RandomMinMax(2, 5); i++)
			{		
				Item item = Loot.RandomJewelry();
			
				int attributeCount=1+Utility.RandomMinMax(2, 5);
				if(attributeCount<1)attributeCount=1;
				if(attributeCount>5)attributeCount=5;
			
				int min=30+Utility.Random((int)Utility.RandomMinMax(3, 6) * 5);
				int max=30+min+Utility.Random(50+((int)Utility.RandomMinMax(3, 6) * 5));
				if(max>100)max=100;
			
				if ( item is BaseJewel )
				{
					BaseRunicTool.ApplyAttributesTo((BaseJewel)item,true,0, attributeCount, min, max );
				}
				DropItem( item );
			}
			
			for(int j=0;j < Utility.RandomMinMax(1, 3); j++)
			{		
				switch ( Utility.Random( 8 ))
				{         
					case 0: DropItem( new BlueDiamond(1,2)); break;
					case 1: DropItem( new DarkSapphire(1,2)); break;     
					case 2: DropItem( new WhitePearl(1,2)); break;  
					case 3: DropItem( new FireRuby(1,2)); break;
					case 4: DropItem( new PerfectEmerald(1,2)); break;   
					case 5: DropItem( new EcruCitrine(1,2)); break;    
					case 6: DropItem( new BrilliantAmber(1,2)); break;   
					case 7: DropItem( new Turquoise(1,2)); break; 	
				}
			}
			
			//DropItem( LootPack.Gems, 30 );
			DropItem( new Gold( 2000, 3000 ) );
		}

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