/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\items\Craftable artys\ml peerless\EcruCitrineRing.cs
Lines of code: 72
***********************************************************/


using Server;
using System;

namespace Server.Items
{
	
	public class  EcruCitrineRingRecipe : BaseRecipe
	{
	
		[Constructable]
		public EcruCitrineRingRecipe() : base(0)
		{		
		//InitRequirements();
		}
		
		
		//overrides:
		
		public override Type CraftedItem { get { return typeof(EcruCitrineRing); } }
		public override string artyname { get { return "Ecru Citrine Ring"; } }
		
		
	
		public override void InitRequirements()
		{
		base.InitRequirements(); //MUST be first! 
		
		//add required skills:
		
		RequiredSkills.Add(new ReqSkill(SkillName.Tinkering,75));
		
		//add required resources
		
		CommonResources.Add(new ReqRes("Citrine",typeof(Citrine),20));
    	CommonResources.Add(new ReqRes("Iron Ingot",typeof(IronIngot),5));		
		
		RareResources.Add(new ReqRes("Ecru Citrine",typeof(EcruCitrine),10));
		}	
		
		public override void OnAfterCraft(Mobile from,Item item)
		{
		//give 2 random attributes
		BaseRunicTool.ApplyAttributesTo((BaseJewel)item,true,1500, 1, 50, 100 );		
		BaseRunicTool.ApplyAttributesTo((BaseJewel)item,true,1500, 1, 50, 100 );	
		
		if (0.8 > Utility.RandomDouble()) BaseRunicTool.ApplyAttributesTo((BaseJewel)item,true,1500, 1, 75, 100 );	
		if (0.6 > Utility.RandomDouble()) BaseRunicTool.ApplyAttributesTo((BaseJewel)item,true,1500, 1, 75, 100 );	
		if (0.4 > Utility.RandomDouble()) BaseRunicTool.ApplyAttributesTo((BaseJewel)item,true,1500, 1, 100, 100 );	
		if (0.2 > Utility.RandomDouble()) BaseRunicTool.ApplyAttributesTo((BaseJewel)item,true,1500, 1, 100, 100 );	
		}		

			
	
		public EcruCitrineRingRecipe( 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();
		}	
		
	}
	
	public class EcruCitrineRing : GoldRing
	{

		public override int LabelNumber{ get{ return 1073457; } } // Ecru Citrine Ring

		[Constructable]
		public EcruCitrineRing() : base()
		{
		Name="Ecru Citrine Ring";
		
		if (0.8 > Utility.RandomDouble())
			Attributes.EnhancePotions += 5;
		else if (0.2 > Utility.RandomDouble())
			Attributes.EnhancePotions = 50;
		else
			Attributes.BonusStr = 5;
		}

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

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

			writer.Write( (int) 2 );
		}
		
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
	
}ÿ