Fixed DBSpawnManager RespawnPattern NPE.
This commit is contained in:
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -219,13 +219,16 @@ public class DBSpawnManager
|
|||||||
npc.setDBStatus(RaidBossStatus.DEAD);
|
npc.setDBStatus(RaidBossStatus.DEAD);
|
||||||
|
|
||||||
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
final SchedulingPattern respawnPattern = npc.getSpawn().getRespawnPattern();
|
||||||
int respawnMinDelay, respawnMaxDelay, respawnDelay;
|
final int respawnMinDelay;
|
||||||
long respawnTime;
|
final int respawnMaxDelay;
|
||||||
|
final int respawnDelay;
|
||||||
|
final long respawnTime;
|
||||||
if (respawnPattern != null)
|
if (respawnPattern != null)
|
||||||
{
|
{
|
||||||
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
respawnTime = respawnPattern.next(System.currentTimeMillis());
|
||||||
respawnMinDelay = respawnMaxDelay = respawnDelay = (int) (respawnTime - System.currentTimeMillis());
|
respawnMinDelay = (int) (respawnTime - System.currentTimeMillis());
|
||||||
|
respawnMaxDelay = respawnMinDelay;
|
||||||
|
respawnDelay = respawnMinDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,8 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
_count = set.getInt("count", 1);
|
_count = set.getInt("count", 1);
|
||||||
_respawnTime = set.getDuration("respawnTime", null);
|
_respawnTime = set.getDuration("respawnTime", null);
|
||||||
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
_respawnTimeRandom = set.getDuration("respawnRandom", null);
|
||||||
_respawnPattern = (set.getString("respawnPattern", null) == null) || set.getString("respawnPattern", null).isEmpty() ? null : new SchedulingPattern(set.getString("respawnPattern", null));
|
final String pattern = set.getString("respawnPattern", null);
|
||||||
|
_respawnPattern = (pattern == null) || pattern.isEmpty() ? null : new SchedulingPattern(pattern);
|
||||||
_chaseRange = set.getInt("chaseRange", 0);
|
_chaseRange = set.getInt("chaseRange", 0);
|
||||||
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
_spawnAnimation = set.getBoolean("spawnAnimation", false);
|
||||||
_saveInDB = set.getBoolean("dbSave", false);
|
_saveInDB = set.getBoolean("dbSave", false);
|
||||||
@@ -381,6 +382,7 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
spawn.setLocation(loc);
|
spawn.setLocation(loc);
|
||||||
int respawn = 0;
|
int respawn = 0;
|
||||||
int respawnRandom = 0;
|
int respawnRandom = 0;
|
||||||
|
SchedulingPattern respawnPattern = null;
|
||||||
if (_respawnTime != null)
|
if (_respawnTime != null)
|
||||||
{
|
{
|
||||||
respawn = (int) _respawnTime.getSeconds();
|
respawn = (int) _respawnTime.getSeconds();
|
||||||
@@ -389,10 +391,15 @@ public class NpcSpawnTemplate implements Cloneable, IParameterized<StatSet>
|
|||||||
{
|
{
|
||||||
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
respawnRandom = (int) _respawnTimeRandom.getSeconds();
|
||||||
}
|
}
|
||||||
|
if (_respawnPattern != null)
|
||||||
|
{
|
||||||
|
respawnPattern = _respawnPattern;
|
||||||
|
}
|
||||||
|
|
||||||
if (respawn > 0)
|
if ((respawn > 0) || (respawnPattern != null))
|
||||||
{
|
{
|
||||||
spawn.setRespawnDelay(respawn, respawnRandom);
|
spawn.setRespawnDelay(respawn, respawnRandom);
|
||||||
|
spawn.setRespawnPattern(respawnPattern);
|
||||||
spawn.startRespawn();
|
spawn.startRespawn();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user