/**********************************************************
RunUO AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Red Squirrel on Sep-25-2011 07:40:08pm
Filepath: scripts\Items\Artifacts\Gauntlet\TheDryadBow.cs
Lines of code: 61

Description: 

***********************************************************/


using System;
using Server;

namespace Server.Items
{
	public class TheDryadBow : Bow
	{
		public override int LabelNumber{ get{ return 1061090; } } // The Dryad Bow

		public override int InitMinHits{ get{ return 255; } }
		public override int InitMaxHits{ get{ return 255; } }

		[Constructable]
		public TheDryadBow()
		{
			ItemID = 0x13B1;
			Hue = 0x48F;
			SkillBonuses.SetValues( 0, m_PossibleBonusSkills[Utility.Random(m_PossibleBonusSkills.Length)], (Utility.Random( 4 ) == 0 ? 10.0 : 5.0) );
			WeaponAttributes.SelfRepair = 5;
			Attributes.WeaponSpeed = 50;
			Attributes.WeaponDamage = 35;
			WeaponAttributes.ResistPoisonBonus = 15;
		}

		private static SkillName[] m_PossibleBonusSkills = new SkillName[]
			{
				SkillName.Archery,
				SkillName.Tactics,
				SkillName.Healing,
				SkillName.Meditation,
				SkillName.MagicResist,
				SkillName.Peacemaking,
				SkillName.Chivalry
			};

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

			if ( version < 2 )
			{
				bool change=true;
				
				for(int i=0;i<m_PossibleBonusSkills.Length;i++)
				{
					if(SkillBonuses.Skill_1_Name==m_PossibleBonusSkills[i])
					{
						change=false;
						break;
					}
				}
			
				if(change)
				{
					SkillBonuses.SetValues( 0, m_PossibleBonusSkills[Utility.Random(m_PossibleBonusSkills.Length)], (Utility.Random( 4 ) == 0 ? 10.0 : 5.0) );
				}
				
			}
		}
	}
}
