Do not correct Z of certain monsters.
This commit is contained in:
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -24,6 +24,8 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.sql.TerritoryTable;
|
||||
import org.l2jmobius.gameserver.data.xml.WalkerRouteData;
|
||||
import org.l2jmobius.gameserver.data.xml.ZoneData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.IdManager;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
@@ -31,6 +33,8 @@ import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
import org.l2jmobius.gameserver.model.quest.EventType;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -442,8 +446,22 @@ public class Spawn
|
||||
newlocz = _locZ;
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
final boolean monsterCheck = npc.isMonster() && (WalkerRouteData.getInstance().getRouteForNpc(npc.getNpcId()) == null) && (getInstanceId() == 0) && !npc.isRaid() && !npc.isMinion() && !npc.isFlying();
|
||||
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneData.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -452,6 +470,7 @@ public class Spawn
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
npc.stopAllEffects();
|
||||
|
||||
|
@@ -24,6 +24,8 @@ import java.util.logging.Logger;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.sql.TerritoryTable;
|
||||
import org.l2jmobius.gameserver.data.xml.WalkerRouteData;
|
||||
import org.l2jmobius.gameserver.data.xml.ZoneData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.IdManager;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
@@ -31,6 +33,8 @@ import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
import org.l2jmobius.gameserver.model.quest.EventType;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -442,8 +446,22 @@ public class Spawn
|
||||
newlocz = _locZ;
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
final boolean monsterCheck = npc.isMonster() && (WalkerRouteData.getInstance().getRouteForNpc(npc.getNpcId()) == null) && (getInstanceId() == 0) && !npc.isRaid() && !npc.isMinion() && !npc.isFlying();
|
||||
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneData.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -452,6 +470,7 @@ public class Spawn
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
npc.stopAllEffects();
|
||||
|
||||
|
@@ -31,14 +31,16 @@ import org.l2jmobius.gameserver.data.NpcPersonalAIData;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.NpcSpawnTerritory;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -386,21 +388,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, getInstanceId()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, getInstanceId()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -409,6 +424,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
npc.stopAllEffects();
|
||||
|
||||
|
@@ -31,14 +31,16 @@ import org.l2jmobius.gameserver.data.NpcPersonalAIData;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.NpcSpawnTerritory;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -386,21 +388,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, getInstanceId()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, getInstanceId()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -409,6 +424,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
npc.stopAllEffects();
|
||||
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
@@ -29,6 +29,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
@@ -36,7 +37,8 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.interfaces.IIdentifiable;
|
||||
import org.l2jmobius.gameserver.model.interfaces.INamable;
|
||||
import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneType;
|
||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||
import org.l2jmobius.gameserver.taskmanager.RespawnTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
@@ -392,21 +394,34 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS)
|
||||
final boolean monsterCheck = npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && (getInstanceId() == 0) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !npc.isFlying() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId());
|
||||
|
||||
// If random spawn system is enabled.
|
||||
if (Config.ENABLE_RANDOM_MONSTER_SPAWNS && monsterCheck)
|
||||
{
|
||||
final int randX = newlocx + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
final int randY = newlocy + Rnd.get(Config.MOB_MIN_SPAWN_RANGE, Config.MOB_MAX_SPAWN_RANGE);
|
||||
|
||||
if (npc.isMonster() && !npc.isQuestMonster() && !WalkingManager.getInstance().isTargeted(npc) && !npc.isInsideZone(ZoneId.NO_BOOKMARK) && (getInstanceId() == 0) && GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()) && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && !Config.MOBS_LIST_NOT_RANDOM.contains(npc.getId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(newlocx, newlocy, newlocz, randX, randY, newlocz, npc.getInstanceWorld()))
|
||||
{
|
||||
newlocx = randX;
|
||||
newlocy = randY;
|
||||
}
|
||||
}
|
||||
|
||||
// Correct Z of monsters. Do not correct Z of flying NPCs.
|
||||
if (npc.isMonster() && !npc.isFlying())
|
||||
// Correct Z of monsters.
|
||||
if (monsterCheck)
|
||||
{
|
||||
// Do not correct Z when in water zone.
|
||||
WaterZone water = null;
|
||||
for (ZoneType zone : ZoneManager.getInstance().getZones(newlocx, newlocy, newlocz))
|
||||
{
|
||||
if (zone instanceof WaterZone)
|
||||
{
|
||||
water = (WaterZone) zone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (water == null)
|
||||
{
|
||||
final int geoZ = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz) + 64;
|
||||
// Do not correct Z distances greater than 300.
|
||||
@@ -415,6 +430,7 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
||||
newlocz = geoZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
Reference in New Issue
Block a user