for (Iterator<Element> iterator = rootElement.elementIterator(); iterator.hasNext();)
{
Element element = iterator.next();
int instanceId;
String name;
SchedulingPattern resetReuse = new SchedulingPattern("30 6 * * *");
int timelimit = -1;
int timer = 60;
int mapx = -1;
int mapy = -1;
boolean dispelBuffs = false;
boolean onPartyDismiss = true;
int mobId, respawn, respawnRnd, count, sharedReuseGroup = 0;
int collapseIfEmpty = 0;
int spawnType = 0;
SpawnInfo spawnDat = null;
int removedItemId = 0, removedItemCount = 0, giveItemId = 0, givedItemCount = 0, requiredQuestId = 0;
int maxChannels = 20;
boolean removedItemNecessity = false;
boolean setReuseUponEntry = true;
StatsSet params = new StatsSet();
List<InstantZone.SpawnInfo> spawns = new ArrayList<>();
IntObjectMap<InstantZone.DoorInfo> doors = Containers.emptyIntObjectMap();
Map<String, InstantZone.ZoneInfo> zones = Collections.emptyMap();
Map<String, InstantZone.SpawnInfo2> spawns2 = Collections.emptyMap();
instanceId = Integer.parseInt(element.attributeValue("id"));
name = element.attributeValue("name");
String n = element.attributeValue("timelimit");
if (n != null)
{
timelimit = Integer.parseInt(n);
}
n = element.attributeValue("collapseIfEmpty");
collapseIfEmpty = Integer.parseInt(n);
n = element.attributeValue("maxChannels");
maxChannels = Integer.parseInt(n);
n = element.attributeValue("dispelBuffs");
dispelBuffs = (n != null) && Boolean.parseBoolean(n);
int minLevel = 0, maxLevel = 0, minParty = 1, maxParty = 7;
List<Location> teleportLocs = Collections.emptyList();
Location ret = null;
for (Iterator<Element> subIterator = element.elementIterator(); subIterator.hasNext();)
{
Element subElement = subIterator.next();
if ("level".equalsIgnoreCase(subElement.getName()))
{
minLevel = Integer.parseInt(subElement.attributeValue("min"));
maxLevel = Integer.parseInt(subElement.attributeValue("max"));
}
else if ("collapse".equalsIgnoreCase(subElement.getName()))
{
onPartyDismiss = Boolean.parseBoolean(subElement.attributeValue("on-party-dismiss"));
timer = Integer.parseInt(subElement.attributeValue("timer"));
}
else if ("party".equalsIgnoreCase(subElement.getName()))
{
minParty = Integer.parseInt(subElement.attributeValue("min"));
maxParty = Integer.parseInt(subElement.attributeValue("max"));
}
else if ("return".equalsIgnoreCase(subElement.getName()))
{
ret = Location.parseLoc(subElement.attributeValue("loc"));
}
else if ("teleport".equalsIgnoreCase(subElement.getName()))
{
if (teleportLocs.isEmpty())
{
teleportLocs = new ArrayList<>(1);
}
teleportLocs.add(Location.parseLoc(subElement.attributeValue("loc")));
}
else if ("remove".equalsIgnoreCase(subElement.getName()))
{
removedItemId = Integer.parseInt(subElement.attributeValue("itemId"));
removedItemCount = Integer.parseInt(subElement.attributeValue("count"));
removedItemNecessity = Boolean.parseBoolean(subElement.attributeValue("necessary"));
}
else if ("give".equalsIgnoreCase(subElement.getName()))
{
giveItemId = Integer.parseInt(subElement.attributeValue("itemId"));
givedItemCount = Integer.parseInt(subElement.attributeValue("count"));
}
else if ("quest".equalsIgnoreCase(subElement.getName()))
{
requiredQuestId = Integer.parseInt(subElement.attributeValue("id"));
}
else if ("reuse".equalsIgnoreCase(subElement.getName()))
{
resetReuse = new SchedulingPattern(subElement.attributeValue("resetReuse"));
sharedReuseGroup = Integer.parseInt(subElement.attributeValue("sharedReuseGroup"));
setReuseUponEntry = Boolean.parseBoolean(subElement.attributeValue("setUponEntry"));
}
else if ("geodata".equalsIgnoreCase(subElement.getName()))
{