diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java index c50a086a26..4ff4745460 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java index c50a086a26..4ff4745460 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java index 45cb122680..1959558ed6 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java index 45cb122680..1959558ed6 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java index 45cb122680..1959558ed6 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java index 45cb122680..1959558ed6 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java index 45cb122680..1959558ed6 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java index 43372a52f8..14ca1bbeb7 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/Spawn.java index 1475559392..04aa26d913 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/Spawn.java @@ -100,7 +100,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -355,7 +355,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/WorldObject.java index 3f15babfa4..07c67b4c8d 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -539,9 +539,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java index e876f3aad5..6737d183db 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2469,15 +2469,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java index 38ff78f500..8a6147c013 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1721,15 +1721,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java index 38ff78f500..8a6147c013 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1721,15 +1721,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java index 38ff78f500..8a6147c013 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1721,15 +1721,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java index 3facf4b8c0..ba2cd65a40 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java index 3facf4b8c0..ba2cd65a40 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/Spawn.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/Spawn.java index 05966df2cb..78c3949b5d 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/Spawn.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/Spawn.java @@ -97,7 +97,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(NpcTemplate template) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); // Set the _template of the Spawn _template = template; @@ -122,7 +122,7 @@ public class Spawn extends Location implements IIdentifiable, INamable */ public Spawn(int npcId) throws SecurityException, ClassNotFoundException, NoSuchMethodException, ClassCastException { - super(0, 0, 0); + super(0, 0, -10000); _template = Objects.requireNonNull(NpcData.getInstance().getTemplate(npcId), "NpcTemplate not found for NPC ID: " + npcId); final String className = "org.l2jmobius.gameserver.model.actor.instance." + _template.getType() + "Instance"; @@ -361,7 +361,7 @@ public class Spawn extends Location implements IIdentifiable, INamable { int newlocx = 0; int newlocy = 0; - int newlocz = 0; + int newlocz = -10000; // If Locx and Locy are not defined, the NpcInstance must be spawned in an area defined by location or spawn territory // New method diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/WorldObject.java index 8cbf03fdc5..463ea7acc4 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -526,9 +526,13 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif return _worldRegion; } - public void setWorldRegion(WorldRegion value) + public void setWorldRegion(WorldRegion region) { - _worldRegion = value; + if ((region == null) && (_worldRegion != null)) + { + _worldRegion.removeVisibleObject(this); + } + _worldRegion = region; } /** diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java index 8c066bbdba..63e2c1f387 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1722,15 +1722,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set world region to null. setWorldRegion(null); - // Reset initial monster position. - if (isMonster() && (((Npc) this).getSpawn() != null)) - { - ThreadPool.schedule(() -> - { - setXYZ(0, 0, -10000); - }, 5000); - } - return true; }