/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\engines\ML Peerless + misc areas\demitel\artifacts\RangersRing.cs
Lines of code: 85
***********************************************************/


using System;
using Server;
using Server.Mobiles;

namespace Server.Items
{
	public class RangersRing : GoldRing
	{
		public override int ArtifactRarity{ get{ return 15; } }

		public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties( list );
			{
				list.Add("D E M I T E L");
			}
		}

		[Constructable]
		public RangersRing()
		{
			Name = "Ranger's Ring (+1 follower slot)";
			Hue = 1420;
			Attributes.AttackChance = 15;
			Attributes.Luck = 70;
		}

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

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

			writer.Write( (int) 0 );
		}

		public override bool OnEquip( Mobile from )
		{
			if ( from is PlayerMobile )
			{
				PlayerMobile m = (PlayerMobile)from;
				m.FollowersMax += 1;
				this.Movable = false;
			}
			return base.OnEquip( from );
		}

		public override void OnRemoved( object parent )
		{
			if ( parent is PlayerMobile )
			{
				PlayerMobile m = (PlayerMobile)parent;
				if (!((m.FollowersMax - 1) < m.Followers))
				{
					this.Movable = true;
					m.FollowersMax -= 1;
				}
				else
				{
					m.SendMessage( "Your total used follower slots must be 5 or less if you want to unequip this item." );
				}
			}
			return;
		}

		public override void OnDoubleClick( Mobile fromm ) 
		{
			if ( this.Parent == fromm ) 
			{
				if ( fromm is PlayerMobile )
				{
					PlayerMobile mmm = (PlayerMobile)fromm;
					if (!((mmm.FollowersMax - 1) < mmm.Followers))
					{
						this.Movable = true;
						mmm.AddToBackpack( this );
					}
					else
					{
						mmm.SendMessage( "You must reduce your followers before you can remove this." );
					}
				}
			}
			return;
		}

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

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