/**********************************************************
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\CSteedSummoner.cs
Lines of code: 59
***********************************************************/


using System;
using System.Net;
using Server;
using Server.Accounting;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
using Server.Prompts;
using Server.Regions;
using System.Collections;
using Server.Engines.PartySystem;

namespace Server.Items 
{ 
    public class CSteedSummoner : Item 
    {
        [Constructable] 
        public CSteedSummoner() : base( 10249 ) 
        { 
	Movable = true;
	Hue = 1195;
	Name = "Crystaline Steed Egg. Will bond instantly on double Click."; 
        } 

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

        public override void OnDoubleClick( Mobile from ) 
        { 
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
				return;
			}
			if ( (from.Followers + 3) > from.FollowersMax )
			{
				from.SendLocalizedMessage( 1049607 ); // You have too many followers to control that creature.
				return;
			}

	CrystalSteed ps = new CrystalSteed();
	ps.Controlled = true;
	ps.ControlMaster = from;
	ps.Location = from.Location;
	ps.Map = from.Map;
	ps.IsBonded = true;
	this.Delete();
        }

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