// Check the type of script.. it must be an assignment-type container
if (arg.asType(dScript.class) != null
&& arg.asType(dScript.class).getType().equalsIgnoreCase("assignment"))
scriptEntry.addObject("script", arg.asType(dScript.class));
else
throw new InvalidArgumentsException("Script specified is not an 'assignment-type' container.");
}
else arg.reportUnhandled();
}
// Check required arguments
if (!((BukkitScriptEntryData)scriptEntry.entryData).hasNPC())
throw new InvalidArgumentsException("NPC linked was missing or invalid.");
if (!scriptEntry.hasObject("action"))
throw new InvalidArgumentsException("Must specify an action!");
if (scriptEntry.getObject("action").equals(Action.SET) && !scriptEntry.hasObject("script"))
throw new InvalidArgumentsException("Script specified was missing or invalid.");
}