@Override
	public void setVar(String baseName, String key, String val)
	{
		final DVector V=getScriptVarSet(baseName,key);
		for(int v=0;v<V.size();v++)
		{
			final String name=(String)V.elementAt(v,1);
			key=((String)V.elementAt(v,2)).toUpperCase();
			Hashtable<String,String> H=(Hashtable)resources._getResource("SCRIPTVAR-"+name);
			if((H==null)&&(defaultQuestName!=null)&&(defaultQuestName.length()>0))
			{
				final MOB M=CMLib.players().getPlayer(name);
				if(M!=null)
				{
					for(final Enumeration<ScriptingEngine> e=M.scripts();e.hasMoreElements();)
					{
						final ScriptingEngine SE=e.nextElement();
						if((SE!=null)
						&&(SE!=this)
						&&(defaultQuestName.equalsIgnoreCase(SE.defaultQuestName()))
						&&(SE.isVar(name,key)))
						{
							SE.setVar(name,key,val);
							return;
						}
					}
				}
			}
			if(H==null)
			{
				if(val.length()==0)
					continue;

				H=new Hashtable<String,String>();
				resources._submitResource("SCRIPTVAR-"+name,H);
			}
			if(val.equals("++"))
			{
				String num=H.get(key);
				if(num==null)
					num="0";
				val=Integer.toString(CMath.s_int(num.trim())+1);
			}
			else
			if(val.equals("--"))
			{
				String num=H.get(key);
				if(num==null)
					num="0";
				val=Integer.toString(CMath.s_int(num.trim())-1);
			}
			else
			if(val.startsWith("+"))
			{
				// add via +number form
				val=val.substring(1);
				final int amount=CMath.s_int(val.trim());
				String num=H.get(key);
				if(num==null)
					num="0";
				val=Integer.toString(CMath.s_int(num.trim())+amount);
			}
			else
			if(val.startsWith("-"))
			{
				// subtract -number form
				val=val.substring(1);
				final int amount=CMath.s_int(val.trim());
				String num=H.get(key);
				if(num==null)
					num="0";
				val=Integer.toString(CMath.s_int(num.trim())-amount);
			}
			else
			if(val.startsWith("*"))
			{
				// multiply via *number form
				val=val.substring(1);
				final int amount=CMath.s_int(val.trim());
				String num=H.get(key);
				if(num==null)
					num="0";
				val=Integer.toString(CMath.s_int(num.trim())*amount);
			}
			else
			if(val.startsWith("/"))
			{
				// divide /number form
				val=val.substring(1);
				final int amount=CMath.s_int(val.trim());
				String num=H.get(key);
				if(num==null)
					num="0";
				if(amount==0)
					Log.errOut("Scripting","Scripting SetVar error: Division by 0: "+name+"/"+key+"="+val);
				else
					val=Integer.toString(CMath.s_int(num.trim())/amount);
			}
			if(H.containsKey(key))
				H.remove(key);
			if(val.trim().length()>0)
				H.put(key,val);
			if(H.size()==0)
				resources._removeResource("SCRIPTVAR-"+name);
		}
	}