Respawn rework and various changes.
This commit is contained in:
@ -88,11 +88,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
/** The task launching the function doSpawn() */
|
||||
class SpawnTask implements Runnable
|
||||
{
|
||||
private final L2Npc _oldNpc;
|
||||
|
||||
public SpawnTask(L2Npc pOldNpc)
|
||||
public SpawnTask()
|
||||
{
|
||||
_oldNpc = pOldNpc;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -100,8 +97,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
{
|
||||
try
|
||||
{
|
||||
// doSpawn();
|
||||
respawnNpc(_oldNpc);
|
||||
doSpawn();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -445,8 +441,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
_scheduledCount++;
|
||||
|
||||
// Create a new SpawnTask to launch after the respawn Delay
|
||||
// ClientScheduler.getInstance().scheduleLow(new SpawnTask(npcId), _respawnDelay);
|
||||
ThreadPoolManager.schedule(new SpawnTask(oldNpc), hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay);
|
||||
ThreadPoolManager.schedule(new SpawnTask(), hasRespawnRandom() ? Rnd.get(_respawnMinDelay, _respawnMaxDelay) : _respawnMinDelay);
|
||||
}
|
||||
}
|
||||
|
||||
@ -621,7 +616,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
}
|
||||
|
||||
// DO NOT CORRECT SPAWN Z IN GENERAL - Prevent NPC spawns on top of buildings
|
||||
// don't correct z of flying npc's
|
||||
// don't correct z of flying NPCs
|
||||
// if (!npc.isFlying())
|
||||
// {
|
||||
// newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||
@ -779,18 +774,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
return _spawnedNpcs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param oldNpc
|
||||
*/
|
||||
public void respawnNpc(L2Npc oldNpc)
|
||||
{
|
||||
if (_doRespawn)
|
||||
{
|
||||
oldNpc.refreshID();
|
||||
initializeNpcInstance(oldNpc);
|
||||
}
|
||||
}
|
||||
|
||||
public L2NpcTemplate getTemplate()
|
||||
{
|
||||
return _template;
|
||||
|
@ -566,7 +566,7 @@ public final class L2World
|
||||
*/
|
||||
public void deleteVisibleNpcSpawns()
|
||||
{
|
||||
_log.info("Deleting all visible NPC's.");
|
||||
_log.info("Deleting all visible NPCs.");
|
||||
for (int i = 0; i <= REGIONS_X; i++)
|
||||
{
|
||||
for (int j = 0; j <= REGIONS_Y; j++)
|
||||
@ -574,7 +574,7 @@ public final class L2World
|
||||
_worldRegions[i][j].deleteVisibleNpcSpawns();
|
||||
}
|
||||
}
|
||||
_log.info("All visible NPC's deleted.");
|
||||
_log.info("All visible NPCs deleted.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -443,7 +443,7 @@ public final class L2WorldRegion
|
||||
*/
|
||||
public void deleteVisibleNpcSpawns()
|
||||
{
|
||||
_log.fine("Deleting all visible NPC's in Region: " + getName());
|
||||
_log.fine("Deleting all visible NPCs in Region: " + getName());
|
||||
for (L2Object obj : _visibleObjects.values())
|
||||
{
|
||||
if (obj instanceof L2Npc)
|
||||
@ -459,6 +459,6 @@ public final class L2WorldRegion
|
||||
_log.finest("Removed NPC " + target.getObjectId());
|
||||
}
|
||||
}
|
||||
_log.info("All visible NPC's deleted in Region: " + getName());
|
||||
_log.info("All visible NPCs deleted in Region: " + getName());
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
import com.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||
|
||||
/**
|
||||
* Olympiad Npc's Instance
|
||||
* Olympiad NPCs Instance
|
||||
* @author godson
|
||||
*/
|
||||
public class L2OlympiadManagerInstance extends L2Npc
|
||||
|
@ -44,7 +44,7 @@ import com.l2jmobius.gameserver.util.Broadcast;
|
||||
|
||||
/**
|
||||
* Parent class for long time events.<br>
|
||||
* Maintains config reading, spawn of NPC's, adding of event's drop.
|
||||
* Maintains config reading, spawn of NPCs, adding of event's drop.
|
||||
* @author GKR
|
||||
*/
|
||||
public class LongTimeEvent extends Quest
|
||||
@ -252,7 +252,7 @@ public class LongTimeEvent extends Quest
|
||||
}
|
||||
|
||||
/**
|
||||
* Maintenance event start - adds global drop, spawns event NPC's, shows start announcement.
|
||||
* Maintenance event start - adds global drop, spawns event NPCs, shows start announcement.
|
||||
*/
|
||||
protected void startEvent()
|
||||
{
|
||||
|
Reference in New Issue
Block a user