Prevent NPC spawns on top of buildings.

This commit is contained in:
MobiusDev 2017-09-11 02:29:39 +00:00
parent d096d02f97
commit d91843d43c
5 changed files with 25 additions and 24 deletions

View File

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

View File

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

View File

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

View File

@ -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
if (!mob.isFlying())
{
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
}
// if (!npc.isFlying())
// {
// newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
// }
mob.stopAllEffects();

View File

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