Removed deleteMe position reset task.

This commit is contained in:
MobiusDevelopment 2019-09-29 21:47:35 +00:00
parent bb447c945f
commit c2b6be2a40
45 changed files with 134 additions and 209 deletions

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}
/**

View File

@ -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;
}