|
@@ -31,6 +31,9 @@ import java.util.logging.Logger;
|
|
|
import javolution.util.FastMap;
|
|
|
import javolution.util.FastSet;
|
|
|
|
|
|
+import org.w3c.dom.NamedNodeMap;
|
|
|
+import org.w3c.dom.Node;
|
|
|
+
|
|
|
import com.l2jserver.Config;
|
|
|
import com.l2jserver.L2DatabaseFactory;
|
|
|
import com.l2jserver.gameserver.engines.DocumentParser;
|
|
@@ -41,9 +44,6 @@ import com.l2jserver.gameserver.model.StatsSet;
|
|
|
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
|
|
import com.l2jserver.gameserver.model.interfaces.IL2Procedure;
|
|
|
|
|
|
-import org.w3c.dom.NamedNodeMap;
|
|
|
-import org.w3c.dom.Node;
|
|
|
-
|
|
|
/**
|
|
|
* Spawn data retriever.
|
|
|
* @author Zoey76
|
|
@@ -121,10 +121,10 @@ public final class SpawnTable extends DocumentParser
|
|
|
String territoryName = null;
|
|
|
|
|
|
// Check, if spawn territory specified and exists
|
|
|
- if (attrs.getNamedItem("zone") != null && ZoneManager.getInstance().getSpawnTerritory(attrs.getNamedItem("zone").getNodeValue()) != null)
|
|
|
+ if ((attrs.getNamedItem("zone") != null) && (ZoneManager.getInstance().getSpawnTerritory(attrs.getNamedItem("zone").getNodeValue()) != null))
|
|
|
{
|
|
|
territoryName = parseString(attrs, "zone");
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
for (Node npctag = param.getFirstChild(); npctag != null; npctag = npctag.getNextSibling())
|
|
|
{
|
|
@@ -140,13 +140,13 @@ public final class SpawnTable extends DocumentParser
|
|
|
|
|
|
try
|
|
|
{
|
|
|
- x = parseInt(attrs, "x");
|
|
|
- y = parseInt(attrs, "y");
|
|
|
- z = parseInt(attrs, "z");
|
|
|
+ x = parseInt(attrs, "x");
|
|
|
+ y = parseInt(attrs, "y");
|
|
|
+ z = parseInt(attrs, "z");
|
|
|
}
|
|
|
catch (NullPointerException npe)
|
|
|
{
|
|
|
- // x, y, z can be unspecified, if this spawn is territory based, do nothing
|
|
|
+ // x, y, z can be unspecified, if this spawn is territory based, do nothing
|
|
|
}
|
|
|
|
|
|
if ((x == 0) && (y == 0) && (territoryName == null)) // Both coordinates and zone are unspecified
|
|
@@ -177,7 +177,7 @@ public final class SpawnTable extends DocumentParser
|
|
|
{
|
|
|
spawnInfo.set("respawnDelay", parseInt(attrs, "respawnDelay"));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (attrs.getNamedItem("respawnRandom") != null)
|
|
|
{
|
|
|
spawnInfo.set("respawnRandom", parseInt(attrs, "respawnRandom"));
|
|
@@ -194,7 +194,7 @@ public final class SpawnTable extends DocumentParser
|
|
|
|
|
|
_xmlSpawnCount += addSpawn(spawnInfo);
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -216,7 +216,7 @@ public final class SpawnTable extends DocumentParser
|
|
|
while (rs.next())
|
|
|
{
|
|
|
StatsSet spawnInfo = new StatsSet();
|
|
|
- int npcId = rs.getInt("npc_templateid");
|
|
|
+ int npcId = rs.getInt("npc_templateid");
|
|
|
|
|
|
// Check basic requirements first
|
|
|
if (!checkTemplate(npcId))
|