From c8488b05c880735ca76a99d1d900b1bf2815b556 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 21 May 2018 15:07:29 +0000 Subject: [PATCH] Dropped L2Spawn spawnOne method. --- .../l2jmobius/gameserver/model/L2Spawn.java | 17 +++----------- .../model/events/AbstractScript.java | 2 +- .../l2jmobius/gameserver/model/L2Spawn.java | 17 +++----------- .../model/events/AbstractScript.java | 2 +- .../l2jmobius/gameserver/model/L2Spawn.java | 17 +++----------- .../model/events/AbstractScript.java | 2 +- .../l2jmobius/gameserver/model/L2Spawn.java | 17 +++----------- .../model/events/AbstractScript.java | 2 +- .../scripts/ai/others/AltarsOfSacrifice.java | 2 +- .../instancemanager/TerritoryWarManager.java | 2 +- .../l2jmobius/gameserver/model/L2Spawn.java | 22 +++++-------------- .../model/events/AbstractScript.java | 2 +- .../l2jmobius/gameserver/model/L2Spawn.java | 17 +++----------- .../model/events/AbstractScript.java | 2 +- .../l2jmobius/gameserver/model/L2Spawn.java | 17 +++----------- .../model/events/AbstractScript.java | 2 +- .../l2jmobius/gameserver/model/L2Spawn.java | 17 +++----------- .../model/events/AbstractScript.java | 2 +- 18 files changed, 37 insertions(+), 124 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java index b16bbb5990..1b7cb26b50 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData; import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.model.actor.L2Npc; 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.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.ILocational; @@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable private Constructor _constructor; /** If True a L2NpcInstance is respawned each time that another is killed */ private boolean _doRespawn = true; - /** If true then spawn is custom */ private final Deque _spawnedNpcs = new ConcurrentLinkedDeque<>(); private boolean _randomWalk = false; // Is no random walk 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() { @@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable public void setXYZ(ILocational loc) { setXYZ(loc.getX(), loc.getY(), loc.getZ()); - } /** @@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable 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 */ @@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable } _spawnedNpcs.add(npc); + + // Increase the current number of L2NpcInstance managed by this L2Spawn _currentCount++; // Minions diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/AbstractScript.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/AbstractScript.java index 12551f22ba..3d999d93e4 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/AbstractScript.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/events/AbstractScript.java @@ -2244,7 +2244,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime spawn.setZ(z); spawn.stopRespawn(); - final L2Npc npc = spawn.spawnOne(isSummonSpawn); + final L2Npc npc = spawn.doSpawn(isSummonSpawn); if (despawnDelay > 0) { npc.scheduleDespawn(despawnDelay); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java index b16bbb5990..1b7cb26b50 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData; import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.model.actor.L2Npc; 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.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.ILocational; @@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable private Constructor _constructor; /** If True a L2NpcInstance is respawned each time that another is killed */ private boolean _doRespawn = true; - /** If true then spawn is custom */ private final Deque _spawnedNpcs = new ConcurrentLinkedDeque<>(); private boolean _randomWalk = false; // Is no random walk 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() { @@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable public void setXYZ(ILocational loc) { setXYZ(loc.getX(), loc.getY(), loc.getZ()); - } /** @@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable 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 */ @@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable } _spawnedNpcs.add(npc); + + // Increase the current number of L2NpcInstance managed by this L2Spawn _currentCount++; // Minions diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/AbstractScript.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/AbstractScript.java index 12551f22ba..3d999d93e4 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/AbstractScript.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/events/AbstractScript.java @@ -2244,7 +2244,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime spawn.setZ(z); spawn.stopRespawn(); - final L2Npc npc = spawn.spawnOne(isSummonSpawn); + final L2Npc npc = spawn.doSpawn(isSummonSpawn); if (despawnDelay > 0) { npc.scheduleDespawn(despawnDelay); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java index b16bbb5990..1b7cb26b50 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData; import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.model.actor.L2Npc; 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.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.ILocational; @@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable private Constructor _constructor; /** If True a L2NpcInstance is respawned each time that another is killed */ private boolean _doRespawn = true; - /** If true then spawn is custom */ private final Deque _spawnedNpcs = new ConcurrentLinkedDeque<>(); private boolean _randomWalk = false; // Is no random walk 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() { @@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable public void setXYZ(ILocational loc) { setXYZ(loc.getX(), loc.getY(), loc.getZ()); - } /** @@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable 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 */ @@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable } _spawnedNpcs.add(npc); + + // Increase the current number of L2NpcInstance managed by this L2Spawn _currentCount++; // Minions diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/AbstractScript.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/AbstractScript.java index de9e909fa9..00b067dba5 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/AbstractScript.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/events/AbstractScript.java @@ -2245,7 +2245,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime spawn.setZ(z); spawn.stopRespawn(); - final L2Npc npc = spawn.spawnOne(isSummonSpawn); + final L2Npc npc = spawn.doSpawn(isSummonSpawn); if (despawnDelay > 0) { npc.scheduleDespawn(despawnDelay); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java index b16bbb5990..1b7cb26b50 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData; import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.model.actor.L2Npc; 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.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.ILocational; @@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable private Constructor _constructor; /** If True a L2NpcInstance is respawned each time that another is killed */ private boolean _doRespawn = true; - /** If true then spawn is custom */ private final Deque _spawnedNpcs = new ConcurrentLinkedDeque<>(); private boolean _randomWalk = false; // Is no random walk 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() { @@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable public void setXYZ(ILocational loc) { setXYZ(loc.getX(), loc.getY(), loc.getZ()); - } /** @@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable 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 */ @@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable } _spawnedNpcs.add(npc); + + // Increase the current number of L2NpcInstance managed by this L2Spawn _currentCount++; // Minions diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/AbstractScript.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/AbstractScript.java index de9e909fa9..00b067dba5 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/AbstractScript.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/events/AbstractScript.java @@ -2245,7 +2245,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime spawn.setZ(z); spawn.stopRespawn(); - final L2Npc npc = spawn.spawnOne(isSummonSpawn); + final L2Npc npc = spawn.doSpawn(isSummonSpawn); if (despawnDelay > 0) { npc.scheduleDespawn(despawnDelay); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/others/AltarsOfSacrifice.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/others/AltarsOfSacrifice.java index 3b96d9fe8b..c27a26ead9 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/others/AltarsOfSacrifice.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/ai/others/AltarsOfSacrifice.java @@ -64,7 +64,7 @@ public final class AltarsOfSacrifice extends AbstractNpcAI spawn.setXYZ(spawnX, spawnY, GeoEngine.getInstance().getHeight(spawnX, spawnY, _middlePoint.getZ())); spawn.stopRespawn(); - _spawnedBoss = spawn.spawnOne(false); + _spawnedBoss = spawn.doSpawn(false); } protected void despawnBoss() diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/TerritoryWarManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/TerritoryWarManager.java index f3a499aed7..82e701a88f 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/TerritoryWarManager.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/TerritoryWarManager.java @@ -739,7 +739,7 @@ public final class TerritoryWarManager implements Siegable spawnDat.setZ(loc.getZ()); spawnDat.setHeading(loc.getHeading()); spawnDat.stopRespawn(); - return spawnDat.spawnOne(false); + return spawnDat.doSpawn(false); } catch (Exception e) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java index 4aa3e56e91..6c5e74e2f0 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -65,7 +65,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable /** The identifier of the location area where L2NpcInstance can be spawned */ private int _locationId; /** 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 */ private NpcSpawnTerritory _spawnTerritory = null; /** Minimum respawn delay */ @@ -410,16 +410,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable return _currentCount; } - /** - * Create a L2NpcInstance in this L2Spawn. - * @param val - * @return - */ - public L2Npc spawnOne(boolean val) - { - return doSpawn(val); - } - /** * @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")) { _currentCount++; - return null; } @@ -519,10 +508,11 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable // New method if (_spawnTerritory != null) { - final Location p = _spawnTerritory.getRandomPoint(); - newlocx = p.getX(); - newlocy = p.getY(); - newlocz = p.getZ(); + final Location loc = _spawnTerritory.getRandomPoint(); + newlocx = loc.getX(); + newlocy = loc.getY(); + newlocz = loc.getZ(); + setLocation(loc); } else if ((getX() == 0) && (getY() == 0)) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/events/AbstractScript.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/events/AbstractScript.java index 80f42957b0..79d9d6bef1 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/events/AbstractScript.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/events/AbstractScript.java @@ -1879,7 +1879,7 @@ public abstract class AbstractScript extends ManagedScript spawn.setZ(z); spawn.stopRespawn(); - final L2Npc npc = spawn.spawnOne(isSummonSpawn); + final L2Npc npc = spawn.doSpawn(isSummonSpawn); if (despawnDelay > 0) { npc.scheduleDespawn(despawnDelay); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java index b16bbb5990..1b7cb26b50 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData; import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.model.actor.L2Npc; 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.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.ILocational; @@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable private Constructor _constructor; /** If True a L2NpcInstance is respawned each time that another is killed */ private boolean _doRespawn = true; - /** If true then spawn is custom */ private final Deque _spawnedNpcs = new ConcurrentLinkedDeque<>(); private boolean _randomWalk = false; // Is no random walk 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() { @@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable public void setXYZ(ILocational loc) { setXYZ(loc.getX(), loc.getY(), loc.getZ()); - } /** @@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable 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 */ @@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable } _spawnedNpcs.add(npc); + + // Increase the current number of L2NpcInstance managed by this L2Spawn _currentCount++; // Minions diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/AbstractScript.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/AbstractScript.java index 12551f22ba..3d999d93e4 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/AbstractScript.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/events/AbstractScript.java @@ -2244,7 +2244,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime spawn.setZ(z); spawn.stopRespawn(); - final L2Npc npc = spawn.spawnOne(isSummonSpawn); + final L2Npc npc = spawn.doSpawn(isSummonSpawn); if (despawnDelay > 0) { npc.scheduleDespawn(despawnDelay); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java index b16bbb5990..1b7cb26b50 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData; import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.model.actor.L2Npc; 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.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.ILocational; @@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable private Constructor _constructor; /** If True a L2NpcInstance is respawned each time that another is killed */ private boolean _doRespawn = true; - /** If true then spawn is custom */ private final Deque _spawnedNpcs = new ConcurrentLinkedDeque<>(); private boolean _randomWalk = false; // Is no random walk 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() { @@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable public void setXYZ(ILocational loc) { setXYZ(loc.getX(), loc.getY(), loc.getZ()); - } /** @@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable 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 */ @@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable } _spawnedNpcs.add(npc); + + // Increase the current number of L2NpcInstance managed by this L2Spawn _currentCount++; // Minions diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/events/AbstractScript.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/events/AbstractScript.java index 12551f22ba..3d999d93e4 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/events/AbstractScript.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/events/AbstractScript.java @@ -2244,7 +2244,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime spawn.setZ(z); spawn.stopRespawn(); - final L2Npc npc = spawn.spawnOne(isSummonSpawn); + final L2Npc npc = spawn.doSpawn(isSummonSpawn); if (despawnDelay > 0) { npc.scheduleDespawn(despawnDelay); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Spawn.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Spawn.java index b16bbb5990..1b7cb26b50 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Spawn.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/L2Spawn.java @@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.data.xml.impl.NpcData; import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.model.actor.L2Npc; 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.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.interfaces.ILocational; @@ -73,7 +72,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable private Constructor _constructor; /** If True a L2NpcInstance is respawned each time that another is killed */ private boolean _doRespawn = true; - /** If true then spawn is custom */ private final Deque _spawnedNpcs = new ConcurrentLinkedDeque<>(); private boolean _randomWalk = false; // Is no random walk 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() { @@ -274,7 +272,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable public void setXYZ(ILocational loc) { setXYZ(loc.getX(), loc.getY(), loc.getZ()); - } /** @@ -416,16 +413,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable 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 */ @@ -589,6 +576,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable } _spawnedNpcs.add(npc); + + // Increase the current number of L2NpcInstance managed by this L2Spawn _currentCount++; // Minions diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/events/AbstractScript.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/events/AbstractScript.java index 12551f22ba..3d999d93e4 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/events/AbstractScript.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/events/AbstractScript.java @@ -2244,7 +2244,7 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime spawn.setZ(z); spawn.stopRespawn(); - final L2Npc npc = spawn.spawnOne(isSummonSpawn); + final L2Npc npc = spawn.doSpawn(isSummonSpawn); if (despawnDelay > 0) { npc.scheduleDespawn(despawnDelay);