SpawnTable should initialize multiple spawns separately.
This commit is contained in:
@@ -306,51 +306,52 @@ public class SpawnTable implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final StatSet spawnInfo = new StatSet();
|
final Node countNode = attrs.getNamedItem("count");
|
||||||
spawnInfo.set("npcTemplateid", templateId);
|
final int count = countNode == null ? 1 : parseInteger(attrs, "count");
|
||||||
spawnInfo.set("x", x);
|
|
||||||
spawnInfo.set("y", y);
|
|
||||||
spawnInfo.set("z", z);
|
|
||||||
spawnInfo.set("territoryName", territoryName);
|
|
||||||
spawnInfo.set("spawnName", spawnName);
|
|
||||||
|
|
||||||
// trying to read optional parameters
|
for (int i = 0; i < count; i++)
|
||||||
if (attrs.getNamedItem("heading") != null)
|
|
||||||
{
|
{
|
||||||
spawnInfo.set("heading", parseInteger(attrs, "heading"));
|
final StatSet spawnInfo = new StatSet();
|
||||||
}
|
spawnInfo.set("npcTemplateid", templateId);
|
||||||
|
spawnInfo.set("x", x);
|
||||||
if (attrs.getNamedItem("count") != null)
|
spawnInfo.set("y", y);
|
||||||
{
|
spawnInfo.set("z", z);
|
||||||
spawnInfo.set("count", parseInteger(attrs, "count"));
|
spawnInfo.set("territoryName", territoryName);
|
||||||
}
|
spawnInfo.set("spawnName", spawnName);
|
||||||
|
|
||||||
if (attrs.getNamedItem("respawnDelay") != null)
|
// trying to read optional parameters
|
||||||
{
|
if (attrs.getNamedItem("heading") != null)
|
||||||
spawnInfo.set("respawnDelay", parseInteger(attrs, "respawnDelay"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attrs.getNamedItem("respawnRandom") != null)
|
|
||||||
{
|
|
||||||
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attrs.getNamedItem("chaseRange") != null)
|
|
||||||
{
|
|
||||||
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attrs.getNamedItem("periodOfDay") != null)
|
|
||||||
{
|
|
||||||
final String period = attrs.getNamedItem("periodOfDay").getNodeValue();
|
|
||||||
if (period.equalsIgnoreCase("day") || period.equalsIgnoreCase("night"))
|
|
||||||
{
|
{
|
||||||
spawnInfo.set("periodOfDay", period.equalsIgnoreCase("day") ? 1 : 2);
|
spawnInfo.set("heading", parseInteger(attrs, "heading"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("respawnDelay") != null)
|
||||||
|
{
|
||||||
|
spawnInfo.set("respawnDelay", parseInteger(attrs, "respawnDelay"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("respawnRandom") != null)
|
||||||
|
{
|
||||||
|
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("chaseRange") != null)
|
||||||
|
{
|
||||||
|
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("periodOfDay") != null)
|
||||||
|
{
|
||||||
|
final String period = attrs.getNamedItem("periodOfDay").getNodeValue();
|
||||||
|
if (period.equalsIgnoreCase("day") || period.equalsIgnoreCase("night"))
|
||||||
|
{
|
||||||
|
spawnInfo.set("periodOfDay", period.equalsIgnoreCase("day") ? 1 : 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spawnInfo.set("fileName", f.getPath());
|
||||||
|
_spanwCount += addSpawn(spawnInfo, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
spawnInfo.set("fileName", f.getPath());
|
|
||||||
_spanwCount += addSpawn(spawnInfo, map);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,51 +306,52 @@ public class SpawnTable implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final StatSet spawnInfo = new StatSet();
|
final Node countNode = attrs.getNamedItem("count");
|
||||||
spawnInfo.set("npcTemplateid", templateId);
|
final int count = countNode == null ? 1 : parseInteger(attrs, "count");
|
||||||
spawnInfo.set("x", x);
|
|
||||||
spawnInfo.set("y", y);
|
|
||||||
spawnInfo.set("z", z);
|
|
||||||
spawnInfo.set("territoryName", territoryName);
|
|
||||||
spawnInfo.set("spawnName", spawnName);
|
|
||||||
|
|
||||||
// trying to read optional parameters
|
for (int i = 0; i < count; i++)
|
||||||
if (attrs.getNamedItem("heading") != null)
|
|
||||||
{
|
{
|
||||||
spawnInfo.set("heading", parseInteger(attrs, "heading"));
|
final StatSet spawnInfo = new StatSet();
|
||||||
}
|
spawnInfo.set("npcTemplateid", templateId);
|
||||||
|
spawnInfo.set("x", x);
|
||||||
if (attrs.getNamedItem("count") != null)
|
spawnInfo.set("y", y);
|
||||||
{
|
spawnInfo.set("z", z);
|
||||||
spawnInfo.set("count", parseInteger(attrs, "count"));
|
spawnInfo.set("territoryName", territoryName);
|
||||||
}
|
spawnInfo.set("spawnName", spawnName);
|
||||||
|
|
||||||
if (attrs.getNamedItem("respawnDelay") != null)
|
// trying to read optional parameters
|
||||||
{
|
if (attrs.getNamedItem("heading") != null)
|
||||||
spawnInfo.set("respawnDelay", parseInteger(attrs, "respawnDelay"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attrs.getNamedItem("respawnRandom") != null)
|
|
||||||
{
|
|
||||||
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attrs.getNamedItem("chaseRange") != null)
|
|
||||||
{
|
|
||||||
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attrs.getNamedItem("periodOfDay") != null)
|
|
||||||
{
|
|
||||||
final String period = attrs.getNamedItem("periodOfDay").getNodeValue();
|
|
||||||
if (period.equalsIgnoreCase("day") || period.equalsIgnoreCase("night"))
|
|
||||||
{
|
{
|
||||||
spawnInfo.set("periodOfDay", period.equalsIgnoreCase("day") ? 1 : 2);
|
spawnInfo.set("heading", parseInteger(attrs, "heading"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("respawnDelay") != null)
|
||||||
|
{
|
||||||
|
spawnInfo.set("respawnDelay", parseInteger(attrs, "respawnDelay"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("respawnRandom") != null)
|
||||||
|
{
|
||||||
|
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("chaseRange") != null)
|
||||||
|
{
|
||||||
|
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("periodOfDay") != null)
|
||||||
|
{
|
||||||
|
final String period = attrs.getNamedItem("periodOfDay").getNodeValue();
|
||||||
|
if (period.equalsIgnoreCase("day") || period.equalsIgnoreCase("night"))
|
||||||
|
{
|
||||||
|
spawnInfo.set("periodOfDay", period.equalsIgnoreCase("day") ? 1 : 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spawnInfo.set("fileName", f.getPath());
|
||||||
|
_spanwCount += addSpawn(spawnInfo, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
spawnInfo.set("fileName", f.getPath());
|
|
||||||
_spanwCount += addSpawn(spawnInfo, map);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,51 +306,52 @@ public class SpawnTable implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final StatSet spawnInfo = new StatSet();
|
final Node countNode = attrs.getNamedItem("count");
|
||||||
spawnInfo.set("npcTemplateid", templateId);
|
final int count = countNode == null ? 1 : parseInteger(attrs, "count");
|
||||||
spawnInfo.set("x", x);
|
|
||||||
spawnInfo.set("y", y);
|
|
||||||
spawnInfo.set("z", z);
|
|
||||||
spawnInfo.set("territoryName", territoryName);
|
|
||||||
spawnInfo.set("spawnName", spawnName);
|
|
||||||
|
|
||||||
// trying to read optional parameters
|
for (int i = 0; i < count; i++)
|
||||||
if (attrs.getNamedItem("heading") != null)
|
|
||||||
{
|
{
|
||||||
spawnInfo.set("heading", parseInteger(attrs, "heading"));
|
final StatSet spawnInfo = new StatSet();
|
||||||
}
|
spawnInfo.set("npcTemplateid", templateId);
|
||||||
|
spawnInfo.set("x", x);
|
||||||
if (attrs.getNamedItem("count") != null)
|
spawnInfo.set("y", y);
|
||||||
{
|
spawnInfo.set("z", z);
|
||||||
spawnInfo.set("count", parseInteger(attrs, "count"));
|
spawnInfo.set("territoryName", territoryName);
|
||||||
}
|
spawnInfo.set("spawnName", spawnName);
|
||||||
|
|
||||||
if (attrs.getNamedItem("respawnDelay") != null)
|
// trying to read optional parameters
|
||||||
{
|
if (attrs.getNamedItem("heading") != null)
|
||||||
spawnInfo.set("respawnDelay", parseInteger(attrs, "respawnDelay"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attrs.getNamedItem("respawnRandom") != null)
|
|
||||||
{
|
|
||||||
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attrs.getNamedItem("chaseRange") != null)
|
|
||||||
{
|
|
||||||
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attrs.getNamedItem("periodOfDay") != null)
|
|
||||||
{
|
|
||||||
final String period = attrs.getNamedItem("periodOfDay").getNodeValue();
|
|
||||||
if (period.equalsIgnoreCase("day") || period.equalsIgnoreCase("night"))
|
|
||||||
{
|
{
|
||||||
spawnInfo.set("periodOfDay", period.equalsIgnoreCase("day") ? 1 : 2);
|
spawnInfo.set("heading", parseInteger(attrs, "heading"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("respawnDelay") != null)
|
||||||
|
{
|
||||||
|
spawnInfo.set("respawnDelay", parseInteger(attrs, "respawnDelay"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("respawnRandom") != null)
|
||||||
|
{
|
||||||
|
spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("chaseRange") != null)
|
||||||
|
{
|
||||||
|
spawnInfo.set("chaseRange", parseInteger(attrs, "chaseRange"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attrs.getNamedItem("periodOfDay") != null)
|
||||||
|
{
|
||||||
|
final String period = attrs.getNamedItem("periodOfDay").getNodeValue();
|
||||||
|
if (period.equalsIgnoreCase("day") || period.equalsIgnoreCase("night"))
|
||||||
|
{
|
||||||
|
spawnInfo.set("periodOfDay", period.equalsIgnoreCase("day") ? 1 : 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spawnInfo.set("fileName", f.getPath());
|
||||||
|
_spanwCount += addSpawn(spawnInfo, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
spawnInfo.set("fileName", f.getPath());
|
|
||||||
_spanwCount += addSpawn(spawnInfo, map);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user