context: using System;
  using System.Text;
  using System.Collections;
  using System.Collections.Generic;
  using Server.Mobiles;
  using Server.Items;
  using Server.Menus.Questions;
  using Server.Menus.ItemLists;
  using Server.Network;
  using Server.Spells;
  using Server.Targeting;
  using Server.Targets;
  using Server.Gumps;
  using Server.Commands.Generic;
  
  namespace Server.Commands
  {
      public class CommandHandlers
  	{
  		public static void Initialize()
  		{
  			CommandSystem.Prefix = "[";
  
  			Register( "Go", AccessLevel.Counselor, new CommandEventHandler( Go_OnCommand ) );
  
  			Register( "DropHolding", AccessLevel.Counselor, new CommandEventHandler( DropHolding_OnCommand ) );
  
  			Register( "GetFollowers", AccessLevel.GameMaster, new CommandEventHandler( GetFollowers_OnCommand ) );
  
  			Register( "ClearFacet", AccessLevel.Administrator, new CommandEventHandler( ClearFacet_OnCommand ) );
  
  			Register( "Where", AccessLevel.Player, new CommandEventHandler( Where_OnCommand ) );
  
  			Register( "AutoPageNotify", AccessLevel.Counselor, new CommandEventHandler( APN_OnCommand ) );
  			Register( "APN", AccessLevel.Counselor, new CommandEventHandler( APN_OnCommand ) );
  
  			Register( "Animate", AccessLevel.GameMaster, new CommandEventHandler( Animate_OnCommand ) );
  
  			Register( "Cast", AccessLevel.Counselor, new CommandEventHandler( Cast_OnCommand ) );
  
  			Register( "Stuck", AccessLevel.Counselor, new CommandEventHandler( Stuck_OnCommand ) );
  
  			// Register( "Help", AccessLevel.Player, new CommandEventHandler( Help_OnCommand ) );
  
  			Register( "Save", AccessLevel.Administrator, new CommandEventHandler( Save_OnCommand ) );
  			Register( "BackgroundSave", AccessLevel.Administrator, new CommandEventHandler( BackgroundSave_OnCommand ) );
  			Register( "BGSave", AccessLevel.Administrator, new CommandEventHandler( BackgroundSave_OnCommand ) );
  			Register( "SaveBG", AccessLevel.Administrator, new CommandEventHandler( BackgroundSave_OnCommand ) );
  
  			Register( "Move", AccessLevel.GameMaster, new CommandEventHandler( Move_OnCommand ) );
  			Register( "Client", AccessLevel.Counselor, new CommandEventHandler( Client_OnCommand ) );
  
  			Register( "SMsg", AccessLevel.Counselor, new CommandEventHandler( StaffMessage_OnCommand ) );
  			Register( "SM", AccessLevel.Counselor, new CommandEventHandler( StaffMessage_OnCommand ) );
  			Register( "S", AccessLevel.Counselor, new CommandEventHandler( StaffMessage_OnCommand ) );
  
  			Register( "BCast", AccessLevel.GameMaster, new CommandEventHandler( BroadcastMessage_OnCommand ) );
  			Register( "BC", AccessLevel.GameMaster, new CommandEventHandler( BroadcastMessage_OnCommand ) );
  			Register( "B", AccessLevel.GameMaster, new CommandEventHandler( BroadcastMessage_OnCommand ) );
  
  			Register( "Bank", AccessLevel.GameMaster, new CommandEventHandler( Bank_OnCommand ) );
  
  			Register( "Echo", AccessLevel.Counselor, new CommandEventHandler( Echo_OnCommand ) );
  
  			Register( "Sound", AccessLevel.GameMaster, new CommandEventHandler( Sound_OnCommand ) );
  
  			Register( "ViewEquip", AccessLevel.GameMaster, new CommandEventHandler( ViewEquip_OnCommand ) );
  
  			Register( "Light", AccessLevel.Counselor, new CommandEventHandler( Light_OnCommand ) );
  			Register( "Stats", AccessLevel.Counselor, new CommandEventHandler( Stats_OnCommand ) );
  
  			Register( "ReplaceBankers", AccessLevel.Administrator, new CommandEventHandler( ReplaceBankers_OnCommand ) );
  
  			Register( "SpeedBoost", AccessLevel.Counselor, new CommandEventHandler( SpeedBoost_OnCommand ) );
  		}
  
  		public static void Register( string command, AccessLevel access, CommandEventHandler handler )
  		{
  			CommandSystem.Register( command, access, handler );
  		}
  
  		[Usage( "SpeedBoost [true|false]" )]
  		[Description( "Enables a speed boost for the invoker.  Disable with paramaters." )]
  		private static void SpeedBoost_OnCommand( CommandEventArgs e )
  		{
  			Mobile from = e.Mobile;
  
  			if ( e.Length <= 1 )
  			{
  				if ( e.Length == 1 && !e.GetBoolean( 0 ) )
  				{
  					from.Send( SpeedControl.Disable );
  					from.SendMessage( "Speed boost has been disabled." );
  				}
  				else
  				{
  					from.Send( SpeedControl.MountSpeed );
  					from.SendMessage( "Speed boost has been enabled." );
  				}
  			}
  			else
  			{
  				from.SendMessage( "Format: SpeedBoost [true|false]" );
  			}
  		}
  
  		[Usage( "Where" )]
  		[Description( "Tells the commanding player his coordinates, region, and facet." )]
  		public static void Where_OnCommand( CommandEventArgs e )
  		{
  			Mobile from = e.Mobile;
  			Map map = from.Map;
  
  			from.SendMessage( "You are at {0} {1} {2} in {3}.", from.X, from.Y, from.Z, map );
  
  			if ( map != null )
  			{
  				Region reg = from.Region;
  
  				if ( !reg.IsDefault )
  				{
  					StringBuilder builder = new StringBuilder();
  
  					builder.Append( reg.ToString() );
  					reg = reg.Parent;
  
  					while ( reg != null )
  					{
  						builder.Append( " <- " + reg.ToString() );
  						reg = reg.Parent;
  					}
  
  					from.SendMessage( "Your region is {0}.", builder.ToString() );
  				}
  			}
  		}
  
  		[Usage( "DropHolding" )]
  		[Description( "Drops the item, if any, that a targeted player is holding. The item is placed into their backpack, or if that's full, at their feet." )]
  		public static void DropHolding_OnCommand( CommandEventArgs e )
  		{
  			e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( DropHolding_OnTarget ) );
  			e.Mobile.SendMessage( "Target the player to drop what they are holding." );
  		}
  
  		public static void DropHolding_OnTarget( Mobile from, object obj )
  		{
  			if ( obj is Mobile && ((Mobile)obj).Player )
  			{
  				Mobile targ = (Mobile)obj;
  				Item held = targ.Holding;
  
  				if ( held == null )
  				{
  					from.SendMessage( "They are not holding anything." );
  				}
  				else
  				{
  					if ( from.AccessLevel == AccessLevel.Counselor )
  					{
  						Engines.Help.PageEntry pe = Engines.Help.PageQueue.GetEntry( targ );
  
  						if ( pe == null || pe.Handler != from )
  						{
  							if ( pe == null )
  								from.SendMessage( "You may only use this command on someone who has paged you." );
  							else
  								from.SendMessage( "You may only use this command if you are handling their help page." );
  
  							return;
  						}
  					}
  
  					if ( targ.AddToBackpack( held ) )
  						from.SendMessage( "The item they were holding has been placed into their backpack." );
  					else
  						from.SendMessage( "The item they were holding has been placed at their feet." );
  
  					held.ClearBounce();
  
  					targ.Holding = null;
  				}
  			}
  			else
  			{
  				from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( DropHolding_OnTarget ) );
  				from.SendMessage( "That is not a player. Try again." );
  			}
  		}
  
  		public static void DeleteList_Callback( Mobile from, bool okay, object state )
  		{
  			if ( okay )
  			{
  				List<IEntity> list = (List<IEntity>)state;
  
  				CommandLogging.WriteLine( from, "{0} {1} deleting {2} object{3}", from.AccessLevel, CommandLogging.Format( from ), list.Count, list.Count == 1 ? "" : "s" );
  
  				NetState.Pause();
  
  				for ( int i = 0; i < list.Count; ++i )
  					list[i].Delete();
  
  				NetState.Resume();
  
  				from.SendMessage( "You have deleted {0} object{1}.", list.Count, list.Count == 1 ? "" : "s" );
  			}
  			else
  			{
  				from.SendMessage( "You have chosen not to delete those objects." );
  			}
  		}
  
  		[Usage( "ClearFacet" )]
  		[Description( "Deletes all items and mobiles in your facet. Players and their inventory will not be deleted." )]
  		public static void ClearFacet_OnCommand( CommandEventArgs e )
  		{
  			Map map = e.Mobile.Map;
  
  			if ( map == null || map == Map.Internal )
  			{
  				e.Mobile.SendMessage( "You may not run that command here." );
  				return;
  			}
  
  
gt: 			List<IEntity> list = new List<IEntity>();