/**********************************************************
RunUO AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Red Squirrel on Jul-26-2011 09:17:43pm
Filepath: scripts\_custom\items\misc\staff\clearbackpackstone.cs
Lines of code: 45

Description: 

***********************************************************/


using System;
using Server.Items;

namespace Server.Items
{
	public class clearbackpackstone : Item
	{
		public override string DefaultName
		{
			get { return "Backpack Empty Stone"; }
		}

		[Constructable]
		public clearbackpackstone() : base( 0xED4 )
		{
			Movable = false;
			Hue = 42;
			Weight = 0;
		}

		public override void OnDoubleClick( Mobile from )
		{	
			if(!Core.Testcenter)
			{
				from.SendMessage("This item can only be used on test center");
				return;
			}
		
		//do it in several sections just to be faster - probably comes up to the same at the end, but w/e :P
		while(from.Backpack.ConsumeTotal(typeof(Item),1000));		
		while(from.Backpack.ConsumeTotal(typeof(Item),100));
		while(from.Backpack.ConsumeTotal(typeof(Item),10));
		while(from.Backpack.ConsumeTotal(typeof(Item),1));
		
		from.SendMessage("Backpack Cleared");		
		}

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

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