using System;
using Server;
using Server.Engines.Craft;
using Server.Mobiles;
using Server.Network;
using System.Collections.Generic;
using System.Collections;

namespace Server.Items
{
	public class RecipeScrollMLBs : Item
	{
		public override int LabelNumber { get { return 1074560; } } // recipe scroll

		public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties( list );
			list.Add( "Magicke elfi dyky, mece a sekyry" );
		}

		[Constructable]
		public RecipeScrollMLBs() : base( 0x2831 )
		{
		}

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

		public override void OnDoubleClick( Mobile from )
		{
			
         if( !IsChildOf( from.Backpack ) )
         {
				from.SendLocalizedMessage( 1060640 ); // The item must be in your backpack to use it.
				return;
         }

			if( from is PlayerMobile )
			{
				PlayerMobile pm = from as PlayerMobile;
				if( !pm.HasRecipe( 300 ) )
				{
			      for ( int i = 300; i < 340; ++i )
			      {
			         pm.AcquireRecipe( i );
// 			         pm.SendMessage( "recipe no: {0}", i );
			      }
					this.Delete();
					pm.SendLocalizedMessage( 1073451, "Magicke elfi dyky, mece a sekyry" ); // You have learned a new recipe: ~1_RECIPE~
				}
				else
				{
					pm.SendLocalizedMessage( 1073427 ); // You already know this recipe.
				}
			}
		}

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

			writer.WriteEncodedInt( 0 ); // version
		}

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

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