@Override
	public boolean fillOutWarrant(MOB criminalM,
								  Law laws,
								  Area myArea,
								  Environmental victimM,
								  String crimeLocs,
								  String crimeFlags,
								  String crime,
								  String sentence,
								  String warnMsg)
	{
		if(criminalM.amDead())
		{
			if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST)) 
				Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+" * IS DEAD!");
			return false;
		}
		if(criminalM.location()==null)
		{
			if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST)) 
				Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Accused is not here.");
			return false;
		}
		if((myArea!=null)&&(!myArea.inMyMetroArea(criminalM.location().getArea())))
		{
			if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST)) 
				Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Accused is not in the area.");
			return false;
		}

		if(isAnyKindOfOfficer(laws,criminalM)
		||(isTheJudge(laws,criminalM))
		||CMSecurity.isAllowed(criminalM,criminalM.location(),CMSecurity.SecFlag.ABOVELAW))
		{
			if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST)) 
				Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Accused is an officer ("+isAnyKindOfOfficer(laws,criminalM)+"), judge ("+isTheJudge(laws,criminalM)+"), or above the law ("+CMSecurity.isAllowed(criminalM,criminalM.location(),CMSecurity.SecFlag.ABOVELAW)+").");
			return false;
		}

		// is there a witness
		final MOB witness=getWitness(myArea,criminalM);
		boolean requiresWitness=true;

		// is there a victim (if necessary)
		MOB victim=null;
		if((victimM!=null)&&(victimM instanceof MOB))
			victim=(MOB)victimM;
		if(criminalM==victim)
		{
			if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST)) 
				Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Accused and victim are the same.");
			return false;
		}

		// any special circumstances?
		if(crimeFlags.trim().length()>0)
		{
			final Vector<String> V=CMParms.parse(crimeFlags.toUpperCase());
			for(int v=0;v<V.size();v++)
			{
				final String str=V.elementAt(v);
				if(str.endsWith("WITNESS")&&(str.length()<9))
				{
					if(str.startsWith("!"))
						requiresWitness=false;
					else
					if((witness!=null)&&(witness.location()!=criminalM.location()))
					{
						if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
							Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Witness required, but not present.");
						return false;
					}
				}
				else
				if(str.endsWith("COMBAT")&&(str.length()<8))
				{
					if(criminalM.isInCombat())
					{
						if(str.startsWith("!"))
						{
							if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
								Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* In combat, but shouldn't be!");
							return false;
						}
					}
					else
					{
						if(!str.startsWith("!"))
						{
							if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
								Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Not in combat, but should be!");
							return false;
						}
					}
				}
				else
				if(str.endsWith("RECENTLY")&&(str.length()<10))
				{
					final LegalWarrant W=laws.getOldWarrant(criminalM,crime,false);
					final long thisTime=System.currentTimeMillis();
					if((W!=null)&&((thisTime-W.lastOffense())<600000))
					{
						if(str.startsWith("!"))
						{
							if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
								Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Not recently, but is!");
							return false;
						}
					}
					else
					{
						if(!str.startsWith("!"))
						{
							if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
								Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Recently required, but it isn't!");
							return false;
						}
					}
				}
			}
		}
		if((requiresWitness)&&(witness==null))
		{
			if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
				Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Witness required, and none present: .");
			return false;
		}

		// is the location significant to this crime?
		if(crimeLocs.trim().length()>0)
		{
			boolean aCrime=false;
			final Vector<String> V=CMParms.parse(crimeLocs);
			final String display=criminalM.location().displayText().toUpperCase().trim();
			for(int v=0;v<V.size();v++)
			{
				final String str=V.elementAt(v).toUpperCase();
				if(str.endsWith("INDOORS")&&(str.length()<9))
				{
					if((criminalM.location().domainType()&Room.INDOORS)>0)
					{
						if(str.startsWith("!"))
						{
							if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
								Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Shouldn't be indoors, but is!");
							return false;
						}
					}
					else
					{
						if(!str.startsWith("!"))
						{
							if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
								Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Should be indoors, but isn't!");
							return false;
						}
					}
					aCrime=true;
				}
				else
				if(str.endsWith("HOME")&&(str.length()<6))
				{
					if(CMLib.law().doesHavePriviledgesHere(criminalM,criminalM.location()))
					{
						if(str.startsWith("!"))
						{
							if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
								Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Should not be home, but is!");
							return false;
						}
					}
					if(!str.startsWith("!"))
					{
						if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
							Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Should be home, but is not!");
						return false;
					}
					aCrime=true;
				}
				else
				if(str.startsWith("!")&&(CMLib.english().containsString(display,str.substring(1))))
				{
					if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
						Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Should not be at '"+str.substring(1)+"', but is!");
					return false;
				}
				else
				if(CMLib.english().containsString(display,str))
				{
					aCrime = true;
					break;
				}
			}
			if(!aCrime)
			{
				if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
					Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Crime flag failure!");
				return false;
			}
		}

		// is the victim a protected race?
		if((victim!=null)&&(!(victim instanceof Deity)))
		{
			if(!CMLib.masking().maskCheck(laws.getMessage(Law.MSG_PROTECTEDMASK),victim,false))
			{
				if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
					Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Victim is not a protected race!");
				return false;
			}
		}

		// does a warrant already exist?
		LegalWarrant W=null;
		for(int i=0;(W=laws.getWarrant(criminalM,i))!=null;i++)
		{
			if((W.criminal()==criminalM)
			&&(W.victim()==victim)
			&&(W.crime().equals(crime)))
			{
				if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
					Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Warrant already exists.");
				return false;
			}
		}
		W=laws.getOldWarrant(criminalM,crime,true);
		if(W==null)
			W=(LegalWarrant)CMClass.getCommon("DefaultArrestWarrant");

		// fill out the warrant!
		W.setCriminal(criminalM);
		W.setVictim(victim);
		W.setCrime(crime);
		W.setState(Law.STATE_SEEKING);
		W.setWitness(requiresWitness?witness:null);
		W.setLastOffense(System.currentTimeMillis());
		W.setWarnMsg(warnMsg);
		sentence=sentence.trim();
		final Vector<String> sentences=CMParms.parse(sentence);
		W.setPunishment(0);
		for(int v=0;v<sentences.size();v++)
		{
			String s=sentences.elementAt(v);
			final int x=s.indexOf('=');
			String parm=null;
			if(x>0)
			{
				parm=s.substring(x+1);
				s=s.substring(0,x+1);
			}
			boolean actionCodeSet=false;
			for(int i=0;i<Law.PUNISHMENT_DESCS.length;i++)
			{
				if(s.equalsIgnoreCase(Law.PUNISHMENT_DESCS[i]))
				{
					actionCodeSet=true;
					W.setPunishment(W.punishment());
					if(parm!=null)
						W.addPunishmentParm(i,parm);
				}
			}
			for(int i=0;i<Law.PUNISHMENTMASK_DESCS.length;i++)
			{
				if(s.equalsIgnoreCase(Law.PUNISHMENTMASK_DESCS[i]))
				{
					actionCodeSet=true;
					W.setPunishment(W.punishment()|Law.PUNISHMENTMASK_CODES[i]);
					if(parm!=null)
						W.addPunishmentParm(Law.PUNISHMENTMASK_CODES[i],parm);
				}
			}
			if(!actionCodeSet)
			{
				Log.errOut("Arrest","Unknown sentence: "+s+" for crime "+crime);
				return false;
			}
		}

		if((W.victim()!=null)&&(isTroubleMaker(W.victim()))&&(!CMath.bset(W.punishment(),Law.PUNISHMENTMASK_SEPARATE)))
			W.setPunishment((W.punishment()&Law.PUNISHMENT_MASK)/2);

		if((isStillACrime(W,CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST)))
		&&((W.witness()==null)||CMLib.flags().canBeSeenBy(W.criminal(),W.witness())))
		{
			if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
				Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Warrant filled out.");
			if(!addWarrant(laws,W))
				return false;
		}
		else
		if(CMSecurity.isDebugging(CMSecurity.DbgFlag.ARREST))
			Log.debugOut("ARREST","("+lastAreaName+"): "+criminalM.name()+", data: "+crimeLocs+"->"+crimeFlags+"->"+crime+"->"+sentence+"* Warrant fails the is a crime check.");
		return true;
	}