private static void dumpDynamicNpcs(RT6CacheSystem system) {
		NpcDefinitionLoader loader = system.npcLoader;
		ScriptLoader scriptLoader = system.scriptLoader;
		PrintWriter writer = null;
		try {
			writer = new PrintWriter(new File("dynamic_npcs.java"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		}
		for (int id = 0; id < 0x20000; id++) {
			if (loader.canLoad(id)) {
				final NpcDefinition definition = loader.load(id);
				if (definition.childrenIds != null) {
					writer.println(definition);
					int mask = definition.childrenIds.length;
					if (definition.configId != -1) {
						writer.println("switch (ctx.varpbits.varpbit(" + definition.configId + ")) {");
					} else {
						final Script script = scriptLoader.load(definition.scriptId);
						mask = script.mask();
						writer.println("switch (" + script.code() + ") {");
					}
					int[] childrenIds = definition.childrenIds;
					for (int i = 0; i < childrenIds.length; i++) {
						if (i > mask) {
							break;
						}

						int childrenId = childrenIds[i];
						final NpcDefinition childDefinition = loader.canLoad(childrenId) ? loader.load(childrenId) : null;
						writer.print("\tcase " + i + ": \t " + childrenId + " " + (childDefinition == null ? "null" : childDefinition));
						//writer.print("\tcase " + i + ": \t " + childrenId + " " + (childDefinition == null ? "null" : "\"" + childDefinition.name + "\" \"" + joiner.join(childDefinition.actions) + "\""));

						writer.println();
					}

					writer.println("}");
					writer.println();
				}
			}
		}
		writer.close();
	}