Diagonal movement GeoEngine.

This commit is contained in:
MobiusDev
2017-08-26 20:50:32 +00:00
parent 1e943ff506
commit 05f0a141c3
549 changed files with 25017 additions and 20141 deletions

View File

@@ -31,7 +31,7 @@ import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.ThreadPoolManager;
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.instancemanager.GlobalVariablesManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.Location;
@@ -294,7 +294,7 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
{
if ((npc != null) && !npc.isDead())
{
final Location destination = GeoData.getInstance().moveCheck(npc.getX(), npc.getY(), npc.getZ(), npc.getSpawn().getLocation().getX() + getRandom(-400, 400), npc.getSpawn().getLocation().getY() + getRandom(-400, 400), npc.getZ(), npc.getInstanceWorld());
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), npc.getSpawn().getLocation().getX() + getRandom(-400, 400), npc.getSpawn().getLocation().getY() + getRandom(-400, 400), npc.getZ(), npc.getInstanceWorld());
if (Util.calculateDistance(npc, npc.getSpawn().getLocation(), false, false) < 600)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);

View File

@@ -20,7 +20,7 @@ import java.util.List;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.StatsSet;
@@ -92,7 +92,7 @@ public final class KartiaHelperAdolph extends AbstractNpcAI
{
final L2MonsterInstance monster = monsterList.get(getRandom(monsterList.size()));
if (monster.isTargetable() && GeoData.getInstance().canSeeTarget(npc, monster) && !CommonUtil.contains(MIRRORS, monster.getId()))
if (monster.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, monster) && !CommonUtil.contains(MIRRORS, monster.getId()))
{
actionFound = true;
addAttackDesire(npc, monster);
@@ -115,7 +115,7 @@ public final class KartiaHelperAdolph extends AbstractNpcAI
final double radian = Math.toRadians(Util.convertHeadingToDegree(instancePlayer.getHeading()));
final int X = (int) (instancePlayer.getX() + (Math.cos(radian) * 150));
final int Y = (int) (instancePlayer.getY() + (Math.sin(radian) * 150));
final Location loc = GeoData.getInstance().moveCheck(instancePlayer.getX(), instancePlayer.getY(), instancePlayer.getZ(), X, Y, instancePlayer.getZ(), instance);
final Location loc = GeoEngine.getInstance().canMoveToTargetLoc(instancePlayer.getX(), instancePlayer.getY(), instancePlayer.getZ(), X, Y, instancePlayer.getZ(), instance);
if (!npc.isInsideRadius(loc, 50, true, true))
{

View File

@@ -19,7 +19,7 @@ package ai.areas.KartiasLabyrinth;
import java.util.List;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -64,7 +64,7 @@ public final class KartiaSupportTroop extends AbstractNpcAI
{
final L2MonsterInstance monster = monsterList.get(getRandom(monsterList.size()));
if (monster.isTargetable() && GeoData.getInstance().canSeeTarget(npc, monster))
if (monster.isTargetable() && GeoEngine.getInstance().canSeeTarget(npc, monster))
{
addAttackDesire(npc, monster);
}

View File

@@ -18,7 +18,7 @@ package ai.areas.PlainsOfDion;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
@@ -78,7 +78,7 @@ public final class PlainsOfDion extends AbstractNpcAI
L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, npc.getTemplate().getClanHelpRange(), obj ->
{
if (CommonUtil.contains(DELU_LIZARDMEN, obj.getId()) && !obj.isAttackingNow() && !obj.isDead() && GeoData.getInstance().canSeeTarget(npc, obj))
if (CommonUtil.contains(DELU_LIZARDMEN, obj.getId()) && !obj.isAttackingNow() && !obj.isDead() && GeoEngine.getInstance().canSeeTarget(npc, obj))
{
addAttackPlayerDesire(obj, player);
obj.broadcastSay(ChatType.NPC_GENERAL, MONSTERS_ASSIST_MSG[getRandom(3)]);

View File

@@ -19,7 +19,7 @@ package ai.areas.PrimevalIsle;
import com.l2jmobius.commons.util.CommonUtil;
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.L2World;
@@ -270,7 +270,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.getInstanceWorld());
final Location loc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, npc.getZ(), npc.getInstanceWorld());
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, loc, 0);
}
else if (ag_type == 1)

View File

@@ -17,7 +17,8 @@
package ai.areas.TalkingIsland;
import com.l2jmobius.gameserver.enums.ChatType;
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.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -74,14 +75,16 @@ public final class BoyAndGirl extends AbstractNpcAI
getTimers().addTimer("NPC_CHANGEWEAP", 15000 + (getRandom(5) * 1000), npc, null);
getTimers().addTimer("NPC_SHOUT", 10000 + (getRandom(5) * 1000), npc, null);
npc.setIsRunning(true);
addMoveToDesire(npc, GeoData.getInstance().moveCheck(npc.getLocation(), Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600), npc.getInstanceWorld()), 23);
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
return super.onSpawn(npc);
}
@Override
public void onMoveFinished(L2Npc npc)
{
addMoveToDesire(npc, GeoData.getInstance().moveCheck(npc.getLocation(), Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600), npc.getInstanceWorld()), 23);
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 200, 600);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
super.onMoveFinished(npc);
}

View File

@@ -17,7 +17,8 @@
package ai.areas.TalkingIsland;
import com.l2jmobius.gameserver.enums.ChatType;
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.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -47,8 +48,8 @@ public final class Devno extends AbstractNpcAI
{
if (getRandomBoolean())
{
addMoveToDesire(npc, GeoData.getInstance().moveCheck(npc.getLocation(), Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500), npc.getInstanceWorld()), 23);
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
}
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
}

View File

@@ -17,7 +17,8 @@
package ai.areas.TalkingIsland;
import com.l2jmobius.gameserver.enums.ChatType;
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.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -47,7 +48,8 @@ public final class Eleve extends AbstractNpcAI
{
if (getRandomBoolean())
{
addMoveToDesire(npc, GeoData.getInstance().moveCheck(npc.getLocation(), Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500), npc.getInstanceWorld()), 23);
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
}
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
}

View File

@@ -16,7 +16,7 @@
*/
package ai.areas.TalkingIsland;
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.instance.L2PcInstance;
@@ -46,7 +46,7 @@ public final class Handermonkey extends AbstractNpcAI
{
final int x = npc.getSpawn().getX() + (getRandom(-100, 100));
final int y = npc.getSpawn().getY() + (getRandom(-100, 100));
final Location loc = GeoData.getInstance().moveCheck(npc.getX(), npc.getY(), npc.getZ(), x, y, npc.getZ(), npc.getInstanceWorld());
final Location loc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x, y, npc.getZ(), npc.getInstanceWorld());
addMoveToDesire(npc, loc, 0);
}
else

View File

@@ -17,7 +17,8 @@
package ai.areas.TalkingIsland;
import com.l2jmobius.gameserver.enums.ChatType;
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.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -47,7 +48,8 @@ public final class Karonf extends AbstractNpcAI
{
if (getRandomBoolean())
{
addMoveToDesire(npc, GeoData.getInstance().moveCheck(npc.getLocation(), Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500), npc.getInstanceWorld()), 23);
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
}
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
}

View File

@@ -17,7 +17,8 @@
package ai.areas.TalkingIsland;
import com.l2jmobius.gameserver.enums.ChatType;
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.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -47,7 +48,8 @@ public final class Marsha extends AbstractNpcAI
{
if (getRandomBoolean())
{
addMoveToDesire(npc, GeoData.getInstance().moveCheck(npc.getLocation(), Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500), npc.getInstanceWorld()), 23);
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
}
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
}

View File

@@ -17,7 +17,8 @@
package ai.areas.TalkingIsland;
import com.l2jmobius.gameserver.enums.ChatType;
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.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -47,7 +48,8 @@ public final class Morgan extends AbstractNpcAI
{
if (getRandomBoolean())
{
addMoveToDesire(npc, GeoData.getInstance().moveCheck(npc.getLocation(), Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500), npc.getInstanceWorld()), 23);
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
}
getTimers().addTimer("NPC_MOVE", (10 + getRandom(5)) * 1000, npc, null);
}

View File

@@ -17,7 +17,8 @@
package ai.areas.TalkingIsland;
import com.l2jmobius.gameserver.enums.ChatType;
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.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -47,7 +48,8 @@ public final class Rubentis extends AbstractNpcAI
{
if (getRandomBoolean())
{
addMoveToDesire(npc, GeoData.getInstance().moveCheck(npc.getLocation(), Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500), npc.getInstanceWorld()), 23);
final Location randomLoc = Util.getRandomPosition(npc.getSpawn().getLocation(), 0, 500);
addMoveToDesire(npc, GeoEngine.getInstance().canMoveToTargetLoc(npc.getLocation().getX(), npc.getLocation().getY(), npc.getLocation().getZ(), randomLoc.getX(), randomLoc.getY(), randomLoc.getZ(), npc.getInstanceWorld()), 23);
}
getTimers().addTimer("NPC_MOVE", 10000 + (getRandom(5) * 1000), npc, null);
}

View File

@@ -23,7 +23,7 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import com.l2jmobius.gameserver.data.xml.impl.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;
@@ -224,7 +224,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;
}

View File

@@ -33,7 +33,7 @@ import com.l2jmobius.commons.util.IGameXmlReader;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.Movie;
import com.l2jmobius.gameserver.enums.TrapAction;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
import com.l2jmobius.gameserver.model.L2Territory;
import com.l2jmobius.gameserver.model.L2World;
@@ -340,7 +340,7 @@ public final class Stage1 extends AbstractInstance implements IGameXmlReader
final Location location = terr.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);
}
}
}

View File

@@ -23,7 +23,7 @@ import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.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.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2World;
@@ -475,7 +475,7 @@ public final class Valakas extends AbstractNpcAI
{
final int posX = npc.getX() + getRandom(-1400, 1400);
final int posY = npc.getY() + getRandom(-1400, 1400);
if (GeoData.getInstance().canMove(npc, posX, posY, npc.getZ()))
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), posX, posY, npc.getZ(), npc.getInstanceWorld()))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(posX, posY, npc.getZ(), 0));
}

View File

@@ -17,7 +17,7 @@
package ai.others;
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;
@@ -69,7 +69,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.getInstanceWorld());
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, attacker.getInstanceWorld());
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
return super.onAttack(npc, attacker, damage, isSummon);
}

View File

@@ -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.actor.L2Character;
@@ -93,7 +93,7 @@ public class L2PcInstanceAction implements IActionHandler
}
else
{
if (GeoData.getInstance().canSeeTarget(activeChar, target))
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
activeChar.onActionRequest();
@@ -104,7 +104,7 @@ 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, target))
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
}

View File

@@ -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();

View File

@@ -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();
@@ -72,7 +72,7 @@ public class L2SummonAction implements IActionHandler
{
activeChar.updateNotMoveUntil();
}
else if (GeoData.getInstance().canSeeTarget(activeChar, target))
else if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
}

View File

@@ -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(worldX, worldY, 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.");
}

View File

@@ -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.getInstanceWorld(), 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.getInstanceWorld(), 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;
}

View File

@@ -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"));

View File

@@ -29,7 +29,7 @@ import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.datatables.SpawnTable;
import com.l2jmobius.gameserver.enums.AdminTeleportType;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import com.l2jmobius.gameserver.instancemanager.MapRegionManager;
@@ -194,7 +194,7 @@ public class AdminTeleport implements IAdminCommandHandler
st.nextToken();
final int x = (int) Float.parseFloat(st.nextToken());
final int y = (int) Float.parseFloat(st.nextToken());
final int z = st.hasMoreTokens() ? ((int) Float.parseFloat(st.nextToken())) : GeoData.getInstance().getHeight(x, y, L2World.MAP_MAX_Z);
final int z = st.hasMoreTokens() ? ((int) Float.parseFloat(st.nextToken())) : GeoEngine.getInstance().getHeight(x, y, L2World.MAP_MAX_Z);
activeChar.teleToLocation(x, y, z);
}

View File

@@ -34,7 +34,7 @@ import com.l2jmobius.Config;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.commons.util.Rnd;
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;
@@ -301,7 +301,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);
}

View File

@@ -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;
@@ -89,7 +89,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.getInstanceWorld());
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));

View File

@@ -19,7 +19,7 @@ package handlers.effecthandlers;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.Race;
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;
@@ -90,7 +90,7 @@ public final class Fear extends AbstractEffect
final int posY = (int) (effected.getY() + (FEAR_RANGE * Math.sin(radians)));
final int posZ = effected.getZ();
final Location destination = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), posX, posY, posZ, effected.getInstanceWorld());
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(effected.getX(), effected.getY(), effected.getZ(), posX, posY, posZ, effected.getInstanceWorld());
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
}
}

View File

@@ -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.actor.L2Character;
@@ -57,7 +57,7 @@ public final class FlyAway extends AbstractEffect
final int y = (int) (effector.getY() - (nRadius * (dy / distance)));
final int z = effector.getZ();
final Location destination = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
final Location destination = GeoEngine.getInstance().canMoveToTargetLoc(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
effected.setXYZ(destination);

View File

@@ -18,7 +18,7 @@ package handlers.effecthandlers;
import com.l2jmobius.gameserver.ai.CtrlEvent;
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;
@@ -107,7 +107,7 @@ public final class KnockBack extends AbstractEffect
final int x = (int) (effected.getX() + (_distance * Math.cos(radians)));
final int y = (int) (effected.getY() + (_distance * Math.sin(radians)));
final int z = effected.getZ();
final Location loc = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
final Location loc = GeoEngine.getInstance().canMoveToTargetLoc(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, loc, _type, _speed, _delay, _animationSpeed));

View File

@@ -16,7 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
@@ -62,7 +62,7 @@ public final class PullBack extends AbstractEffect
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
// In retail, you get debuff, but you are not even moved if there is obstacle. You are still disabled from using skills and moving though.
if (GeoData.getInstance().canMove(effected, effector))
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effector.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
effected.setXYZ(effector);

View File

@@ -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;
@@ -88,7 +88,7 @@ public final class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
final Location loc = GeoData.getInstance().moveCheck(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
final Location loc = GeoEngine.getInstance().canMoveToTargetLoc(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));

View File

@@ -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 TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
final Location loc = GeoData.getInstance().moveCheck(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
final Location loc = GeoEngine.getInstance().canMoveToTargetLoc(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));

View File

@@ -17,7 +17,7 @@
package handlers.skillconditionhandlers;
import com.l2jmobius.gameserver.enums.Position;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
@@ -70,6 +70,6 @@ public class OpBlinkSkillCondition implements ISkillCondition
final int y = caster.getY() + y1;
final int z = caster.getZ();
return GeoData.getInstance().canMove(caster.getX(), caster.getY(), caster.getZ(), x, y, z, caster.getInstanceWorld());
return GeoEngine.getInstance().canMoveToTarget(caster.getX(), caster.getY(), caster.getZ(), x, y, z, caster.getInstanceWorld());
}
}

View File

@@ -16,7 +16,7 @@
*/
package handlers.targethandlers;
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;
@@ -103,7 +103,7 @@ public class Enemy implements ITargetTypeHandler
}
// Geodata check when character is within range.
if (!GeoData.getInstance().canSeeTarget(activeChar, target))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
if (sendMessage)
{

View File

@@ -16,7 +16,7 @@
*/
package handlers.targethandlers;
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;
@@ -73,7 +73,7 @@ public class EnemyNot implements ITargetTypeHandler
}
}
if ((skill.isFlyType()) && !GeoData.getInstance().canMove(activeChar, target))
if ((skill.isFlyType()) && !GeoEngine.getInstance().canMoveToTarget(activeChar.getX(), activeChar.getY(), activeChar.getZ(), target.getX(), target.getY(), target.getZ(), activeChar.getInstanceWorld()))
{
if (sendMessage)
{
@@ -83,7 +83,7 @@ public class EnemyNot implements ITargetTypeHandler
}
// Geodata check when character is within range.
if (!GeoData.getInstance().canSeeTarget(activeChar, target))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
if (sendMessage)
{

View File

@@ -16,7 +16,7 @@
*/
package handlers.targethandlers;
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;
@@ -103,7 +103,7 @@ public class EnemyOnly implements ITargetTypeHandler
}
// Geodata check when character is within range.
if (!GeoData.getInstance().canSeeTarget(activeChar, target))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
if (sendMessage)
{

View File

@@ -16,7 +16,7 @@
*/
package handlers.targethandlers;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.handler.ITargetTypeHandler;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Object;
@@ -52,7 +52,7 @@ public class Ground implements ITargetTypeHandler
return null;
}
if (!GeoData.getInstance().canSeeTarget(activeChar, worldPosition))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, worldPosition))
{
if (sendMessage)
{

View File

@@ -16,7 +16,7 @@
*/
package handlers.targethandlers;
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;
@@ -80,7 +80,7 @@ public class NpcBody implements ITargetTypeHandler
}
// Geodata check when character is within range.
if (!GeoData.getInstance().canSeeTarget(activeChar, npc))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc))
{
if (sendMessage)
{

View File

@@ -16,7 +16,7 @@
*/
package handlers.targethandlers;
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;
@@ -107,7 +107,7 @@ public class PcBody implements ITargetTypeHandler
}
// Geodata check when character is within range.
if (!GeoData.getInstance().canSeeTarget(activeChar, target))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
if (sendMessage)
{

View File

@@ -16,7 +16,7 @@
*/
package handlers.targethandlers;
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;
@@ -75,7 +75,7 @@ public class Target implements ITargetTypeHandler
}
}
if ((skill.isFlyType()) && !GeoData.getInstance().canMove(activeChar, target))
if (skill.isFlyType() && !GeoEngine.getInstance().canMoveToTarget(activeChar.getX(), activeChar.getY(), activeChar.getZ(), target.getX(), target.getY(), target.getZ(), activeChar.getInstanceWorld()))
{
if (sendMessage)
{
@@ -85,7 +85,7 @@ public class Target implements ITargetTypeHandler
}
// Geodata check when character is within range.
if (!GeoData.getInstance().canSeeTarget(activeChar, target))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
if (sendMessage)
{

View File

@@ -20,7 +20,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.function.Predicate;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.handler.AffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectScopeHandler;
@@ -67,7 +67,7 @@ public class Fan implements IAffectScopeHandler
{
return false;
}
if (!GeoData.getInstance().canSeeTarget(activeChar, c))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, c))
{
return false;
}

View File

@@ -20,7 +20,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.function.Predicate;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.handler.AffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectScopeHandler;
@@ -68,7 +68,7 @@ public class FanPB implements IAffectScopeHandler
{
return false;
}
if (!GeoData.getInstance().canSeeTarget(activeChar, c))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, c))
{
return false;
}

View File

@@ -20,7 +20,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.function.Predicate;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.handler.AffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectScopeHandler;
@@ -59,7 +59,7 @@ public class PointBlank implements IAffectScopeHandler
{
return false;
}
if (!GeoData.getInstance().canSeeTarget(target, c))
if (!GeoEngine.getInstance().canSeeTarget(target, c))
{
return false;
}

View File

@@ -20,7 +20,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.function.Predicate;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.handler.AffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectScopeHandler;
@@ -65,7 +65,7 @@ public class Range implements IAffectScopeHandler
{
return false;
}
if (!GeoData.getInstance().canSeeTarget(target, c))
if (!GeoEngine.getInstance().canSeeTarget(target, c))
{
return false;
}

View File

@@ -20,7 +20,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.function.Predicate;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.handler.AffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectScopeHandler;
@@ -69,7 +69,7 @@ public class RingRange implements IAffectScopeHandler
return false;
}
if (!GeoData.getInstance().canSeeTarget(target, c))
if (!GeoEngine.getInstance().canSeeTarget(target, c))
{
return false;
}

View File

@@ -20,7 +20,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.function.Predicate;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.handler.AffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectScopeHandler;
@@ -77,7 +77,7 @@ public class Square implements IAffectScopeHandler
{
return false;
}
if (!GeoData.getInstance().canSeeTarget(activeChar, c))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, c))
{
return false;
}

View File

@@ -20,7 +20,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.function.Predicate;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.handler.AffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectObjectHandler;
import com.l2jmobius.gameserver.handler.IAffectScopeHandler;
@@ -77,7 +77,7 @@ public class SquarePB implements IAffectScopeHandler
{
return false;
}
if (!GeoData.getInstance().canSeeTarget(activeChar, c))
if (!GeoEngine.getInstance().canSeeTarget(activeChar, c))
{
return false;
}

View File

@@ -24,7 +24,7 @@ import com.l2jmobius.gameserver.enums.CategoryType;
import com.l2jmobius.gameserver.enums.HtmlActionScope;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.geodata.GeoData;
import com.l2jmobius.gameserver.geoengine.GeoEngine;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.Location;
@@ -561,7 +561,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
player.sendPacket(new ExSendUIEvent(player, true, false, 1, 0, NpcStringId.REMAINING_TIME));
L2World.getInstance().forEachVisibleObjectInRange(npc, L2Npc.class, 1000, box ->
{
if ((box.getId() == ATHREAS_BOX) && GeoData.getInstance().canSeeTarget(npc, box))
if ((box.getId() == ATHREAS_BOX) && GeoEngine.getInstance().canSeeTarget(npc, box))
{
box.deleteMe();
}