Despawn precautions.
This commit is contained in:
@@ -228,8 +228,8 @@ public class TarBeetleSpawn implements IGameXmlReader
|
||||
final L2Spawn spawn = new L2Spawn(18804);
|
||||
spawn.setHeading(Rnd.get(65535));
|
||||
spawn.setXYZ(location.getX(), location.getY(), GeoEngine.getInstance().getHeight(location.getX(), location.getY(), location.getZ()));
|
||||
|
||||
final L2Npc npc = spawn.doSpawn();
|
||||
spawn.stopRespawn();
|
||||
npc.setRandomWalking(false);
|
||||
npc.setIsImmobilized(true);
|
||||
npc.setIsInvul(true);
|
||||
|
@@ -489,7 +489,7 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
SpawnTable.getInstance().addNewSpawn(spawn, permanent);
|
||||
spawn.init();
|
||||
}
|
||||
if (!permanent)
|
||||
if (!permanent || (respawnTime <= 0))
|
||||
{
|
||||
spawn.stopRespawn();
|
||||
}
|
||||
|
@@ -562,6 +562,10 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
}
|
||||
SpawnTable.getInstance().addNewSpawn(spawn, true);
|
||||
spawn.init();
|
||||
if (respawnTime <= 0)
|
||||
{
|
||||
spawn.stopRespawn();
|
||||
}
|
||||
|
||||
BuilderUtil.sendSysMessage(activeChar, "Created " + target.getTemplate().getName() + " on " + target.getObjectId() + ".");
|
||||
}
|
||||
|
@@ -160,6 +160,10 @@ public final class SiegeGuardManager
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (spawn.getRespawnDelay() == 0)
|
||||
{
|
||||
spawn.stopRespawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -464,7 +464,6 @@ public class AutoSpawnHandler
|
||||
if (spawnInst._spawnCount == 1)
|
||||
{
|
||||
npcInst = newSpawn.doSpawn();
|
||||
newSpawn.stopRespawn(); // Just in case...
|
||||
npcInst.setXYZ(npcInst.getX(), npcInst.getY(), npcInst.getZ());
|
||||
spawnInst.addNpcInstance(npcInst);
|
||||
}
|
||||
@@ -481,12 +480,13 @@ public class AutoSpawnHandler
|
||||
spawnInst.addNpcInstance(npcInst);
|
||||
}
|
||||
}
|
||||
newSpawn.stopRespawn();
|
||||
|
||||
if (npcInst != null)
|
||||
{
|
||||
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...");
|
||||
npcInst.teleToLocation(locationList[Rnd.get(locationList.length)]);
|
||||
|
@@ -286,7 +286,7 @@ public class L2Spawn extends Location implements IIdentifiable, INamable
|
||||
{
|
||||
doSpawn();
|
||||
}
|
||||
_doRespawn = _respawnMinDelay != 0;
|
||||
_doRespawn = _respawnMinDelay > 0;
|
||||
|
||||
return _currentCount;
|
||||
}
|
||||
|
@@ -174,6 +174,10 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
for (L2Spawn guard : _guards)
|
||||
{
|
||||
guard.init();
|
||||
if (guard.getRespawnDelay() == 0)
|
||||
{
|
||||
guard.stopRespawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user