/**********************************************************
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\Melisande\Rare Drop\SquirrelSummoner.cs
Lines of code: 56
***********************************************************/


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 SquirrelSummoner : Item 
    { 
        [Constructable] 
        public SquirrelSummoner() : base( 576 ) 
        { 
            Hue = 1154; 
            Movable = true; 
            Name = "Snow White Holy Squirrel. Will bond instantly on double Click."; 
        } 

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

        public override void OnDoubleClick( Mobile from ) 
        { 
        
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1060640 );
			}
			else
			{
				melholysquirrel s = new melholysquirrel();
				s.Controlled = true;
				s.ControlMaster = from;
				s.Location = from.Location;
				s.Map = from.Map;
				s.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(); 
        } 
    } 
}