/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Red Squirrel on Jan-02-2010 02:32:37pm
Filepath: scripts\_custom\items\misc\OrcBow.cs
Lines of code: 65
***********************************************************/


using System;
using Server.Network;
using Server.Items;

namespace Server.Items
{
	[FlipableAttribute( 0x13B2, 0x13B1 )]
	public class OrcBow : BaseRanged
	{
		public override int EffectID{ get{ return 0xF42; } }
		public override Type AmmoType{ get{ return typeof( Arrow ); } }
		public override Item Ammo{ get{ return new Arrow(); } }
		
		public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.ParalyzingBlow; } }
		public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.MortalStrike; } }

		public override int AosStrengthReq{ get{ return 30; } }
		public override int AosMinDamage{ get{ return 15; } }
		public override int AosMaxDamage{ get{ return 19; } }
		public override double SpeedSecs{ get{ return 4.25; } }

		public override int DefMaxRange{ get{ return 13; } }

		public override int InitMinHits{ get{ return 31; } }
		public override int InitMaxHits{ get{ return 60; } }

		public override WeaponAnimation DefAnimation{ get{ return WeaponAnimation.ShootBow; } }
		
		private bool m_looted=false;

		[Constructable]
		public OrcBow() : base( 0x13B2 )
		{
			Weight = 6.0;
			Layer = Layer.TwoHanded;
			Name = "orc bow";
			StrRequirement = 60;
			Hue = 2106;
			Attributes.WeaponDamage=25;
			WeaponAttributes.DurabilityBonus=70;
		}

		public OrcBow( Serial serial ) : base( serial )
		{
		}
		
		public override bool OnDragLift( Mobile from )
		{
		
		if(!m_looted)
		{
			if(0.5>Utility.RandomDouble())
			{
			from.SendMessage("The bow breaks as you attempt to pick it up");
			Delete();
			return false;
			}
		m_looted=true;
		Modify();
		}
		
		return true;
		}



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

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

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

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