Dropped L2Spawn spawnOne method.

This commit is contained in:
MobiusDev
2018-05-21 15:07:29 +00:00
parent b58e4ca5c6
commit c8488b05c8
18 changed files with 37 additions and 124 deletions

View File

@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable;
import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.interfaces.ILocational;
@@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
private Constructor<? extends L2Npc> _constructor; private Constructor<? extends L2Npc> _constructor;
/** If True a L2NpcInstance is respawned each time that another is killed */ /** If True a L2NpcInstance is respawned each time that another is killed */
private boolean _doRespawn = true; private boolean _doRespawn = true;
/** If true then spawn is custom */
private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>(); private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>();
private boolean _randomWalk = false; // Is no random walk private boolean _randomWalk = false; // Is no random walk
private NpcSpawnTemplate _spawnTemplate; private NpcSpawnTemplate _spawnTemplate;
@@ -182,7 +180,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
/** /**
* @return the Identifier of the location area where L2NpcInstance can be spwaned. * @return the Identifier of the location area where L2NpcInstance can be spawned.
*/ */
public int getLocationId() public int getLocationId()
{ {
@@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
public void setXYZ(ILocational loc) public void setXYZ(ILocational loc)
{ {
setXYZ(loc.getX(), loc.getY(), loc.getZ()); setXYZ(loc.getX(), loc.getY(), loc.getZ());
} }
/** /**
@@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
return _currentCount; return _currentCount;
} }
/**
* Create a {@link L2NpcInstance} in this L2Spawn.
* @param val
* @return
*/
public L2Npc spawnOne(boolean val)
{
return doSpawn(val);
}
/** /**
* @return true if respawn enabled * @return true if respawn enabled
*/ */
@@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
_spawnedNpcs.add(npc); _spawnedNpcs.add(npc);
// Increase the current number of L2NpcInstance managed by this L2Spawn
_currentCount++; _currentCount++;
// Minions // Minions

View File

@@ -2244,7 +2244,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
spawn.setZ(z); spawn.setZ(z);
spawn.stopRespawn(); spawn.stopRespawn();
final L2Npc npc = spawn.spawnOne(isSummonSpawn); final L2Npc npc = spawn.doSpawn(isSummonSpawn);
if (despawnDelay > 0) if (despawnDelay > 0)
{ {
npc.scheduleDespawn(despawnDelay); npc.scheduleDespawn(despawnDelay);

View File

@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable;
import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.interfaces.ILocational;
@@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
private Constructor<? extends L2Npc> _constructor; private Constructor<? extends L2Npc> _constructor;
/** If True a L2NpcInstance is respawned each time that another is killed */ /** If True a L2NpcInstance is respawned each time that another is killed */
private boolean _doRespawn = true; private boolean _doRespawn = true;
/** If true then spawn is custom */
private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>(); private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>();
private boolean _randomWalk = false; // Is no random walk private boolean _randomWalk = false; // Is no random walk
private NpcSpawnTemplate _spawnTemplate; private NpcSpawnTemplate _spawnTemplate;
@@ -182,7 +180,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
/** /**
* @return the Identifier of the location area where L2NpcInstance can be spwaned. * @return the Identifier of the location area where L2NpcInstance can be spawned.
*/ */
public int getLocationId() public int getLocationId()
{ {
@@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
public void setXYZ(ILocational loc) public void setXYZ(ILocational loc)
{ {
setXYZ(loc.getX(), loc.getY(), loc.getZ()); setXYZ(loc.getX(), loc.getY(), loc.getZ());
} }
/** /**
@@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
return _currentCount; return _currentCount;
} }
/**
* Create a {@link L2NpcInstance} in this L2Spawn.
* @param val
* @return
*/
public L2Npc spawnOne(boolean val)
{
return doSpawn(val);
}
/** /**
* @return true if respawn enabled * @return true if respawn enabled
*/ */
@@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
_spawnedNpcs.add(npc); _spawnedNpcs.add(npc);
// Increase the current number of L2NpcInstance managed by this L2Spawn
_currentCount++; _currentCount++;
// Minions // Minions

View File

@@ -2244,7 +2244,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
spawn.setZ(z); spawn.setZ(z);
spawn.stopRespawn(); spawn.stopRespawn();
final L2Npc npc = spawn.spawnOne(isSummonSpawn); final L2Npc npc = spawn.doSpawn(isSummonSpawn);
if (despawnDelay > 0) if (despawnDelay > 0)
{ {
npc.scheduleDespawn(despawnDelay); npc.scheduleDespawn(despawnDelay);

View File

@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable;
import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.interfaces.ILocational;
@@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
private Constructor<? extends L2Npc> _constructor; private Constructor<? extends L2Npc> _constructor;
/** If True a L2NpcInstance is respawned each time that another is killed */ /** If True a L2NpcInstance is respawned each time that another is killed */
private boolean _doRespawn = true; private boolean _doRespawn = true;
/** If true then spawn is custom */
private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>(); private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>();
private boolean _randomWalk = false; // Is no random walk private boolean _randomWalk = false; // Is no random walk
private NpcSpawnTemplate _spawnTemplate; private NpcSpawnTemplate _spawnTemplate;
@@ -182,7 +180,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
/** /**
* @return the Identifier of the location area where L2NpcInstance can be spwaned. * @return the Identifier of the location area where L2NpcInstance can be spawned.
*/ */
public int getLocationId() public int getLocationId()
{ {
@@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
public void setXYZ(ILocational loc) public void setXYZ(ILocational loc)
{ {
setXYZ(loc.getX(), loc.getY(), loc.getZ()); setXYZ(loc.getX(), loc.getY(), loc.getZ());
} }
/** /**
@@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
return _currentCount; return _currentCount;
} }
/**
* Create a {@link L2NpcInstance} in this L2Spawn.
* @param val
* @return
*/
public L2Npc spawnOne(boolean val)
{
return doSpawn(val);
}
/** /**
* @return true if respawn enabled * @return true if respawn enabled
*/ */
@@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
_spawnedNpcs.add(npc); _spawnedNpcs.add(npc);
// Increase the current number of L2NpcInstance managed by this L2Spawn
_currentCount++; _currentCount++;
// Minions // Minions

View File

@@ -2245,7 +2245,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
spawn.setZ(z); spawn.setZ(z);
spawn.stopRespawn(); spawn.stopRespawn();
final L2Npc npc = spawn.spawnOne(isSummonSpawn); final L2Npc npc = spawn.doSpawn(isSummonSpawn);
if (despawnDelay > 0) if (despawnDelay > 0)
{ {
npc.scheduleDespawn(despawnDelay); npc.scheduleDespawn(despawnDelay);

View File

@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable;
import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.interfaces.ILocational;
@@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
private Constructor<? extends L2Npc> _constructor; private Constructor<? extends L2Npc> _constructor;
/** If True a L2NpcInstance is respawned each time that another is killed */ /** If True a L2NpcInstance is respawned each time that another is killed */
private boolean _doRespawn = true; private boolean _doRespawn = true;
/** If true then spawn is custom */
private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>(); private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>();
private boolean _randomWalk = false; // Is no random walk private boolean _randomWalk = false; // Is no random walk
private NpcSpawnTemplate _spawnTemplate; private NpcSpawnTemplate _spawnTemplate;
@@ -182,7 +180,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
/** /**
* @return the Identifier of the location area where L2NpcInstance can be spwaned. * @return the Identifier of the location area where L2NpcInstance can be spawned.
*/ */
public int getLocationId() public int getLocationId()
{ {
@@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
public void setXYZ(ILocational loc) public void setXYZ(ILocational loc)
{ {
setXYZ(loc.getX(), loc.getY(), loc.getZ()); setXYZ(loc.getX(), loc.getY(), loc.getZ());
} }
/** /**
@@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
return _currentCount; return _currentCount;
} }
/**
* Create a {@link L2NpcInstance} in this L2Spawn.
* @param val
* @return
*/
public L2Npc spawnOne(boolean val)
{
return doSpawn(val);
}
/** /**
* @return true if respawn enabled * @return true if respawn enabled
*/ */
@@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
_spawnedNpcs.add(npc); _spawnedNpcs.add(npc);
// Increase the current number of L2NpcInstance managed by this L2Spawn
_currentCount++; _currentCount++;
// Minions // Minions

View File

@@ -2245,7 +2245,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
spawn.setZ(z); spawn.setZ(z);
spawn.stopRespawn(); spawn.stopRespawn();
final L2Npc npc = spawn.spawnOne(isSummonSpawn); final L2Npc npc = spawn.doSpawn(isSummonSpawn);
if (despawnDelay > 0) if (despawnDelay > 0)
{ {
npc.scheduleDespawn(despawnDelay); npc.scheduleDespawn(despawnDelay);

View File

@@ -64,7 +64,7 @@ public final class AltarsOfSacrifice extends AbstractNpcAI
spawn.setXYZ(spawnX, spawnY, GeoEngine.getInstance().getHeight(spawnX, spawnY, _middlePoint.getZ())); spawn.setXYZ(spawnX, spawnY, GeoEngine.getInstance().getHeight(spawnX, spawnY, _middlePoint.getZ()));
spawn.stopRespawn(); spawn.stopRespawn();
_spawnedBoss = spawn.spawnOne(false); _spawnedBoss = spawn.doSpawn(false);
} }
protected void despawnBoss() protected void despawnBoss()

View File

@@ -739,7 +739,7 @@ public final class TerritoryWarManager implements Siegable
spawnDat.setZ(loc.getZ()); spawnDat.setZ(loc.getZ());
spawnDat.setHeading(loc.getHeading()); spawnDat.setHeading(loc.getHeading());
spawnDat.stopRespawn(); spawnDat.stopRespawn();
return spawnDat.spawnOne(false); return spawnDat.doSpawn(false);
} }
catch (Exception e) catch (Exception e)
{ {

View File

@@ -65,7 +65,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
/** The identifier of the location area where L2NpcInstance can be spawned */ /** The identifier of the location area where L2NpcInstance can be spawned */
private int _locationId; private int _locationId;
/** The Location of this NPC spawn. */ /** The Location of this NPC spawn. */
private Location _location = new Location(0, 0, 0, 0, 0); private static Location _location = new Location(0, 0, 0, 0, 0);
/** Link to NPC spawn territory */ /** Link to NPC spawn territory */
private NpcSpawnTerritory _spawnTerritory = null; private NpcSpawnTerritory _spawnTerritory = null;
/** Minimum respawn delay */ /** Minimum respawn delay */
@@ -410,16 +410,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
return _currentCount; return _currentCount;
} }
/**
* Create a L2NpcInstance in this L2Spawn.
* @param val
* @return
*/
public L2Npc spawnOne(boolean val)
{
return doSpawn(val);
}
/** /**
* @return true if respawn enabled * @return true if respawn enabled
*/ */
@@ -478,7 +468,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
if (_template.isType("L2Pet") || _template.isType("L2Decoy") || _template.isType("L2Trap")) if (_template.isType("L2Pet") || _template.isType("L2Decoy") || _template.isType("L2Trap"))
{ {
_currentCount++; _currentCount++;
return null; return null;
} }
@@ -519,10 +508,11 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
// New method // New method
if (_spawnTerritory != null) if (_spawnTerritory != null)
{ {
final Location p = _spawnTerritory.getRandomPoint(); final Location loc = _spawnTerritory.getRandomPoint();
newlocx = p.getX(); newlocx = loc.getX();
newlocy = p.getY(); newlocy = loc.getY();
newlocz = p.getZ(); newlocz = loc.getZ();
setLocation(loc);
} }
else if ((getX() == 0) && (getY() == 0)) else if ((getX() == 0) && (getY() == 0))
{ {

View File

@@ -1879,7 +1879,7 @@ public abstract class AbstractScript extends ManagedScript
spawn.setZ(z); spawn.setZ(z);
spawn.stopRespawn(); spawn.stopRespawn();
final L2Npc npc = spawn.spawnOne(isSummonSpawn); final L2Npc npc = spawn.doSpawn(isSummonSpawn);
if (despawnDelay > 0) if (despawnDelay > 0)
{ {
npc.scheduleDespawn(despawnDelay); npc.scheduleDespawn(despawnDelay);

View File

@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable;
import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.interfaces.ILocational;
@@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
private Constructor<? extends L2Npc> _constructor; private Constructor<? extends L2Npc> _constructor;
/** If True a L2NpcInstance is respawned each time that another is killed */ /** If True a L2NpcInstance is respawned each time that another is killed */
private boolean _doRespawn = true; private boolean _doRespawn = true;
/** If true then spawn is custom */
private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>(); private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>();
private boolean _randomWalk = false; // Is no random walk private boolean _randomWalk = false; // Is no random walk
private NpcSpawnTemplate _spawnTemplate; private NpcSpawnTemplate _spawnTemplate;
@@ -182,7 +180,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
/** /**
* @return the Identifier of the location area where L2NpcInstance can be spwaned. * @return the Identifier of the location area where L2NpcInstance can be spawned.
*/ */
public int getLocationId() public int getLocationId()
{ {
@@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
public void setXYZ(ILocational loc) public void setXYZ(ILocational loc)
{ {
setXYZ(loc.getX(), loc.getY(), loc.getZ()); setXYZ(loc.getX(), loc.getY(), loc.getZ());
} }
/** /**
@@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
return _currentCount; return _currentCount;
} }
/**
* Create a {@link L2NpcInstance} in this L2Spawn.
* @param val
* @return
*/
public L2Npc spawnOne(boolean val)
{
return doSpawn(val);
}
/** /**
* @return true if respawn enabled * @return true if respawn enabled
*/ */
@@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
_spawnedNpcs.add(npc); _spawnedNpcs.add(npc);
// Increase the current number of L2NpcInstance managed by this L2Spawn
_currentCount++; _currentCount++;
// Minions // Minions

View File

@@ -2244,7 +2244,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
spawn.setZ(z); spawn.setZ(z);
spawn.stopRespawn(); spawn.stopRespawn();
final L2Npc npc = spawn.spawnOne(isSummonSpawn); final L2Npc npc = spawn.doSpawn(isSummonSpawn);
if (despawnDelay > 0) if (despawnDelay > 0)
{ {
npc.scheduleDespawn(despawnDelay); npc.scheduleDespawn(despawnDelay);

View File

@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable;
import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.interfaces.ILocational;
@@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
private Constructor<? extends L2Npc> _constructor; private Constructor<? extends L2Npc> _constructor;
/** If True a L2NpcInstance is respawned each time that another is killed */ /** If True a L2NpcInstance is respawned each time that another is killed */
private boolean _doRespawn = true; private boolean _doRespawn = true;
/** If true then spawn is custom */
private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>(); private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>();
private boolean _randomWalk = false; // Is no random walk private boolean _randomWalk = false; // Is no random walk
private NpcSpawnTemplate _spawnTemplate; private NpcSpawnTemplate _spawnTemplate;
@@ -182,7 +180,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
/** /**
* @return the Identifier of the location area where L2NpcInstance can be spwaned. * @return the Identifier of the location area where L2NpcInstance can be spawned.
*/ */
public int getLocationId() public int getLocationId()
{ {
@@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
public void setXYZ(ILocational loc) public void setXYZ(ILocational loc)
{ {
setXYZ(loc.getX(), loc.getY(), loc.getZ()); setXYZ(loc.getX(), loc.getY(), loc.getZ());
} }
/** /**
@@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
return _currentCount; return _currentCount;
} }
/**
* Create a {@link L2NpcInstance} in this L2Spawn.
* @param val
* @return
*/
public L2Npc spawnOne(boolean val)
{
return doSpawn(val);
}
/** /**
* @return true if respawn enabled * @return true if respawn enabled
*/ */
@@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
_spawnedNpcs.add(npc); _spawnedNpcs.add(npc);
// Increase the current number of L2NpcInstance managed by this L2Spawn
_currentCount++; _currentCount++;
// Minions // Minions

View File

@@ -2244,7 +2244,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
spawn.setZ(z); spawn.setZ(z);
spawn.stopRespawn(); spawn.stopRespawn();
final L2Npc npc = spawn.spawnOne(isSummonSpawn); final L2Npc npc = spawn.doSpawn(isSummonSpawn);
if (despawnDelay > 0) if (despawnDelay > 0)
{ {
npc.scheduleDespawn(despawnDelay); npc.scheduleDespawn(despawnDelay);

View File

@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable;
import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.interfaces.ILocational;
@@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
private Constructor<? extends L2Npc> _constructor; private Constructor<? extends L2Npc> _constructor;
/** If True a L2NpcInstance is respawned each time that another is killed */ /** If True a L2NpcInstance is respawned each time that another is killed */
private boolean _doRespawn = true; private boolean _doRespawn = true;
/** If true then spawn is custom */
private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>(); private final Deque<L2Npc> _spawnedNpcs = new ConcurrentLinkedDeque<>();
private boolean _randomWalk = false; // Is no random walk private boolean _randomWalk = false; // Is no random walk
private NpcSpawnTemplate _spawnTemplate; private NpcSpawnTemplate _spawnTemplate;
@@ -182,7 +180,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
/** /**
* @return the Identifier of the location area where L2NpcInstance can be spwaned. * @return the Identifier of the location area where L2NpcInstance can be spawned.
*/ */
public int getLocationId() public int getLocationId()
{ {
@@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
public void setXYZ(ILocational loc) public void setXYZ(ILocational loc)
{ {
setXYZ(loc.getX(), loc.getY(), loc.getZ()); setXYZ(loc.getX(), loc.getY(), loc.getZ());
} }
/** /**
@@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
return _currentCount; return _currentCount;
} }
/**
* Create a {@link L2NpcInstance} in this L2Spawn.
* @param val
* @return
*/
public L2Npc spawnOne(boolean val)
{
return doSpawn(val);
}
/** /**
* @return true if respawn enabled * @return true if respawn enabled
*/ */
@@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
} }
_spawnedNpcs.add(npc); _spawnedNpcs.add(npc);
// Increase the current number of L2NpcInstance managed by this L2Spawn
_currentCount++; _currentCount++;
// Minions // Minions

View File

@@ -2244,7 +2244,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
spawn.setZ(z); spawn.setZ(z);
spawn.stopRespawn(); spawn.stopRespawn();
final L2Npc npc = spawn.spawnOne(isSummonSpawn); final L2Npc npc = spawn.doSpawn(isSummonSpawn);
if (despawnDelay > 0) if (despawnDelay > 0)
{ {
npc.scheduleDespawn(despawnDelay); npc.scheduleDespawn(despawnDelay);