Despawn precautions.

This commit is contained in:
MobiusDev
2019-01-09 07:20:24 +00:00
parent 066996efbb
commit 592399f5c0
67 changed files with 107 additions and 35 deletions

View File

@@ -495,7 +495,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -558,6 +558,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -133,6 +133,7 @@ public class DBSpawnManager
} }
else else
{ {
spawn.stopRespawn();
LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate); LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate);
continue; continue;
} }

View File

@@ -332,7 +332,7 @@ public final class SiegeGuardManager
if (spawn != null) if (spawn != null)
{ {
spawn.init(); spawn.init();
if (isHired) if (isHired || (spawn.getRespawnDelay() == 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -291,7 +291,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -1191,6 +1191,7 @@ public final class Castle extends AbstractResidence
spawn.setXYZ(holder); spawn.setXYZ(holder);
spawn.setHeading(holder.getHeading()); spawn.setHeading(holder.getHeading());
final L2Npc npc = spawn.doSpawn(false); final L2Npc npc = spawn.doSpawn(false);
spawn.stopRespawn();
npc.broadcastInfo(); npc.broadcastInfo();
_sideNpcs.add(npc); _sideNpcs.add(npc);
} }

View File

@@ -495,7 +495,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -558,6 +558,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -133,6 +133,7 @@ public class DBSpawnManager
} }
else else
{ {
spawn.stopRespawn();
LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate); LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate);
continue; continue;
} }

View File

@@ -332,7 +332,7 @@ public final class SiegeGuardManager
if (spawn != null) if (spawn != null)
{ {
spawn.init(); spawn.init();
if (isHired) if (isHired || (spawn.getRespawnDelay() == 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -291,7 +291,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -1191,6 +1191,7 @@ public final class Castle extends AbstractResidence
spawn.setXYZ(holder); spawn.setXYZ(holder);
spawn.setHeading(holder.getHeading()); spawn.setHeading(holder.getHeading());
final L2Npc npc = spawn.doSpawn(false); final L2Npc npc = spawn.doSpawn(false);
spawn.stopRespawn();
npc.broadcastInfo(); npc.broadcastInfo();
_sideNpcs.add(npc); _sideNpcs.add(npc);
} }

View File

@@ -495,7 +495,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -558,6 +558,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -133,6 +133,7 @@ public class DBSpawnManager
} }
else else
{ {
spawn.stopRespawn();
LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate); LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate);
continue; continue;
} }

View File

@@ -332,7 +332,7 @@ public final class SiegeGuardManager
if (spawn != null) if (spawn != null)
{ {
spawn.init(); spawn.init();
if (isHired) if (isHired || (spawn.getRespawnDelay() == 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -291,7 +291,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -1191,6 +1191,7 @@ public final class Castle extends AbstractResidence
spawn.setXYZ(holder); spawn.setXYZ(holder);
spawn.setHeading(holder.getHeading()); spawn.setHeading(holder.getHeading());
final L2Npc npc = spawn.doSpawn(false); final L2Npc npc = spawn.doSpawn(false);
spawn.stopRespawn();
npc.broadcastInfo(); npc.broadcastInfo();
_sideNpcs.add(npc); _sideNpcs.add(npc);
} }

View File

@@ -495,7 +495,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -558,6 +558,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -133,6 +133,7 @@ public class DBSpawnManager
} }
else else
{ {
spawn.stopRespawn();
LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate); LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate);
continue; continue;
} }

View File

@@ -332,7 +332,7 @@ public final class SiegeGuardManager
if (spawn != null) if (spawn != null)
{ {
spawn.init(); spawn.init();
if (isHired) if (isHired || (spawn.getRespawnDelay() == 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -291,7 +291,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -1191,6 +1191,7 @@ public final class Castle extends AbstractResidence
spawn.setXYZ(holder); spawn.setXYZ(holder);
spawn.setHeading(holder.getHeading()); spawn.setHeading(holder.getHeading());
final L2Npc npc = spawn.doSpawn(false); final L2Npc npc = spawn.doSpawn(false);
spawn.stopRespawn();
npc.broadcastInfo(); npc.broadcastInfo();
_sideNpcs.add(npc); _sideNpcs.add(npc);
} }

View File

@@ -495,7 +495,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -558,6 +558,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -133,6 +133,7 @@ public class DBSpawnManager
} }
else else
{ {
spawn.stopRespawn();
LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate); LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate);
continue; continue;
} }

View File

@@ -332,7 +332,7 @@ public final class SiegeGuardManager
if (spawn != null) if (spawn != null)
{ {
spawn.init(); spawn.init();
if (isHired) if (isHired || (spawn.getRespawnDelay() == 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -291,7 +291,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -1191,6 +1191,7 @@ public final class Castle extends AbstractResidence
spawn.setXYZ(holder); spawn.setXYZ(holder);
spawn.setHeading(holder.getHeading()); spawn.setHeading(holder.getHeading());
final L2Npc npc = spawn.doSpawn(false); final L2Npc npc = spawn.doSpawn(false);
spawn.stopRespawn();
npc.broadcastInfo(); npc.broadcastInfo();
_sideNpcs.add(npc); _sideNpcs.add(npc);
} }

View File

@@ -495,7 +495,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -558,6 +558,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -133,6 +133,7 @@ public class DBSpawnManager
} }
else else
{ {
spawn.stopRespawn();
LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate); LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate);
continue; continue;
} }

View File

@@ -332,7 +332,7 @@ public final class SiegeGuardManager
if (spawn != null) if (spawn != null)
{ {
spawn.init(); spawn.init();
if (isHired) if (isHired || (spawn.getRespawnDelay() == 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -291,7 +291,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -1191,6 +1191,7 @@ public final class Castle extends AbstractResidence
spawn.setXYZ(holder); spawn.setXYZ(holder);
spawn.setHeading(holder.getHeading()); spawn.setHeading(holder.getHeading());
final L2Npc npc = spawn.doSpawn(false); final L2Npc npc = spawn.doSpawn(false);
spawn.stopRespawn();
npc.broadcastInfo(); npc.broadcastInfo();
_sideNpcs.add(npc); _sideNpcs.add(npc);
} }

View File

@@ -228,8 +228,8 @@ public class TarBeetleSpawn implements IGameXmlReader
final L2Spawn spawn = new L2Spawn(18804); final L2Spawn spawn = new L2Spawn(18804);
spawn.setHeading(Rnd.get(65535)); spawn.setHeading(Rnd.get(65535));
spawn.setXYZ(location.getX(), location.getY(), GeoEngine.getInstance().getHeight(location.getX(), location.getY(), location.getZ())); spawn.setXYZ(location.getX(), location.getY(), GeoEngine.getInstance().getHeight(location.getX(), location.getY(), location.getZ()));
final L2Npc npc = spawn.doSpawn(); final L2Npc npc = spawn.doSpawn();
spawn.stopRespawn();
npc.setRandomWalking(false); npc.setRandomWalking(false);
npc.setIsImmobilized(true); npc.setIsImmobilized(true);
npc.setIsInvul(true); npc.setIsInvul(true);

View File

@@ -489,7 +489,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
} }
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -562,6 +562,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + target.getTemplate().getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + target.getTemplate().getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -160,6 +160,10 @@ public final class SiegeGuardManager
return; return;
} }
} }
else if (spawn.getRespawnDelay() == 0)
{
spawn.stopRespawn();
}
} }
} }
} }

View File

@@ -464,7 +464,6 @@ public class AutoSpawnHandler
if (spawnInst._spawnCount == 1) if (spawnInst._spawnCount == 1)
{ {
npcInst = newSpawn.doSpawn(); npcInst = newSpawn.doSpawn();
newSpawn.stopRespawn(); // Just in case...
npcInst.setXYZ(npcInst.getX(), npcInst.getY(), npcInst.getZ()); npcInst.setXYZ(npcInst.getX(), npcInst.getY(), npcInst.getZ());
spawnInst.addNpcInstance(npcInst); spawnInst.addNpcInstance(npcInst);
} }
@@ -481,12 +480,13 @@ public class AutoSpawnHandler
spawnInst.addNpcInstance(npcInst); spawnInst.addNpcInstance(npcInst);
} }
} }
newSpawn.stopRespawn();
if (npcInst != null) if (npcInst != null)
{ {
if (spawnInst.isRandomSpawn()) if (spawnInst.isRandomSpawn())
{ {
while (!L2World.getInstance().getVisibleObjectsInRange(npcInst, L2Npc.class, 10).isEmpty()) while (!L2World.getInstance().getVisibleObjectsInRange(npcInst, L2Npc.class, 5).isEmpty())
{ {
// LOGGER.log(Level.INFO, "AutoSpawnHandler: Random spawn location " + npcInst.getLocation() + " for " + npcInst + " is occupied. Teleporting..."); // LOGGER.log(Level.INFO, "AutoSpawnHandler: Random spawn location " + npcInst.getLocation() + " for " + npcInst + " is occupied. Teleporting...");
npcInst.teleToLocation(locationList[Rnd.get(locationList.length)]); npcInst.teleToLocation(locationList[Rnd.get(locationList.length)]);

View File

@@ -286,7 +286,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -174,6 +174,10 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
for (L2Spawn guard : _guards) for (L2Spawn guard : _guards)
{ {
guard.init(); guard.init();
if (guard.getRespawnDelay() == 0)
{
guard.stopRespawn();
}
} }
} }

View File

@@ -495,7 +495,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -558,6 +558,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -133,6 +133,7 @@ public class DBSpawnManager
} }
else else
{ {
spawn.stopRespawn();
LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate); LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate);
continue; continue;
} }

View File

@@ -332,7 +332,7 @@ public final class SiegeGuardManager
if (spawn != null) if (spawn != null)
{ {
spawn.init(); spawn.init();
if (isHired) if (isHired || (spawn.getRespawnDelay() == 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -291,7 +291,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -1190,6 +1190,7 @@ public final class Castle extends AbstractResidence
spawn.setXYZ(holder); spawn.setXYZ(holder);
spawn.setHeading(holder.getHeading()); spawn.setHeading(holder.getHeading());
final L2Npc npc = spawn.doSpawn(false); final L2Npc npc = spawn.doSpawn(false);
spawn.stopRespawn();
npc.broadcastInfo(); npc.broadcastInfo();
_sideNpcs.add(npc); _sideNpcs.add(npc);
} }

View File

@@ -495,7 +495,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -558,6 +558,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -133,6 +133,7 @@ public class DBSpawnManager
} }
else else
{ {
spawn.stopRespawn();
LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate); LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate);
continue; continue;
} }

View File

@@ -332,7 +332,7 @@ public final class SiegeGuardManager
if (spawn != null) if (spawn != null)
{ {
spawn.init(); spawn.init();
if (isHired) if (isHired || (spawn.getRespawnDelay() == 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -291,7 +291,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -1190,6 +1190,7 @@ public final class Castle extends AbstractResidence
spawn.setXYZ(holder); spawn.setXYZ(holder);
spawn.setHeading(holder.getHeading()); spawn.setHeading(holder.getHeading());
final L2Npc npc = spawn.doSpawn(false); final L2Npc npc = spawn.doSpawn(false);
spawn.stopRespawn();
npc.broadcastInfo(); npc.broadcastInfo();
_sideNpcs.add(npc); _sideNpcs.add(npc);
} }

View File

@@ -495,7 +495,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -558,6 +558,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -133,6 +133,7 @@ public class DBSpawnManager
} }
else else
{ {
spawn.stopRespawn();
LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate); LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate);
continue; continue;
} }

View File

@@ -332,7 +332,7 @@ public final class SiegeGuardManager
if (spawn != null) if (spawn != null)
{ {
spawn.init(); spawn.init();
if (isHired) if (isHired || (spawn.getRespawnDelay() == 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -291,7 +291,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -1190,6 +1190,7 @@ public final class Castle extends AbstractResidence
spawn.setXYZ(holder); spawn.setXYZ(holder);
spawn.setHeading(holder.getHeading()); spawn.setHeading(holder.getHeading());
final L2Npc npc = spawn.doSpawn(false); final L2Npc npc = spawn.doSpawn(false);
spawn.stopRespawn();
npc.broadcastInfo(); npc.broadcastInfo();
_sideNpcs.add(npc); _sideNpcs.add(npc);
} }

View File

@@ -495,7 +495,7 @@ public class AdminSpawn implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, permanent); SpawnTable.getInstance().addNewSpawn(spawn, permanent);
spawn.init(); spawn.init();
if (!permanent) if (!permanent || (respawnTime <= 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -558,6 +558,10 @@ public class AdminTeleport implements IAdminCommandHandler
} }
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
if (respawnTime <= 0)
{
spawn.stopRespawn();
}
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }

View File

@@ -133,6 +133,7 @@ public class DBSpawnManager
} }
else else
{ {
spawn.stopRespawn();
LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate); LOGGER.warning(getClass().getSimpleName() + ": Found database spawns without respawn for npc: " + template.getId() + " - " + template.getName() + " " + spawnTemplate);
continue; continue;
} }

View File

@@ -332,7 +332,7 @@ public final class SiegeGuardManager
if (spawn != null) if (spawn != null)
{ {
spawn.init(); spawn.init();
if (isHired) if (isHired || (spawn.getRespawnDelay() == 0))
{ {
spawn.stopRespawn(); spawn.stopRespawn();
} }

View File

@@ -291,7 +291,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
{ {
doSpawn(); doSpawn();
} }
_doRespawn = _respawnMinDelay != 0; _doRespawn = _respawnMinDelay > 0;
return _currentCount; return _currentCount;
} }

View File

@@ -1190,6 +1190,7 @@ public final class Castle extends AbstractResidence
spawn.setXYZ(holder); spawn.setXYZ(holder);
spawn.setHeading(holder.getHeading()); spawn.setHeading(holder.getHeading());
final L2Npc npc = spawn.doSpawn(false); final L2Npc npc = spawn.doSpawn(false);
spawn.stopRespawn();
npc.broadcastInfo(); npc.broadcastInfo();
_sideNpcs.add(npc); _sideNpcs.add(npc);
} }