Use geodata to correct spawn z value.
This commit is contained in:
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.datatables.sql.TerritoryTable;
|
import org.l2jmobius.gameserver.datatables.sql.TerritoryTable;
|
||||||
|
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||||
import org.l2jmobius.gameserver.idfactory.IdFactory;
|
import org.l2jmobius.gameserver.idfactory.IdFactory;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||||
@@ -497,8 +498,15 @@ public class Spawn
|
|||||||
newlocz = _locZ;
|
newlocz = _locZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (npc != null)
|
// if (npc != null)
|
||||||
|
// {
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
{
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
npc.stopAllEffects();
|
npc.stopAllEffects();
|
||||||
|
|
||||||
// Set the HP and MP of the NpcInstance to the max
|
// Set the HP and MP of the NpcInstance to the max
|
||||||
@@ -534,7 +542,9 @@ public class Spawn
|
|||||||
|
|
||||||
// Increase the current number of NpcInstance managed by this Spawn
|
// Increase the current number of NpcInstance managed by this Spawn
|
||||||
_currentCount++;
|
_currentCount++;
|
||||||
}
|
|
||||||
|
// }
|
||||||
|
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -392,6 +392,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
npc.stopAllEffects();
|
npc.stopAllEffects();
|
||||||
|
|
||||||
npc.setIsDead(false);
|
npc.setIsDead(false);
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
@@ -398,6 +398,12 @@ public class Spawn extends Location implements IIdentifiable, INamable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not correct z of flying NPCs.
|
||||||
|
if (!npc.isFlying())
|
||||||
|
{
|
||||||
|
newlocz = GeoEngine.getInstance().getHeight(newlocx, newlocy, newlocz);
|
||||||
|
}
|
||||||
|
|
||||||
// Set is not random walk default value
|
// Set is not random walk default value
|
||||||
npc.setRandomWalking(_randomWalk);
|
npc.setRandomWalking(_randomWalk);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user