Diagonal movement GeoEngine.
This commit is contained in:
@@ -18,7 +18,7 @@ package ai.group_template;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.L2Spawn;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
@@ -62,7 +62,7 @@ public final class AltarsOfSacrifice extends AbstractNpcAI
|
||||
final int spawnX = (int) (radius * Math.cos(angleRadians)) + _middlePoint.getX();
|
||||
final int spawnY = (int) (radius * Math.sin(angleRadians)) + _middlePoint.getY();
|
||||
|
||||
spawn.setXYZ(spawnX, spawnY, GeoData.getInstance().getHeight(spawnX, spawnY, _middlePoint.getZ()));
|
||||
spawn.setXYZ(spawnX, spawnY, GeoEngine.getInstance().getHeight(spawnX, spawnY, _middlePoint.getZ()));
|
||||
spawn.stopRespawn();
|
||||
_spawnedBoss = spawn.spawnOne(false);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package ai.group_template;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
@@ -71,7 +71,7 @@ public final class FleeMonsters extends AbstractNpcAI
|
||||
final int posY = (int) (npc.getY() + (FLEE_DISTANCE * Math.sin(radians)));
|
||||
final int posZ = npc.getZ();
|
||||
|
||||
final Location destination = GeoData.getInstance().moveCheck(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, attacker.getInstanceId());
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, attacker.getInstanceId());
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package ai.group_template;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
@@ -78,7 +78,7 @@ public final class PlainsOfDion extends AbstractNpcAI
|
||||
|
||||
for (L2Character obj : npc.getKnownList().getKnownCharactersInRadius(npc.getTemplate().getClanHelpRange()))
|
||||
{
|
||||
if (obj.isMonster() && Util.contains(DELU_LIZARDMEN, obj.getId()) && !obj.isAttackingNow() && !obj.isDead() && GeoData.getInstance().canSeeTarget(npc, obj))
|
||||
if (obj.isMonster() && Util.contains(DELU_LIZARDMEN, obj.getId()) && !obj.isAttackingNow() && !obj.isDead() && GeoEngine.getInstance().canSeeTarget(npc, obj))
|
||||
{
|
||||
final L2Npc monster = (L2Npc) obj;
|
||||
addAttackDesire(monster, player);
|
||||
|
||||
@@ -18,7 +18,7 @@ package ai.group_template;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.handler.ItemHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
@@ -269,7 +269,7 @@ public final class PrimevalIsle extends AbstractNpcAI
|
||||
final double cos = Math.cos(radian);
|
||||
final int newX = (int) (npc.getX() + (cos * distance));
|
||||
final int newY = (int) (npc.getY() + (sin * distance));
|
||||
final Location loc = GeoData.getInstance().moveCheck(npc.getX(), npc.getY(), npc.getZ(), newX, newY, npc.getZ(), npc.getInstanceId());
|
||||
final Location loc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, npc.getZ(), npc.getInstanceId());
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, loc, 0);
|
||||
}
|
||||
else if (ag_type == 1)
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.l2jmobius.gameserver.datatables.SkillData;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
@@ -222,7 +222,7 @@ public final class ScarletVanHalisha extends AbstractNpcAI
|
||||
continue;
|
||||
}
|
||||
|
||||
if (((((L2Character) obj).getZ() < (npc.getZ() - 100)) && (((L2Character) obj).getZ() > (npc.getZ() + 100))) || !GeoData.getInstance().canSeeTarget(((L2Character) obj).getX(), ((L2Character) obj).getY(), ((L2Character) obj).getZ(), npc.getX(), npc.getY(), npc.getZ()))
|
||||
if (((((L2Character) obj).getZ() < (npc.getZ() - 100)) && (((L2Character) obj).getZ() > (npc.getZ() + 100))) || !GeoEngine.getInstance().canSeeTarget(obj, npc))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.datatables.SkillData;
|
||||
import com.l2jmobius.gameserver.enums.MountType;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
@@ -477,7 +477,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
final int posX = x + getRandom(-1400, 1400);
|
||||
final int posY = y + getRandom(-1400, 1400);
|
||||
|
||||
if (GeoData.getInstance().canMove(x, y, z, posX, posY, z, npc.getInstanceId()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(x, y, z, posX, posY, z, npc.getInstanceId()))
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(posX, posY, z, 0));
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.L2Spawn;
|
||||
import com.l2jmobius.gameserver.model.L2Territory;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
@@ -228,7 +228,7 @@ public class TarBeetleSpawn implements IXmlReader
|
||||
spawn.setHeading(Rnd.get(65535));
|
||||
spawn.setX(location.getX());
|
||||
spawn.setY(location.getY());
|
||||
spawn.setZ(GeoData.getInstance().getSpawnHeight(location));
|
||||
spawn.setZ(GeoEngine.getInstance().getHeight(location.getX(), location.getY(), location.getZ()));
|
||||
|
||||
final L2Npc npc = spawn.doSpawn();
|
||||
npc.setIsNoRndWalk(true);
|
||||
|
||||
@@ -19,7 +19,7 @@ package handlers.actionhandlers;
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.InstanceType;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IActionHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
@@ -82,13 +82,13 @@ public class L2NpcAction implements IActionHandler
|
||||
// Check if the activeChar is attackable (without a forced attack) and isn't dead
|
||||
if (target.isAutoAttackable(activeChar) && !((L2Npc) target).isAlikeDead())
|
||||
{
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, target))
|
||||
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, target);
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), target.getX(), target.getY(), target.getZ(), activeChar.getInstanceId());
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package handlers.actionhandlers;
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.InstanceType;
|
||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IActionHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
@@ -102,13 +102,13 @@ public class L2PcInstanceAction implements IActionHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, player))
|
||||
if (GeoEngine.getInstance().canSeeTarget(activeChar, player))
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, player);
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), player.getX(), player.getY(), player.getZ(), activeChar.getInstanceId());
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
||||
}
|
||||
activeChar.onActionRequest();
|
||||
@@ -118,13 +118,13 @@ public class L2PcInstanceAction implements IActionHandler
|
||||
{
|
||||
// This Action Failed packet avoids activeChar getting stuck when clicking three or more times
|
||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, player))
|
||||
if (GeoEngine.getInstance().canSeeTarget(activeChar, player))
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, player);
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), player.getX(), player.getY(), player.getZ(), activeChar.getInstanceId());
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package handlers.actionhandlers;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.InstanceType;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IActionHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
@@ -58,7 +58,7 @@ public class L2PetInstanceAction implements IActionHandler
|
||||
// Check if the pet is attackable (without a forced attack) and isn't dead
|
||||
if (target.isAutoAttackable(activeChar) && !isOwner)
|
||||
{
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, target))
|
||||
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
|
||||
{
|
||||
// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
@@ -67,7 +67,7 @@ public class L2PetInstanceAction implements IActionHandler
|
||||
}
|
||||
else if (!((L2Character) target).isInsideRadius(activeChar, 150, false, false))
|
||||
{
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, target))
|
||||
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target);
|
||||
activeChar.onActionRequest();
|
||||
|
||||
@@ -18,7 +18,7 @@ package handlers.actionhandlers;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.InstanceType;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IActionHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
@@ -58,7 +58,7 @@ public class L2SummonAction implements IActionHandler
|
||||
{
|
||||
if (target.isAutoAttackable(activeChar))
|
||||
{
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, target))
|
||||
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
activeChar.onActionRequest();
|
||||
@@ -74,7 +74,7 @@ public class L2SummonAction implements IActionHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, target))
|
||||
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
@@ -54,12 +54,12 @@ public class AdminGeodata implements IAdminCommandHandler
|
||||
final int worldX = activeChar.getX();
|
||||
final int worldY = activeChar.getY();
|
||||
final int worldZ = activeChar.getZ();
|
||||
final int geoX = GeoData.getInstance().getGeoX(worldX);
|
||||
final int geoY = GeoData.getInstance().getGeoY(worldY);
|
||||
final int geoX = GeoEngine.getInstance().getGeoX(worldX);
|
||||
final int geoY = GeoEngine.getInstance().getGeoY(worldY);
|
||||
|
||||
if (GeoData.getInstance().hasGeoPos(geoX, geoY))
|
||||
if (GeoEngine.getInstance().hasGeoPos(geoX, geoY))
|
||||
{
|
||||
activeChar.sendMessage("WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoData.getInstance().getNearestZ(geoX, geoY, worldZ));
|
||||
activeChar.sendMessage("WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(geoX, geoY, worldZ));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -72,12 +72,12 @@ public class AdminGeodata implements IAdminCommandHandler
|
||||
final int worldX = activeChar.getX();
|
||||
final int worldY = activeChar.getY();
|
||||
final int worldZ = activeChar.getZ();
|
||||
final int geoX = GeoData.getInstance().getGeoX(worldX);
|
||||
final int geoY = GeoData.getInstance().getGeoY(worldY);
|
||||
final int geoX = GeoEngine.getInstance().getGeoX(worldX);
|
||||
final int geoY = GeoEngine.getInstance().getGeoY(worldY);
|
||||
|
||||
if (GeoData.getInstance().hasGeoPos(geoX, geoY))
|
||||
if (GeoEngine.getInstance().hasGeoPos(geoX, geoY))
|
||||
{
|
||||
activeChar.sendMessage("WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoData.getInstance().getSpawnHeight(worldX, worldY, worldZ));
|
||||
activeChar.sendMessage("WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -90,7 +90,7 @@ public class AdminGeodata implements IAdminCommandHandler
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target != null)
|
||||
{
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, target))
|
||||
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
|
||||
{
|
||||
activeChar.sendMessage("Can move beeline.");
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class AdminGeodata implements IAdminCommandHandler
|
||||
final L2Object target = activeChar.getTarget();
|
||||
if (target != null)
|
||||
{
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, target))
|
||||
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
|
||||
{
|
||||
activeChar.sendMessage("Can see target.");
|
||||
}
|
||||
|
||||
@@ -18,78 +18,49 @@ package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.geodata.pathfinding.AbstractNodeLoc;
|
||||
import com.l2jmobius.gameserver.geodata.pathfinding.PathFinding;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
|
||||
public class AdminPathNode implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_pn_info",
|
||||
"admin_show_path",
|
||||
"admin_path_debug",
|
||||
"admin_show_pn",
|
||||
"admin_find_path",
|
||||
"admin_path_find",
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||
{
|
||||
if (command.equals("admin_pn_info"))
|
||||
if (command.equals("admin_path_find"))
|
||||
{
|
||||
final String[] info = PathFinding.getInstance().getStat();
|
||||
if (info == null)
|
||||
{
|
||||
activeChar.sendMessage("Not supported");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (String msg : info)
|
||||
{
|
||||
activeChar.sendMessage(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (command.equals("admin_show_path"))
|
||||
{
|
||||
|
||||
}
|
||||
else if (command.equals("admin_path_debug"))
|
||||
{
|
||||
|
||||
}
|
||||
else if (command.equals("admin_show_pn"))
|
||||
{
|
||||
|
||||
}
|
||||
else if (command.equals("admin_find_path"))
|
||||
{
|
||||
if (Config.PATHFINDING == 0)
|
||||
{
|
||||
activeChar.sendMessage("PathFinding is disabled.");
|
||||
return true;
|
||||
}
|
||||
if (activeChar.getTarget() != null)
|
||||
{
|
||||
final List<AbstractNodeLoc> path = PathFinding.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceId(), true);
|
||||
List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceId(), true);
|
||||
if (path == null)
|
||||
{
|
||||
activeChar.sendMessage("No Route!");
|
||||
return true;
|
||||
activeChar.sendMessage("No route found or pathfinding disabled.");
|
||||
}
|
||||
for (AbstractNodeLoc a : path)
|
||||
else
|
||||
{
|
||||
activeChar.sendMessage("x:" + a.getX() + " y:" + a.getY() + " z:" + a.getZ());
|
||||
for (Location point : path)
|
||||
{
|
||||
activeChar.sendMessage("x:" + point.getX() + " y:" + point.getY() + " z:" + point.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.sendMessage("No Target!");
|
||||
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public class AdminServerInfo implements IAdminCommandHandler
|
||||
html.replace("%slots%", getPlayersCount("ALL") + "/" + Config.MAXIMUM_ONLINE_USERS);
|
||||
html.replace("%gameTime%", GameTimeController.getInstance().getGameHour() + ":" + GameTimeController.getInstance().getGameMinute());
|
||||
html.replace("%dayNight%", GameTimeController.getInstance().isNight() ? "Night" : "Day");
|
||||
html.replace("%geodata%", Config.PATHFINDING > 0 ? "Enabled" : "Disabled");
|
||||
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
|
||||
html.replace("%serverTime%", fmt.format(new Date(System.currentTimeMillis())));
|
||||
html.replace("%serverUpTime%", getServerUpTime());
|
||||
html.replace("%onlineAll%", getPlayersCount("ALL"));
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.enums.PlayerAction;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
@@ -262,7 +262,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
|
||||
{
|
||||
final int x = zone.getX()[i];
|
||||
final int y = zone.getY()[i];
|
||||
holder.addNode(new Location(x, y, GeoData.getInstance().getSpawnHeight(x, y, Rnd.get(zone.getLowZ(), zone.getHighZ()))));
|
||||
holder.addNode(new Location(x, y, GeoEngine.getInstance().getHeight(x, y, Rnd.get(zone.getLowZ(), zone.getHighZ()))));
|
||||
}
|
||||
showPoints(activeChar);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
@@ -70,7 +70,7 @@ public final class Blink extends AbstractEffect
|
||||
final int y = effected.getY() + y1;
|
||||
final int z = effected.getZ();
|
||||
|
||||
final Location destination = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceId());
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceId());
|
||||
|
||||
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.DUMMY));
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
@@ -91,7 +91,7 @@ public final class EnemyCharge extends AbstractEffect
|
||||
final int y = curY + (int) ((distance - offset) * sin);
|
||||
final int z = info.getEffected().getZ();
|
||||
|
||||
final Location destination = GeoData.getInstance().moveCheck(info.getEffector().getX(), info.getEffector().getY(), info.getEffector().getZ(), x, y, z, info.getEffector().getInstanceId());
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(info.getEffector().getX(), info.getEffector().getY(), info.getEffector().getZ(), x, y, z, info.getEffector().getInstanceId());
|
||||
|
||||
info.getEffector().broadcastPacket(new FlyToLocation(info.getEffector(), destination, FlyType.CHARGE));
|
||||
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.PcCondOverride;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
@@ -237,19 +238,19 @@ public final class Fishing extends AbstractEffect
|
||||
// always use water zone, fishing zone high z is high in the air...
|
||||
final int baitZ = waterZone.getWaterZ();
|
||||
|
||||
if (!GeoData.getInstance().canSeeTarget(player.getX(), player.getY(), player.getZ(), baitX, baitY, baitZ))
|
||||
if (!GeoEngine.getInstance().canSeeTarget(player, new Location(baitX, baitY, baitZ)))
|
||||
{
|
||||
return Integer.MIN_VALUE;
|
||||
}
|
||||
|
||||
if (GeoData.getInstance().hasGeo(baitX, baitY))
|
||||
if (GeoEngine.getInstance().hasGeo(baitX, baitY))
|
||||
{
|
||||
if (GeoData.getInstance().getHeight(baitX, baitY, baitZ) > baitZ)
|
||||
if (GeoEngine.getInstance().getHeight(baitX, baitY, baitZ) > baitZ)
|
||||
{
|
||||
return Integer.MIN_VALUE;
|
||||
}
|
||||
|
||||
if (GeoData.getInstance().getHeight(baitX, baitY, player.getZ()) > baitZ)
|
||||
if (GeoEngine.getInstance().getHeight(baitX, baitY, player.getZ()) > baitZ)
|
||||
{
|
||||
return Integer.MIN_VALUE;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
@@ -78,7 +78,7 @@ public final class TeleportToTarget extends AbstractEffect
|
||||
final int y = (int) (py + (25 * Math.sin(ph)));
|
||||
final int z = target.getZ();
|
||||
|
||||
final Location loc = GeoData.getInstance().moveCheck(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceId());
|
||||
final Location loc = GeoEngine.getInstance().canMoveToTargetLoc(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceId());
|
||||
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
activeChar.broadcastPacket(new FlyToLocation(activeChar, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
@@ -95,7 +95,7 @@ public final class ThrowUp extends AbstractEffect
|
||||
final int y = info.getEffector().getY() - (int) (offset * sin);
|
||||
final int z = info.getEffected().getZ();
|
||||
|
||||
final Location destination = GeoData.getInstance().moveCheck(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), x, y, z, info.getEffected().getInstanceId());
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), x, y, z, info.getEffected().getInstanceId());
|
||||
|
||||
info.getEffected().broadcastPacket(new FlyToLocation(info.getEffected(), destination, FlyType.THROW_UP));
|
||||
// TODO: Review.
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.handler.ITargetTypeHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
@@ -100,7 +100,7 @@ public class AreaFriendly implements ITargetTypeHandler
|
||||
|
||||
private boolean checkTarget(L2PcInstance activeChar, L2Character target)
|
||||
{
|
||||
if (!GeoData.getInstance().canSeeTarget(activeChar, target))
|
||||
if (!GeoEngine.getInstance().canSeeTarget(activeChar, target))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.datatables.SkillData;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.enums.TrapAction;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.L2Party;
|
||||
@@ -682,7 +682,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
final int _y = effector.getY() - (int) (offset * sin);
|
||||
final int _z = effected.getZ();
|
||||
|
||||
final Location destination = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), _x, _y, _z, effected.getInstanceId());
|
||||
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(effected.getX(), effected.getY(), effected.getZ(), _x, _y, _z, effected.getInstanceId());
|
||||
|
||||
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.w3c.dom.Node;
|
||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.InstanceType;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import com.l2jmobius.gameserver.model.L2CommandChannel;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
@@ -569,7 +569,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IXmlRea
|
||||
final Location location = _spawnZoneList.get(spw.zone).getRandomPoint();
|
||||
if (location != null)
|
||||
{
|
||||
spawn(world, spw.npcId, location.getX(), location.getY(), GeoData.getInstance().getSpawnHeight(location), getRandom(65535), spw.isNeededNextFlag);
|
||||
spawn(world, spw.npcId, location.getX(), location.getY(), GeoEngine.getInstance().getHeight(location.getX(), location.getY(), location.getZ()), getRandom(65535), spw.isNeededNextFlag);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user