int npcId = Integer.parseInt(routeElement.attributeValue("npcId"));
RouteType type = RouteType.valueOf(routeElement.attributeValue("type"));
long baseDelay = Long.parseLong(routeElement.attributeValue("delay"));
boolean isRunning = Boolean.parseBoolean(routeElement.attributeValue("isRunning"));
int walkRange = Integer.parseInt(routeElement.attributeValue("walkRange"));
WalkerRouteTemplate template = new WalkerRouteTemplate(npcId, baseDelay, type, isRunning, walkRange);
for (Iterator<Element> subIterator = routeElement.elementIterator(); subIterator.hasNext();)
{
Element subElement = subIterator.next();
if (subElement.getName().equalsIgnoreCase("point"))
{
int x = Integer.parseInt(subElement.attributeValue("x"));
int y = Integer.parseInt(subElement.attributeValue("y"));
int z = Integer.parseInt(subElement.attributeValue("z"));
int h = subElement.attributeValue("h") == null ? -1 : Integer.parseInt(subElement.attributeValue("h"));
long delay = subElement.attributeValue("delay") == null ? 0 : Long.parseLong(subElement.attributeValue("delay"));
boolean end = (subElement.attributeValue("endPoint") != null) && Boolean.parseBoolean(routeElement.attributeValue("endPoint"));
template.setRoute(x, y, z, h, delay, end);
}
}
getHolder().addSpawn(template);
}
}