<NME> Modify.java
<BEF> package com.planet_ink.coffee_mud.Commands;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.core.exceptions.CMException;
import com.planet_ink.coffee_mud.core.exceptions.MQLException;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.PlanarAbility.PlanarVar;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.Session.InputCallback;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.AbilityMapper;
import com.planet_ink.coffee_mud.Libraries.interfaces.AchievementLibrary.Achievement;
import com.planet_ink.coffee_mud.Libraries.interfaces.AreaGenerationLibrary.UpdateSet;
import com.planet_ink.coffee_mud.Libraries.interfaces.HelpLibrary.HelpSection;
import com.planet_ink.coffee_mud.Libraries.interfaces.JournalsLibrary.MsgMkrCallback;
import com.planet_ink.coffee_mud.Libraries.interfaces.JournalsLibrary.MsgMkrResolution;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;

/*
   Copyright 2004-2022 Bo Zimmerman

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

	   http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
public class Modify extends StdCommand
{
	public Modify()
	{
	}

	private final String[] access=I(new String[]{"MODIFY","MOD"});

	@Override
	public String[] getAccessWords()
	{
		return access;
	}

	private final static Class<?>[][] internalParameters=new Class<?>[][]{{Environmental.class}};

	public void items(final MOB mob, final List<String> commands)
		throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY ITEM [ITEM NAME](@ room/[MOB NAME]) "
					+ "[LEVEL, ABILITY, REJUV, USES, MISC, ?] [NUMBER, TEXT]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}

		String itemID=(commands.get(2));
		MOB srchMob=mob;
		Item srchContainer=null;
		Room srchRoom=mob.location();
		final int x=itemID.indexOf('@');
		if(x>0)
		{
			final String rest=itemID.substring(x+1).trim();
			itemID=itemID.substring(0,x).trim();
			if(rest.equalsIgnoreCase("room"))
				srchMob=null;
			else
			if(rest.length()>0)
			{
				final MOB M=srchRoom.fetchInhabitant(rest);
				if(M==null)
				{
					final Item I = srchRoom.findItem(null, rest);
					if(I instanceof Container)
						srchContainer=I;
					else
					{
						mob.tell(L("MOB or Container '@x1' not found.",rest));
						mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
						return;
					}
				}
				else
				{
					srchMob=M;
					srchRoom=null;
				}
			}
		}
		String command="";
		if(commands.size()>3)
			command=commands.get(3).toUpperCase();
		String restStr="";
		if(commands.size()>4)
			restStr=CMParms.combine(commands,4);

		Environmental modE=null;
		if((srchMob!=null)&&(srchRoom!=null))
		{
			final Environmental E=srchRoom.fetchFromMOBRoomFavorsItems(srchMob,srchContainer,itemID,Wearable.FILTER_ANY);
			if(E instanceof Item)
				modE=E;
			else
				modE=srchRoom.findItem(srchContainer,itemID);
		}
		else
		if(srchMob!=null)
			modE=srchMob.findItem(itemID);
		else
		if(srchRoom!=null)
		{
			modE=srchRoom.findItem(srchContainer, itemID);
			if(modE==null)
				modE=srchRoom.findItem(itemID);
		}
		if(modE==null)
		{
			Environmental E=CMLib.space().findSpaceObject(itemID,true);
			if(!(E instanceof Item))
				E=CMLib.space().findSpaceObject(itemID,false);
			if(E instanceof Item)
				modE=E;
		}
		if(modE == null)
		{
			ShopKeeper SK=CMLib.coffeeShops().getShopKeeper(srchMob);
			if(SK!=null)
			{
				final CoffeeShop shop=(SK instanceof Librarian)?((Librarian)SK).getBaseLibrary():SK.getShop();
				final Environmental E=shop.getStock(itemID,mob);
				if(E instanceof Item)
					modE=E;
			}
			if(modE == null)
			{
				SK=CMLib.coffeeShops().getShopKeeper(srchRoom);
				if(SK!=null)
				{
					final CoffeeShop shop=(SK instanceof Librarian)?((Librarian)SK).getBaseLibrary():SK.getShop();
					final Environmental E=shop.getStock(itemID,mob);
					if(E instanceof Item)
						modE=E;
				}
			}
		}
		if((modE==null)||(!(modE instanceof Item)))
		{
			mob.tell(L("I don't see '@x1 here.\n\r",itemID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		final Item modItem=(Item)modE;
		mob.location().showOthers(mob,modItem,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));

		final Item copyItem=(Item)modItem.copyOf();
		if(command.equals("LEVEL"))
		{
			final int newLevel=CMath.s_int(restStr);
			if(newLevel>=0)
			{
				modItem.basePhyStats().setLevel(newLevel);
				modItem.recoverPhyStats();
				mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));
			}
		}
		else
		if(command.equals("ABILITY"))
		{
			final int newAbility=CMath.s_int(restStr);
			modItem.basePhyStats().setAbility(newAbility);
			modItem.recoverPhyStats();
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));
		}
		else
		if(command.equals("HEIGHT"))
		{
			final int newAbility=CMath.s_int(restStr);
			modItem.basePhyStats().setHeight(newAbility);
			modItem.recoverPhyStats();
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));
		}
		else
		if(command.equals("REJUV"))
		{
			final int newRejuv=CMath.s_int(restStr);
			if(newRejuv>0)
			{
				modItem.basePhyStats().setRejuv(newRejuv);
				modItem.recoverPhyStats();
				mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));
			}
			else
			{
				modItem.basePhyStats().setRejuv(PhyStats.NO_REJUV);
				modItem.recoverPhyStats();
				mob.tell(L("@x1 will now never rejuvenate.",modItem.name()));
				mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));
			}
		}
		else
		if(command.equals("USES"))
		{
			final int newUses=CMath.s_int(restStr);
			if(newUses>=0)
			{
				modItem.setUsesRemaining(newUses);
				mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));
			}
		}
		else
		if(command.equals("MISC"))
		{
			if(modItem.isGeneric())
				CMLib.genEd().genMiscSet(mob,modItem,-1);
			else
				modItem.setMiscText(restStr);
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));
		}
		else
		if(CMLib.coffeeMaker().isAnyGenStat(modItem, command))
		{
			CMLib.coffeeMaker().setAnyGenStat(modItem,command, restStr);
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));
		}
		else
		if((command.length()==0)&&(modItem.isGeneric()))
		{
			CMLib.genEd().genMiscSet(mob,modItem,-1);
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));
		}
		else
		{
			final STreeSet<String> set=new STreeSet<String>();
			set.addAll(CMParms.parseCommas("LEVEL,ABILITY,HEIGHT,REJUV,USES,MISC",true));
			set.addAll(CMLib.coffeeMaker().getAllGenStats(modItem));
			mob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(set)));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
		}
		if(!copyItem.sameAs(modItem))
		{
			Log.sysOut("Items",mob.Name()+" modified item "+modItem.ID()+".");
			if(modItem instanceof SpaceObject)
			{
				CMLib.database().DBUpdateItem("SPACE", modItem);
			}
		}
		copyItem.destroy();
	}

	protected void flunkRoomCmd(final MOB mob)
	{
		mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY ROOM [NAME, AREA, DESCRIPTION, "
				+ "AFFECTS, BEHAVIORS, CLASS, XGRID, YGRID, ?] [TEXT]\n\r"));
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
	}

	protected void flunkAreaCmd(final MOB mob)
	{
		mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY AREA [NAME, DESCRIPTION, CLIMATE, "
				+ "FILE, AFFECTS, BEHAVIORS, ADDSUB, DELSUB, XGRID, YGRID, ?] [TEXT]\n\r"));
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
	}

	protected void fixDeities(final Room R)
	{
		if(R==null)
			return;
		//OK! Keep this weirdness here!  It's necessary because oldRoom will have blown
		//away any real deities with copy deities in the CMMap, and this will restore
		//the real ones.
		for(final Enumeration<MOB> m=R.inhabitants();m.hasMoreElements();)
		{
			final MOB M=m.nextElement();
			if((M instanceof Deity)
			&&(M.isMonster())
			&&(M.isSavable())
			&&(M.getStartRoom()==R))
				CMLib.map().registerWorldObjectLoaded(R.getArea(), R, M);
		}
	}

	public void expertises(final MOB mob, final List<String> commands)
	{
		if((commands.size()<3)||(CMParms.combine(commands,1).indexOf('=')<0))
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rFormat: CREATE EXPERTISE [EXPERTISE ID]=[PARAMETERS] as follows: \n\r"));
			final String inst=CMLib.expertises().getExpertiseInstructions();
			if(mob.session()!=null)
				mob.session().wraplessPrintln(inst.toString());
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		final String parms=CMParms.combineQuoted(commands,2);
		final String skillID=parms.substring(0,parms.indexOf('='));
		if(skillID.indexOf(' ')>=0)
		{
			mob.tell(L("Spaces are not allowed in expertise codes."));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		String WKID=CMStrings.replaceAll(skillID.toUpperCase(),"@X1","");
		WKID=CMStrings.replaceAll(WKID,"@X2","").trim();
		if(CMLib.expertises().numStages(WKID)<=0)
		{
			mob.tell(L("'@x1' does not exist, try LIST EXPERTISES.",WKID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		final String error=CMLib.expertises().confirmExpertiseLine(parms,null,false);
		if(error!=null)
		{
			mob.tell(error);
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		if(!CMLib.expertises().addModifyDefinition(parms, true))
		{
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The power of skill usage just went sideways!"));
	}

	public void rooms(final MOB mob, final List<String> commands)
		throws IOException
	{
		if(mob.location().roomID().equals(""))
		{
			mob.tell(L("This command is invalid from within a GridLocaleChild room."));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
			return;
		}
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around the room."));
		if(commands.size()==2)
		{
			final Room oldRoom=(Room)mob.location().copyOf();
			final Room newRoom=CMLib.genEd().modifyRoom(mob,mob.location(),-1);
			if((!oldRoom.sameAs(newRoom))&&(!newRoom.amDestroyed()))
			{
				CMLib.database().DBUpdateRoom(newRoom);
				newRoom.showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\n\r"));
				Log.sysOut("Rooms",mob.Name()+" modified room "+newRoom.roomID()+".");
			}
			oldRoom.destroy();
			newRoom.getArea().fillInAreaRoom(newRoom);
			fixDeities(newRoom);
			return;
		}
		if (commands.size() < 3)
		{
			flunkRoomCmd(mob);
			return;
		}

		final String command=commands.get(2).toUpperCase();
		String restStr="";
		if(commands.size()>=3)
			restStr=CMParms.combine(commands,3);

		if(command.equalsIgnoreCase("AREA"))
		{
			if (commands.size() < 4)
			{
				flunkRoomCmd(mob);
				return;
			}
			boolean confirmed=false;
			String areaType="";
			if((commands.size()>4)&&(CMClass.getAreaType(commands.get(commands.size()-1).toString())!=null))
			{
				areaType=commands.remove(commands.size()-1).toString();
				restStr=CMParms.combine(commands,3);
				confirmed=true;
			}
			Area A=CMLib.map().getArea(restStr);
			boolean reid=false;
			if((A==null)&&(!CMSecurity.isAllowed(mob, mob.location(), CMSecurity.SecFlag.CMDAREAS)))
			{
				mob.session().println(L("Not permitted."));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
				return;
			}
			else
			if(A==null)
			{
				if((!mob.isMonster())&&(CMLib.map().getShip(restStr)==null))
				{
					if(confirmed||mob.session().confirm(L("\n\rThis command will create a BRAND NEW AREA\n\r with Area code '@x1'.  Are you SURE (y/N)?",restStr),"N"))
					{
						int tries=0;
						while((areaType.length()==0)&&((++tries)<10)&&(mob.session()!=null)&&(!mob.session().isStopped()))
						{
							areaType=mob.session().prompt(L("Enter an area type to create (default=StdArea): "),L("StdArea"));
							if(CMClass.getAreaType(areaType)==null)
							{
								mob.session().println(L("Invalid area type! Valid ones are:"));
								mob.session().println(CMLib.lister().build3ColTable(mob,CMClass.areaTypes()).toString());
								areaType="";
							}
						}
						if(areaType.length()==0)
							areaType="StdArea";
						A=CMClass.getAreaType(areaType);
						A.setName(restStr);
						CMLib.map().addArea(A);
						CMLib.database().DBCreateArea(A);
						mob.location().setArea(A);
						CMLib.map().registerWorldObjectLoaded(A, null, A);
						CMLib.coffeeMaker().addAutoPropsToAreaIfNecessary(A);
						reid=true;
						mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("This entire area twitches.\n\r"));
					}
				}
				else
				{
					mob.tell(L("Sorry Charlie!"));
					mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
				}
			}
			else
			{
				mob.location().setArea(A);
				if(A.getRandomProperRoom()!=null)
					reid=true;
				else
					CMLib.database().DBUpdateRoom(mob.location());
				mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("This area twitches.\n\r"));
			}

			if(reid)
			{
				Room R=mob.location();
				final String oldID=R.roomID();
				synchronized(CMClass.getSync("SYNC"+R.roomID()))
				{
					R=CMLib.map().getRoom(R);
					final Room reference=CMLib.map().findConnectingRoom(R);
					String checkID=null;
					if(A!=null)
					{
						if(reference!=null)
							checkID=A.getNewRoomID(reference,CMLib.map().getRoomDir(reference,R));
						else
							checkID=A.getNewRoomID(R,-1);
						mob.location().setRoomID(checkID);
						CMLib.database().DBReCreate(R,oldID);
					}
				}
			}
		}
		else
		if(command.equalsIgnoreCase("NAME"))
		{
			if (commands.size() < 4)
			{
				flunkRoomCmd(mob);
				return;
			}
			mob.location().setDisplayText(restStr);
			CMLib.database().DBUpdateRoom(mob.location());
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\n\r"));
		}
		else
		if(command.equalsIgnoreCase("CLASS"))
		{
			if (commands.size() < 4)
			{
				flunkRoomCmd(mob);
				return;
			}
			final Room newRoom=CMClass.getLocale(restStr);
			if(newRoom==null)
			{
				mob.tell(L("'@x1' is not a valid room locale.",restStr));
				return;
			}
			CMLib.genEd().changeRoomType(mob.location(),newRoom);
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\n\r"));
		}
		else
		if((command.equalsIgnoreCase("XGRID"))&&(mob.location() instanceof GridLocale))
		{
			if (commands.size() < 4)
			{
				flunkRoomCmd(mob);
				return;
			}
			((GridLocale)mob.location()).setXGridSize(CMath.s_int(restStr));
			((GridLocale)mob.location()).buildGrid();
			CMLib.database().DBUpdateRoom(mob.location());
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\n\r"));
		}
		else
		if((command.equalsIgnoreCase("YGRID"))&&(mob.location() instanceof GridLocale))
		{
			if (commands.size() < 4)
			{
				flunkRoomCmd(mob);
				return;
			}
			((GridLocale)mob.location()).setYGridSize(CMath.s_int(restStr));
			((GridLocale)mob.location()).buildGrid();
			CMLib.database().DBUpdateRoom(mob.location());
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\n\r"));
		}
		else
		if(command.equalsIgnoreCase("DESCRIPTION"))
		{
			if (commands.size() < 4)
			{
				flunkRoomCmd(mob);
				return;
			}
			mob.location().setDescription(restStr);
			CMLib.database().DBUpdateRoom(mob.location());
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The very nature of reality changes.\n\r"));
		}
		else
		if(command.equalsIgnoreCase("AFFECTS"))
		{
			CMLib.genEd().genAffects(mob,mob.location(),1,1);
			mob.location().recoverPhyStats();
			CMLib.database().DBUpdateRoom(mob.location());
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The very nature of reality changes.\n\r"));
		}
		else
		if(command.equalsIgnoreCase("BEHAVIORS"))
		{
			CMLib.genEd().genBehaviors(mob,mob.location(),1,1);
			mob.location().recoverPhyStats();
			CMLib.database().DBUpdateRoom(mob.location());
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The very nature of reality changes.\n\r"));
		}
		else
		if(CMLib.coffeeMaker().isAnyGenStat(mob.location(), command))
		{
			CMLib.coffeeMaker().setAnyGenStat(mob.location(),command, restStr);
			mob.location().recoverPhyStats();
			CMLib.database().DBUpdateRoom(mob.location());
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The very nature of reality changes.\n\r"));
		}
		else
		{
			final Room R=CMLib.map().getRoom(command);
			if((R==null)
			||(!CMSecurity.isAllowed(mob, R, CMSecurity.SecFlag.CMDROOMS)))
			{
				final STreeSet<String> set=new STreeSet<String>();
				set.addAll(CMParms.parseCommas("NAME,AREA,DESCRIPTION,AFFECTS,BEHAVIORS,CLASS,XGRID,YGRID,[ROOM ID]",true));
				set.addAll(CMLib.coffeeMaker().getAllGenStats(mob.location()));
				mob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(set)));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			}
			else
			{
				final Room oldRoom=(Room)mob.location().copyOf();
				final Room newRoom=CMLib.genEd().modifyRoom(mob,R,-1);
				if((!oldRoom.sameAs(newRoom))&&(!newRoom.amDestroyed()))
				{
					CMLib.database().DBUpdateRoom(newRoom);
					newRoom.showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\n\r"));
					Log.sysOut("Rooms",mob.Name()+" modified room "+newRoom.roomID()+".");
				}
				oldRoom.destroy();
				newRoom.getArea().fillInAreaRoom(newRoom);
				fixDeities(newRoom);
			}
			return;
		}
		mob.location().recoverRoomStats();
		Log.sysOut("Rooms",mob.Name()+" modified room "+mob.location().roomID()+".");
	}

	public void accounts(final MOB mob, final List<String> commands)
		throws IOException
	{
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around the heavens."));
		PlayerAccount theAccount = null;
		String oldName = null;
		if(commands.size()==2)
		{
			theAccount=mob.playerStats().getAccount();
			oldName=theAccount.getAccountName();
			CMLib.genEd().modifyAccount(mob,theAccount,-1);
		}
		else
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY ACCOUNT ([NAME])\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
			return;
		}
		else
		{
			final String accountName=CMStrings.capitalizeAndLower(CMParms.combine(commands, 2));
			theAccount = CMLib.players().getLoadAccount(accountName);
			if(theAccount==null)
			{
				mob.tell(L("There is no account called '@x1'!\n\r",accountName));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
				return;
			}
			oldName=theAccount.getAccountName();
			CMLib.genEd().modifyAccount(mob,theAccount,-1);
			mob.location().recoverRoomStats();
		}
		Log.sysOut("Modify",mob.Name()+" modified account "+theAccount.getAccountName()+".");
		if(!oldName.equals(theAccount.getAccountName()))
		{
			final List<MOB> V=new ArrayList<MOB>();
			for(final Enumeration<String> es=theAccount.getPlayers();es.hasMoreElements();)
			{
				final String playerName=es.nextElement();
				final MOB playerM=CMLib.players().getLoadPlayer(playerName);
				if((playerM!=null)&&(!CMLib.flags().isInTheGame(playerM,true)))
					V.add(playerM);
			}
			final PlayerAccount acc = (PlayerAccount)CMClass.getCommon("DefaultPlayerAccount");
			acc.setAccountName(oldName);
			CMLib.database().DBDeleteAccount(acc);
			CMLib.database().DBCreateAccount(theAccount);
			for(final MOB playerM : V)
				CMLib.database().DBUpdatePlayerPlayerStats(playerM);
		}
		CMLib.database().DBUpdateAccount(theAccount);
	}

	public void doMql(final MOB mob, final boolean areaFlag, final List<String> commands)
		throws IOException
	{
		if(commands.size()<2)
			mob.tell(L("This is not valid MQL."));
		else
		{
			final StringBuilder lines = new StringBuilder("");
			final String mql=CMParms.combineQuoted(commands,0);
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around."));
			try
			{
				final List<UpdateSet> res=CMLib.percolator().doMQLUpdateObjects(areaFlag?(mob.location().getArea()):null, mql);
				if(res.size()==0)
					lines.append("(nothing to do)");
				else
				{
					lines.append("Update preview:\n\r");
					for(final UpdateSet o : res)
					{
						if(o.first instanceof Environmental)
							lines.append(o.first.name()+" ("+o.first.ID()+") @"+CMLib.map().getApproximateExtendedRoomID(CMLib.map().roomLocation((Environmental)o.first))+":\n\r");
						else
							lines.append(o.first.name()+" ("+o.first.ID()+"):\n\r");
						lines.append("  OLD: "+o.second+"="+o.first.getStat(o.second)).append("\n\r");
						lines.append("  NEW: "+o.second+"="+o.third).append("\n\r");
					}
					final Runnable doUpdate = new Runnable()
					{
						final List<UpdateSet> todo=res;
						public void run()
						{
							for(final UpdateSet o : todo)
							{
								o.first.setStat(o.second, o.third);
								if(o.first instanceof Environmental)
								{
									Environmental E=(Environmental)o.first;
									final Room R=CMLib.map().roomLocation(E);
									if((R!=null) && R.isSavable() && (R.roomID().length()>0))
									{
										Log.infoOut(mob.name()+" modified "+E.name()+" at "+R.roomID());
										if(E instanceof Ability)
											E=((Ability)E).affecting();
										if(E instanceof Room)
											CMLib.database().DBUpdateRoom(R);
										else
										if(E instanceof Item)
										{
											final Item I=(Item)E;
											if((I.owner() instanceof Room)
											&&(I.databaseID().length()>0))
												CMLib.database().DBUpdateItem(R.roomID(), I);
											else
											if((I.owner() instanceof MOB)
											&&(((MOB)I.owner()).databaseID().length()>0)
											&&(((MOB)I.owner()).getStartRoom()!=null)
											&&(((MOB)I.owner()).getStartRoom().roomID().length()>0))
												CMLib.database().DBUpdateMOB(((MOB)I.owner()).getStartRoom().roomID(), (MOB)I.owner());
										}
										else
										if((E instanceof MOB)
										&&(((MOB)E).databaseID().length()>0))
											CMLib.database().DBUpdateMOB(R.roomID(), (MOB)E);
									}
								}
							}
						}
					};
					final Session session = mob.session();
					if(session!=null)
					{
						final InputCallback callBack = new InputCallback(InputCallback.Type.CONFIRM,"N",0)
						{
							@Override
							public void showPrompt()
							{
								session.promptPrint(L("\n\rSave the above changes (y/N)? "));
							}

							@Override
							public void timedOut()
							{
							}

							@Override
							public void callBack()
							{
								if(this.input.equals("Y"))
								{
									doUpdate.run();
								}
							}
						};
						session.wraplessPrintln(lines.toString());
						lines.setLength(0);
						session.prompt(callBack);
					}
				}
			}
			catch(final MQLException e)
			{
				final ByteArrayOutputStream bout=new ByteArrayOutputStream();
				final PrintStream pw=new PrintStream(bout);
				e.printStackTrace(pw);
				pw.flush();
				lines.append(e.getMessage()+"\n\r"+bout.toString());
				if(mob.session()!=null)
					mob.session().wraplessPrintln(lines.toString());
				lines.setLength(0);
			}
		}
	}

	public void areas(final MOB mob, final List<String> commands)
		throws IOException
	{
		if(mob.location()==null)
			return;
		if(mob.location().getArea()==null)
			return;
		Area myArea=mob.location().getArea();

		String oldName=myArea.Name();
		final Vector<Room> allMyDamnRooms=new Vector<Room>();
		for(final Enumeration<Room> e=myArea.getCompleteMap();e.hasMoreElements();)
			allMyDamnRooms.add(e.nextElement());

		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around wildly."));
		Resources.removeResource("HELP_"+myArea.Name().toUpperCase());
		final Set<Area> alsoUpdateAreas=new HashSet<Area>();
		if(commands.size()==2)
			CMLib.genEd().modifyArea(mob,myArea,alsoUpdateAreas, -1);
		else
		if((commands.size()==3)&&(CMLib.map().getArea(commands.get(2))!=null))
		{
			myArea=CMLib.map().getArea(commands.get(2));
			oldName=myArea.Name();
			CMLib.genEd().modifyArea(mob,myArea,alsoUpdateAreas, -1);
		}
		else
		{
			if (commands.size() < 3)
			{
				flunkAreaCmd(mob);
				return;
			}

			String command=commands.get(2).toUpperCase();
			final STreeSet<String> helpSet=new STreeSet<String>();
			helpSet.addAll(CMParms.parseCommas("NAME,DESCRIPTION,CLIMATE,FILE,AFFECTS,BEHAVIORS,ADDSUB,DELSUB,XGRID,YGRID,PASSIVE,ACTIVE,FROZEN,STOPPED",true));
			helpSet.addAll(CMLib.coffeeMaker().getAllGenStats(myArea));
			if((commands.size()>3)&&(!helpSet.contains(command)))
			{
				final Area possibleArea=CMLib.map().getArea(command);
				if(possibleArea!=null)
				{
					myArea=possibleArea;
					oldName=possibleArea.Name();
					commands.remove(2);
					command=commands.get(2).toUpperCase();
				}
			}
			String restStr="";
			if(commands.size()>=3)
				restStr=CMParms.combine(commands,3);

			if(command.equalsIgnoreCase("NAME"))
			{
				if (commands.size() < 4)
				{
					flunkAreaCmd(mob);
					return;
				}
				myArea.setName(restStr);
			}
			else
			if(command.equalsIgnoreCase("PASSIVE"))
			{
				myArea.setAreaState(Area.State.PASSIVE);
			}
			else
			if(command.equalsIgnoreCase("ACTIVE"))
			{
				myArea.setAreaState(Area.State.ACTIVE);
			}
			else
			if(command.equalsIgnoreCase("FROZEN"))
			{
				myArea.setAreaState(Area.State.FROZEN);
			}
			else
			if(command.equalsIgnoreCase("STOPPED"))
			{
				myArea.setAreaState(Area.State.STOPPED);
			}
			else
			if(command.equalsIgnoreCase("DESC"))
			{
				if (commands.size() < 4)
				{
					flunkAreaCmd(mob);
					return;
				}
				myArea.setDescription(restStr);
			}
			else
			if(command.equalsIgnoreCase("FILE"))
			{
				if (commands.size() < 4)
				{
					flunkAreaCmd(mob);
					return;
				}
				myArea.setArchivePath(restStr);
			}
			else
			if((command.equalsIgnoreCase("XGRID"))&&(myArea instanceof GridZones))
			{
				if (commands.size() < 4)
				{
					flunkAreaCmd(mob);
					return;
				}
				((GridZones)myArea).setXGridSize(CMath.s_int(restStr));
			}
			else
			if((command.equalsIgnoreCase("YGRID"))&&(myArea instanceof GridZones))
			{
				if (commands.size() < 4)
				{
					flunkAreaCmd(mob);
					return;
				}
				((GridZones)myArea).setYGridSize(CMath.s_int(restStr));
			}
			else
			if(command.equalsIgnoreCase("CLIMATE"))
			{
				if (commands.size() < 4)
				{
					flunkAreaCmd(mob);
					return;
				}
				int newClimate=0;
				for(int i=0;i<restStr.length();i++)
				{
					switch(Character.toUpperCase(restStr.charAt(i)))
					{
					case 'R':
						newClimate=newClimate|Places.CLIMASK_WET;
						break;
					case 'H':
						newClimate=newClimate|Places.CLIMASK_HOT;
						break;
					case 'C':
						newClimate=newClimate|Places.CLIMASK_COLD;
						break;
					case 'W':
						newClimate=newClimate|Places.CLIMASK_WINDY;
						break;
					case 'D':
						newClimate=newClimate|Places.CLIMASK_WINDY;
						break;
					case 'N':
						// do nothing
						break;
					default:
						mob.tell(L("Invalid CLIMATE code: '@x1'.  Valid codes include: R)AINY, H)OT, C)OLD, D)RY, W)INDY, N)ORMAL.\n\r",""+restStr.charAt(i)));
						mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
						return;
					}
				}
				myArea.setClimateType(newClimate);
			}
			else
			if(command.equalsIgnoreCase("ADDSUB"))
			{
				if((commands.size()<4)||(!CMLib.players().playerExists(restStr)))
				{
					mob.tell(L("Unknown or invalid username given.\n\r"));
					mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
				}
				myArea.addSubOp(restStr);
			}
			else
			if(command.equalsIgnoreCase("DELSUB"))
			{
				if((commands.size()<4)||(!myArea.amISubOp(restStr)))
				{
					mob.tell(L("Unknown or invalid staff name given.  Valid names are: @x1.\n\r",myArea.getSubOpList()));
					mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
				}
				myArea.delSubOp(restStr);
			}
			else
			if(command.equalsIgnoreCase("AFFECTS"))
			{
				CMLib.genEd().genAffects(mob,myArea,1,1);
				myArea.recoverPhyStats();
			}
			else
			if(command.equalsIgnoreCase("BEHAVIORS"))
			{
				CMLib.genEd().genBehaviors(mob,myArea,1,1);
				myArea.recoverPhyStats();
			}
			else
			if(CMLib.coffeeMaker().isAnyGenStat(myArea, command))
			{
				CMLib.coffeeMaker().setAnyGenStat(myArea,command, restStr);
				myArea.recoverPhyStats();
			}
			else
			{
				mob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(helpSet)));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
				return;
			}
		}

		if((!myArea.Name().equals(oldName))&&(!mob.isMonster()))
		{
			if(mob.session().confirm(L("Is changing the name of this area really necessary (y/N)?"),"N"))
			{
				for(final Enumeration<Room> r=myArea.getCompleteMap();r.hasMoreElements();)
				{
					Room R=r.nextElement();
					synchronized(CMClass.getSync("SYNC"+R.roomID()))
					{
						R=CMLib.map().getRoom(R);
						if((R.roomID().startsWith(oldName+"#"))
						&&(CMLib.map().getRoom(myArea.Name()+"#"+R.roomID().substring(oldName.length()+1))==null))
						{
							R=CMLib.map().getRoom(R);
							final String oldID=R.roomID();
							R.setRoomID(myArea.Name()+"#"+R.roomID().substring(oldName.length()+1));
							CMLib.database().DBReCreate(R,oldID);
						}
						else
							CMLib.database().DBUpdateRoom(R);
					}
				}
			}
			else
				myArea.setName(oldName);
		}
		else
			myArea.setName(oldName);
		myArea.recoverPhyStats();
		mob.location().recoverRoomStats();
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\n\r"));
		if(myArea.name().equals(oldName))
			CMLib.database().DBUpdateArea(myArea.Name(),myArea);
		else
		{
			CMLib.database().DBUpdateArea(oldName,myArea);
			CMLib.map().renameRooms(myArea,oldName,allMyDamnRooms);
		}
		for(final Area A : alsoUpdateAreas)
		{
			if((A!=myArea)&&(!A.Name().equals(myArea.Name())))
				CMLib.database().DBUpdateArea(A.Name(),A);
		}
		Log.sysOut("Rooms",mob.Name()+" modified area "+myArea.Name()+".");
	}

	public void cron(final MOB mob, final List<String> commands) throws IOException
	{
		if(commands.size()<4)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\r"
					+ "The format is MODIFY CRON [NAME/#] [SUBJECT, INTERVAL, SCRIPT] [VALUE]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}

		final String cronID=commands.get(2);
		final String field=commands.get(3).toUpperCase().trim();
		final String value=CMParms.combine(commands, 4);
		final List<JournalEntry> jobs = CMLib.database().DBReadJournalMsgsByCreateDate("SYSTEM_CRON", true);
		JournalEntry modJob=null;
		if(CMath.isInteger(cronID)
		&&(CMath.s_int(cronID)>0)
		&&(CMath.s_int(cronID)<=jobs.size()))
			modJob=jobs.get(CMath.s_int(cronID)-1);
		else
		{
			for(final JournalEntry E : jobs)
			{
				if(E.subj().equalsIgnoreCase(cronID))
					modJob=E;
			}
			if(modJob == null)
			{
				for(final JournalEntry E : jobs)
				{
					if(E.subj().toUpperCase().indexOf(cronID.toUpperCase())>=0)
					{
						modJob=E;
						break;
					}
				}
			}
			if(modJob == null)
			{
				mob.tell(L("@x1 is not a valid [NAME/#].  Try LIST CRON.\n\r",cronID));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
				return;
			}
		}
		if(field.equals("SUBJECT"))
		{
			if(value.trim().length()==0)
			{
				mob.tell(L("'@x1' is not a valid subject.\n\r",value));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
				return;
			}
			modJob.subj(field);
			CMLib.database().DBUpdateJournal("SYSTEM_CRON", modJob);
			Log.sysOut(mob.Name()+" modified cron job "+modJob.subj()+".");
		}
		else
		if(field.equals("INTERVAL"))
		{
			long tm = CMLib.time().parseTickExpression(value);
			if((tm <= 0)||(value.trim().length()==0))
			{
				mob.tell(L("@x1 is not a valid interval.\n\r",value));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
				return;
			}
			tm = tm * CMProps.getTickMillis();
			modJob.data("INTERVAL="+tm);
			modJob.update(System.currentTimeMillis()+tm);
			CMLib.database().DBUpdateJournal("SYSTEM_CRON", modJob);
			Log.sysOut(mob.Name()+" modified cron job "+modJob.subj()+".");
			CMLib.journals().activate();
		}
		else
		if(field.equals("SCRIPT"))
		{
			final JournalEntry E=modJob;
			final List<String> msgV=Resources.getFileLineVector(new StringBuffer(modJob.msg()));
			CMLib.journals().makeMessageASync(mob, modJob.subj(),msgV, false, new MsgMkrCallback() {
				final JournalEntry E2 = E;
				@Override
				public void callBack(final MOB mob, final Session sess, final MsgMkrResolution res)
				{
					if(res == MsgMkrResolution.SAVEFILE)
					{
						E2.msg(CMParms.combineWith(msgV, "\n\r"));
						CMLib.database().DBUpdateJournal("SYSTEM_CRON", E2);
						Log.sysOut(mob.Name()+" modified cron job "+E2.subj()+".");
					}
				}
			});
		}
	}

	public void quests(final MOB mob, final List<String> commands)
		throws IOException
	{
		if(commands.size()<3)
			mob.tell(L("modify which quest?  Use list quests."));
		else
		{
			int cmdDex=-1;
			final String[] CMDS={"START","STOP","ENABLE","DISABLE"};
			if(commands.size()>3)
			{
				cmdDex=CMParms.indexOf(CMDS,commands.get(commands.size()-1).toUpperCase());
				if(cmdDex>=0)
					commands.remove(commands.size()-1);
			}
			String name=CMParms.combine(commands,2);
			Quest Q=null;
			if(CMath.isInteger(name))
			{
				Q=CMLib.quests().fetchQuest(CMath.s_int(name)-1);
				if(Q!=null)
					name=Q.name();
			}
			if(Q==null)
				Q=CMLib.quests().fetchQuest(name);
			if(Q==null)
			{
				mob.tell(L("Quest '@x1' is unknown.  Try list quests.",name));
				return;
			}
			else
			if(!mob.isMonster())
			{
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around @x1.",Q.name()));
				int showFlag=-1;
				if(CMProps.getIntVar(CMProps.Int.EDITORTYPE)>0)
					showFlag=-999;
				boolean ok=false;
				while(!ok)
				{
					int showNumber=0;
					int doCmd=cmdDex;
					String newScript=null;
					if((doCmd<0)&&(CMLib.genEd().promptToggle(mob,++showNumber,showFlag,"Started: "+Q.running())))
						doCmd=Q.running()?1:0;
					if((doCmd<0)&&(CMLib.genEd().promptToggle(mob,++showNumber,showFlag,"Enabled: "+(!Q.suspended()))))
						doCmd=Q.suspended()?2:3;
					if(doCmd<0)
					{
						final String oldScript=Q.script();
						newScript=CMLib.genEd().prompt(mob,oldScript,++showNumber,showFlag,L("Script"),false,true,CMLib.help().getHelpText("QUESTS",mob,true).toString(),null,null);
						if(!newScript.equals(oldScript))
						{
							Q.setScript(newScript,true);
							boolean revert=false;
							if(Q.name().length()==0)
							{
								mob.tell(L("You must specify a VALID quest string.  This one contained no name."));
								revert=true;
							}
							else
							if(Q.duration()<0)
							{
								mob.tell(L("You must specify a VALID quest string.  This one contained no duration."));
								revert=true;
							}
							else
							for(int q=0;q<CMLib.quests().numQuests();q++)
							{
								final Quest Q1=CMLib.quests().fetchQuest(q);
								if(Q1.name().equalsIgnoreCase(Q.name())&&(Q1!=Q))
								{
									mob.tell(L("A quest with that name already exists."));
									revert=true;
								}
							}
							if(revert)
								Q.setScript(oldScript,true);
							else
								CMLib.quests().save();
						}
					}
					switch(doCmd)
					{
					case 0:
					{
						if(Q.running())
							mob.tell(L("That quest is already running."));
						else
						{
							Q.startQuest();
							if((!Q.running())&&(Q.getSpawn()!=Quest.SPAWN_ANY))
								mob.tell(L("Quest '@x1' NOT started -- check your mud.log for errors.",Q.name()));
							else
								mob.tell(L("Quest '@x1' started.",Q.name()));
						}
						break;
					}
					case 1:
					{
						if(!Q.running())
							mob.tell(L("That quest is not running."));
						else
						{
							CMLib.coffeeTables().bump(Q,CoffeeTableRow.STAT_QUESTSTOP);
							Q.stopQuest();
							if(!Q.running())
								mob.tell(L("Quest '@x1' stopped.",Q.name()));
							else
								mob.tell(L("Quest '@x1' NOT stopped -- check your mud.log for errors.",Q.name()));
						}
						break;
					}
					case 2:
					{
						if(!Q.suspended())
							mob.tell(L("That quest is not disabled."));
						else
						{
							Q.setSuspended(false);
							CMLib.database().DBUpdateQuest(Q);
							mob.tell(L("Quest '@x1' enabled.",Q.name()));
						}
						break;
					}
					case 3:
					{
						if(Q.suspended())
							mob.tell(L("That quest is already disabled."));
						else
						{
							if(Q.running())
								Q.stopQuest();
							Q.setSuspended(true);
							CMLib.database().DBUpdateQuest(Q);
							mob.tell(L("Quest '@x1' disabled.",Q.name()));
						}
						break;
					}
					}

					if ((showFlag < -900) || (cmdDex >= 0))
					{
						ok = true;
						break;
					}
					if (showFlag > 0)
					{
						showFlag = -1;
						continue;
					}
					showFlag=CMath.s_int(mob.session().prompt(L("Edit which? "),""));
					if(showFlag<=0)
					{
						showFlag=-1;
						ok=true;
					}
				}
				Log.sysOut("Rooms",mob.Name()+" modified quest "+Q.name()+".");
			}
		}
	}

	public void updateChangedExit(final MOB mob, final Room baseRoom, final Exit thisExit, final Exit prevExit)
	{
		thisExit.recoverPhyStats();
		CMLib.database().DBUpdateExits(baseRoom);
		try
		{
			for(final Enumeration<Room> r=CMLib.map().rooms();r.hasMoreElements();)
			{
				Room room=r.nextElement();
				synchronized(CMClass.getSync("SYNC"+room.roomID()))
				{
					room=CMLib.map().getRoom(room);
					if(room != null)
					{
						for(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--)
						{
							final Exit exit=room.getRawExit(d);
							if((exit!=null)&&(exit==thisExit))
							{
								CMLib.database().DBUpdateExits(room);
								room.getArea().fillInAreaRoom(room);
								break;
							}
						}
					}
				}
			}
		}
		catch (final NoSuchElementException e)
		{
		}
		if(!prevExit.sameAs(thisExit))
			Log.sysOut("CreateEdit",mob.Name()+" modified exit "+thisExit.ID()+".");
		prevExit.destroy();
		mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("@x1 shake(s) under the transforming power.",thisExit.name()));
		baseRoom.getArea().fillInAreaRoom(baseRoom);
	}

	public void exits(final MOB mob, final List<String> commands)
		throws IOException
	{
		if(mob.location().roomID().equals(""))
		{
			mob.tell(L("This command is invalid from within a GridLocaleChild room."));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
			return;
		}
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY EXIT [DIRECTION] (TEXT, ?) (VALUE)\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}

		final int direction=CMLib.directions().getGoodDirectionCode((commands.get(2)));
		if(direction<0)
		{
			mob.tell(L("You have failed to specify a direction.  Try @x1.\n\r",Directions.LETTERS()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}

		final Exit thisExit=mob.location().getRawExit(direction);
		if(thisExit==null)
		{
			mob.tell(L("You have failed to specify a valid exit '@x1'.\n\r",(commands.get(2))));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		final Directions.DirType dirType=CMLib.flags().getInDirType(mob);
		final String inDirName=CMLib.directions().getInDirectionName(direction, dirType);
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around to the @x1.",inDirName));
		final Exit copyExit=(Exit)thisExit.copyOf();
		if(thisExit.isGeneric() && (commands.size()<5))
		{
			CMLib.genEd().modifyGenExit(mob,thisExit,-1);
			updateChangedExit(mob,mob.location(),thisExit,copyExit);
			return;
		}

		if(commands.size()<5)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY EXIT [DIRECTION] (TEXT, ?) (VALUE)\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}

		final String command=commands.get(3).toUpperCase();
		final String restStr=CMParms.combine(commands,4);

		if(command.equalsIgnoreCase("text"))
		{
			if(thisExit.isGeneric())
				CMLib.genEd().modifyGenExit(mob,thisExit,-1);
			else
				thisExit.setMiscText(restStr);
		}
		else
		if(CMLib.coffeeMaker().isAnyGenStat(thisExit, command))
		{
			CMLib.coffeeMaker().setAnyGenStat(thisExit,command, restStr);
			thisExit.recoverPhyStats();
		}
		else
		{
			final STreeSet<String> set=new STreeSet<String>();
			set.addAll(CMParms.parseCommas("TEXT",true));
			set.addAll(CMLib.coffeeMaker().getAllGenStats(thisExit));
			mob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(set)));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		updateChangedExit(mob,mob.location(),thisExit,copyExit);
	}

	public boolean races(final MOB mob, final List<String> commands)
		throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY RACE [RACE ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}

		final String raceID=CMParms.combine(commands,2);
		final Race R=CMClass.getRace(raceID);
		if(R==null)
		{
			mob.tell(L("'@x1' is an invalid race id.",raceID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(R.isGeneric()))
		{
			mob.tell(L("'@x1' is not generic, and may not be modified as it is.  Use CREATE RACE @x2 to convert it to a generic race.",R.ID(),R.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",R.name()));
		CMLib.genEd().modifyGenRace(mob,R,-1);
		CMLib.database().DBDeleteRace(R.ID());
		CMLib.database().DBCreateRace(R.ID(),R.racialParms());
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1's everywhere shake under the transforming power!",R.name()));
		return true;
	}

	public void allQualify(final MOB mob, final List<String> commands)
	throws IOException
	{
		if(commands.size()<4)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY ALLQUALIFY EACH/ALL [SKILL ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		final String eachOrAll=commands.get(2);
		if((!eachOrAll.equalsIgnoreCase("each"))&&(!eachOrAll.equalsIgnoreCase("all")))
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY ALLQUALIFY EACH/ALL [SKILL ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		final String classD=CMParms.combine(commands,3);
		final Ability A=CMClass.getAbility(classD);
		if(A==null)
		{
			mob.tell(L("Ability with the ID '@x1' does not exist! Try LIST ABILITIES.",classD));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		Map<String,Map<String,AbilityMapper.AbilityMapping>> map=CMLib.ableMapper().getAllQualifiesMap(null);
		Map<String,AbilityMapper.AbilityMapping> subMap=map.get(eachOrAll.toUpperCase().trim());
		if(!subMap.containsKey(classD.toUpperCase().trim()))
		{
			mob.tell(L("All-Qualify entry (@x1) ID '@x2' does not exist!  Try CREATE, or LIST ALLQUALIFYS.",eachOrAll,A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		final AbilityMapper.AbilityMapping mapped = CMLib.genEd().modifyAllQualifyEntry(mob,eachOrAll.toUpperCase().trim(),A, -1);
		map=CMLib.ableMapper().getAllQualifiesMap(null);
		subMap=map.get(eachOrAll.toUpperCase().trim());
		subMap.put(A.ID().toUpperCase().trim(), mapped);
		CMLib.ableMapper().saveAllQualifysFile(map);
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The skill of the world just changed!"));
	}

	public boolean classes(final MOB mob, final List<String> commands)
		throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY CLASS [CLASS ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}

		final String classID=CMParms.combine(commands,2);
		final CharClass C=CMClass.getCharClass(classID);
		if(C==null)
		{
			mob.tell(L("'@x1' is an invalid class id.",classID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(C.isGeneric()))
		{
			mob.tell(L("'@x1' is not generic, and may not be modified as it is.  Use CREATE CLASS @x2 to convert it to a generic character class.",C.ID(),C.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",C.name()));
		CMLib.genEd().modifyGenClass(mob,C,-1);
		CMLib.database().DBDeleteClass(C.ID());
		CMLib.database().DBCreateClass(C.ID(),C.classParms());
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1's everywhere shake under the transforming power!",C.name()));
		return true;
	}

	public boolean abilities(final MOB mob, final List<String> commands)
	throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY ABILITY [ABILITY ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}

		final String classID=CMParms.combine(commands,2);
		final Ability A=CMClass.getAbility(classID);
		if(A==null)
		{
			mob.tell(L("'@x1' is an invalid ability id.",classID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(A.isGeneric()))
		{
			mob.tell(L("'@x1' is not generic, and may not be modified.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof Language)
		{
			mob.tell(L("'@x1' is a language.  Try MODIFY LANGUAGE.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof Trap)
		{
			mob.tell(L("'@x1' is a trap.  Try MODIFY TRAP.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof ItemCraftor)
		{
			mob.tell(L("'@x1' is a crafting skill.  Try MODIFY CRAFTSKILL.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));
		CMLib.genEd().modifyGenAbility(mob,A,-1);
		CMLib.database().DBDeleteAbility(A.ID());
		CMLib.database().DBCreateAbility(A.ID(),"GenAbility",A.getStat("ALLXML"));
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1's everywhere shake under the transforming power!",A.name()));
		return true;
	}

	public boolean traps(final MOB mob, final List<String> commands)
	throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY TRAP [ABILITY ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}

		final String classID=CMParms.combine(commands,2);
		final Ability A=CMClass.getAbility(classID);
		if(A==null)
		{
			mob.tell(L("'@x1' is an invalid ability id.",classID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(A.isGeneric()))
		{
			mob.tell(L("'@x1' is not generic, and may not be modified.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof Language)
		{
			mob.tell(L("'@x1' is a language.  Try MODIFY LANGUAGE.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof ItemCraftor)
		{
			mob.tell(L("'@x1' is a crafting skill.  Try MODIFY CRAFTSKILL.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(A instanceof Trap))
		{
			mob.tell(L("'@x1' is not a trap.  Try MODIFY ABILITY.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));
		CMLib.genEd().modifyGenTrap(mob,(Trap)A,-1);
		CMLib.database().DBDeleteAbility(A.ID());
		CMLib.database().DBCreateAbility(A.ID(),"GenTrap",A.getStat("ALLXML"));
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1's everywhere shake under the transforming power!",A.name()));
		return true;
	}

	public boolean languages(final MOB mob, final List<String> commands)
	throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY LANGUAGE [SKILL ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}

		final String classID=CMParms.combine(commands,2);
		final Ability A=CMClass.getAbility(classID);
		if(A==null)
                mob.tell("No Javascripts require approval at this time.");
        }
        else
        if(commandType.equals("USER"))
        {
            if(!CMSecurity.isAllowed(mob,mob.location(),"CMDPLAYERS")) return errorOut(mob);
            players(mob,commands);
			mob.tell(L("'@x1' is not generic, and may not be modified.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof ItemCraftor)
		{
			mob.tell(L("'@x1' is a crafting skill.  Try MODIFY CRAFTSKILL.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof ItemCollection)
		{
			mob.tell(L("'@x1' is a gathering skill.  Try MODIFY GATHERSKILL.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(A instanceof Language))
		{
			mob.tell(L("'@x1' is not a language.  Try MODIFY ABILITY.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));
		CMLib.genEd().modifyGenLanguage(mob,(Language)A,-1);
		CMLib.database().DBDeleteAbility(A.ID());
		CMLib.database().DBCreateAbility(A.ID(),"GenLanguage",A.getStat("ALLXML"));
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1's everywhere shake under the transforming power!",A.name()));
		return true;
	}

	public boolean craftSkills(final MOB mob, final List<String> commands)
	throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY CRAFTSKILL [SKILL ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}

		final String classID=CMParms.combine(commands,2);
		final Ability A=CMClass.getAbility(classID);
		if(A==null)
		{
			mob.tell(L("'@x1' is an invalid ability id.",classID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(A.isGeneric()))
		{
			mob.tell(L("'@x1' is not generic, and may not be modified.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof Language)
		{
			mob.tell(L("'@x1' is a crafting skill.  Try MODIFY LANGUAGE.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(A instanceof ItemCraftor))
		{
			if(A instanceof ItemCollection)
				mob.tell(L("'@x1' is a gathering skill.  Try MODIFY GATHERSKILL.",A.ID()));
			else
				mob.tell(L("'@x1' is not a crafting skill.  Try MODIFY ABILITY.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(((ItemCraftor)A).getCraftorType()==ItemCraftor.CraftorType.LargeConstructions)
		{
			mob.tell(L("'@x1' is a building/wrighting skill.  Try MODIFY WRIGHTSKILL.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));
		CMLib.genEd().modifyGenCraftSkill(mob,A,-1);
		CMLib.database().DBDeleteAbility(A.ID());
		CMLib.database().DBCreateAbility(A.ID(),"GenCraftSkill",A.getStat("ALLXML"));
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1's everywhere shake under the transforming power!",A.name()));
		return true;
	}

	public boolean gatherSkills(final MOB mob, final List<String> commands)
	throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY GATHERSKILL [SKILL ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}

		final String classID=CMParms.combine(commands,2);
		final Ability A=CMClass.getAbility(classID);
		if(A==null)
		{
			mob.tell(L("'@x1' is an invalid ability id.",classID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(A.isGeneric()))
		{
			mob.tell(L("'@x1' is not generic, and may not be modified.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof Language)
		{
			mob.tell(L("'@x1' is a crafting skill.  Try MODIFY LANGUAGE.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof ItemCraftor)
		{
			mob.tell(L("'@x1' is a crafting skill.  Try MODIFY CRAFTSKILL.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(A instanceof ItemCollection))
		{
			mob.tell(L("'@x1' is not a gathering skill.  Try MODIFY ABILITY.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));
		CMLib.genEd().modifyGenGatheringSkill(mob,A,-1);
		CMLib.database().DBDeleteAbility(A.ID());
		CMLib.database().DBCreateAbility(A.ID(),"GenGatheringSkill",A.getStat("ALLXML"));
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1's everywhere shake under the transforming power!",A.name()));
		return true;
	}

	public boolean wrightSkills(final MOB mob, final List<String> commands)
	throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY WRIGHTSKILL [SKILL ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}

		final String classID=CMParms.combine(commands,2);
		final Ability A=CMClass.getAbility(classID);
		if(A==null)
		{
			mob.tell(L("'@x1' is an invalid ability id.",classID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(A.isGeneric()))
		{
			mob.tell(L("'@x1' is not generic, and may not be modified.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(A instanceof Language)
		{
			mob.tell(L("'@x1' is a crafting skill.  Try MODIFY LANGUAGE.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!(A instanceof ItemCraftor))
		{
			if(A instanceof ItemCollection)
				mob.tell(L("'@x1' is a gathering skill.  Try MODIFY GATHERSKILL.",A.ID()));
			else
				mob.tell(L("'@x1' is not a crafting skill.  Try MODIFY ABILITY.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(((ItemCraftor)A).getCraftorType()!=ItemCraftor.CraftorType.LargeConstructions)
		{
			mob.tell(L("'@x1' is a crafting skill.  Try MODIFY CRAFTSKILL.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));
		CMLib.genEd().modifyGenWrightSkill(mob,A,-1);
		CMLib.database().DBDeleteAbility(A.ID());
		CMLib.database().DBCreateAbility(A.ID(),"GenWrightSkill",A.getStat("ALLXML"));
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1's everywhere shake under the transforming power!",A.name()));
		return true;
	}

	public void components(final MOB mob, final List<String> commands)
	throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\r"
					+ "Format: MODIFY COMPONENT [SKILL ID]\n\r"
					+ "Format: MODIFY COMPONENT SOCIAL [SOCIAL ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		if(commands.get(2).equalsIgnoreCase("SOCIAL"))
		{
			final String socialID=CMParms.combine(commands,3);
			final Vector<String> socialsParse=CMParms.parse(socialID);
			if(socialsParse.size()==0)
			{
				mob.tell(L("Which social? That doesn't exist.  Try LIST COMPONENTS"));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
				return;
			}
			final String name=socialsParse.firstElement().toUpperCase().trim();
			final String rest=socialsParse.size()>1?CMParms.combine(socialsParse,1):"";
			final List<Social> socials=CMLib.ableComponents().getSocialsSet(name);
			if((socials==null)||(socials.size()==0))
			{
				mob.tell(L("'@x1' does not exist, try LIST COMPONENTS.",socialID));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
				return;
			}
			final List<Social> copy = new XArrayList<Social>(socials);
			final List<String> socEncV = new ArrayList<String>(socials.size());
			for(final Social S : copy)
				socEncV.add(S.getEncodedLine());
			CMLib.socials().modifySocialInterface(mob, socials, rest);
			for(final Social copyS : copy)
				if(!socials.contains(copyS))
					CMLib.ableComponents().alterAbilityComponentFile(CMStrings.trimCRLF(copyS.getEncodedLine()), true);
			for(final Social newS : socials)
			{
				if((!socials.contains(newS))||(!socEncV.contains(newS.getEncodedLine())))
					CMLib.ableComponents().alterAbilityComponentFile(CMStrings.trimCRLF(newS.getEncodedLine()), false);
			}
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The complication of skill usage just increased!"));
			return;
		}
		String skillID=CMParms.combine(commands,2);
		final Ability A=CMClass.getAbility(skillID);
		if(A==null)
		{
			mob.tell(L("'@x1' is not a proper skill/spell ID.  Try LIST ABILITIES.",skillID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		skillID=A.ID();
		if(CMLib.ableComponents().getAbilityComponentMap().get(A.ID().toUpperCase())==null)
		{
			mob.tell(L("A component definition for '@x1' doesn't exists, you'll need to create it first.",A.ID()));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		CMLib.genEd().modifyComponents(mob,skillID,-1);
		final String parms=CMLib.ableComponents().getAbilityComponentCodedString(skillID);
		final String error=CMLib.ableComponents().addAbilityComponent(parms,CMLib.ableComponents().getAbilityComponentMap());
		if(error!=null)
		{
			mob.tell(error);
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		CMLib.ableComponents().alterAbilityComponentFile(skillID,false);
		mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The complication of skill usage just increased!"));
	}

	public void plane(final MOB mob, final List<String> commands)
	throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rFormat: MODIFY PLANE [SKILL ID]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		String planeName=CMParms.combine(commands,2);
		final PlanarAbility planeSet = (PlanarAbility)CMClass.getAbility("StdPlanarAbility");
		final Map<String,String> planeVars = planeSet.getPlanarVars(planeName);
		if(planeVars == null)
		{
			mob.tell(L("'@x1' already exists, you'll need to destroy it first.",planeName));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		planeName = planeVars.get(PlanarVar.ID.name());
		final Map<String,String> alterParms = new XHashtable<String,String>(planeVars);
		final String modifiedRule = CMLib.genEd().modifyPlane(mob,planeName,alterParms,-1);
		final String err = planeSet.addOrEditPlane(planeName, modifiedRule);
		if(err.startsWith("ERROR"))
		{
			mob.tell(err);
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}
		else
		if(err.length()>0)
		{
			Log.infoOut(mob.Name()+" modified plane: "+planeName+": \n\r"+err);
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The planar universe just changed!"));
		}
	}

	public void socials(final MOB mob, final List<String> commands)
		throws IOException
	{
		if(mob.isMonster())
			return;

		if(commands.size()<3)
		{
			mob.session().safeRawPrintln(L("but fail to specify the proper fields.\n\rThe format is MODIFY SOCIAL [NAME] ([PARAM])\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
			return;
		}
		final String name=commands.get(2).toUpperCase();
		String stuff="";
		if(commands.size()>3)
			stuff=CMParms.combine(commands,3).toUpperCase().trim();
		if(stuff.startsWith("T-"))
			stuff="TNAME";
		if(stuff.equals("TNAME"))
			stuff="<T-NAME>";
		final String oldStuff=stuff;
		if(stuff.equals("NONE"))
			stuff="";
		final Social S=CMLib.socials().fetchSocial((name+" "+stuff).trim(),false);
		if(S==null)
		{
			mob.tell(L("The social '@x1' does not exist.",stuff));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
			return;
		}
		final List<Social> oldSocials = new ArrayList<Social>();
		List<Social> allSocials = CMLib.socials().getSocialsSet(name);
		if(allSocials==null)
			allSocials=new ArrayList<Social>();
		for(int a = 0; a<allSocials.size();a++)
			oldSocials.add((Social)allSocials.get(a).copyOf());
		{
			final Vector<String> socialsParse=CMParms.parse((name+" "+oldStuff).trim());
			if(socialsParse.size()==0)
			{
				mob.tell(L("Which social?"));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
				return;
			}
			final String sname=socialsParse.firstElement().toUpperCase().trim();
			final String rest=socialsParse.size()>1?CMParms.combine(socialsParse,1):"";
			final List<Social> socials=CMLib.socials().getSocialsSet(socialsParse.firstElement());
			if((socials==null)||(socials.size()==0))
			{
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("The social '@x1' does not exist. Try LIST SOCIALS ",sname));
				return;
			}
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around the idea of  @x1s.",S.name()));
			final List<Social> copy=new XArrayList<Social>(socials);
			CMLib.socials().modifySocialInterface(mob,socials, rest);
			{
				for(final Social copyS : copy)
					if(!socials.contains(copyS))
						CMLib.socials().delSocial(copyS.name());
				for(final Social newS : socials)
				{
					if(!socials.contains(newS))
						CMLib.socials().addSocial(newS);
				}
			}
			CMLib.socials().save(mob);
		}
		allSocials = CMLib.socials().getSocialsSet(name);
		if(allSocials==null)
			allSocials=new ArrayList<Social>();
		boolean changed = allSocials. size() != oldSocials.size();
		if(!changed)
		{
			for(int a=0;a<oldSocials.size();a++)
			{
				final Social oldSocial = oldSocials.get(a);
				boolean found = false;
				for(int a2=0;a2<allSocials.size();a2++)
				{
					final Social newSocial = allSocials.get(a2);
					if(oldSocial.name().equals(newSocial.name()))
					{
						found = true;
						changed = !oldSocial.sameAs(newSocial);
						break;
					}
				}
				if(!found)
					changed = true;
				if(changed)
					break;
			}
		}
		if(changed)
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The happiness of all mankind has just fluxuated!"));
	}

	public void players(final MOB mob, final List<String> commands)
		throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY USER [PLAYER NAME] ([STAT],?) (VALUE)\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
			return;
		}

		final String mobID=commands.get(2);
		final MOB M=CMLib.players().getLoadPlayer(mobID);
		if(M!=null)
		{
			if(M.playerStats()!=null)
				M.playerStats().setLastUpdated(M.playerStats().getLastDateTime());
			M.recoverPhyStats();
			M.recoverCharStats();
		}
		else
		{
			mob.tell(L("There is no such player as '@x1'!",mobID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
			return;
		}
		mob.location().showOthers(mob,M,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));
		final MOB copyMOB=(MOB)M.copyOf();
		M.basePhyStats().copyInto(copyMOB.basePhyStats());
		M.phyStats().copyInto(copyMOB.phyStats());
		mob.location().delInhabitant(copyMOB); //necc because location is cleared later, before destroy is called.
		if(M.location()!=null)
			M.location().delInhabitant(copyMOB); //necc because location is cleared later, before destroy is called.
		if(commands.size()<4)
		{
			CMLib.genEd().modifyPlayer(mob,M,-1);
			if(!copyMOB.sameAs(M))
			{
				final StringBuilder changed=new StringBuilder("");
				final String[] codes = M.getStatCodes();
				for (int i = 0; i < codes.length; i++)
				{
					if (!M.getStat(codes[i]).equals(copyMOB.getStat(codes[i])))
						changed.append(codes[i]).append(" ");
				}
				Log.sysOut("Mobs",mob.Name()+" modified player "+M.Name()+": "+changed.toString()+".");
			}
		}
		else
		{
			final String command=commands.get(3).toUpperCase();
			final String restStr=CMParms.combine(commands,4);
			if(command.equalsIgnoreCase("PROFICIENCIES")||command.equalsIgnoreCase("PROFICIENCY"))
			{
				final int prof=CMath.s_int(restStr);
				for(int a=0;a<M.numAbilities();a++)
					M.fetchAbility(a).setProficiency(prof);
				for(int a=0;a<M.numEffects();a++)
				{
					final Ability A=M.fetchEffect(a);
					if((A!=null)&&(A.isNowAnAutoEffect()))
						A.setProficiency(prof);
				}
				mob.tell(L("All of @x1's skill proficiencies set to @x2",M.Name(),""+prof));
				Log.sysOut("Mobs",mob.Name()+" modified player "+M.Name()+" skill proficiencies.");
			}
			else
			if(command.toUpperCase().startsWith("PROFICIENCY(")&&command.endsWith(")"))
			{
				final int prof=CMath.s_int(restStr);
				final String ableName=command.substring(12,command.length()-1).trim();
				final Ability A=M.findAbility(ableName);
				if(A==null)
				{
					mob.tell(L("...but failed to specify an valid ability name.  Try one of: @x1",CMParms.toCMObjectListString(M.abilities())));
					mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
					return;
				}
				A.setProficiency(prof);
				final Ability eA=M.fetchEffect(A.ID());
				if((eA!=null)&&(eA.isNowAnAutoEffect()))
					eA.setProficiency(prof);
				mob.tell(L("@x1's skill proficiency in @x2 set to @x3",M.Name(),A.ID(),""+prof));
				Log.sysOut("Mobs",mob.Name()+" modified player "+M.Name()+" skill proficiency in "+A.ID()+".");
			}
			else
			if(CMLib.coffeeMaker().isAnyGenStat(M, command))
			{
				CMLib.coffeeMaker().setAnyGenStat(M,command, restStr);
				M.recoverPhyStats();
				M.recoverCharStats();
				M.recoverMaxState();
				if(!copyMOB.sameAs(M))
					Log.sysOut("Mobs",mob.Name()+" modified player "+M.Name()+".");
			}
			else
			{
				final STreeSet<String> set=new STreeSet<String>();
				set.addAll(CMLib.coffeeMaker().getAllGenStats(M));
				set.add("PROFICIENCIES");
				set.add("PROFICIENCY(ABILITY_ID)");
				mob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(set)));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			}
			CMLib.database().DBUpdatePlayer(M);
			if(CMLib.flags().isInTheGame(M,true))
				CMLib.database().DBUpdateFollowers(M);
		}
		copyMOB.setSession(null); // prevents logoffs.
		copyMOB.setLocation(null);
		copyMOB.destroy();
	}

	public boolean achievements(final MOB mob, final List<String> commands)
	{
		final boolean accountSys = CMProps.isUsingAccountSystem();
		if(commands.size()<((accountSys)?4:3))
		{
			if(accountSys)
				mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY ACHIEVEMENT (PLAYER/ACCOUNT/ALL) [TATTOO]\n\r"));
			else
				mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY ACHIEVEMENT [TATTOO]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}

		final String agentStr=accountSys?commands.get(2).toString():"PLAYER";
		final AccountStats.Agent agent=(AccountStats.Agent)CMath.s_valueOf(AccountStats.Agent.class, agentStr.toUpperCase().trim());
		if(agent == null)
		{
			mob.tell(L("'@x1' is an unknown achievement type.  Try @x2!",agentStr,CMParms.toListString(AccountStats.Agent.values())));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		final String tattoo=CMParms.combine(commands,((accountSys)?3:2));
		final Achievement A=CMLib.achievements().getAchievement(tattoo);
		if(A==null)
		{
			mob.tell(L("An achievement with the TATTOO/ID '@x1' does not exist!",tattoo));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(CMLib.achievements().addModifyAchievement(mob, agent, A.getTattoo(), A))
			mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The vanity of the world just changed!"));
		return true;
	}

	public boolean helps(final MOB mob, final List<String> commands)
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY HELP [KEY]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		final boolean preferAHelp = commands.get(1).toUpperCase().startsWith("A");
		final String helpStr=CMParms.combine(commands,2).toUpperCase().trim().replace(' ','_');
		final List<Properties> ps;
		if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.AHELP))
			ps = new XVector<Properties>(CMLib.help().getHelpFile());
		else
		if(preferAHelp)
			ps = new XVector<Properties>(CMLib.help().getArcHelpFile(), CMLib.help().getHelpFile());
		else
			ps = new XVector<Properties>(CMLib.help().getHelpFile(), CMLib.help().getArcHelpFile());
		Pair<String, String> match=null;
		for(final Properties p : ps)
		{
			match = CMLib.help().getHelpMatch(helpStr,p,mob, 0);
			if((match!=null)&&(match.second!=null))
				break;
		}
		if((match==null)||(match.second==null))
		{
			mob.tell(L("An help entry with key '@x1' does not exist!",helpStr));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		final HelpSection section = preferAHelp?HelpSection.ArchonFirst:HelpSection.NormalFirst;
		final String fileName = CMLib.help().findHelpFile(match.first, section, true);
		if(fileName == null)
		{
			mob.tell(L("A help file with key '@x1' does not exist!",match.first));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		if(!CMLib.help().addModifyHelpEntry(mob, fileName, match.first, false))
		{
			mob.tell(L("A help file with key '@x1' could not be edited!",match.first));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return false;
		}
		//mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The vanity of the world just changed!"));
		return true;
	}

	public void manufacturer(final MOB mob, final List<String> commands) throws IOException
	{
		if(commands.size()<3)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY MANUFACTURER [NAME]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}

		final String manufacturerID=CMParms.combine(commands,2);

		final Manufacturer manufacturer=CMLib.tech().getManufacturer(manufacturerID);
		if((manufacturer==null)||(manufacturer==CMLib.tech().getDefaultManufacturer()))
		{
			mob.tell(L("There's no manufacturer called '@x1' Try LIST MANUFACTURERS.\n\r",manufacturerID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
			return;
		}

		CMLib.genEd().modifyManufacturer(mob, manufacturer, -1);
		CMLib.tech().updateManufacturer(manufacturer);
		mob.location().recoverRoomStats();
		Log.sysOut(mob.Name()+" modified manufacturer "+manufacturer.name()+".");
	}

	public void mobs(final MOB mob, final List<String> commands)
		throws IOException
	{

		if(commands.size()<4)
		{
			mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY MOB [MOB NAME] [LEVEL, ABILITY, REJUV, MISC, ?] [NUMBER, TEXT]\n\r"));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
			return;
		}

		final String mobID=(commands.get(2));
		final String command=commands.get(3).toUpperCase();
		String restStr="";
		if(commands.size()>4)
			restStr=CMParms.combine(commands,4);

		final MOB modMOB=mob.location().fetchInhabitant(mobID);
		if(modMOB==null)
		{
			mob.tell(L("I don't see '@x1 here.\n\r",mobID));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));
			return;
		}

		if(!modMOB.isMonster())
		{
			mob.tell(L("@x1 is a player! Try MODIFY USER!",modMOB.Name()));
			return;
		}
		final MOB copyMOB=(MOB)modMOB.copyOf();
		mob.location().showOthers(mob,modMOB,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));
		if(command.equals("LEVEL"))
		{
			final int newLevel=CMath.s_int(restStr);
			if(newLevel>=0)
			{
				modMOB.basePhyStats().setLevel(newLevel);
				modMOB.recoverCharStats();
				modMOB.recoverPhyStats();
				mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shakes under the transforming power.",modMOB.name()));
			}
		}
		else
		if(command.equals("ABILITY"))
		{
			final int newAbility=CMath.s_int(restStr);
			modMOB.basePhyStats().setAbility(newAbility);
			modMOB.recoverPhyStats();
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shakes under the transforming power.",modMOB.name()));
		}
		else
		if(command.equals("REJUV"))
		{
			final int newRejuv=CMath.s_int(restStr);
			if(newRejuv>0)
			{
				modMOB.basePhyStats().setRejuv(newRejuv);
				modMOB.recoverPhyStats();
				mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shakes under the transforming power.",modMOB.name()));
			}
			else
			{
				modMOB.basePhyStats().setRejuv(PhyStats.NO_REJUV);
				modMOB.recoverPhyStats();
				mob.tell(L("@x1 will now never rejuvenate.",modMOB.name()));
				mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shakes under the transforming power.",modMOB.name()));
			}
		}
		else
		if(command.equals("MISC"))
		{
			if(modMOB.isGeneric())
				CMLib.genEd().genMiscSet(mob,modMOB,-1);
			else
				modMOB.setMiscText(restStr);
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shakes under the transforming power.",modMOB.name()));
		}
		else
		if(CMLib.coffeeMaker().isAnyGenStat(modMOB, command))
		{
			CMLib.coffeeMaker().setAnyGenStat(modMOB,command, restStr);
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modMOB.name()));
		}
		else
		{
			final STreeSet<String> set=new STreeSet<String>();
			set.addAll(CMParms.parseCommas("LEVEL,ABILITY,REJUV,MISC",true));
			set.addAll(CMLib.coffeeMaker().getAllGenStats(modMOB));
			mob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(set)));
			mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
		}
		if(!modMOB.sameAs(copyMOB))
			Log.sysOut("Mobs",mob.Name()+" modified mob "+modMOB.Name()+".");
		copyMOB.destroy();
	}

	public boolean errorOut(final MOB mob)
	{
		mob.tell(L("You are not allowed to do that here."));
		return false;
	}

	protected String listOfThings()
	{
		return "ITEM, RACE, CLASS, ABILITY, LANGUAGE, CRAFTSKILL, GATHERSKILL, WRIGHTSKILL, "
			+ "ALLQUALIFY, AREA, EXIT, COMPONENT, RECIPE, EXPERTISE, QUEST, "
			+ "MOB, USER, HOLIDAY, ACHIEVEMENT, MANUFACTURER, HELP/AHELP, TRAP, CRON, "
			+ "GOVERNMENT, JSCRIPT, FACTION, SOCIAL, CLAN, POLL, NEWS, DAY, MONTH, YEAR, "
			+ "TIME, HOUR, UPDATE:, or ROOM";
	}

	@Override
	public boolean execute(final MOB mob, List<String> commands, final int metaFlags)
		throws java.io.IOException
	{
		String commandType="";
		if(commands.size()>1)
			commandType=commands.get(1).toUpperCase();
		if(commands.size()==1)
		{
			mob.tell(L("\n\rModify what? Try an "+listOfThings()+"."));
		}
		if(commandType.equals("ITEM"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDITEMS))
				return errorOut(mob);
			items(mob,commands);
		}
		else
		if(commandType.equals("MANUFACTURER"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDITEMS))
				return errorOut(mob);
			manufacturer(mob,commands);
		}
		else
		if(commandType.equals("CRON"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDCRON))
				return errorOut(mob);
			cron(mob,commands);
		}
		else
		if(commandType.equals("RECIPE"))
		{
			//mob.tell(L("Not yet implemented")); if(true) return true;
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDRECIPES))
				return errorOut(mob);
			if(commands.size()<3)
			{
				mob.tell(L("Modify which recipe?  Name a common skill ID -- use list abilities to find one."));
				return false;
			}
			final String name=CMParms.combine(commands,2);
			final Ability A=CMClass.findAbility(name,Ability.ACODE_COMMON_SKILL,-1,false);
			if(A==null)
			{
				mob.tell(L("'@x1' is not a valid skill id.",name));
				return false;
			}
			if(!(A instanceof RecipeDriven))
			{
				mob.tell(L("'@x1' is not a valid recipe skill.",A.ID()));
				return false;
			}
			final RecipeDriven iA = (RecipeDriven)A;
			if((iA.getRecipeFormat()==null)
			||(iA.getRecipeFormat().length()==0)
			||(iA.getRecipeFilename()==null)
			||(iA.getRecipeFilename().length()==0))
			{
				mob.tell(L("'@x1' does not have modifiable recipes.",A.ID()));
				return false;
			}
			CMLib.ableParms().modifyRecipesList(mob,iA.getRecipeFilename(),iA.getRecipeFormat());
		}
		else
		if(commandType.equals("ROOM"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDROOMS))
				return errorOut(mob);
			rooms(mob,commands);
		}
		else
		if((commandType.equals("ACCOUNT"))&&(CMProps.isUsingAccountSystem()))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDPLAYERS))
				return errorOut(mob);
			accounts(mob,commands);
		}
		else
		if(commandType.equals("RACE"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDRACES))
				return errorOut(mob);
			races(mob,commands);
		}
		else
		if(commandType.equals("CLASS"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDCLASSES))
				return errorOut(mob);
			classes(mob,commands);
		}
		else
		if(commandType.equals("ABILITY"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))
				return errorOut(mob);
			abilities(mob,commands);
		}
		else
		if(commandType.equals("TRAP"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))
				return errorOut(mob);
			traps(mob,commands);
		}
		else
		if(commandType.equals("LANGUAGE"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))
				return errorOut(mob);
			languages(mob,commands);
		}
		else
		if(commandType.equals("CRAFTSKILL"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))
				return errorOut(mob);
			craftSkills(mob,commands);
		}
		else
		if(commandType.equals("WRIGHTSKILL"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))
				return errorOut(mob);
			wrightSkills(mob,commands);
		}
		else
		if(commandType.equals("GATHERSKILL"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))
				return errorOut(mob);
			gatherSkills(mob,commands);
		}
		else
		if(commandType.equals("ALLQUALIFY"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))
				return errorOut(mob);
			allQualify(mob,commands);
		}
		else
		if(commandType.equals("AREA"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDAREAS))
				return errorOut(mob);
			if((commands.size()>2)
			&&(commands.get(2).equalsIgnoreCase("UPDATE:"))
			&&(CMSecurity.isAllowedEverywhere(mob, CMSecurity.SecFlag.CMDAREAS)))
			{
				commands.remove(1);
				commands.remove(0);
				doMql(mob, true, commands);
			}
			else
				areas(mob,commands);
		}
		else
		if(commandType.equals("EXIT"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDEXITS))
				return errorOut(mob);
			exits(mob,commands);
		}
		else
		if(commandType.equals("COMPONENT"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.COMPONENTS))
				return errorOut(mob);
			components(mob,commands);
			return false;
		}
		else
		if(commandType.equals("PLANE"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.PLANES))
				return errorOut(mob);
			plane(mob,commands);
			return false;
		}
		else
		if(commandType.equals("EXPERTISE"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.EXPERTISES))
				return errorOut(mob);
			mob.tell(L("You can't modify components, you can only LIST, CREATE, and DESTROY them."));
			return false;
		}
		else
		if(commandType.equals("HELP")||commandType.equals("AHELP"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDHELP))
				return errorOut(mob);
			helps(mob, commands);
			return false;
		}
		else
		if(commandType.equals("TITLE"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.TITLES))
				return errorOut(mob);
			mob.tell(L("You can't modify titles, you can only LIST, CREATE, and DESTROY them."));
			return false;
		}
		else
		if(commandType.equals("AWARD"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.AUTOAWARDS))
				return errorOut(mob);
			mob.tell(L("You can't modify auto-awards, you can only LIST, CREATE, and DESTROY them."));
			return false;
		}
		else
		if(commandType.equals("ACHIEVEMENT"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.ACHIEVEMENTS))
				return errorOut(mob);
			achievements(mob,commands);
			return false;
		}
		else
		if(commandType.equals("SOCIAL"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDSOCIALS))
				return errorOut(mob);
			socials(mob,commands);
		}
		else
		if(commandType.equals("MOB"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDMOBS))
				return errorOut(mob);
			mobs(mob,commands);
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("The space-time continuum shake(s) under the transforming power."));
		}
		else
		if(commandType.equals("DAY"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.TICKTOCK))
				return errorOut(mob);
			if(commands.size()<3)
			{
				mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY DAY [INT]\n\r"));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell."));
				return false;
			}
			mob.location().getArea().getTimeObj().setDayOfMonth(CMath.s_int(commands.get(2)));
			mob.location().getArea().getTimeObj().save();
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("The space-time continuum shake(s) under the transforming power."));
		}
		else
		if(commandType.equals("MONTH"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.TICKTOCK))
				return errorOut(mob);
			if(commands.size()<3)
			{
				mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY MONTH [INT]\n\r"));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell."));
				return false;
			}
			mob.location().getArea().getTimeObj().setMonth(CMath.s_int(commands.get(2)));
			mob.location().getArea().getTimeObj().save();
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("The space-time continuum shake(s) under the transforming power."));
		}
		else
		if(commandType.equals("YEAR"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.TICKTOCK))
				return errorOut(mob);
			if(commands.size()<3)
			{
				mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY YEAR [INT]\n\r"));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell."));
				return false;
			}
			mob.location().getArea().getTimeObj().setYear(CMath.s_int(commands.get(2)));
			mob.location().getArea().getTimeObj().save();
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("The space-time continuum shake(s) under the transforming power."));
		}
		else
		if((commandType.equals("TIME"))||(commandType.equals("HOUR")))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.TICKTOCK))
				return errorOut(mob);
			if(commands.size()<3)
			{
				mob.tell(L("You have failed to specify the proper fields.\n\rThe format is MODIFY TIME [INT]\n\r"));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell."));
				return false;
			}
			final TimeClock C=mob.location().getArea().getTimeObj();
			final TimeClock.TimeOfDay oldTOD=C.getTODCode();
			C.setHourOfDay(CMath.s_int(commands.get(2)));
			if(oldTOD!=C.getTODCode())
				C.handleTimeChange();
			C.save();
			mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("The space-time continuum shake(s) under the transforming power."));
		}
		else
		if(commandType.startsWith("JSCRIPT"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.JSCRIPTS))
				return errorOut(mob);
			if(CMProps.getIntVar(CMProps.Int.JSCRIPTS)!=CMSecurity.JSCRIPT_REQ_APPROVAL)
			{
				mob.tell(L("This command is only used when your Scriptable Javascripts require approval as specified in your coffeemud.ini file."));
				return true;
			}
			Object O=null;
			final Map<Long,String> j=CMSecurity.getApprovedJScriptTable();
			boolean somethingFound=false;
			for(final Long L : j.keySet())
			{
				O=j.get(L);
				if(!CMLib.players().playerExists(O.toString()))
				{
					somethingFound=true;
					mob.tell(L("Unapproved script:\n\r@x1\n\r",O.toString()));
					if((!mob.isMonster())
					&&(mob.session().confirm(L("Approve this script (Y/n)?"),"Y")))
						CMSecurity.approveJScript(mob.Name(),L.longValue());
					else
						j.remove(L);
				}
			}
			if(!somethingFound)
				mob.tell(L("No Javascripts require approval at this time."));
		}
		else
		if(commandType.equals("USER")||commandType.equals("PLAYER"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDPLAYERS))
				return errorOut(mob);
			players(mob,commands);
		}
		else
		if(commandType.equals("EXPERTISE"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.EXPERTISES))
				return errorOut(mob);
			mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^S<S-NAME> wave(s) <S-HIS-HER> arms...^?"));
			expertises(mob,commands);
		}
		else
		if(commandType.equals("POLL"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.POLLS))
				return errorOut(mob);
			final String name=CMParms.combine(commands,2);
			Poll P=null;
			if(CMath.isInteger(name))
				P=CMLib.polls().getPoll(CMath.s_int(name)-1);
			else
			if(name.length()>0)
				P=CMLib.polls().getPoll(name);
			if(P==null)
			{
				mob.tell(L("POLL '@x1' not found. Try LIST POLLS.",name));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
				return false;
			}
			mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^S<S-NAME> wave(s) <S-HIS-HER> arms around the idea of @x1.^?",P.getSubject()));
			CMLib.polls().modifyVote(P, mob);
			mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^SThe world's uncertainty has changed.^?"));
			Log.sysOut("CreateEdit",mob.Name()+" modified Poll "+P.getName()+".");
		}
		else
		if(commandType.equals("HOLIDAY"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDQUESTS))
				return errorOut(mob);
			final String name=CMParms.combine(commands,2);
			int num=-1;
			if(CMath.isInteger(name))
				num=CMath.s_int(name);
			else
			if(name.length()>0)
				num=CMLib.quests().getHolidayIndex(name);
			if(num<0)
			{
				mob.tell(L("HOLIDAY '@x1' not found. Try LIST HOLIDAYS.",name));
				mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
				return false;
			}
			mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^S<S-NAME> wave(s) <S-HIS-HER> arms...^?"));
			CMLib.quests().modifyHoliday(mob,num);
			Log.sysOut("CreateEdit",mob.Name()+" modified Holiday "+name+".");
		}
		else
		if(commandType.equals("NEWS"))
		{
			if((!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.JOURNALS))
			&&(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.NEWS)))
				return errorOut(mob);

			mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^S<S-NAME> wave(s) <S-HIS-HER> arms...^?"));
			final Item I=CMClass.getItem("StdJournal");
			I.setName(L("SYSTEM_NEWS"));
			I.setDescription(L("Enter `LIST NEWS [NUMBER]` to read an entry.%0D%0AEnter CREATE NEWS to add new entries. "));
			final CMMsg newMsg=CMClass.getMsg(mob,I,null,
											CMMsg.MSG_WRITE|CMMsg.MASK_ALWAYS,null,
											CMMsg.MSG_WRITE|CMMsg.MASK_ALWAYS,CMParms.combine(commands,2),
											CMMsg.MSG_WRITE|CMMsg.MASK_ALWAYS,null);
			if(mob.location().okMessage(mob,newMsg)&&I.okMessage(mob, newMsg))
			{
				mob.location().send(mob,newMsg);
				I.executeMsg(mob,newMsg);
				mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^SThe world is now more informed!^?"));
			}
		}
		else
		if(commandType.equals("QUEST"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDQUESTS))
				return errorOut(mob);
			quests(mob,commands);
		}
		else
		if(commandType.equals("SQL"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDDATABASE))
				return errorOut(mob);
			try
			{
				final String sql=CMParms.combine(commands,2);
				if(sql.equals("ping"))
				{
					final int num=CMLib.database().pingAllConnections(1000);
					mob.tell(L("Pings completed=@x1.",""+num));
				}
				else
				if(sql.toUpperCase().trim().startsWith("SELECT"))
				{
					mob.tell(L("SQL Query: @x1",sql));
					final List<String[]> results=CMLib.database().DBRawQuery(sql.replace('`','\''));
					final StringBuilder buf=new StringBuilder("QueryResults\n\r");
					if(results.size()>0)
					{
						final String[] headerRow=results.get(0);
						for (final String element : headerRow)
							buf.append(element);
						buf.append("\n\r");
						for(int r=1;r<results.size();r++)
						{
							final String[] row=results.get(r);
							for(int c=0;c<row.length;c++)
							{
								if(c<headerRow.length)
									buf.append(CMStrings.padRight(row[c],headerRow[c].length()));
								else
									buf.append(row[c]);
							}
							buf.append("\n\r");
						}
					}
					if(mob.session()!=null)
						mob.session().rawPrint(buf.toString());
					mob.tell(L("Command completed."));
				}
				else
				{
					mob.tell(L("SQL Statement: @x1",sql));
					final int resp=CMLib.database().DBRawExecute(sql.replace('`','\''));
					mob.tell(L("Command completed. Response code: @x1",""+resp));
				}
			}
			catch(final Exception e)
			{
				mob.tell(L("SQL Error: @x1",e.getMessage()));
			}
		}
		else
		if(commandType.equals("GOVERNMENT"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDCLANS))
				return errorOut(mob);
			if(commands.size()<3)
				mob.tell(L("Modify which government?  Use list governments."));
			else
			{
				final String name=CMParms.combine(commands,2);
				ClanGovernment G = null;
				for(final ClanGovernment g : CMLib.clans().getStockGovernments())
				{
					if(g.getName().equalsIgnoreCase(name))
						G=g;
				}
				if(G==null)
				{
					for(final ClanGovernment g : CMLib.clans().getStockGovernments())
					{
						if(g.getName().toLowerCase().startsWith(name.toLowerCase()))
							G=g;
					}
				}
				if(G==null)
					mob.tell(L("Government '@x1' is unknown.  Try list governments.",name));
				else
				if(!mob.isMonster())
				{
					mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around @x1.",G.getName()));
					CMLib.genEd().modifyGovernment(mob, G,-1);
					CMLib.clans().reSaveGovernmentsXML();
					Log.sysOut("CreateEdit",mob.Name()+" modified Clan Government "+G.getName()+".");
				}
			}
		}
		else
		if(commandType.equals("FACTION"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDFACTIONS))
				return errorOut(mob);
			if(commands.size()<3)
				mob.tell(L("Modify which faction?  Use list factions."));
			else
			{
				final String name=CMParms.combine(commands,2);
				Faction F=CMLib.factions().getFaction(name);
				if(F==null)
					F=CMLib.factions().getFactionByName(name);
				if(F==null)
					mob.tell(L("Faction '@x1' is unknown.  Try list factions.",name));
				else
				if(!mob.isMonster())
				{
					mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around the idea of  @x1.",F.name()));
					CMLib.factions().modifyFaction(mob,F);
					Log.sysOut("CreateEdit",mob.Name()+" modified Faction "+F.name()+" ("+F.factionID()+").");
				}
			}
		}
		else
		if(commandType.equals("UPDATE:"))
		{
			if((!CMSecurity.isASysOp(mob))&&(!CMSecurity.isAllowedEverywhere(mob, CMSecurity.SecFlag.CMDAREAS)))
				return errorOut(mob);
			commands.remove(0);
			doMql(mob, false, commands);
		}
		else
		if(commandType.equals("CLAN"))
		{
			if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDCLANS))
				return errorOut(mob);
			if(commands.size()<3)
				mob.tell(L("Modify which clan?  Use clanlist."));
			else
			{
				final String name=CMParms.combine(commands,2);
				final Clan C=CMLib.clans().findClan(name);
				if(C==null)
					mob.tell(L("Clan '@x1' is unknown.  Try clanlist.",name));
				else
				if(!mob.isMonster())
				{
					mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around @x1.",C.name()));
					CMLib.genEd().modifyClan(mob,C,-1);
					Log.sysOut("CreateEdit",mob.Name()+" modified Clan "+C.name()+".");
				}
			}
		}
		else
		{
			String allWord=CMParms.combine(commands,1);
			Environmental thang=null;
			MOB srchMob=mob;
			Item srchContainer=null;
			Room srchRoom=mob.location();
			if(allWord.length()>0)
			{
				final int x=allWord.indexOf('@');
				if(x>0)
				{
					final String rest=allWord.substring(x+1).trim();
					allWord=allWord.substring(0,x).trim();
					if(rest.equalsIgnoreCase("room"))
						srchMob=null;
					else
					if(rest.length()>0)
					{
						final MOB M=srchRoom.fetchInhabitant(rest);
						if(M==null)
						{
							final Item I = srchRoom.findItem(null, rest);
							if(I instanceof Container)
								srchContainer=I;
							else
							{
								mob.tell(L("MOB or Container '@x1' not found.",rest));
								mob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));
								return false;
							}
						}
						else
						{
							srchMob=M;
							srchRoom=null;
						}
					}
				}
			}
			if((srchMob!=null)&&(srchRoom!=null))
				thang=srchRoom.fetchFromMOBRoomFavorsItems(srchMob,srchContainer,allWord,Wearable.FILTER_ANY);
			else
			if(srchMob!=null)
				thang=srchMob.findItem(allWord);
			else
			if(srchRoom!=null)
				thang=srchRoom.fetchFromRoomFavorItems(srchContainer,allWord);
			if((thang!=null)&&(thang instanceof Item))
			{
				if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDITEMS))
					return errorOut(mob);
				final Item copyItem=(Item)thang.copyOf();
				mob.location().showOthers(mob,thang,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));
				if(!thang.isGeneric())
				{
					CMLib.genEd().modifyStdItem(mob,(Item)thang,-1);
				}
				else
					CMLib.genEd().genMiscSet(mob,thang,-1);
				((Item)thang).recoverPhyStats();
				mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("@x1 shake(s) under the transforming power.",thang.name()));
				if(!copyItem.sameAs(thang))
					Log.sysOut("CreateEdit",mob.Name()+" modified item "+thang.Name()+" ("+thang.ID()+") in "+CMLib.map().getDescriptiveExtendedRoomID(mob.location())+".");
				copyItem.destroy();
			}
			else
			if((thang!=null)&&(thang instanceof MOB))
			{
				if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDMOBS))
					return errorOut(mob);
				if((!thang.isGeneric())&&(((MOB)thang).isMonster()))
				{
					final MOB copyMOB=(MOB)thang.copyOf();
					if(thang instanceof Deity)
						CMLib.map().registerWorldObjectLoaded(((Deity) thang).location().getArea(), ((Deity) thang).location(), thang);
					mob.location().showOthers(mob,thang,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));
					CMLib.genEd().modifyStdMob(mob,(MOB)thang,-1);
					if(!copyMOB.sameAs(thang))
						Log.sysOut("CreateEdit",mob.Name()+" modified mob "+thang.Name()+" ("+thang.ID()+") in "+CMLib.map().getDescriptiveExtendedRoomID(((MOB)thang).location())+".");
					copyMOB.destroy();
					if(thang instanceof Deity)
						CMLib.map().registerWorldObjectLoaded(((Deity) thang).location().getArea(), ((Deity) thang).location(), thang);
				}
				else
				if(!((MOB)thang).isMonster())
				{
					if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDPLAYERS))
						return errorOut(mob);
					players(mob,CMParms.parse("MODIFY USER \""+thang.Name()+"\""));
				}
				else
				{
					final MOB copyMOB=(MOB)thang.copyOf();
					if(thang instanceof Deity)
						CMLib.map().registerWorldObjectLoaded(((Deity) thang).location().getArea(), ((Deity) thang).location(), thang);
					mob.location().showOthers(mob,thang,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));
					CMLib.genEd().genMiscSet(mob,thang,-1);
					if(!copyMOB.sameAs(thang))
						Log.sysOut("CreateEdit",mob.Name()+" modified mob "+thang.Name()+" ("+thang.ID()+") in "+CMLib.map().getDescriptiveExtendedRoomID(((MOB)thang).location())+".");
					copyMOB.destroy();
					if(thang instanceof Deity)
						CMLib.map().registerWorldObjectLoaded(((Deity) thang).location().getArea(), ((Deity) thang).location(), thang);
				}
				((MOB)thang).recoverPhyStats();
				mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("@x1 shake(s) under the transforming power.",thang.name()));
			}
			else
			if((CMLib.directions().getGoodDirectionCode(allWord)>=0)||(thang instanceof Exit))
			{
				if(CMLib.directions().getGoodDirectionCode(allWord)>=0)
					thang=mob.location().getRawExit(CMLib.directions().getGoodDirectionCode(allWord));

				if(thang!=null)
				{
					if(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDEXITS))
						return errorOut(mob);
					mob.location().showOthers(mob,thang,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));
					final Exit copyExit=(Exit)thang.copyOf();
					int showFlag=-1;
					if(CMProps.getIntVar(CMProps.Int.EDITORTYPE)>0)
						showFlag=-999;
					CMLib.genEd().genMiscText(mob,thang,0,showFlag);
					updateChangedExit(mob, mob.location(), (Exit)thang, copyExit);
				}
				else
				{
					commands.add(1,"EXIT");
					execute(mob,commands,metaFlags);
				}
			}
			else
			if(CMLib.socials().fetchSocial(allWord,true)!=null)
			{
				commands.add(1,"SOCIAL");
				execute(mob,commands,metaFlags);
			}
			else
			if((thang=CMLib.space().findSpaceObject(allWord,true))!=null)
			{
				commands=new Vector<String>();
				commands.add("MODIFY");
				if(thang instanceof Area)
					commands.add("AREA");
				else
				if(thang instanceof Item)
					commands.add("ITEM");
				commands.add(allWord);
				execute(mob,commands,metaFlags);
			}
			else
			if((thang=CMLib.map().findArea(allWord))!=null)
			{
				commands=new Vector<String>();
				commands.add("MODIFY");
				commands.add("AREA");
				commands.add(allWord);
				execute(mob,commands,metaFlags);
			}
			else
			if((thang=CMLib.space().findSpaceObject(allWord,false))!=null)
			{
				if(thang instanceof Area)
					commands.add(1,"AREA");
				else
				if(thang instanceof Item)
					commands.add(1,"ITEM");
				execute(mob,commands,metaFlags);
			}
			else
			if(allWord.indexOf('@')>=0)
			{
				commands.add(1,"ITEM");
				execute(mob,commands,metaFlags);
			}
			else
				mob.tell(L("\n\rYou cannot modify a '@x1'. However, you might try an "+listOfThings()+".",allWord));
		}
		return false;
	}

	@Override
	public Object executeInternal(final MOB mob, final int metaFlags, final Object... args) throws java.io.IOException
	{
		if(!super.checkArguments(internalParameters, args))
			return Boolean.FALSE;
		final Object O = args[0];
		if(O instanceof Environmental)
		{
			CMLib.genEd().genMiscSet(mob,(Environmental)O,-1);
			if(O instanceof Physical)
				((Physical)O).recoverPhyStats();
			((Environmental)O).text();
			return Boolean.TRUE;
		}
		return Boolean.FALSE;
	}

	@Override
	public boolean canBeOrdered()
	{
		return false;
	}

	@Override
	public boolean securityCheck(final MOB mob)
	{
		return CMSecurity.isAllowedContainsAny(mob, mob.location(), CMSecurity.SECURITY_CMD_GROUP);
	}

}

<MSG> 

git-svn-id: svn://192.168.1.10/public/CoffeeMud@9514 0d6f1817-ed0e-0410-87c9-987e46238f29

<DFF> @@ -1602,7 +1602,7 @@ public class Modify extends StdCommand
                 mob.tell("No Javascripts require approval at this time.");
         }
         else
-        if(commandType.equals("USER"))
+        if(commandType.equals("USER")||commandType.equals("PLAYER"))
         {
             if(!CMSecurity.isAllowed(mob,mob.location(),"CMDPLAYERS")) return errorOut(mob);
             players(mob,commands);

{'commit': 'diff --git a/com/planet_ink/coffee_mud/Commands/Destroy.java b/com/planet_ink/coffee_mud/Commands/Destroy.java\nindex b1d6a74208..20cc17961c 100644\n--- a/com/planet_ink/coffee_mud/Commands/Destroy.java\n+++ b/com/planet_ink/coffee_mud/Commands/Destroy.java\n@@ -1036,7 +1036,7 @@ public class Destroy extends StdCommand\n             titles(mob,commands);\r\n         }\r\n \t\telse\r\n-\t\tif(commandType.equals("USER"))\r\n+    if(commandType.equals("USER")||commandType.equals("PLAYER"))\r\n \t\t{\r\n \t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),"CMDPLAYERS")) return errorOut(mob);\r\n \t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,"^S<S-NAME> wave(s) <S-HIS-HER> arms...^?");\r\ndiff --git a/com/planet_ink/coffee_mud/Commands/Modify.java b/com/planet_ink/coffee_mud/Commands/Modify.java\nindex c7c2e6fb4f..1555564214 100644\n--- a/com/planet_ink/coffee_mud/Commands/Modify.java\n+++ b/com/planet_ink/coffee_mud/Commands/Modify.java\n@@ -1602,7 +1602,7 @@ public class Modify extends StdCommand\n                 mob.tell("No Javascripts require approval at this time.");\r\n         }\r\n         else\r\n-        if(commandType.equals("USER"))\r\n+        if(commandType.equals("USER")||commandType.equals("PLAYER"))\r\n         {\r\n             if(!CMSecurity.isAllowed(mob,mob.location(),"CMDPLAYERS")) return errorOut(mob);\r\n             players(mob,commands);\r\n', 'commit_subject': '', 'repo_name': 'bozimmerman/CoffeeMud', 'committer': {'name': 'bozimmerman', 'email': 'dc45fe023482b3b890b5e574e53c1d051f45b1ef@zimmers.net', 'time_sec': '1335368227', 'tz_offset': '0', 'date': {'seconds': '1335368227'}}, 'commit_tree': 'cba8ed1786d29ffdc60991aa5db61c5221365330', 'commit_message': '\n\ngit-svn-id: svn://192.168.1.10/public/CoffeeMud@9514 0d6f1817-ed0e-0410-87c9-987e46238f29\n', 'language_name': 'Shell', 'license': 'apache-2.0', 'hunks': '@@ -1602,7 +1602,7 @@ public class Modify extends StdCommand\n                 mob.tell("No Javascripts require approval at this time.");\r\n         }\r\n         else\r\n-        if(commandType.equals("USER"))\r\n+        if(commandType.equals("USER")||commandType.equals("PLAYER"))\r\n         {\r\n             if(!CMSecurity.isAllowed(mob,mob.location(),"CMDPLAYERS")) return errorOut(mob);\r\n             players(mob,commands);\r\n', 'addition_count': 1, 'deletion_count': 1, 'src_file': 'a/com/planet_ink/coffee_mud/Commands/Modify.java', 'tgt_file': 'b/com/planet_ink/coffee_mud/Commands/Modify.java', 'file_extension': '.java', 'before_file': 'package com.planet_ink.coffee_mud.Commands;\nimport com.planet_ink.coffee_mud.core.interfaces.*;\nimport com.planet_ink.coffee_mud.core.*;\nimport com.planet_ink.coffee_mud.core.collections.*;\nimport com.planet_ink.coffee_mud.core.exceptions.CMException;\nimport com.planet_ink.coffee_mud.core.exceptions.MQLException;\nimport com.planet_ink.coffee_mud.Abilities.interfaces.*;\nimport com.planet_ink.coffee_mud.Abilities.interfaces.PlanarAbility.PlanarVar;\nimport com.planet_ink.coffee_mud.Areas.interfaces.*;\nimport com.planet_ink.coffee_mud.Behaviors.interfaces.*;\nimport com.planet_ink.coffee_mud.CharClasses.interfaces.*;\nimport com.planet_ink.coffee_mud.Commands.interfaces.*;\nimport com.planet_ink.coffee_mud.Common.interfaces.*;\nimport com.planet_ink.coffee_mud.Common.interfaces.Session.InputCallback;\nimport com.planet_ink.coffee_mud.Exits.interfaces.*;\nimport com.planet_ink.coffee_mud.Items.interfaces.*;\nimport com.planet_ink.coffee_mud.Libraries.interfaces.AbilityMapper;\nimport com.planet_ink.coffee_mud.Libraries.interfaces.AchievementLibrary.Achievement;\nimport com.planet_ink.coffee_mud.Libraries.interfaces.AreaGenerationLibrary.UpdateSet;\nimport com.planet_ink.coffee_mud.Libraries.interfaces.HelpLibrary.HelpSection;\nimport com.planet_ink.coffee_mud.Libraries.interfaces.JournalsLibrary.MsgMkrCallback;\nimport com.planet_ink.coffee_mud.Libraries.interfaces.JournalsLibrary.MsgMkrResolution;\nimport com.planet_ink.coffee_mud.Locales.interfaces.*;\nimport com.planet_ink.coffee_mud.MOBS.interfaces.*;\nimport com.planet_ink.coffee_mud.Races.interfaces.*;\n\nimport java.util.*;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.PrintStream;\n\n/*\n   Copyright 2004-2022 Bo Zimmerman\n\n   Licensed under the Apache License, Version 2.0 (the "License");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n\t   http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an "AS IS" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\npublic class Modify extends StdCommand\n{\n\tpublic Modify()\n\t{\n\t}\n\n\tprivate final String[] access=I(new String[]{"MODIFY","MOD"});\n\n\t@Override\n\tpublic String[] getAccessWords()\n\t{\n\t\treturn access;\n\t}\n\n\tprivate final static Class<?>[][] internalParameters=new Class<?>[][]{{Environmental.class}};\n\n\tpublic void items(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY ITEM [ITEM NAME](@ room/[MOB NAME]) "\n\t\t\t\t\t+ "[LEVEL, ABILITY, REJUV, USES, MISC, ?] [NUMBER, TEXT]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\n\t\tString itemID=(commands.get(2));\n\t\tMOB srchMob=mob;\n\t\tItem srchContainer=null;\n\t\tRoom srchRoom=mob.location();\n\t\tfinal int x=itemID.indexOf(\'@\');\n\t\tif(x>0)\n\t\t{\n\t\t\tfinal String rest=itemID.substring(x+1).trim();\n\t\t\titemID=itemID.substring(0,x).trim();\n\t\t\tif(rest.equalsIgnoreCase("room"))\n\t\t\t\tsrchMob=null;\n\t\t\telse\n\t\t\tif(rest.length()>0)\n\t\t\t{\n\t\t\t\tfinal MOB M=srchRoom.fetchInhabitant(rest);\n\t\t\t\tif(M==null)\n\t\t\t\t{\n\t\t\t\t\tfinal Item I = srchRoom.findItem(null, rest);\n\t\t\t\t\tif(I instanceof Container)\n\t\t\t\t\t\tsrchContainer=I;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tmob.tell(L("MOB or Container \'@x1\' not found.",rest));\n\t\t\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsrchMob=M;\n\t\t\t\t\tsrchRoom=null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tString command="";\n\t\tif(commands.size()>3)\n\t\t\tcommand=commands.get(3).toUpperCase();\n\t\tString restStr="";\n\t\tif(commands.size()>4)\n\t\t\trestStr=CMParms.combine(commands,4);\n\n\t\tEnvironmental modE=null;\n\t\tif((srchMob!=null)&&(srchRoom!=null))\n\t\t{\n\t\t\tfinal Environmental E=srchRoom.fetchFromMOBRoomFavorsItems(srchMob,srchContainer,itemID,Wearable.FILTER_ANY);\n\t\t\tif(E instanceof Item)\n\t\t\t\tmodE=E;\n\t\t\telse\n\t\t\t\tmodE=srchRoom.findItem(srchContainer,itemID);\n\t\t}\n\t\telse\n\t\tif(srchMob!=null)\n\t\t\tmodE=srchMob.findItem(itemID);\n\t\telse\n\t\tif(srchRoom!=null)\n\t\t{\n\t\t\tmodE=srchRoom.findItem(srchContainer, itemID);\n\t\t\tif(modE==null)\n\t\t\t\tmodE=srchRoom.findItem(itemID);\n\t\t}\n\t\tif(modE==null)\n\t\t{\n\t\t\tEnvironmental E=CMLib.space().findSpaceObject(itemID,true);\n\t\t\tif(!(E instanceof Item))\n\t\t\t\tE=CMLib.space().findSpaceObject(itemID,false);\n\t\t\tif(E instanceof Item)\n\t\t\t\tmodE=E;\n\t\t}\n\t\tif(modE == null)\n\t\t{\n\t\t\tShopKeeper SK=CMLib.coffeeShops().getShopKeeper(srchMob);\n\t\t\tif(SK!=null)\n\t\t\t{\n\t\t\t\tfinal CoffeeShop shop=(SK instanceof Librarian)?((Librarian)SK).getBaseLibrary():SK.getShop();\n\t\t\t\tfinal Environmental E=shop.getStock(itemID,mob);\n\t\t\t\tif(E instanceof Item)\n\t\t\t\t\tmodE=E;\n\t\t\t}\n\t\t\tif(modE == null)\n\t\t\t{\n\t\t\t\tSK=CMLib.coffeeShops().getShopKeeper(srchRoom);\n\t\t\t\tif(SK!=null)\n\t\t\t\t{\n\t\t\t\t\tfinal CoffeeShop shop=(SK instanceof Librarian)?((Librarian)SK).getBaseLibrary():SK.getShop();\n\t\t\t\t\tfinal Environmental E=shop.getStock(itemID,mob);\n\t\t\t\t\tif(E instanceof Item)\n\t\t\t\t\t\tmodE=E;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif((modE==null)||(!(modE instanceof Item)))\n\t\t{\n\t\t\tmob.tell(L("I don\'t see \'@x1 here.\\n\\r",itemID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tfinal Item modItem=(Item)modE;\n\t\tmob.location().showOthers(mob,modItem,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));\n\n\t\tfinal Item copyItem=(Item)modItem.copyOf();\n\t\tif(command.equals("LEVEL"))\n\t\t{\n\t\t\tfinal int newLevel=CMath.s_int(restStr);\n\t\t\tif(newLevel>=0)\n\t\t\t{\n\t\t\t\tmodItem.basePhyStats().setLevel(newLevel);\n\t\t\t\tmodItem.recoverPhyStats();\n\t\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));\n\t\t\t}\n\t\t}\n\t\telse\n\t\tif(command.equals("ABILITY"))\n\t\t{\n\t\t\tfinal int newAbility=CMath.s_int(restStr);\n\t\t\tmodItem.basePhyStats().setAbility(newAbility);\n\t\t\tmodItem.recoverPhyStats();\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));\n\t\t}\n\t\telse\n\t\tif(command.equals("HEIGHT"))\n\t\t{\n\t\t\tfinal int newAbility=CMath.s_int(restStr);\n\t\t\tmodItem.basePhyStats().setHeight(newAbility);\n\t\t\tmodItem.recoverPhyStats();\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));\n\t\t}\n\t\telse\n\t\tif(command.equals("REJUV"))\n\t\t{\n\t\t\tfinal int newRejuv=CMath.s_int(restStr);\n\t\t\tif(newRejuv>0)\n\t\t\t{\n\t\t\t\tmodItem.basePhyStats().setRejuv(newRejuv);\n\t\t\t\tmodItem.recoverPhyStats();\n\t\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmodItem.basePhyStats().setRejuv(PhyStats.NO_REJUV);\n\t\t\t\tmodItem.recoverPhyStats();\n\t\t\t\tmob.tell(L("@x1 will now never rejuvenate.",modItem.name()));\n\t\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));\n\t\t\t}\n\t\t}\n\t\telse\n\t\tif(command.equals("USES"))\n\t\t{\n\t\t\tfinal int newUses=CMath.s_int(restStr);\n\t\t\tif(newUses>=0)\n\t\t\t{\n\t\t\t\tmodItem.setUsesRemaining(newUses);\n\t\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));\n\t\t\t}\n\t\t}\n\t\telse\n\t\tif(command.equals("MISC"))\n\t\t{\n\t\t\tif(modItem.isGeneric())\n\t\t\t\tCMLib.genEd().genMiscSet(mob,modItem,-1);\n\t\t\telse\n\t\t\t\tmodItem.setMiscText(restStr);\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));\n\t\t}\n\t\telse\n\t\tif(CMLib.coffeeMaker().isAnyGenStat(modItem, command))\n\t\t{\n\t\t\tCMLib.coffeeMaker().setAnyGenStat(modItem,command, restStr);\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));\n\t\t}\n\t\telse\n\t\tif((command.length()==0)&&(modItem.isGeneric()))\n\t\t{\n\t\t\tCMLib.genEd().genMiscSet(mob,modItem,-1);\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modItem.name()));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinal STreeSet<String> set=new STreeSet<String>();\n\t\t\tset.addAll(CMParms.parseCommas("LEVEL,ABILITY,HEIGHT,REJUV,USES,MISC",true));\n\t\t\tset.addAll(CMLib.coffeeMaker().getAllGenStats(modItem));\n\t\t\tmob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(set)));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t}\n\t\tif(!copyItem.sameAs(modItem))\n\t\t{\n\t\t\tLog.sysOut("Items",mob.Name()+" modified item "+modItem.ID()+".");\n\t\t\tif(modItem instanceof SpaceObject)\n\t\t\t{\n\t\t\t\tCMLib.database().DBUpdateItem("SPACE", modItem);\n\t\t\t}\n\t\t}\n\t\tcopyItem.destroy();\n\t}\n\n\tprotected void flunkRoomCmd(final MOB mob)\n\t{\n\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY ROOM [NAME, AREA, DESCRIPTION, "\n\t\t\t\t+ "AFFECTS, BEHAVIORS, CLASS, XGRID, YGRID, ?] [TEXT]\\n\\r"));\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t}\n\n\tprotected void flunkAreaCmd(final MOB mob)\n\t{\n\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY AREA [NAME, DESCRIPTION, CLIMATE, "\n\t\t\t\t+ "FILE, AFFECTS, BEHAVIORS, ADDSUB, DELSUB, XGRID, YGRID, ?] [TEXT]\\n\\r"));\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t}\n\n\tprotected void fixDeities(final Room R)\n\t{\n\t\tif(R==null)\n\t\t\treturn;\n\t\t//OK! Keep this weirdness here!  It\'s necessary because oldRoom will have blown\n\t\t//away any real deities with copy deities in the CMMap, and this will restore\n\t\t//the real ones.\n\t\tfor(final Enumeration<MOB> m=R.inhabitants();m.hasMoreElements();)\n\t\t{\n\t\t\tfinal MOB M=m.nextElement();\n\t\t\tif((M instanceof Deity)\n\t\t\t&&(M.isMonster())\n\t\t\t&&(M.isSavable())\n\t\t\t&&(M.getStartRoom()==R))\n\t\t\t\tCMLib.map().registerWorldObjectLoaded(R.getArea(), R, M);\n\t\t}\n\t}\n\n\tpublic void expertises(final MOB mob, final List<String> commands)\n\t{\n\t\tif((commands.size()<3)||(CMParms.combine(commands,1).indexOf(\'=\')<0))\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rFormat: CREATE EXPERTISE [EXPERTISE ID]=[PARAMETERS] as follows: \\n\\r"));\n\t\t\tfinal String inst=CMLib.expertises().getExpertiseInstructions();\n\t\t\tif(mob.session()!=null)\n\t\t\t\tmob.session().wraplessPrintln(inst.toString());\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tfinal String parms=CMParms.combineQuoted(commands,2);\n\t\tfinal String skillID=parms.substring(0,parms.indexOf(\'=\'));\n\t\tif(skillID.indexOf(\' \')>=0)\n\t\t{\n\t\t\tmob.tell(L("Spaces are not allowed in expertise codes."));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tString WKID=CMStrings.replaceAll(skillID.toUpperCase(),"@X1","");\n\t\tWKID=CMStrings.replaceAll(WKID,"@X2","").trim();\n\t\tif(CMLib.expertises().numStages(WKID)<=0)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' does not exist, try LIST EXPERTISES.",WKID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tfinal String error=CMLib.expertises().confirmExpertiseLine(parms,null,false);\n\t\tif(error!=null)\n\t\t{\n\t\t\tmob.tell(error);\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tif(!CMLib.expertises().addModifyDefinition(parms, true))\n\t\t{\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The power of skill usage just went sideways!"));\n\t}\n\n\tpublic void rooms(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tif(mob.location().roomID().equals(""))\n\t\t{\n\t\t\tmob.tell(L("This command is invalid from within a GridLocaleChild room."));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\treturn;\n\t\t}\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around the room."));\n\t\tif(commands.size()==2)\n\t\t{\n\t\t\tfinal Room oldRoom=(Room)mob.location().copyOf();\n\t\t\tfinal Room newRoom=CMLib.genEd().modifyRoom(mob,mob.location(),-1);\n\t\t\tif((!oldRoom.sameAs(newRoom))&&(!newRoom.amDestroyed()))\n\t\t\t{\n\t\t\t\tCMLib.database().DBUpdateRoom(newRoom);\n\t\t\t\tnewRoom.showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\\n\\r"));\n\t\t\t\tLog.sysOut("Rooms",mob.Name()+" modified room "+newRoom.roomID()+".");\n\t\t\t}\n\t\t\toldRoom.destroy();\n\t\t\tnewRoom.getArea().fillInAreaRoom(newRoom);\n\t\t\tfixDeities(newRoom);\n\t\t\treturn;\n\t\t}\n\t\tif (commands.size() < 3)\n\t\t{\n\t\t\tflunkRoomCmd(mob);\n\t\t\treturn;\n\t\t}\n\n\t\tfinal String command=commands.get(2).toUpperCase();\n\t\tString restStr="";\n\t\tif(commands.size()>=3)\n\t\t\trestStr=CMParms.combine(commands,3);\n\n\t\tif(command.equalsIgnoreCase("AREA"))\n\t\t{\n\t\t\tif (commands.size() < 4)\n\t\t\t{\n\t\t\t\tflunkRoomCmd(mob);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tboolean confirmed=false;\n\t\t\tString areaType="";\n\t\t\tif((commands.size()>4)&&(CMClass.getAreaType(commands.get(commands.size()-1).toString())!=null))\n\t\t\t{\n\t\t\t\tareaType=commands.remove(commands.size()-1).toString();\n\t\t\t\trestStr=CMParms.combine(commands,3);\n\t\t\t\tconfirmed=true;\n\t\t\t}\n\t\t\tArea A=CMLib.map().getArea(restStr);\n\t\t\tboolean reid=false;\n\t\t\tif((A==null)&&(!CMSecurity.isAllowed(mob, mob.location(), CMSecurity.SecFlag.CMDAREAS)))\n\t\t\t{\n\t\t\t\tmob.session().println(L("Not permitted."));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\tif(A==null)\n\t\t\t{\n\t\t\t\tif((!mob.isMonster())&&(CMLib.map().getShip(restStr)==null))\n\t\t\t\t{\n\t\t\t\t\tif(confirmed||mob.session().confirm(L("\\n\\rThis command will create a BRAND NEW AREA\\n\\r with Area code \'@x1\'.  Are you SURE (y/N)?",restStr),"N"))\n\t\t\t\t\t{\n\t\t\t\t\t\tint tries=0;\n\t\t\t\t\t\twhile((areaType.length()==0)&&((++tries)<10)&&(mob.session()!=null)&&(!mob.session().isStopped()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tareaType=mob.session().prompt(L("Enter an area type to create (default=StdArea): "),L("StdArea"));\n\t\t\t\t\t\t\tif(CMClass.getAreaType(areaType)==null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmob.session().println(L("Invalid area type! Valid ones are:"));\n\t\t\t\t\t\t\t\tmob.session().println(CMLib.lister().build3ColTable(mob,CMClass.areaTypes()).toString());\n\t\t\t\t\t\t\t\tareaType="";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(areaType.length()==0)\n\t\t\t\t\t\t\tareaType="StdArea";\n\t\t\t\t\t\tA=CMClass.getAreaType(areaType);\n\t\t\t\t\t\tA.setName(restStr);\n\t\t\t\t\t\tCMLib.map().addArea(A);\n\t\t\t\t\t\tCMLib.database().DBCreateArea(A);\n\t\t\t\t\t\tmob.location().setArea(A);\n\t\t\t\t\t\tCMLib.map().registerWorldObjectLoaded(A, null, A);\n\t\t\t\t\t\tCMLib.coffeeMaker().addAutoPropsToAreaIfNecessary(A);\n\t\t\t\t\t\treid=true;\n\t\t\t\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("This entire area twitches.\\n\\r"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmob.tell(L("Sorry Charlie!"));\n\t\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmob.location().setArea(A);\n\t\t\t\tif(A.getRandomProperRoom()!=null)\n\t\t\t\t\treid=true;\n\t\t\t\telse\n\t\t\t\t\tCMLib.database().DBUpdateRoom(mob.location());\n\t\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("This area twitches.\\n\\r"));\n\t\t\t}\n\n\t\t\tif(reid)\n\t\t\t{\n\t\t\t\tRoom R=mob.location();\n\t\t\t\tfinal String oldID=R.roomID();\n\t\t\t\tsynchronized(CMClass.getSync("SYNC"+R.roomID()))\n\t\t\t\t{\n\t\t\t\t\tR=CMLib.map().getRoom(R);\n\t\t\t\t\tfinal Room reference=CMLib.map().findConnectingRoom(R);\n\t\t\t\t\tString checkID=null;\n\t\t\t\t\tif(A!=null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(reference!=null)\n\t\t\t\t\t\t\tcheckID=A.getNewRoomID(reference,CMLib.map().getRoomDir(reference,R));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcheckID=A.getNewRoomID(R,-1);\n\t\t\t\t\t\tmob.location().setRoomID(checkID);\n\t\t\t\t\t\tCMLib.database().DBReCreate(R,oldID);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\tif(command.equalsIgnoreCase("NAME"))\n\t\t{\n\t\t\tif (commands.size() < 4)\n\t\t\t{\n\t\t\t\tflunkRoomCmd(mob);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmob.location().setDisplayText(restStr);\n\t\t\tCMLib.database().DBUpdateRoom(mob.location());\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\\n\\r"));\n\t\t}\n\t\telse\n\t\tif(command.equalsIgnoreCase("CLASS"))\n\t\t{\n\t\t\tif (commands.size() < 4)\n\t\t\t{\n\t\t\t\tflunkRoomCmd(mob);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinal Room newRoom=CMClass.getLocale(restStr);\n\t\t\tif(newRoom==null)\n\t\t\t{\n\t\t\t\tmob.tell(L("\'@x1\' is not a valid room locale.",restStr));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tCMLib.genEd().changeRoomType(mob.location(),newRoom);\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\\n\\r"));\n\t\t}\n\t\telse\n\t\tif((command.equalsIgnoreCase("XGRID"))&&(mob.location() instanceof GridLocale))\n\t\t{\n\t\t\tif (commands.size() < 4)\n\t\t\t{\n\t\t\t\tflunkRoomCmd(mob);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t((GridLocale)mob.location()).setXGridSize(CMath.s_int(restStr));\n\t\t\t((GridLocale)mob.location()).buildGrid();\n\t\t\tCMLib.database().DBUpdateRoom(mob.location());\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\\n\\r"));\n\t\t}\n\t\telse\n\t\tif((command.equalsIgnoreCase("YGRID"))&&(mob.location() instanceof GridLocale))\n\t\t{\n\t\t\tif (commands.size() < 4)\n\t\t\t{\n\t\t\t\tflunkRoomCmd(mob);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t((GridLocale)mob.location()).setYGridSize(CMath.s_int(restStr));\n\t\t\t((GridLocale)mob.location()).buildGrid();\n\t\t\tCMLib.database().DBUpdateRoom(mob.location());\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\\n\\r"));\n\t\t}\n\t\telse\n\t\tif(command.equalsIgnoreCase("DESCRIPTION"))\n\t\t{\n\t\t\tif (commands.size() < 4)\n\t\t\t{\n\t\t\t\tflunkRoomCmd(mob);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmob.location().setDescription(restStr);\n\t\t\tCMLib.database().DBUpdateRoom(mob.location());\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The very nature of reality changes.\\n\\r"));\n\t\t}\n\t\telse\n\t\tif(command.equalsIgnoreCase("AFFECTS"))\n\t\t{\n\t\t\tCMLib.genEd().genAffects(mob,mob.location(),1,1);\n\t\t\tmob.location().recoverPhyStats();\n\t\t\tCMLib.database().DBUpdateRoom(mob.location());\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The very nature of reality changes.\\n\\r"));\n\t\t}\n\t\telse\n\t\tif(command.equalsIgnoreCase("BEHAVIORS"))\n\t\t{\n\t\t\tCMLib.genEd().genBehaviors(mob,mob.location(),1,1);\n\t\t\tmob.location().recoverPhyStats();\n\t\t\tCMLib.database().DBUpdateRoom(mob.location());\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The very nature of reality changes.\\n\\r"));\n\t\t}\n\t\telse\n\t\tif(CMLib.coffeeMaker().isAnyGenStat(mob.location(), command))\n\t\t{\n\t\t\tCMLib.coffeeMaker().setAnyGenStat(mob.location(),command, restStr);\n\t\t\tmob.location().recoverPhyStats();\n\t\t\tCMLib.database().DBUpdateRoom(mob.location());\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The very nature of reality changes.\\n\\r"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinal Room R=CMLib.map().getRoom(command);\n\t\t\tif((R==null)\n\t\t\t||(!CMSecurity.isAllowed(mob, R, CMSecurity.SecFlag.CMDROOMS)))\n\t\t\t{\n\t\t\t\tfinal STreeSet<String> set=new STreeSet<String>();\n\t\t\t\tset.addAll(CMParms.parseCommas("NAME,AREA,DESCRIPTION,AFFECTS,BEHAVIORS,CLASS,XGRID,YGRID,[ROOM ID]",true));\n\t\t\t\tset.addAll(CMLib.coffeeMaker().getAllGenStats(mob.location()));\n\t\t\t\tmob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(set)));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfinal Room oldRoom=(Room)mob.location().copyOf();\n\t\t\t\tfinal Room newRoom=CMLib.genEd().modifyRoom(mob,R,-1);\n\t\t\t\tif((!oldRoom.sameAs(newRoom))&&(!newRoom.amDestroyed()))\n\t\t\t\t{\n\t\t\t\t\tCMLib.database().DBUpdateRoom(newRoom);\n\t\t\t\t\tnewRoom.showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\\n\\r"));\n\t\t\t\t\tLog.sysOut("Rooms",mob.Name()+" modified room "+newRoom.roomID()+".");\n\t\t\t\t}\n\t\t\t\toldRoom.destroy();\n\t\t\t\tnewRoom.getArea().fillInAreaRoom(newRoom);\n\t\t\t\tfixDeities(newRoom);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tmob.location().recoverRoomStats();\n\t\tLog.sysOut("Rooms",mob.Name()+" modified room "+mob.location().roomID()+".");\n\t}\n\n\tpublic void accounts(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around the heavens."));\n\t\tPlayerAccount theAccount = null;\n\t\tString oldName = null;\n\t\tif(commands.size()==2)\n\t\t{\n\t\t\ttheAccount=mob.playerStats().getAccount();\n\t\t\toldName=theAccount.getAccountName();\n\t\t\tCMLib.genEd().modifyAccount(mob,theAccount,-1);\n\t\t}\n\t\telse\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY ACCOUNT ([NAME])\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinal String accountName=CMStrings.capitalizeAndLower(CMParms.combine(commands, 2));\n\t\t\ttheAccount = CMLib.players().getLoadAccount(accountName);\n\t\t\tif(theAccount==null)\n\t\t\t{\n\t\t\t\tmob.tell(L("There is no account called \'@x1\'!\\n\\r",accountName));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\toldName=theAccount.getAccountName();\n\t\t\tCMLib.genEd().modifyAccount(mob,theAccount,-1);\n\t\t\tmob.location().recoverRoomStats();\n\t\t}\n\t\tLog.sysOut("Modify",mob.Name()+" modified account "+theAccount.getAccountName()+".");\n\t\tif(!oldName.equals(theAccount.getAccountName()))\n\t\t{\n\t\t\tfinal List<MOB> V=new ArrayList<MOB>();\n\t\t\tfor(final Enumeration<String> es=theAccount.getPlayers();es.hasMoreElements();)\n\t\t\t{\n\t\t\t\tfinal String playerName=es.nextElement();\n\t\t\t\tfinal MOB playerM=CMLib.players().getLoadPlayer(playerName);\n\t\t\t\tif((playerM!=null)&&(!CMLib.flags().isInTheGame(playerM,true)))\n\t\t\t\t\tV.add(playerM);\n\t\t\t}\n\t\t\tfinal PlayerAccount acc = (PlayerAccount)CMClass.getCommon("DefaultPlayerAccount");\n\t\t\tacc.setAccountName(oldName);\n\t\t\tCMLib.database().DBDeleteAccount(acc);\n\t\t\tCMLib.database().DBCreateAccount(theAccount);\n\t\t\tfor(final MOB playerM : V)\n\t\t\t\tCMLib.database().DBUpdatePlayerPlayerStats(playerM);\n\t\t}\n\t\tCMLib.database().DBUpdateAccount(theAccount);\n\t}\n\n\tpublic void doMql(final MOB mob, final boolean areaFlag, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tif(commands.size()<2)\n\t\t\tmob.tell(L("This is not valid MQL."));\n\t\telse\n\t\t{\n\t\t\tfinal StringBuilder lines = new StringBuilder("");\n\t\t\tfinal String mql=CMParms.combineQuoted(commands,0);\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around."));\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfinal List<UpdateSet> res=CMLib.percolator().doMQLUpdateObjects(areaFlag?(mob.location().getArea()):null, mql);\n\t\t\t\tif(res.size()==0)\n\t\t\t\t\tlines.append("(nothing to do)");\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlines.append("Update preview:\\n\\r");\n\t\t\t\t\tfor(final UpdateSet o : res)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(o.first instanceof Environmental)\n\t\t\t\t\t\t\tlines.append(o.first.name()+" ("+o.first.ID()+") @"+CMLib.map().getApproximateExtendedRoomID(CMLib.map().roomLocation((Environmental)o.first))+":\\n\\r");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tlines.append(o.first.name()+" ("+o.first.ID()+"):\\n\\r");\n\t\t\t\t\t\tlines.append("  OLD: "+o.second+"="+o.first.getStat(o.second)).append("\\n\\r");\n\t\t\t\t\t\tlines.append("  NEW: "+o.second+"="+o.third).append("\\n\\r");\n\t\t\t\t\t}\n\t\t\t\t\tfinal Runnable doUpdate = new Runnable()\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal List<UpdateSet> todo=res;\n\t\t\t\t\t\tpublic void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor(final UpdateSet o : todo)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\to.first.setStat(o.second, o.third);\n\t\t\t\t\t\t\t\tif(o.first instanceof Environmental)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tEnvironmental E=(Environmental)o.first;\n\t\t\t\t\t\t\t\t\tfinal Room R=CMLib.map().roomLocation(E);\n\t\t\t\t\t\t\t\t\tif((R!=null) && R.isSavable() && (R.roomID().length()>0))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tLog.infoOut(mob.name()+" modified "+E.name()+" at "+R.roomID());\n\t\t\t\t\t\t\t\t\t\tif(E instanceof Ability)\n\t\t\t\t\t\t\t\t\t\t\tE=((Ability)E).affecting();\n\t\t\t\t\t\t\t\t\t\tif(E instanceof Room)\n\t\t\t\t\t\t\t\t\t\t\tCMLib.database().DBUpdateRoom(R);\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tif(E instanceof Item)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tfinal Item I=(Item)E;\n\t\t\t\t\t\t\t\t\t\t\tif((I.owner() instanceof Room)\n\t\t\t\t\t\t\t\t\t\t\t&&(I.databaseID().length()>0))\n\t\t\t\t\t\t\t\t\t\t\t\tCMLib.database().DBUpdateItem(R.roomID(), I);\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tif((I.owner() instanceof MOB)\n\t\t\t\t\t\t\t\t\t\t\t&&(((MOB)I.owner()).databaseID().length()>0)\n\t\t\t\t\t\t\t\t\t\t\t&&(((MOB)I.owner()).getStartRoom()!=null)\n\t\t\t\t\t\t\t\t\t\t\t&&(((MOB)I.owner()).getStartRoom().roomID().length()>0))\n\t\t\t\t\t\t\t\t\t\t\t\tCMLib.database().DBUpdateMOB(((MOB)I.owner()).getStartRoom().roomID(), (MOB)I.owner());\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tif((E instanceof MOB)\n\t\t\t\t\t\t\t\t\t\t&&(((MOB)E).databaseID().length()>0))\n\t\t\t\t\t\t\t\t\t\t\tCMLib.database().DBUpdateMOB(R.roomID(), (MOB)E);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tfinal Session session = mob.session();\n\t\t\t\t\tif(session!=null)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal InputCallback callBack = new InputCallback(InputCallback.Type.CONFIRM,"N",0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void showPrompt()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsession.promptPrint(L("\\n\\rSave the above changes (y/N)? "));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void timedOut()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void callBack()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(this.input.equals("Y"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tdoUpdate.run();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsession.wraplessPrintln(lines.toString());\n\t\t\t\t\t\tlines.setLength(0);\n\t\t\t\t\t\tsession.prompt(callBack);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(final MQLException e)\n\t\t\t{\n\t\t\t\tfinal ByteArrayOutputStream bout=new ByteArrayOutputStream();\n\t\t\t\tfinal PrintStream pw=new PrintStream(bout);\n\t\t\t\te.printStackTrace(pw);\n\t\t\t\tpw.flush();\n\t\t\t\tlines.append(e.getMessage()+"\\n\\r"+bout.toString());\n\t\t\t\tif(mob.session()!=null)\n\t\t\t\t\tmob.session().wraplessPrintln(lines.toString());\n\t\t\t\tlines.setLength(0);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void areas(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tif(mob.location()==null)\n\t\t\treturn;\n\t\tif(mob.location().getArea()==null)\n\t\t\treturn;\n\t\tArea myArea=mob.location().getArea();\n\n\t\tString oldName=myArea.Name();\n\t\tfinal Vector<Room> allMyDamnRooms=new Vector<Room>();\n\t\tfor(final Enumeration<Room> e=myArea.getCompleteMap();e.hasMoreElements();)\n\t\t\tallMyDamnRooms.add(e.nextElement());\n\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around wildly."));\n\t\tResources.removeResource("HELP_"+myArea.Name().toUpperCase());\n\t\tfinal Set<Area> alsoUpdateAreas=new HashSet<Area>();\n\t\tif(commands.size()==2)\n\t\t\tCMLib.genEd().modifyArea(mob,myArea,alsoUpdateAreas, -1);\n\t\telse\n\t\tif((commands.size()==3)&&(CMLib.map().getArea(commands.get(2))!=null))\n\t\t{\n\t\t\tmyArea=CMLib.map().getArea(commands.get(2));\n\t\t\toldName=myArea.Name();\n\t\t\tCMLib.genEd().modifyArea(mob,myArea,alsoUpdateAreas, -1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (commands.size() < 3)\n\t\t\t{\n\t\t\t\tflunkAreaCmd(mob);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tString command=commands.get(2).toUpperCase();\n\t\t\tfinal STreeSet<String> helpSet=new STreeSet<String>();\n\t\t\thelpSet.addAll(CMParms.parseCommas("NAME,DESCRIPTION,CLIMATE,FILE,AFFECTS,BEHAVIORS,ADDSUB,DELSUB,XGRID,YGRID,PASSIVE,ACTIVE,FROZEN,STOPPED",true));\n\t\t\thelpSet.addAll(CMLib.coffeeMaker().getAllGenStats(myArea));\n\t\t\tif((commands.size()>3)&&(!helpSet.contains(command)))\n\t\t\t{\n\t\t\t\tfinal Area possibleArea=CMLib.map().getArea(command);\n\t\t\t\tif(possibleArea!=null)\n\t\t\t\t{\n\t\t\t\t\tmyArea=possibleArea;\n\t\t\t\t\toldName=possibleArea.Name();\n\t\t\t\t\tcommands.remove(2);\n\t\t\t\t\tcommand=commands.get(2).toUpperCase();\n\t\t\t\t}\n\t\t\t}\n\t\t\tString restStr="";\n\t\t\tif(commands.size()>=3)\n\t\t\t\trestStr=CMParms.combine(commands,3);\n\n\t\t\tif(command.equalsIgnoreCase("NAME"))\n\t\t\t{\n\t\t\t\tif (commands.size() < 4)\n\t\t\t\t{\n\t\t\t\t\tflunkAreaCmd(mob);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tmyArea.setName(restStr);\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("PASSIVE"))\n\t\t\t{\n\t\t\t\tmyArea.setAreaState(Area.State.PASSIVE);\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("ACTIVE"))\n\t\t\t{\n\t\t\t\tmyArea.setAreaState(Area.State.ACTIVE);\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("FROZEN"))\n\t\t\t{\n\t\t\t\tmyArea.setAreaState(Area.State.FROZEN);\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("STOPPED"))\n\t\t\t{\n\t\t\t\tmyArea.setAreaState(Area.State.STOPPED);\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("DESC"))\n\t\t\t{\n\t\t\t\tif (commands.size() < 4)\n\t\t\t\t{\n\t\t\t\t\tflunkAreaCmd(mob);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tmyArea.setDescription(restStr);\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("FILE"))\n\t\t\t{\n\t\t\t\tif (commands.size() < 4)\n\t\t\t\t{\n\t\t\t\t\tflunkAreaCmd(mob);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tmyArea.setArchivePath(restStr);\n\t\t\t}\n\t\t\telse\n\t\t\tif((command.equalsIgnoreCase("XGRID"))&&(myArea instanceof GridZones))\n\t\t\t{\n\t\t\t\tif (commands.size() < 4)\n\t\t\t\t{\n\t\t\t\t\tflunkAreaCmd(mob);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t((GridZones)myArea).setXGridSize(CMath.s_int(restStr));\n\t\t\t}\n\t\t\telse\n\t\t\tif((command.equalsIgnoreCase("YGRID"))&&(myArea instanceof GridZones))\n\t\t\t{\n\t\t\t\tif (commands.size() < 4)\n\t\t\t\t{\n\t\t\t\t\tflunkAreaCmd(mob);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t((GridZones)myArea).setYGridSize(CMath.s_int(restStr));\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("CLIMATE"))\n\t\t\t{\n\t\t\t\tif (commands.size() < 4)\n\t\t\t\t{\n\t\t\t\t\tflunkAreaCmd(mob);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tint newClimate=0;\n\t\t\t\tfor(int i=0;i<restStr.length();i++)\n\t\t\t\t{\n\t\t\t\t\tswitch(Character.toUpperCase(restStr.charAt(i)))\n\t\t\t\t\t{\n\t\t\t\t\tcase \'R\':\n\t\t\t\t\t\tnewClimate=newClimate|Places.CLIMASK_WET;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \'H\':\n\t\t\t\t\t\tnewClimate=newClimate|Places.CLIMASK_HOT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \'C\':\n\t\t\t\t\t\tnewClimate=newClimate|Places.CLIMASK_COLD;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \'W\':\n\t\t\t\t\t\tnewClimate=newClimate|Places.CLIMASK_WINDY;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \'D\':\n\t\t\t\t\t\tnewClimate=newClimate|Places.CLIMASK_WINDY;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \'N\':\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tmob.tell(L("Invalid CLIMATE code: \'@x1\'.  Valid codes include: R)AINY, H)OT, C)OLD, D)RY, W)INDY, N)ORMAL.\\n\\r",""+restStr.charAt(i)));\n\t\t\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmyArea.setClimateType(newClimate);\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("ADDSUB"))\n\t\t\t{\n\t\t\t\tif((commands.size()<4)||(!CMLib.players().playerExists(restStr)))\n\t\t\t\t{\n\t\t\t\t\tmob.tell(L("Unknown or invalid username given.\\n\\r"));\n\t\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\t\t}\n\t\t\t\tmyArea.addSubOp(restStr);\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("DELSUB"))\n\t\t\t{\n\t\t\t\tif((commands.size()<4)||(!myArea.amISubOp(restStr)))\n\t\t\t\t{\n\t\t\t\t\tmob.tell(L("Unknown or invalid staff name given.  Valid names are: @x1.\\n\\r",myArea.getSubOpList()));\n\t\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\t\t}\n\t\t\t\tmyArea.delSubOp(restStr);\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("AFFECTS"))\n\t\t\t{\n\t\t\t\tCMLib.genEd().genAffects(mob,myArea,1,1);\n\t\t\t\tmyArea.recoverPhyStats();\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.equalsIgnoreCase("BEHAVIORS"))\n\t\t\t{\n\t\t\t\tCMLib.genEd().genBehaviors(mob,myArea,1,1);\n\t\t\t\tmyArea.recoverPhyStats();\n\t\t\t}\n\t\t\telse\n\t\t\tif(CMLib.coffeeMaker().isAnyGenStat(myArea, command))\n\t\t\t{\n\t\t\t\tCMLib.coffeeMaker().setAnyGenStat(myArea,command, restStr);\n\t\t\t\tmyArea.recoverPhyStats();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(helpSet)));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif((!myArea.Name().equals(oldName))&&(!mob.isMonster()))\n\t\t{\n\t\t\tif(mob.session().confirm(L("Is changing the name of this area really necessary (y/N)?"),"N"))\n\t\t\t{\n\t\t\t\tfor(final Enumeration<Room> r=myArea.getCompleteMap();r.hasMoreElements();)\n\t\t\t\t{\n\t\t\t\t\tRoom R=r.nextElement();\n\t\t\t\t\tsynchronized(CMClass.getSync("SYNC"+R.roomID()))\n\t\t\t\t\t{\n\t\t\t\t\t\tR=CMLib.map().getRoom(R);\n\t\t\t\t\t\tif((R.roomID().startsWith(oldName+"#"))\n\t\t\t\t\t\t&&(CMLib.map().getRoom(myArea.Name()+"#"+R.roomID().substring(oldName.length()+1))==null))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tR=CMLib.map().getRoom(R);\n\t\t\t\t\t\t\tfinal String oldID=R.roomID();\n\t\t\t\t\t\t\tR.setRoomID(myArea.Name()+"#"+R.roomID().substring(oldName.length()+1));\n\t\t\t\t\t\t\tCMLib.database().DBReCreate(R,oldID);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tCMLib.database().DBUpdateRoom(R);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tmyArea.setName(oldName);\n\t\t}\n\t\telse\n\t\t\tmyArea.setName(oldName);\n\t\tmyArea.recoverPhyStats();\n\t\tmob.location().recoverRoomStats();\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("There is something different about this place...\\n\\r"));\n\t\tif(myArea.name().equals(oldName))\n\t\t\tCMLib.database().DBUpdateArea(myArea.Name(),myArea);\n\t\telse\n\t\t{\n\t\t\tCMLib.database().DBUpdateArea(oldName,myArea);\n\t\t\tCMLib.map().renameRooms(myArea,oldName,allMyDamnRooms);\n\t\t}\n\t\tfor(final Area A : alsoUpdateAreas)\n\t\t{\n\t\t\tif((A!=myArea)&&(!A.Name().equals(myArea.Name())))\n\t\t\t\tCMLib.database().DBUpdateArea(A.Name(),A);\n\t\t}\n\t\tLog.sysOut("Rooms",mob.Name()+" modified area "+myArea.Name()+".");\n\t}\n\n\tpublic void cron(final MOB mob, final List<String> commands) throws IOException\n\t{\n\t\tif(commands.size()<4)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\r"\n\t\t\t\t\t+ "The format is MODIFY CRON [NAME/#] [SUBJECT, INTERVAL, SCRIPT] [VALUE]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\n\t\tfinal String cronID=commands.get(2);\n\t\tfinal String field=commands.get(3).toUpperCase().trim();\n\t\tfinal String value=CMParms.combine(commands, 4);\n\t\tfinal List<JournalEntry> jobs = CMLib.database().DBReadJournalMsgsByCreateDate("SYSTEM_CRON", true);\n\t\tJournalEntry modJob=null;\n\t\tif(CMath.isInteger(cronID)\n\t\t&&(CMath.s_int(cronID)>0)\n\t\t&&(CMath.s_int(cronID)<=jobs.size()))\n\t\t\tmodJob=jobs.get(CMath.s_int(cronID)-1);\n\t\telse\n\t\t{\n\t\t\tfor(final JournalEntry E : jobs)\n\t\t\t{\n\t\t\t\tif(E.subj().equalsIgnoreCase(cronID))\n\t\t\t\t\tmodJob=E;\n\t\t\t}\n\t\t\tif(modJob == null)\n\t\t\t{\n\t\t\t\tfor(final JournalEntry E : jobs)\n\t\t\t\t{\n\t\t\t\t\tif(E.subj().toUpperCase().indexOf(cronID.toUpperCase())>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tmodJob=E;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(modJob == null)\n\t\t\t{\n\t\t\t\tmob.tell(L("@x1 is not a valid [NAME/#].  Try LIST CRON.\\n\\r",cronID));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(field.equals("SUBJECT"))\n\t\t{\n\t\t\tif(value.trim().length()==0)\n\t\t\t{\n\t\t\t\tmob.tell(L("\'@x1\' is not a valid subject.\\n\\r",value));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmodJob.subj(field);\n\t\t\tCMLib.database().DBUpdateJournal("SYSTEM_CRON", modJob);\n\t\t\tLog.sysOut(mob.Name()+" modified cron job "+modJob.subj()+".");\n\t\t}\n\t\telse\n\t\tif(field.equals("INTERVAL"))\n\t\t{\n\t\t\tlong tm = CMLib.time().parseTickExpression(value);\n\t\t\tif((tm <= 0)||(value.trim().length()==0))\n\t\t\t{\n\t\t\t\tmob.tell(L("@x1 is not a valid interval.\\n\\r",value));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttm = tm * CMProps.getTickMillis();\n\t\t\tmodJob.data("INTERVAL="+tm);\n\t\t\tmodJob.update(System.currentTimeMillis()+tm);\n\t\t\tCMLib.database().DBUpdateJournal("SYSTEM_CRON", modJob);\n\t\t\tLog.sysOut(mob.Name()+" modified cron job "+modJob.subj()+".");\n\t\t\tCMLib.journals().activate();\n\t\t}\n\t\telse\n\t\tif(field.equals("SCRIPT"))\n\t\t{\n\t\t\tfinal JournalEntry E=modJob;\n\t\t\tfinal List<String> msgV=Resources.getFileLineVector(new StringBuffer(modJob.msg()));\n\t\t\tCMLib.journals().makeMessageASync(mob, modJob.subj(),msgV, false, new MsgMkrCallback() {\n\t\t\t\tfinal JournalEntry E2 = E;\n\t\t\t\t@Override\n\t\t\t\tpublic void callBack(final MOB mob, final Session sess, final MsgMkrResolution res)\n\t\t\t\t{\n\t\t\t\t\tif(res == MsgMkrResolution.SAVEFILE)\n\t\t\t\t\t{\n\t\t\t\t\t\tE2.msg(CMParms.combineWith(msgV, "\\n\\r"));\n\t\t\t\t\t\tCMLib.database().DBUpdateJournal("SYSTEM_CRON", E2);\n\t\t\t\t\t\tLog.sysOut(mob.Name()+" modified cron job "+E2.subj()+".");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic void quests(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t\tmob.tell(L("modify which quest?  Use list quests."));\n\t\telse\n\t\t{\n\t\t\tint cmdDex=-1;\n\t\t\tfinal String[] CMDS={"START","STOP","ENABLE","DISABLE"};\n\t\t\tif(commands.size()>3)\n\t\t\t{\n\t\t\t\tcmdDex=CMParms.indexOf(CMDS,commands.get(commands.size()-1).toUpperCase());\n\t\t\t\tif(cmdDex>=0)\n\t\t\t\t\tcommands.remove(commands.size()-1);\n\t\t\t}\n\t\t\tString name=CMParms.combine(commands,2);\n\t\t\tQuest Q=null;\n\t\t\tif(CMath.isInteger(name))\n\t\t\t{\n\t\t\t\tQ=CMLib.quests().fetchQuest(CMath.s_int(name)-1);\n\t\t\t\tif(Q!=null)\n\t\t\t\t\tname=Q.name();\n\t\t\t}\n\t\t\tif(Q==null)\n\t\t\t\tQ=CMLib.quests().fetchQuest(name);\n\t\t\tif(Q==null)\n\t\t\t{\n\t\t\t\tmob.tell(L("Quest \'@x1\' is unknown.  Try list quests.",name));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\tif(!mob.isMonster())\n\t\t\t{\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around @x1.",Q.name()));\n\t\t\t\tint showFlag=-1;\n\t\t\t\tif(CMProps.getIntVar(CMProps.Int.EDITORTYPE)>0)\n\t\t\t\t\tshowFlag=-999;\n\t\t\t\tboolean ok=false;\n\t\t\t\twhile(!ok)\n\t\t\t\t{\n\t\t\t\t\tint showNumber=0;\n\t\t\t\t\tint doCmd=cmdDex;\n\t\t\t\t\tString newScript=null;\n\t\t\t\t\tif((doCmd<0)&&(CMLib.genEd().promptToggle(mob,++showNumber,showFlag,"Started: "+Q.running())))\n\t\t\t\t\t\tdoCmd=Q.running()?1:0;\n\t\t\t\t\tif((doCmd<0)&&(CMLib.genEd().promptToggle(mob,++showNumber,showFlag,"Enabled: "+(!Q.suspended()))))\n\t\t\t\t\t\tdoCmd=Q.suspended()?2:3;\n\t\t\t\t\tif(doCmd<0)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal String oldScript=Q.script();\n\t\t\t\t\t\tnewScript=CMLib.genEd().prompt(mob,oldScript,++showNumber,showFlag,L("Script"),false,true,CMLib.help().getHelpText("QUESTS",mob,true).toString(),null,null);\n\t\t\t\t\t\tif(!newScript.equals(oldScript))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tQ.setScript(newScript,true);\n\t\t\t\t\t\t\tboolean revert=false;\n\t\t\t\t\t\t\tif(Q.name().length()==0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmob.tell(L("You must specify a VALID quest string.  This one contained no name."));\n\t\t\t\t\t\t\t\trevert=true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\tif(Q.duration()<0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmob.tell(L("You must specify a VALID quest string.  This one contained no duration."));\n\t\t\t\t\t\t\t\trevert=true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\tfor(int q=0;q<CMLib.quests().numQuests();q++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfinal Quest Q1=CMLib.quests().fetchQuest(q);\n\t\t\t\t\t\t\t\tif(Q1.name().equalsIgnoreCase(Q.name())&&(Q1!=Q))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmob.tell(L("A quest with that name already exists."));\n\t\t\t\t\t\t\t\t\trevert=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(revert)\n\t\t\t\t\t\t\t\tQ.setScript(oldScript,true);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tCMLib.quests().save();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tswitch(doCmd)\n\t\t\t\t\t{\n\t\t\t\t\tcase 0:\n\t\t\t\t\t{\n\t\t\t\t\t\tif(Q.running())\n\t\t\t\t\t\t\tmob.tell(L("That quest is already running."));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tQ.startQuest();\n\t\t\t\t\t\t\tif((!Q.running())&&(Q.getSpawn()!=Quest.SPAWN_ANY))\n\t\t\t\t\t\t\t\tmob.tell(L("Quest \'@x1\' NOT started -- check your mud.log for errors.",Q.name()));\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tmob.tell(L("Quest \'@x1\' started.",Q.name()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 1:\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!Q.running())\n\t\t\t\t\t\t\tmob.tell(L("That quest is not running."));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tCMLib.coffeeTables().bump(Q,CoffeeTableRow.STAT_QUESTSTOP);\n\t\t\t\t\t\t\tQ.stopQuest();\n\t\t\t\t\t\t\tif(!Q.running())\n\t\t\t\t\t\t\t\tmob.tell(L("Quest \'@x1\' stopped.",Q.name()));\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tmob.tell(L("Quest \'@x1\' NOT stopped -- check your mud.log for errors.",Q.name()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 2:\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!Q.suspended())\n\t\t\t\t\t\t\tmob.tell(L("That quest is not disabled."));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tQ.setSuspended(false);\n\t\t\t\t\t\t\tCMLib.database().DBUpdateQuest(Q);\n\t\t\t\t\t\t\tmob.tell(L("Quest \'@x1\' enabled.",Q.name()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 3:\n\t\t\t\t\t{\n\t\t\t\t\t\tif(Q.suspended())\n\t\t\t\t\t\t\tmob.tell(L("That quest is already disabled."));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(Q.running())\n\t\t\t\t\t\t\t\tQ.stopQuest();\n\t\t\t\t\t\t\tQ.setSuspended(true);\n\t\t\t\t\t\t\tCMLib.database().DBUpdateQuest(Q);\n\t\t\t\t\t\t\tmob.tell(L("Quest \'@x1\' disabled.",Q.name()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((showFlag < -900) || (cmdDex >= 0))\n\t\t\t\t\t{\n\t\t\t\t\t\tok = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (showFlag > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tshowFlag = -1;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tshowFlag=CMath.s_int(mob.session().prompt(L("Edit which? "),""));\n\t\t\t\t\tif(showFlag<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tshowFlag=-1;\n\t\t\t\t\t\tok=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tLog.sysOut("Rooms",mob.Name()+" modified quest "+Q.name()+".");\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void updateChangedExit(final MOB mob, final Room baseRoom, final Exit thisExit, final Exit prevExit)\n\t{\n\t\tthisExit.recoverPhyStats();\n\t\tCMLib.database().DBUpdateExits(baseRoom);\n\t\ttry\n\t\t{\n\t\t\tfor(final Enumeration<Room> r=CMLib.map().rooms();r.hasMoreElements();)\n\t\t\t{\n\t\t\t\tRoom room=r.nextElement();\n\t\t\t\tsynchronized(CMClass.getSync("SYNC"+room.roomID()))\n\t\t\t\t{\n\t\t\t\t\troom=CMLib.map().getRoom(room);\n\t\t\t\t\tif(room != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinal Exit exit=room.getRawExit(d);\n\t\t\t\t\t\t\tif((exit!=null)&&(exit==thisExit))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tCMLib.database().DBUpdateExits(room);\n\t\t\t\t\t\t\t\troom.getArea().fillInAreaRoom(room);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (final NoSuchElementException e)\n\t\t{\n\t\t}\n\t\tif(!prevExit.sameAs(thisExit))\n\t\t\tLog.sysOut("CreateEdit",mob.Name()+" modified exit "+thisExit.ID()+".");\n\t\tprevExit.destroy();\n\t\tmob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("@x1 shake(s) under the transforming power.",thisExit.name()));\n\t\tbaseRoom.getArea().fillInAreaRoom(baseRoom);\n\t}\n\n\tpublic void exits(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tif(mob.location().roomID().equals(""))\n\t\t{\n\t\t\tmob.tell(L("This command is invalid from within a GridLocaleChild room."));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\treturn;\n\t\t}\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY EXIT [DIRECTION] (TEXT, ?) (VALUE)\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\n\t\tfinal int direction=CMLib.directions().getGoodDirectionCode((commands.get(2)));\n\t\tif(direction<0)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify a direction.  Try @x1.\\n\\r",Directions.LETTERS()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\n\t\tfinal Exit thisExit=mob.location().getRawExit(direction);\n\t\tif(thisExit==null)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify a valid exit \'@x1\'.\\n\\r",(commands.get(2))));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tfinal Directions.DirType dirType=CMLib.flags().getInDirType(mob);\n\t\tfinal String inDirName=CMLib.directions().getInDirectionName(direction, dirType);\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around to the @x1.",inDirName));\n\t\tfinal Exit copyExit=(Exit)thisExit.copyOf();\n\t\tif(thisExit.isGeneric() && (commands.size()<5))\n\t\t{\n\t\t\tCMLib.genEd().modifyGenExit(mob,thisExit,-1);\n\t\t\tupdateChangedExit(mob,mob.location(),thisExit,copyExit);\n\t\t\treturn;\n\t\t}\n\n\t\tif(commands.size()<5)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY EXIT [DIRECTION] (TEXT, ?) (VALUE)\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\n\t\tfinal String command=commands.get(3).toUpperCase();\n\t\tfinal String restStr=CMParms.combine(commands,4);\n\n\t\tif(command.equalsIgnoreCase("text"))\n\t\t{\n\t\t\tif(thisExit.isGeneric())\n\t\t\t\tCMLib.genEd().modifyGenExit(mob,thisExit,-1);\n\t\t\telse\n\t\t\t\tthisExit.setMiscText(restStr);\n\t\t}\n\t\telse\n\t\tif(CMLib.coffeeMaker().isAnyGenStat(thisExit, command))\n\t\t{\n\t\t\tCMLib.coffeeMaker().setAnyGenStat(thisExit,command, restStr);\n\t\t\tthisExit.recoverPhyStats();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinal STreeSet<String> set=new STreeSet<String>();\n\t\t\tset.addAll(CMParms.parseCommas("TEXT",true));\n\t\t\tset.addAll(CMLib.coffeeMaker().getAllGenStats(thisExit));\n\t\t\tmob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(set)));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tupdateChangedExit(mob,mob.location(),thisExit,copyExit);\n\t}\n\n\tpublic boolean races(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY RACE [RACE ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\n\t\tfinal String raceID=CMParms.combine(commands,2);\n\t\tfinal Race R=CMClass.getRace(raceID);\n\t\tif(R==null)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is an invalid race id.",raceID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(R.isGeneric()))\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not generic, and may not be modified as it is.  Use CREATE RACE @x2 to convert it to a generic race.",R.ID(),R.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",R.name()));\n\t\tCMLib.genEd().modifyGenRace(mob,R,-1);\n\t\tCMLib.database().DBDeleteRace(R.ID());\n\t\tCMLib.database().DBCreateRace(R.ID(),R.racialParms());\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1\'s everywhere shake under the transforming power!",R.name()));\n\t\treturn true;\n\t}\n\n\tpublic void allQualify(final MOB mob, final List<String> commands)\n\tthrows IOException\n\t{\n\t\tif(commands.size()<4)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY ALLQUALIFY EACH/ALL [SKILL ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tfinal String eachOrAll=commands.get(2);\n\t\tif((!eachOrAll.equalsIgnoreCase("each"))&&(!eachOrAll.equalsIgnoreCase("all")))\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY ALLQUALIFY EACH/ALL [SKILL ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tfinal String classD=CMParms.combine(commands,3);\n\t\tfinal Ability A=CMClass.getAbility(classD);\n\t\tif(A==null)\n\t\t{\n\t\t\tmob.tell(L("Ability with the ID \'@x1\' does not exist! Try LIST ABILITIES.",classD));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tMap<String,Map<String,AbilityMapper.AbilityMapping>> map=CMLib.ableMapper().getAllQualifiesMap(null);\n\t\tMap<String,AbilityMapper.AbilityMapping> subMap=map.get(eachOrAll.toUpperCase().trim());\n\t\tif(!subMap.containsKey(classD.toUpperCase().trim()))\n\t\t{\n\t\t\tmob.tell(L("All-Qualify entry (@x1) ID \'@x2\' does not exist!  Try CREATE, or LIST ALLQUALIFYS.",eachOrAll,A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tfinal AbilityMapper.AbilityMapping mapped = CMLib.genEd().modifyAllQualifyEntry(mob,eachOrAll.toUpperCase().trim(),A, -1);\n\t\tmap=CMLib.ableMapper().getAllQualifiesMap(null);\n\t\tsubMap=map.get(eachOrAll.toUpperCase().trim());\n\t\tsubMap.put(A.ID().toUpperCase().trim(), mapped);\n\t\tCMLib.ableMapper().saveAllQualifysFile(map);\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The skill of the world just changed!"));\n\t}\n\n\tpublic boolean classes(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY CLASS [CLASS ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\n\t\tfinal String classID=CMParms.combine(commands,2);\n\t\tfinal CharClass C=CMClass.getCharClass(classID);\n\t\tif(C==null)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is an invalid class id.",classID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(C.isGeneric()))\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not generic, and may not be modified as it is.  Use CREATE CLASS @x2 to convert it to a generic character class.",C.ID(),C.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",C.name()));\n\t\tCMLib.genEd().modifyGenClass(mob,C,-1);\n\t\tCMLib.database().DBDeleteClass(C.ID());\n\t\tCMLib.database().DBCreateClass(C.ID(),C.classParms());\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1\'s everywhere shake under the transforming power!",C.name()));\n\t\treturn true;\n\t}\n\n\tpublic boolean abilities(final MOB mob, final List<String> commands)\n\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY ABILITY [ABILITY ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\n\t\tfinal String classID=CMParms.combine(commands,2);\n\t\tfinal Ability A=CMClass.getAbility(classID);\n\t\tif(A==null)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is an invalid ability id.",classID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(A.isGeneric()))\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not generic, and may not be modified.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof Language)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a language.  Try MODIFY LANGUAGE.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof Trap)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a trap.  Try MODIFY TRAP.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof ItemCraftor)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a crafting skill.  Try MODIFY CRAFTSKILL.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));\n\t\tCMLib.genEd().modifyGenAbility(mob,A,-1);\n\t\tCMLib.database().DBDeleteAbility(A.ID());\n\t\tCMLib.database().DBCreateAbility(A.ID(),"GenAbility",A.getStat("ALLXML"));\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1\'s everywhere shake under the transforming power!",A.name()));\n\t\treturn true;\n\t}\n\n\tpublic boolean traps(final MOB mob, final List<String> commands)\n\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY TRAP [ABILITY ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\n\t\tfinal String classID=CMParms.combine(commands,2);\n\t\tfinal Ability A=CMClass.getAbility(classID);\n\t\tif(A==null)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is an invalid ability id.",classID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(A.isGeneric()))\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not generic, and may not be modified.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof Language)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a language.  Try MODIFY LANGUAGE.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof ItemCraftor)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a crafting skill.  Try MODIFY CRAFTSKILL.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(A instanceof Trap))\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not a trap.  Try MODIFY ABILITY.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));\n\t\tCMLib.genEd().modifyGenTrap(mob,(Trap)A,-1);\n\t\tCMLib.database().DBDeleteAbility(A.ID());\n\t\tCMLib.database().DBCreateAbility(A.ID(),"GenTrap",A.getStat("ALLXML"));\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1\'s everywhere shake under the transforming power!",A.name()));\n\t\treturn true;\n\t}\n\n\tpublic boolean languages(final MOB mob, final List<String> commands)\n\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY LANGUAGE [SKILL ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\n\t\tfinal String classID=CMParms.combine(commands,2);\n\t\tfinal Ability A=CMClass.getAbility(classID);\n\t\tif(A==null)\n                mob.tell("No Javascripts require approval at this time.");\r\n        }\r\n        else\r\n        if(commandType.equals("USER"))\r\n        {\r\n            if(!CMSecurity.isAllowed(mob,mob.location(),"CMDPLAYERS")) return errorOut(mob);\r\n            players(mob,commands);\r\n\t\t\tmob.tell(L("\'@x1\' is not generic, and may not be modified.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof ItemCraftor)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a crafting skill.  Try MODIFY CRAFTSKILL.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof ItemCollection)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a gathering skill.  Try MODIFY GATHERSKILL.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(A instanceof Language))\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not a language.  Try MODIFY ABILITY.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));\n\t\tCMLib.genEd().modifyGenLanguage(mob,(Language)A,-1);\n\t\tCMLib.database().DBDeleteAbility(A.ID());\n\t\tCMLib.database().DBCreateAbility(A.ID(),"GenLanguage",A.getStat("ALLXML"));\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1\'s everywhere shake under the transforming power!",A.name()));\n\t\treturn true;\n\t}\n\n\tpublic boolean craftSkills(final MOB mob, final List<String> commands)\n\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY CRAFTSKILL [SKILL ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\n\t\tfinal String classID=CMParms.combine(commands,2);\n\t\tfinal Ability A=CMClass.getAbility(classID);\n\t\tif(A==null)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is an invalid ability id.",classID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(A.isGeneric()))\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not generic, and may not be modified.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof Language)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a crafting skill.  Try MODIFY LANGUAGE.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(A instanceof ItemCraftor))\n\t\t{\n\t\t\tif(A instanceof ItemCollection)\n\t\t\t\tmob.tell(L("\'@x1\' is a gathering skill.  Try MODIFY GATHERSKILL.",A.ID()));\n\t\t\telse\n\t\t\t\tmob.tell(L("\'@x1\' is not a crafting skill.  Try MODIFY ABILITY.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(((ItemCraftor)A).getCraftorType()==ItemCraftor.CraftorType.LargeConstructions)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a building/wrighting skill.  Try MODIFY WRIGHTSKILL.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));\n\t\tCMLib.genEd().modifyGenCraftSkill(mob,A,-1);\n\t\tCMLib.database().DBDeleteAbility(A.ID());\n\t\tCMLib.database().DBCreateAbility(A.ID(),"GenCraftSkill",A.getStat("ALLXML"));\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1\'s everywhere shake under the transforming power!",A.name()));\n\t\treturn true;\n\t}\n\n\tpublic boolean gatherSkills(final MOB mob, final List<String> commands)\n\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY GATHERSKILL [SKILL ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\n\t\tfinal String classID=CMParms.combine(commands,2);\n\t\tfinal Ability A=CMClass.getAbility(classID);\n\t\tif(A==null)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is an invalid ability id.",classID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(A.isGeneric()))\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not generic, and may not be modified.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof Language)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a crafting skill.  Try MODIFY LANGUAGE.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof ItemCraftor)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a crafting skill.  Try MODIFY CRAFTSKILL.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(A instanceof ItemCollection))\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not a gathering skill.  Try MODIFY ABILITY.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));\n\t\tCMLib.genEd().modifyGenGatheringSkill(mob,A,-1);\n\t\tCMLib.database().DBDeleteAbility(A.ID());\n\t\tCMLib.database().DBCreateAbility(A.ID(),"GenGatheringSkill",A.getStat("ALLXML"));\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1\'s everywhere shake under the transforming power!",A.name()));\n\t\treturn true;\n\t}\n\n\tpublic boolean wrightSkills(final MOB mob, final List<String> commands)\n\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY WRIGHTSKILL [SKILL ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\n\t\tfinal String classID=CMParms.combine(commands,2);\n\t\tfinal Ability A=CMClass.getAbility(classID);\n\t\tif(A==null)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is an invalid ability id.",classID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(A.isGeneric()))\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not generic, and may not be modified.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(A instanceof Language)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a crafting skill.  Try MODIFY LANGUAGE.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!(A instanceof ItemCraftor))\n\t\t{\n\t\t\tif(A instanceof ItemCollection)\n\t\t\t\tmob.tell(L("\'@x1\' is a gathering skill.  Try MODIFY GATHERSKILL.",A.ID()));\n\t\t\telse\n\t\t\t\tmob.tell(L("\'@x1\' is not a crafting skill.  Try MODIFY ABILITY.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(((ItemCraftor)A).getCraftorType()!=ItemCraftor.CraftorType.LargeConstructions)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is a crafting skill.  Try MODIFY CRAFTSKILL.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around all @x1s.",A.name()));\n\t\tCMLib.genEd().modifyGenWrightSkill(mob,A,-1);\n\t\tCMLib.database().DBDeleteAbility(A.ID());\n\t\tCMLib.database().DBCreateAbility(A.ID(),"GenWrightSkill",A.getStat("ALLXML"));\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1\'s everywhere shake under the transforming power!",A.name()));\n\t\treturn true;\n\t}\n\n\tpublic void components(final MOB mob, final List<String> commands)\n\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\r"\n\t\t\t\t\t+ "Format: MODIFY COMPONENT [SKILL ID]\\n\\r"\n\t\t\t\t\t+ "Format: MODIFY COMPONENT SOCIAL [SOCIAL ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tif(commands.get(2).equalsIgnoreCase("SOCIAL"))\n\t\t{\n\t\t\tfinal String socialID=CMParms.combine(commands,3);\n\t\t\tfinal Vector<String> socialsParse=CMParms.parse(socialID);\n\t\t\tif(socialsParse.size()==0)\n\t\t\t{\n\t\t\t\tmob.tell(L("Which social? That doesn\'t exist.  Try LIST COMPONENTS"));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinal String name=socialsParse.firstElement().toUpperCase().trim();\n\t\t\tfinal String rest=socialsParse.size()>1?CMParms.combine(socialsParse,1):"";\n\t\t\tfinal List<Social> socials=CMLib.ableComponents().getSocialsSet(name);\n\t\t\tif((socials==null)||(socials.size()==0))\n\t\t\t{\n\t\t\t\tmob.tell(L("\'@x1\' does not exist, try LIST COMPONENTS.",socialID));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinal List<Social> copy = new XArrayList<Social>(socials);\n\t\t\tfinal List<String> socEncV = new ArrayList<String>(socials.size());\n\t\t\tfor(final Social S : copy)\n\t\t\t\tsocEncV.add(S.getEncodedLine());\n\t\t\tCMLib.socials().modifySocialInterface(mob, socials, rest);\n\t\t\tfor(final Social copyS : copy)\n\t\t\t\tif(!socials.contains(copyS))\n\t\t\t\t\tCMLib.ableComponents().alterAbilityComponentFile(CMStrings.trimCRLF(copyS.getEncodedLine()), true);\n\t\t\tfor(final Social newS : socials)\n\t\t\t{\n\t\t\t\tif((!socials.contains(newS))||(!socEncV.contains(newS.getEncodedLine())))\n\t\t\t\t\tCMLib.ableComponents().alterAbilityComponentFile(CMStrings.trimCRLF(newS.getEncodedLine()), false);\n\t\t\t}\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The complication of skill usage just increased!"));\n\t\t\treturn;\n\t\t}\n\t\tString skillID=CMParms.combine(commands,2);\n\t\tfinal Ability A=CMClass.getAbility(skillID);\n\t\tif(A==null)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is not a proper skill/spell ID.  Try LIST ABILITIES.",skillID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tskillID=A.ID();\n\t\tif(CMLib.ableComponents().getAbilityComponentMap().get(A.ID().toUpperCase())==null)\n\t\t{\n\t\t\tmob.tell(L("A component definition for \'@x1\' doesn\'t exists, you\'ll need to create it first.",A.ID()));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tCMLib.genEd().modifyComponents(mob,skillID,-1);\n\t\tfinal String parms=CMLib.ableComponents().getAbilityComponentCodedString(skillID);\n\t\tfinal String error=CMLib.ableComponents().addAbilityComponent(parms,CMLib.ableComponents().getAbilityComponentMap());\n\t\tif(error!=null)\n\t\t{\n\t\t\tmob.tell(error);\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tCMLib.ableComponents().alterAbilityComponentFile(skillID,false);\n\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The complication of skill usage just increased!"));\n\t}\n\n\tpublic void plane(final MOB mob, final List<String> commands)\n\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rFormat: MODIFY PLANE [SKILL ID]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tString planeName=CMParms.combine(commands,2);\n\t\tfinal PlanarAbility planeSet = (PlanarAbility)CMClass.getAbility("StdPlanarAbility");\n\t\tfinal Map<String,String> planeVars = planeSet.getPlanarVars(planeName);\n\t\tif(planeVars == null)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' already exists, you\'ll need to destroy it first.",planeName));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\tplaneName = planeVars.get(PlanarVar.ID.name());\n\t\tfinal Map<String,String> alterParms = new XHashtable<String,String>(planeVars);\n\t\tfinal String modifiedRule = CMLib.genEd().modifyPlane(mob,planeName,alterParms,-1);\n\t\tfinal String err = planeSet.addOrEditPlane(planeName, modifiedRule);\n\t\tif(err.startsWith("ERROR"))\n\t\t{\n\t\t\tmob.tell(err);\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\tif(err.length()>0)\n\t\t{\n\t\t\tLog.infoOut(mob.Name()+" modified plane: "+planeName+": \\n\\r"+err);\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The planar universe just changed!"));\n\t\t}\n\t}\n\n\tpublic void socials(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tif(mob.isMonster())\n\t\t\treturn;\n\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.session().safeRawPrintln(L("but fail to specify the proper fields.\\n\\rThe format is MODIFY SOCIAL [NAME] ([PARAM])\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\treturn;\n\t\t}\n\t\tfinal String name=commands.get(2).toUpperCase();\n\t\tString stuff="";\n\t\tif(commands.size()>3)\n\t\t\tstuff=CMParms.combine(commands,3).toUpperCase().trim();\n\t\tif(stuff.startsWith("T-"))\n\t\t\tstuff="TNAME";\n\t\tif(stuff.equals("TNAME"))\n\t\t\tstuff="<T-NAME>";\n\t\tfinal String oldStuff=stuff;\n\t\tif(stuff.equals("NONE"))\n\t\t\tstuff="";\n\t\tfinal Social S=CMLib.socials().fetchSocial((name+" "+stuff).trim(),false);\n\t\tif(S==null)\n\t\t{\n\t\t\tmob.tell(L("The social \'@x1\' does not exist.",stuff));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\treturn;\n\t\t}\n\t\tfinal List<Social> oldSocials = new ArrayList<Social>();\n\t\tList<Social> allSocials = CMLib.socials().getSocialsSet(name);\n\t\tif(allSocials==null)\n\t\t\tallSocials=new ArrayList<Social>();\n\t\tfor(int a = 0; a<allSocials.size();a++)\n\t\t\toldSocials.add((Social)allSocials.get(a).copyOf());\n\t\t{\n\t\t\tfinal Vector<String> socialsParse=CMParms.parse((name+" "+oldStuff).trim());\n\t\t\tif(socialsParse.size()==0)\n\t\t\t{\n\t\t\t\tmob.tell(L("Which social?"));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinal String sname=socialsParse.firstElement().toUpperCase().trim();\n\t\t\tfinal String rest=socialsParse.size()>1?CMParms.combine(socialsParse,1):"";\n\t\t\tfinal List<Social> socials=CMLib.socials().getSocialsSet(socialsParse.firstElement());\n\t\t\tif((socials==null)||(socials.size()==0))\n\t\t\t{\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("The social \'@x1\' does not exist. Try LIST SOCIALS ",sname));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around the idea of  @x1s.",S.name()));\n\t\t\tfinal List<Social> copy=new XArrayList<Social>(socials);\n\t\t\tCMLib.socials().modifySocialInterface(mob,socials, rest);\n\t\t\t{\n\t\t\t\tfor(final Social copyS : copy)\n\t\t\t\t\tif(!socials.contains(copyS))\n\t\t\t\t\t\tCMLib.socials().delSocial(copyS.name());\n\t\t\t\tfor(final Social newS : socials)\n\t\t\t\t{\n\t\t\t\t\tif(!socials.contains(newS))\n\t\t\t\t\t\tCMLib.socials().addSocial(newS);\n\t\t\t\t}\n\t\t\t}\n\t\t\tCMLib.socials().save(mob);\n\t\t}\n\t\tallSocials = CMLib.socials().getSocialsSet(name);\n\t\tif(allSocials==null)\n\t\t\tallSocials=new ArrayList<Social>();\n\t\tboolean changed = allSocials. size() != oldSocials.size();\n\t\tif(!changed)\n\t\t{\n\t\t\tfor(int a=0;a<oldSocials.size();a++)\n\t\t\t{\n\t\t\t\tfinal Social oldSocial = oldSocials.get(a);\n\t\t\t\tboolean found = false;\n\t\t\t\tfor(int a2=0;a2<allSocials.size();a2++)\n\t\t\t\t{\n\t\t\t\t\tfinal Social newSocial = allSocials.get(a2);\n\t\t\t\t\tif(oldSocial.name().equals(newSocial.name()))\n\t\t\t\t\t{\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tchanged = !oldSocial.sameAs(newSocial);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!found)\n\t\t\t\t\tchanged = true;\n\t\t\t\tif(changed)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(changed)\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The happiness of all mankind has just fluxuated!"));\n\t}\n\n\tpublic void players(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY USER [PLAYER NAME] ([STAT],?) (VALUE)\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\treturn;\n\t\t}\n\n\t\tfinal String mobID=commands.get(2);\n\t\tfinal MOB M=CMLib.players().getLoadPlayer(mobID);\n\t\tif(M!=null)\n\t\t{\n\t\t\tif(M.playerStats()!=null)\n\t\t\t\tM.playerStats().setLastUpdated(M.playerStats().getLastDateTime());\n\t\t\tM.recoverPhyStats();\n\t\t\tM.recoverCharStats();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmob.tell(L("There is no such player as \'@x1\'!",mobID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\treturn;\n\t\t}\n\t\tmob.location().showOthers(mob,M,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));\n\t\tfinal MOB copyMOB=(MOB)M.copyOf();\n\t\tM.basePhyStats().copyInto(copyMOB.basePhyStats());\n\t\tM.phyStats().copyInto(copyMOB.phyStats());\n\t\tmob.location().delInhabitant(copyMOB); //necc because location is cleared later, before destroy is called.\n\t\tif(M.location()!=null)\n\t\t\tM.location().delInhabitant(copyMOB); //necc because location is cleared later, before destroy is called.\n\t\tif(commands.size()<4)\n\t\t{\n\t\t\tCMLib.genEd().modifyPlayer(mob,M,-1);\n\t\t\tif(!copyMOB.sameAs(M))\n\t\t\t{\n\t\t\t\tfinal StringBuilder changed=new StringBuilder("");\n\t\t\t\tfinal String[] codes = M.getStatCodes();\n\t\t\t\tfor (int i = 0; i < codes.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (!M.getStat(codes[i]).equals(copyMOB.getStat(codes[i])))\n\t\t\t\t\t\tchanged.append(codes[i]).append(" ");\n\t\t\t\t}\n\t\t\t\tLog.sysOut("Mobs",mob.Name()+" modified player "+M.Name()+": "+changed.toString()+".");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinal String command=commands.get(3).toUpperCase();\n\t\t\tfinal String restStr=CMParms.combine(commands,4);\n\t\t\tif(command.equalsIgnoreCase("PROFICIENCIES")||command.equalsIgnoreCase("PROFICIENCY"))\n\t\t\t{\n\t\t\t\tfinal int prof=CMath.s_int(restStr);\n\t\t\t\tfor(int a=0;a<M.numAbilities();a++)\n\t\t\t\t\tM.fetchAbility(a).setProficiency(prof);\n\t\t\t\tfor(int a=0;a<M.numEffects();a++)\n\t\t\t\t{\n\t\t\t\t\tfinal Ability A=M.fetchEffect(a);\n\t\t\t\t\tif((A!=null)&&(A.isNowAnAutoEffect()))\n\t\t\t\t\t\tA.setProficiency(prof);\n\t\t\t\t}\n\t\t\t\tmob.tell(L("All of @x1\'s skill proficiencies set to @x2",M.Name(),""+prof));\n\t\t\t\tLog.sysOut("Mobs",mob.Name()+" modified player "+M.Name()+" skill proficiencies.");\n\t\t\t}\n\t\t\telse\n\t\t\tif(command.toUpperCase().startsWith("PROFICIENCY(")&&command.endsWith(")"))\n\t\t\t{\n\t\t\t\tfinal int prof=CMath.s_int(restStr);\n\t\t\t\tfinal String ableName=command.substring(12,command.length()-1).trim();\n\t\t\t\tfinal Ability A=M.findAbility(ableName);\n\t\t\t\tif(A==null)\n\t\t\t\t{\n\t\t\t\t\tmob.tell(L("...but failed to specify an valid ability name.  Try one of: @x1",CMParms.toCMObjectListString(M.abilities())));\n\t\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tA.setProficiency(prof);\n\t\t\t\tfinal Ability eA=M.fetchEffect(A.ID());\n\t\t\t\tif((eA!=null)&&(eA.isNowAnAutoEffect()))\n\t\t\t\t\teA.setProficiency(prof);\n\t\t\t\tmob.tell(L("@x1\'s skill proficiency in @x2 set to @x3",M.Name(),A.ID(),""+prof));\n\t\t\t\tLog.sysOut("Mobs",mob.Name()+" modified player "+M.Name()+" skill proficiency in "+A.ID()+".");\n\t\t\t}\n\t\t\telse\n\t\t\tif(CMLib.coffeeMaker().isAnyGenStat(M, command))\n\t\t\t{\n\t\t\t\tCMLib.coffeeMaker().setAnyGenStat(M,command, restStr);\n\t\t\t\tM.recoverPhyStats();\n\t\t\t\tM.recoverCharStats();\n\t\t\t\tM.recoverMaxState();\n\t\t\t\tif(!copyMOB.sameAs(M))\n\t\t\t\t\tLog.sysOut("Mobs",mob.Name()+" modified player "+M.Name()+".");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfinal STreeSet<String> set=new STreeSet<String>();\n\t\t\t\tset.addAll(CMLib.coffeeMaker().getAllGenStats(M));\n\t\t\t\tset.add("PROFICIENCIES");\n\t\t\t\tset.add("PROFICIENCY(ABILITY_ID)");\n\t\t\t\tmob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(set)));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t}\n\t\t\tCMLib.database().DBUpdatePlayer(M);\n\t\t\tif(CMLib.flags().isInTheGame(M,true))\n\t\t\t\tCMLib.database().DBUpdateFollowers(M);\n\t\t}\n\t\tcopyMOB.setSession(null); // prevents logoffs.\n\t\tcopyMOB.setLocation(null);\n\t\tcopyMOB.destroy();\n\t}\n\n\tpublic boolean achievements(final MOB mob, final List<String> commands)\n\t{\n\t\tfinal boolean accountSys = CMProps.isUsingAccountSystem();\n\t\tif(commands.size()<((accountSys)?4:3))\n\t\t{\n\t\t\tif(accountSys)\n\t\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY ACHIEVEMENT (PLAYER/ACCOUNT/ALL) [TATTOO]\\n\\r"));\n\t\t\telse\n\t\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY ACHIEVEMENT [TATTOO]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\n\t\tfinal String agentStr=accountSys?commands.get(2).toString():"PLAYER";\n\t\tfinal AccountStats.Agent agent=(AccountStats.Agent)CMath.s_valueOf(AccountStats.Agent.class, agentStr.toUpperCase().trim());\n\t\tif(agent == null)\n\t\t{\n\t\t\tmob.tell(L("\'@x1\' is an unknown achievement type.  Try @x2!",agentStr,CMParms.toListString(AccountStats.Agent.values())));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tfinal String tattoo=CMParms.combine(commands,((accountSys)?3:2));\n\t\tfinal Achievement A=CMLib.achievements().getAchievement(tattoo);\n\t\tif(A==null)\n\t\t{\n\t\t\tmob.tell(L("An achievement with the TATTOO/ID \'@x1\' does not exist!",tattoo));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(CMLib.achievements().addModifyAchievement(mob, agent, A.getTattoo(), A))\n\t\t\tmob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The vanity of the world just changed!"));\n\t\treturn true;\n\t}\n\n\tpublic boolean helps(final MOB mob, final List<String> commands)\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY HELP [KEY]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tfinal boolean preferAHelp = commands.get(1).toUpperCase().startsWith("A");\n\t\tfinal String helpStr=CMParms.combine(commands,2).toUpperCase().trim().replace(\' \',\'_\');\n\t\tfinal List<Properties> ps;\n\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.AHELP))\n\t\t\tps = new XVector<Properties>(CMLib.help().getHelpFile());\n\t\telse\n\t\tif(preferAHelp)\n\t\t\tps = new XVector<Properties>(CMLib.help().getArcHelpFile(), CMLib.help().getHelpFile());\n\t\telse\n\t\t\tps = new XVector<Properties>(CMLib.help().getHelpFile(), CMLib.help().getArcHelpFile());\n\t\tPair<String, String> match=null;\n\t\tfor(final Properties p : ps)\n\t\t{\n\t\t\tmatch = CMLib.help().getHelpMatch(helpStr,p,mob, 0);\n\t\t\tif((match!=null)&&(match.second!=null))\n\t\t\t\tbreak;\n\t\t}\n\t\tif((match==null)||(match.second==null))\n\t\t{\n\t\t\tmob.tell(L("An help entry with key \'@x1\' does not exist!",helpStr));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tfinal HelpSection section = preferAHelp?HelpSection.ArchonFirst:HelpSection.NormalFirst;\n\t\tfinal String fileName = CMLib.help().findHelpFile(match.first, section, true);\n\t\tif(fileName == null)\n\t\t{\n\t\t\tmob.tell(L("A help file with key \'@x1\' does not exist!",match.first));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\tif(!CMLib.help().addModifyHelpEntry(mob, fileName, match.first, false))\n\t\t{\n\t\t\tmob.tell(L("A help file with key \'@x1\' could not be edited!",match.first));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn false;\n\t\t}\n\t\t//mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("The vanity of the world just changed!"));\n\t\treturn true;\n\t}\n\n\tpublic void manufacturer(final MOB mob, final List<String> commands) throws IOException\n\t{\n\t\tif(commands.size()<3)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY MANUFACTURER [NAME]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\n\t\tfinal String manufacturerID=CMParms.combine(commands,2);\n\n\t\tfinal Manufacturer manufacturer=CMLib.tech().getManufacturer(manufacturerID);\n\t\tif((manufacturer==null)||(manufacturer==CMLib.tech().getDefaultManufacturer()))\n\t\t{\n\t\t\tmob.tell(L("There\'s no manufacturer called \'@x1\' Try LIST MANUFACTURERS.\\n\\r",manufacturerID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\treturn;\n\t\t}\n\n\t\tCMLib.genEd().modifyManufacturer(mob, manufacturer, -1);\n\t\tCMLib.tech().updateManufacturer(manufacturer);\n\t\tmob.location().recoverRoomStats();\n\t\tLog.sysOut(mob.Name()+" modified manufacturer "+manufacturer.name()+".");\n\t}\n\n\tpublic void mobs(final MOB mob, final List<String> commands)\n\t\tthrows IOException\n\t{\n\n\t\tif(commands.size()<4)\n\t\t{\n\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY MOB [MOB NAME] [LEVEL, ABILITY, REJUV, MISC, ?] [NUMBER, TEXT]\\n\\r"));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\treturn;\n\t\t}\n\n\t\tfinal String mobID=(commands.get(2));\n\t\tfinal String command=commands.get(3).toUpperCase();\n\t\tString restStr="";\n\t\tif(commands.size()>4)\n\t\t\trestStr=CMParms.combine(commands,4);\n\n\t\tfinal MOB modMOB=mob.location().fetchInhabitant(mobID);\n\t\tif(modMOB==null)\n\t\t{\n\t\t\tmob.tell(L("I don\'t see \'@x1 here.\\n\\r",mobID));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a powerful spell."));\n\t\t\treturn;\n\t\t}\n\n\t\tif(!modMOB.isMonster())\n\t\t{\n\t\t\tmob.tell(L("@x1 is a player! Try MODIFY USER!",modMOB.Name()));\n\t\t\treturn;\n\t\t}\n\t\tfinal MOB copyMOB=(MOB)modMOB.copyOf();\n\t\tmob.location().showOthers(mob,modMOB,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));\n\t\tif(command.equals("LEVEL"))\n\t\t{\n\t\t\tfinal int newLevel=CMath.s_int(restStr);\n\t\t\tif(newLevel>=0)\n\t\t\t{\n\t\t\t\tmodMOB.basePhyStats().setLevel(newLevel);\n\t\t\t\tmodMOB.recoverCharStats();\n\t\t\t\tmodMOB.recoverPhyStats();\n\t\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shakes under the transforming power.",modMOB.name()));\n\t\t\t}\n\t\t}\n\t\telse\n\t\tif(command.equals("ABILITY"))\n\t\t{\n\t\t\tfinal int newAbility=CMath.s_int(restStr);\n\t\t\tmodMOB.basePhyStats().setAbility(newAbility);\n\t\t\tmodMOB.recoverPhyStats();\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shakes under the transforming power.",modMOB.name()));\n\t\t}\n\t\telse\n\t\tif(command.equals("REJUV"))\n\t\t{\n\t\t\tfinal int newRejuv=CMath.s_int(restStr);\n\t\t\tif(newRejuv>0)\n\t\t\t{\n\t\t\t\tmodMOB.basePhyStats().setRejuv(newRejuv);\n\t\t\t\tmodMOB.recoverPhyStats();\n\t\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shakes under the transforming power.",modMOB.name()));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmodMOB.basePhyStats().setRejuv(PhyStats.NO_REJUV);\n\t\t\t\tmodMOB.recoverPhyStats();\n\t\t\t\tmob.tell(L("@x1 will now never rejuvenate.",modMOB.name()));\n\t\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shakes under the transforming power.",modMOB.name()));\n\t\t\t}\n\t\t}\n\t\telse\n\t\tif(command.equals("MISC"))\n\t\t{\n\t\t\tif(modMOB.isGeneric())\n\t\t\t\tCMLib.genEd().genMiscSet(mob,modMOB,-1);\n\t\t\telse\n\t\t\t\tmodMOB.setMiscText(restStr);\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shakes under the transforming power.",modMOB.name()));\n\t\t}\n\t\telse\n\t\tif(CMLib.coffeeMaker().isAnyGenStat(modMOB, command))\n\t\t{\n\t\t\tCMLib.coffeeMaker().setAnyGenStat(modMOB,command, restStr);\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("@x1 shake(s) under the transforming power.",modMOB.name()));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinal STreeSet<String> set=new STreeSet<String>();\n\t\t\tset.addAll(CMParms.parseCommas("LEVEL,ABILITY,REJUV,MISC",true));\n\t\t\tset.addAll(CMLib.coffeeMaker().getAllGenStats(modMOB));\n\t\t\tmob.tell(L("...but failed to specify an aspect.  Try one of: @x1",CMParms.toListString(set)));\n\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t}\n\t\tif(!modMOB.sameAs(copyMOB))\n\t\t\tLog.sysOut("Mobs",mob.Name()+" modified mob "+modMOB.Name()+".");\n\t\tcopyMOB.destroy();\n\t}\n\n\tpublic boolean errorOut(final MOB mob)\n\t{\n\t\tmob.tell(L("You are not allowed to do that here."));\n\t\treturn false;\n\t}\n\n\tprotected String listOfThings()\n\t{\n\t\treturn "ITEM, RACE, CLASS, ABILITY, LANGUAGE, CRAFTSKILL, GATHERSKILL, WRIGHTSKILL, "\n\t\t\t+ "ALLQUALIFY, AREA, EXIT, COMPONENT, RECIPE, EXPERTISE, QUEST, "\n\t\t\t+ "MOB, USER, HOLIDAY, ACHIEVEMENT, MANUFACTURER, HELP/AHELP, TRAP, CRON, "\n\t\t\t+ "GOVERNMENT, JSCRIPT, FACTION, SOCIAL, CLAN, POLL, NEWS, DAY, MONTH, YEAR, "\n\t\t\t+ "TIME, HOUR, UPDATE:, or ROOM";\n\t}\n\n\t@Override\n\tpublic boolean execute(final MOB mob, List<String> commands, final int metaFlags)\n\t\tthrows java.io.IOException\n\t{\n\t\tString commandType="";\n\t\tif(commands.size()>1)\n\t\t\tcommandType=commands.get(1).toUpperCase();\n\t\tif(commands.size()==1)\n\t\t{\n\t\t\tmob.tell(L("\\n\\rModify what? Try an "+listOfThings()+"."));\n\t\t}\n\t\tif(commandType.equals("ITEM"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDITEMS))\n\t\t\t\treturn errorOut(mob);\n\t\t\titems(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("MANUFACTURER"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDITEMS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tmanufacturer(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("CRON"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDCRON))\n\t\t\t\treturn errorOut(mob);\n\t\t\tcron(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("RECIPE"))\n\t\t{\n\t\t\t//mob.tell(L("Not yet implemented")); if(true) return true;\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDRECIPES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tif(commands.size()<3)\n\t\t\t{\n\t\t\t\tmob.tell(L("Modify which recipe?  Name a common skill ID -- use list abilities to find one."));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfinal String name=CMParms.combine(commands,2);\n\t\t\tfinal Ability A=CMClass.findAbility(name,Ability.ACODE_COMMON_SKILL,-1,false);\n\t\t\tif(A==null)\n\t\t\t{\n\t\t\t\tmob.tell(L("\'@x1\' is not a valid skill id.",name));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(!(A instanceof RecipeDriven))\n\t\t\t{\n\t\t\t\tmob.tell(L("\'@x1\' is not a valid recipe skill.",A.ID()));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfinal RecipeDriven iA = (RecipeDriven)A;\n\t\t\tif((iA.getRecipeFormat()==null)\n\t\t\t||(iA.getRecipeFormat().length()==0)\n\t\t\t||(iA.getRecipeFilename()==null)\n\t\t\t||(iA.getRecipeFilename().length()==0))\n\t\t\t{\n\t\t\t\tmob.tell(L("\'@x1\' does not have modifiable recipes.",A.ID()));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tCMLib.ableParms().modifyRecipesList(mob,iA.getRecipeFilename(),iA.getRecipeFormat());\n\t\t}\n\t\telse\n\t\tif(commandType.equals("ROOM"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDROOMS))\n\t\t\t\treturn errorOut(mob);\n\t\t\trooms(mob,commands);\n\t\t}\n\t\telse\n\t\tif((commandType.equals("ACCOUNT"))&&(CMProps.isUsingAccountSystem()))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDPLAYERS))\n\t\t\t\treturn errorOut(mob);\n\t\t\taccounts(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("RACE"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDRACES))\n\t\t\t\treturn errorOut(mob);\n\t\t\traces(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("CLASS"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDCLASSES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tclasses(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("ABILITY"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tabilities(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("TRAP"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))\n\t\t\t\treturn errorOut(mob);\n\t\t\ttraps(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("LANGUAGE"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tlanguages(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("CRAFTSKILL"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tcraftSkills(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("WRIGHTSKILL"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))\n\t\t\t\treturn errorOut(mob);\n\t\t\twrightSkills(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("GATHERSKILL"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tgatherSkills(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("ALLQUALIFY"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDABILITIES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tallQualify(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("AREA"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDAREAS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tif((commands.size()>2)\n\t\t\t&&(commands.get(2).equalsIgnoreCase("UPDATE:"))\n\t\t\t&&(CMSecurity.isAllowedEverywhere(mob, CMSecurity.SecFlag.CMDAREAS)))\n\t\t\t{\n\t\t\t\tcommands.remove(1);\n\t\t\t\tcommands.remove(0);\n\t\t\t\tdoMql(mob, true, commands);\n\t\t\t}\n\t\t\telse\n\t\t\t\tareas(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("EXIT"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDEXITS))\n\t\t\t\treturn errorOut(mob);\n\t\t\texits(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("COMPONENT"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.COMPONENTS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tcomponents(mob,commands);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\tif(commandType.equals("PLANE"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.PLANES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tplane(mob,commands);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\tif(commandType.equals("EXPERTISE"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.EXPERTISES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tmob.tell(L("You can\'t modify components, you can only LIST, CREATE, and DESTROY them."));\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\tif(commandType.equals("HELP")||commandType.equals("AHELP"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDHELP))\n\t\t\t\treturn errorOut(mob);\n\t\t\thelps(mob, commands);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\tif(commandType.equals("TITLE"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.TITLES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tmob.tell(L("You can\'t modify titles, you can only LIST, CREATE, and DESTROY them."));\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\tif(commandType.equals("AWARD"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.AUTOAWARDS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tmob.tell(L("You can\'t modify auto-awards, you can only LIST, CREATE, and DESTROY them."));\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\tif(commandType.equals("ACHIEVEMENT"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.ACHIEVEMENTS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tachievements(mob,commands);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\tif(commandType.equals("SOCIAL"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDSOCIALS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tsocials(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("MOB"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDMOBS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tmobs(mob,commands);\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("The space-time continuum shake(s) under the transforming power."));\n\t\t}\n\t\telse\n\t\tif(commandType.equals("DAY"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.TICKTOCK))\n\t\t\t\treturn errorOut(mob);\n\t\t\tif(commands.size()<3)\n\t\t\t{\n\t\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY DAY [INT]\\n\\r"));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell."));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tmob.location().getArea().getTimeObj().setDayOfMonth(CMath.s_int(commands.get(2)));\n\t\t\tmob.location().getArea().getTimeObj().save();\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("The space-time continuum shake(s) under the transforming power."));\n\t\t}\n\t\telse\n\t\tif(commandType.equals("MONTH"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.TICKTOCK))\n\t\t\t\treturn errorOut(mob);\n\t\t\tif(commands.size()<3)\n\t\t\t{\n\t\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY MONTH [INT]\\n\\r"));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell."));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tmob.location().getArea().getTimeObj().setMonth(CMath.s_int(commands.get(2)));\n\t\t\tmob.location().getArea().getTimeObj().save();\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("The space-time continuum shake(s) under the transforming power."));\n\t\t}\n\t\telse\n\t\tif(commandType.equals("YEAR"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.TICKTOCK))\n\t\t\t\treturn errorOut(mob);\n\t\t\tif(commands.size()<3)\n\t\t\t{\n\t\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY YEAR [INT]\\n\\r"));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell."));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tmob.location().getArea().getTimeObj().setYear(CMath.s_int(commands.get(2)));\n\t\t\tmob.location().getArea().getTimeObj().save();\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("The space-time continuum shake(s) under the transforming power."));\n\t\t}\n\t\telse\n\t\tif((commandType.equals("TIME"))||(commandType.equals("HOUR")))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.TICKTOCK))\n\t\t\t\treturn errorOut(mob);\n\t\t\tif(commands.size()<3)\n\t\t\t{\n\t\t\t\tmob.tell(L("You have failed to specify the proper fields.\\n\\rThe format is MODIFY TIME [INT]\\n\\r"));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell."));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfinal TimeClock C=mob.location().getArea().getTimeObj();\n\t\t\tfinal TimeClock.TimeOfDay oldTOD=C.getTODCode();\n\t\t\tC.setHourOfDay(CMath.s_int(commands.get(2)));\n\t\t\tif(oldTOD!=C.getTODCode())\n\t\t\t\tC.handleTimeChange();\n\t\t\tC.save();\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("The space-time continuum shake(s) under the transforming power."));\n\t\t}\n\t\telse\n\t\tif(commandType.startsWith("JSCRIPT"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.JSCRIPTS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tif(CMProps.getIntVar(CMProps.Int.JSCRIPTS)!=CMSecurity.JSCRIPT_REQ_APPROVAL)\n\t\t\t{\n\t\t\t\tmob.tell(L("This command is only used when your Scriptable Javascripts require approval as specified in your coffeemud.ini file."));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tObject O=null;\n\t\t\tfinal Map<Long,String> j=CMSecurity.getApprovedJScriptTable();\n\t\t\tboolean somethingFound=false;\n\t\t\tfor(final Long L : j.keySet())\n\t\t\t{\n\t\t\t\tO=j.get(L);\n\t\t\t\tif(!CMLib.players().playerExists(O.toString()))\n\t\t\t\t{\n\t\t\t\t\tsomethingFound=true;\n\t\t\t\t\tmob.tell(L("Unapproved script:\\n\\r@x1\\n\\r",O.toString()));\n\t\t\t\t\tif((!mob.isMonster())\n\t\t\t\t\t&&(mob.session().confirm(L("Approve this script (Y/n)?"),"Y")))\n\t\t\t\t\t\tCMSecurity.approveJScript(mob.Name(),L.longValue());\n\t\t\t\t\telse\n\t\t\t\t\t\tj.remove(L);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!somethingFound)\n\t\t\t\tmob.tell(L("No Javascripts require approval at this time."));\n\t\t}\n\t\telse\n\t\tif(commandType.equals("USER")||commandType.equals("PLAYER"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDPLAYERS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tplayers(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("EXPERTISE"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.EXPERTISES))\n\t\t\t\treturn errorOut(mob);\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^S<S-NAME> wave(s) <S-HIS-HER> arms...^?"));\n\t\t\texpertises(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("POLL"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.POLLS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tfinal String name=CMParms.combine(commands,2);\n\t\t\tPoll P=null;\n\t\t\tif(CMath.isInteger(name))\n\t\t\t\tP=CMLib.polls().getPoll(CMath.s_int(name)-1);\n\t\t\telse\n\t\t\tif(name.length()>0)\n\t\t\t\tP=CMLib.polls().getPoll(name);\n\t\t\tif(P==null)\n\t\t\t{\n\t\t\t\tmob.tell(L("POLL \'@x1\' not found. Try LIST POLLS.",name));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^S<S-NAME> wave(s) <S-HIS-HER> arms around the idea of @x1.^?",P.getSubject()));\n\t\t\tCMLib.polls().modifyVote(P, mob);\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^SThe world\'s uncertainty has changed.^?"));\n\t\t\tLog.sysOut("CreateEdit",mob.Name()+" modified Poll "+P.getName()+".");\n\t\t}\n\t\telse\n\t\tif(commandType.equals("HOLIDAY"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDQUESTS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tfinal String name=CMParms.combine(commands,2);\n\t\t\tint num=-1;\n\t\t\tif(CMath.isInteger(name))\n\t\t\t\tnum=CMath.s_int(name);\n\t\t\telse\n\t\t\tif(name.length()>0)\n\t\t\t\tnum=CMLib.quests().getHolidayIndex(name);\n\t\t\tif(num<0)\n\t\t\t{\n\t\t\t\tmob.tell(L("HOLIDAY \'@x1\' not found. Try LIST HOLIDAYS.",name));\n\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^S<S-NAME> wave(s) <S-HIS-HER> arms...^?"));\n\t\t\tCMLib.quests().modifyHoliday(mob,num);\n\t\t\tLog.sysOut("CreateEdit",mob.Name()+" modified Holiday "+name+".");\n\t\t}\n\t\telse\n\t\tif(commandType.equals("NEWS"))\n\t\t{\n\t\t\tif((!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.JOURNALS))\n\t\t\t&&(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.NEWS)))\n\t\t\t\treturn errorOut(mob);\n\n\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^S<S-NAME> wave(s) <S-HIS-HER> arms...^?"));\n\t\t\tfinal Item I=CMClass.getItem("StdJournal");\n\t\t\tI.setName(L("SYSTEM_NEWS"));\n\t\t\tI.setDescription(L("Enter `LIST NEWS [NUMBER]` to read an entry.%0D%0AEnter CREATE NEWS to add new entries. "));\n\t\t\tfinal CMMsg newMsg=CMClass.getMsg(mob,I,null,\n\t\t\t\t\t\t\t\t\t\t\tCMMsg.MSG_WRITE|CMMsg.MASK_ALWAYS,null,\n\t\t\t\t\t\t\t\t\t\t\tCMMsg.MSG_WRITE|CMMsg.MASK_ALWAYS,CMParms.combine(commands,2),\n\t\t\t\t\t\t\t\t\t\t\tCMMsg.MSG_WRITE|CMMsg.MASK_ALWAYS,null);\n\t\t\tif(mob.location().okMessage(mob,newMsg)&&I.okMessage(mob, newMsg))\n\t\t\t{\n\t\t\t\tmob.location().send(mob,newMsg);\n\t\t\t\tI.executeMsg(mob,newMsg);\n\t\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("^SThe world is now more informed!^?"));\n\t\t\t}\n\t\t}\n\t\telse\n\t\tif(commandType.equals("QUEST"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDQUESTS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tquests(mob,commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("SQL"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDDATABASE))\n\t\t\t\treturn errorOut(mob);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfinal String sql=CMParms.combine(commands,2);\n\t\t\t\tif(sql.equals("ping"))\n\t\t\t\t{\n\t\t\t\t\tfinal int num=CMLib.database().pingAllConnections(1000);\n\t\t\t\t\tmob.tell(L("Pings completed=@x1.",""+num));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif(sql.toUpperCase().trim().startsWith("SELECT"))\n\t\t\t\t{\n\t\t\t\t\tmob.tell(L("SQL Query: @x1",sql));\n\t\t\t\t\tfinal List<String[]> results=CMLib.database().DBRawQuery(sql.replace(\'`\',\'\\\'\'));\n\t\t\t\t\tfinal StringBuilder buf=new StringBuilder("QueryResults\\n\\r");\n\t\t\t\t\tif(results.size()>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal String[] headerRow=results.get(0);\n\t\t\t\t\t\tfor (final String element : headerRow)\n\t\t\t\t\t\t\tbuf.append(element);\n\t\t\t\t\t\tbuf.append("\\n\\r");\n\t\t\t\t\t\tfor(int r=1;r<results.size();r++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinal String[] row=results.get(r);\n\t\t\t\t\t\t\tfor(int c=0;c<row.length;c++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(c<headerRow.length)\n\t\t\t\t\t\t\t\t\tbuf.append(CMStrings.padRight(row[c],headerRow[c].length()));\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tbuf.append(row[c]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbuf.append("\\n\\r");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(mob.session()!=null)\n\t\t\t\t\t\tmob.session().rawPrint(buf.toString());\n\t\t\t\t\tmob.tell(L("Command completed."));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmob.tell(L("SQL Statement: @x1",sql));\n\t\t\t\t\tfinal int resp=CMLib.database().DBRawExecute(sql.replace(\'`\',\'\\\'\'));\n\t\t\t\t\tmob.tell(L("Command completed. Response code: @x1",""+resp));\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(final Exception e)\n\t\t\t{\n\t\t\t\tmob.tell(L("SQL Error: @x1",e.getMessage()));\n\t\t\t}\n\t\t}\n\t\telse\n\t\tif(commandType.equals("GOVERNMENT"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDCLANS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tif(commands.size()<3)\n\t\t\t\tmob.tell(L("Modify which government?  Use list governments."));\n\t\t\telse\n\t\t\t{\n\t\t\t\tfinal String name=CMParms.combine(commands,2);\n\t\t\t\tClanGovernment G = null;\n\t\t\t\tfor(final ClanGovernment g : CMLib.clans().getStockGovernments())\n\t\t\t\t{\n\t\t\t\t\tif(g.getName().equalsIgnoreCase(name))\n\t\t\t\t\t\tG=g;\n\t\t\t\t}\n\t\t\t\tif(G==null)\n\t\t\t\t{\n\t\t\t\t\tfor(final ClanGovernment g : CMLib.clans().getStockGovernments())\n\t\t\t\t\t{\n\t\t\t\t\t\tif(g.getName().toLowerCase().startsWith(name.toLowerCase()))\n\t\t\t\t\t\t\tG=g;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(G==null)\n\t\t\t\t\tmob.tell(L("Government \'@x1\' is unknown.  Try list governments.",name));\n\t\t\t\telse\n\t\t\t\tif(!mob.isMonster())\n\t\t\t\t{\n\t\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around @x1.",G.getName()));\n\t\t\t\t\tCMLib.genEd().modifyGovernment(mob, G,-1);\n\t\t\t\t\tCMLib.clans().reSaveGovernmentsXML();\n\t\t\t\t\tLog.sysOut("CreateEdit",mob.Name()+" modified Clan Government "+G.getName()+".");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\tif(commandType.equals("FACTION"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDFACTIONS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tif(commands.size()<3)\n\t\t\t\tmob.tell(L("Modify which faction?  Use list factions."));\n\t\t\telse\n\t\t\t{\n\t\t\t\tfinal String name=CMParms.combine(commands,2);\n\t\t\t\tFaction F=CMLib.factions().getFaction(name);\n\t\t\t\tif(F==null)\n\t\t\t\t\tF=CMLib.factions().getFactionByName(name);\n\t\t\t\tif(F==null)\n\t\t\t\t\tmob.tell(L("Faction \'@x1\' is unknown.  Try list factions.",name));\n\t\t\t\telse\n\t\t\t\tif(!mob.isMonster())\n\t\t\t\t{\n\t\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around the idea of  @x1.",F.name()));\n\t\t\t\t\tCMLib.factions().modifyFaction(mob,F);\n\t\t\t\t\tLog.sysOut("CreateEdit",mob.Name()+" modified Faction "+F.name()+" ("+F.factionID()+").");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\tif(commandType.equals("UPDATE:"))\n\t\t{\n\t\t\tif((!CMSecurity.isASysOp(mob))&&(!CMSecurity.isAllowedEverywhere(mob, CMSecurity.SecFlag.CMDAREAS)))\n\t\t\t\treturn errorOut(mob);\n\t\t\tcommands.remove(0);\n\t\t\tdoMql(mob, false, commands);\n\t\t}\n\t\telse\n\t\tif(commandType.equals("CLAN"))\n\t\t{\n\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDCLANS))\n\t\t\t\treturn errorOut(mob);\n\t\t\tif(commands.size()<3)\n\t\t\t\tmob.tell(L("Modify which clan?  Use clanlist."));\n\t\t\telse\n\t\t\t{\n\t\t\t\tfinal String name=CMParms.combine(commands,2);\n\t\t\t\tfinal Clan C=CMLib.clans().findClan(name);\n\t\t\t\tif(C==null)\n\t\t\t\t\tmob.tell(L("Clan \'@x1\' is unknown.  Try clanlist.",name));\n\t\t\t\telse\n\t\t\t\tif(!mob.isMonster())\n\t\t\t\t{\n\t\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around @x1.",C.name()));\n\t\t\t\t\tCMLib.genEd().modifyClan(mob,C,-1);\n\t\t\t\t\tLog.sysOut("CreateEdit",mob.Name()+" modified Clan "+C.name()+".");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString allWord=CMParms.combine(commands,1);\n\t\t\tEnvironmental thang=null;\n\t\t\tMOB srchMob=mob;\n\t\t\tItem srchContainer=null;\n\t\t\tRoom srchRoom=mob.location();\n\t\t\tif(allWord.length()>0)\n\t\t\t{\n\t\t\t\tfinal int x=allWord.indexOf(\'@\');\n\t\t\t\tif(x>0)\n\t\t\t\t{\n\t\t\t\t\tfinal String rest=allWord.substring(x+1).trim();\n\t\t\t\t\tallWord=allWord.substring(0,x).trim();\n\t\t\t\t\tif(rest.equalsIgnoreCase("room"))\n\t\t\t\t\t\tsrchMob=null;\n\t\t\t\t\telse\n\t\t\t\t\tif(rest.length()>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal MOB M=srchRoom.fetchInhabitant(rest);\n\t\t\t\t\t\tif(M==null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinal Item I = srchRoom.findItem(null, rest);\n\t\t\t\t\t\t\tif(I instanceof Container)\n\t\t\t\t\t\t\t\tsrchContainer=I;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmob.tell(L("MOB or Container \'@x1\' not found.",rest));\n\t\t\t\t\t\t\t\tmob.location().showOthers(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> flub(s) a spell.."));\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsrchMob=M;\n\t\t\t\t\t\t\tsrchRoom=null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif((srchMob!=null)&&(srchRoom!=null))\n\t\t\t\tthang=srchRoom.fetchFromMOBRoomFavorsItems(srchMob,srchContainer,allWord,Wearable.FILTER_ANY);\n\t\t\telse\n\t\t\tif(srchMob!=null)\n\t\t\t\tthang=srchMob.findItem(allWord);\n\t\t\telse\n\t\t\tif(srchRoom!=null)\n\t\t\t\tthang=srchRoom.fetchFromRoomFavorItems(srchContainer,allWord);\n\t\t\tif((thang!=null)&&(thang instanceof Item))\n\t\t\t{\n\t\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDITEMS))\n\t\t\t\t\treturn errorOut(mob);\n\t\t\t\tfinal Item copyItem=(Item)thang.copyOf();\n\t\t\t\tmob.location().showOthers(mob,thang,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));\n\t\t\t\tif(!thang.isGeneric())\n\t\t\t\t{\n\t\t\t\t\tCMLib.genEd().modifyStdItem(mob,(Item)thang,-1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tCMLib.genEd().genMiscSet(mob,thang,-1);\n\t\t\t\t((Item)thang).recoverPhyStats();\n\t\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("@x1 shake(s) under the transforming power.",thang.name()));\n\t\t\t\tif(!copyItem.sameAs(thang))\n\t\t\t\t\tLog.sysOut("CreateEdit",mob.Name()+" modified item "+thang.Name()+" ("+thang.ID()+") in "+CMLib.map().getDescriptiveExtendedRoomID(mob.location())+".");\n\t\t\t\tcopyItem.destroy();\n\t\t\t}\n\t\t\telse\n\t\t\tif((thang!=null)&&(thang instanceof MOB))\n\t\t\t{\n\t\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDMOBS))\n\t\t\t\t\treturn errorOut(mob);\n\t\t\t\tif((!thang.isGeneric())&&(((MOB)thang).isMonster()))\n\t\t\t\t{\n\t\t\t\t\tfinal MOB copyMOB=(MOB)thang.copyOf();\n\t\t\t\t\tif(thang instanceof Deity)\n\t\t\t\t\t\tCMLib.map().registerWorldObjectLoaded(((Deity) thang).location().getArea(), ((Deity) thang).location(), thang);\n\t\t\t\t\tmob.location().showOthers(mob,thang,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));\n\t\t\t\t\tCMLib.genEd().modifyStdMob(mob,(MOB)thang,-1);\n\t\t\t\t\tif(!copyMOB.sameAs(thang))\n\t\t\t\t\t\tLog.sysOut("CreateEdit",mob.Name()+" modified mob "+thang.Name()+" ("+thang.ID()+") in "+CMLib.map().getDescriptiveExtendedRoomID(((MOB)thang).location())+".");\n\t\t\t\t\tcopyMOB.destroy();\n\t\t\t\t\tif(thang instanceof Deity)\n\t\t\t\t\t\tCMLib.map().registerWorldObjectLoaded(((Deity) thang).location().getArea(), ((Deity) thang).location(), thang);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif(!((MOB)thang).isMonster())\n\t\t\t\t{\n\t\t\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDPLAYERS))\n\t\t\t\t\t\treturn errorOut(mob);\n\t\t\t\t\tplayers(mob,CMParms.parse("MODIFY USER \\""+thang.Name()+"\\""));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfinal MOB copyMOB=(MOB)thang.copyOf();\n\t\t\t\t\tif(thang instanceof Deity)\n\t\t\t\t\t\tCMLib.map().registerWorldObjectLoaded(((Deity) thang).location().getArea(), ((Deity) thang).location(), thang);\n\t\t\t\t\tmob.location().showOthers(mob,thang,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));\n\t\t\t\t\tCMLib.genEd().genMiscSet(mob,thang,-1);\n\t\t\t\t\tif(!copyMOB.sameAs(thang))\n\t\t\t\t\t\tLog.sysOut("CreateEdit",mob.Name()+" modified mob "+thang.Name()+" ("+thang.ID()+") in "+CMLib.map().getDescriptiveExtendedRoomID(((MOB)thang).location())+".");\n\t\t\t\t\tcopyMOB.destroy();\n\t\t\t\t\tif(thang instanceof Deity)\n\t\t\t\t\t\tCMLib.map().registerWorldObjectLoaded(((Deity) thang).location().getArea(), ((Deity) thang).location(), thang);\n\t\t\t\t}\n\t\t\t\t((MOB)thang).recoverPhyStats();\n\t\t\t\tmob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("@x1 shake(s) under the transforming power.",thang.name()));\n\t\t\t}\n\t\t\telse\n\t\t\tif((CMLib.directions().getGoodDirectionCode(allWord)>=0)||(thang instanceof Exit))\n\t\t\t{\n\t\t\t\tif(CMLib.directions().getGoodDirectionCode(allWord)>=0)\n\t\t\t\t\tthang=mob.location().getRawExit(CMLib.directions().getGoodDirectionCode(allWord));\n\n\t\t\t\tif(thang!=null)\n\t\t\t\t{\n\t\t\t\t\tif(!CMSecurity.isAllowed(mob,mob.location(),CMSecurity.SecFlag.CMDEXITS))\n\t\t\t\t\t\treturn errorOut(mob);\n\t\t\t\t\tmob.location().showOthers(mob,thang,CMMsg.MSG_OK_ACTION,L("<S-NAME> wave(s) <S-HIS-HER> hands around <T-NAMESELF>."));\n\t\t\t\t\tfinal Exit copyExit=(Exit)thang.copyOf();\n\t\t\t\t\tint showFlag=-1;\n\t\t\t\t\tif(CMProps.getIntVar(CMProps.Int.EDITORTYPE)>0)\n\t\t\t\t\t\tshowFlag=-999;\n\t\t\t\t\tCMLib.genEd().genMiscText(mob,thang,0,showFlag);\n\t\t\t\t\tupdateChangedExit(mob, mob.location(), (Exit)thang, copyExit);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcommands.add(1,"EXIT");\n\t\t\t\t\texecute(mob,commands,metaFlags);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\tif(CMLib.socials().fetchSocial(allWord,true)!=null)\n\t\t\t{\n\t\t\t\tcommands.add(1,"SOCIAL");\n\t\t\t\texecute(mob,commands,metaFlags);\n\t\t\t}\n\t\t\telse\n\t\t\tif((thang=CMLib.space().findSpaceObject(allWord,true))!=null)\n\t\t\t{\n\t\t\t\tcommands=new Vector<String>();\n\t\t\t\tcommands.add("MODIFY");\n\t\t\t\tif(thang instanceof Area)\n\t\t\t\t\tcommands.add("AREA");\n\t\t\t\telse\n\t\t\t\tif(thang instanceof Item)\n\t\t\t\t\tcommands.add("ITEM");\n\t\t\t\tcommands.add(allWord);\n\t\t\t\texecute(mob,commands,metaFlags);\n\t\t\t}\n\t\t\telse\n\t\t\tif((thang=CMLib.map().findArea(allWord))!=null)\n\t\t\t{\n\t\t\t\tcommands=new Vector<String>();\n\t\t\t\tcommands.add("MODIFY");\n\t\t\t\tcommands.add("AREA");\n\t\t\t\tcommands.add(allWord);\n\t\t\t\texecute(mob,commands,metaFlags);\n\t\t\t}\n\t\t\telse\n\t\t\tif((thang=CMLib.space().findSpaceObject(allWord,false))!=null)\n\t\t\t{\n\t\t\t\tif(thang instanceof Area)\n\t\t\t\t\tcommands.add(1,"AREA");\n\t\t\t\telse\n\t\t\t\tif(thang instanceof Item)\n\t\t\t\t\tcommands.add(1,"ITEM");\n\t\t\t\texecute(mob,commands,metaFlags);\n\t\t\t}\n\t\t\telse\n\t\t\tif(allWord.indexOf(\'@\')>=0)\n\t\t\t{\n\t\t\t\tcommands.add(1,"ITEM");\n\t\t\t\texecute(mob,commands,metaFlags);\n\t\t\t}\n\t\t\telse\n\t\t\t\tmob.tell(L("\\n\\rYou cannot modify a \'@x1\'. However, you might try an "+listOfThings()+".",allWord));\n\t\t}\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic Object executeInternal(final MOB mob, final int metaFlags, final Object... args) throws java.io.IOException\n\t{\n\t\tif(!super.checkArguments(internalParameters, args))\n\t\t\treturn Boolean.FALSE;\n\t\tfinal Object O = args[0];\n\t\tif(O instanceof Environmental)\n\t\t{\n\t\t\tCMLib.genEd().genMiscSet(mob,(Environmental)O,-1);\n\t\t\tif(O instanceof Physical)\n\t\t\t\t((Physical)O).recoverPhyStats();\n\t\t\t((Environmental)O).text();\n\t\t\treturn Boolean.TRUE;\n\t\t}\n\t\treturn Boolean.FALSE;\n\t}\n\n\t@Override\n\tpublic boolean canBeOrdered()\n\t{\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic boolean securityCheck(final MOB mob)\n\t{\n\t\treturn CMSecurity.isAllowedContainsAny(mob, mob.location(), CMSecurity.SECURITY_CMD_GROUP);\n\t}\n\n}\n', 'message': '\n\ngit-svn-id: svn://192.168.1.10/public/CoffeeMud@9514 0d6f1817-ed0e-0410-87c9-987e46238f29\n', 'author_name': 'bozimmerman', 'lang': 'java'}