Prevent NPC spawns on top of buildings.
This commit is contained in:
@@ -26,7 +26,6 @@ import java.util.logging.Logger;
|
|||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
||||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
||||||
@@ -541,11 +540,12 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
|||||||
newlocz = getZ();
|
newlocz = getZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DO NOT CORRECT SPAWN Z IN GENERAL - Prevent NPC spawns on top of buildings
|
||||||
// don't correct z of flying npc's
|
// don't correct z of flying npc's
|
||||||
if (!npc.isFlying())
|
// if (!npc.isFlying())
|
||||||
{
|
// {
|
||||||
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
// newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(getRandomWalking());
|
npc.setRandomWalking(getRandomWalking());
|
||||||
|
@@ -26,7 +26,6 @@ import java.util.logging.Logger;
|
|||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
||||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
||||||
@@ -541,11 +540,12 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
|||||||
newlocz = getZ();
|
newlocz = getZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DO NOT CORRECT SPAWN Z IN GENERAL - Prevent NPC spawns on top of buildings
|
||||||
// don't correct z of flying npc's
|
// don't correct z of flying npc's
|
||||||
if (!npc.isFlying())
|
// if (!npc.isFlying())
|
||||||
{
|
// {
|
||||||
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
// newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(getRandomWalking());
|
npc.setRandomWalking(getRandomWalking());
|
||||||
|
@@ -26,7 +26,6 @@ import java.util.logging.Logger;
|
|||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
||||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
||||||
@@ -541,11 +540,12 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
|||||||
newlocz = getZ();
|
newlocz = getZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DO NOT CORRECT SPAWN Z IN GENERAL - Prevent NPC spawns on top of buildings
|
||||||
// don't correct z of flying npc's
|
// don't correct z of flying npc's
|
||||||
if (!npc.isFlying())
|
// if (!npc.isFlying())
|
||||||
{
|
// {
|
||||||
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
// newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(getRandomWalking());
|
npc.setRandomWalking(getRandomWalking());
|
||||||
|
@@ -620,11 +620,12 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DO NOT CORRECT SPAWN Z IN GENERAL - Prevent NPC spawns on top of buildings
|
||||||
// don't correct z of flying npc's
|
// don't correct z of flying npc's
|
||||||
if (!mob.isFlying())
|
// if (!npc.isFlying())
|
||||||
{
|
// {
|
||||||
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
// newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
}
|
// }
|
||||||
|
|
||||||
mob.stopAllEffects();
|
mob.stopAllEffects();
|
||||||
|
|
||||||
|
@@ -26,7 +26,6 @@ import java.util.logging.Logger;
|
|||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
||||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
|
||||||
@@ -541,11 +540,12 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
|||||||
newlocz = getZ();
|
newlocz = getZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DO NOT CORRECT SPAWN Z IN GENERAL - Prevent NPC spawns on top of buildings
|
||||||
// don't correct z of flying npc's
|
// don't correct z of flying npc's
|
||||||
if (!npc.isFlying())
|
// if (!npc.isFlying())
|
||||||
{
|
// {
|
||||||
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
// newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(getRandomWalking());
|
npc.setRandomWalking(getRandomWalking());
|
||||||
|
Reference in New Issue
Block a user