Diagonal movement GeoEngine.
This commit is contained in:
@@ -21,7 +21,7 @@ import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_ATTACK;
|
||||
import static com.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_REST;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
@@ -150,7 +150,7 @@ public class FriendlyNpcAI extends L2AttackableAI
|
||||
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
||||
{
|
||||
final int newZ = npc.getZ() + 30;
|
||||
if (GeoData.getInstance().canMove(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
|
||||
{
|
||||
moveTo(newX, newY, newZ);
|
||||
}
|
||||
@@ -189,7 +189,7 @@ public class FriendlyNpcAI extends L2AttackableAI
|
||||
posY = posY - 300;
|
||||
}
|
||||
|
||||
if (GeoData.getInstance().canMove(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, npc.getInstanceWorld()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, npc.getInstanceWorld()))
|
||||
{
|
||||
setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(posX, posY, posZ, 0));
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public class FriendlyNpcAI extends L2AttackableAI
|
||||
}
|
||||
}
|
||||
|
||||
if ((dist2 > range) || !GeoData.getInstance().canSeeTarget(npc, originalAttackTarget))
|
||||
if ((dist2 > range) || !GeoEngine.getInstance().canSeeTarget(npc, originalAttackTarget))
|
||||
{
|
||||
if (originalAttackTarget.isMoving())
|
||||
{
|
||||
|
@@ -33,7 +33,7 @@ import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||
import com.l2jmobius.gameserver.enums.AISkillScope;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.AggroInfo;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
@@ -195,7 +195,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
}
|
||||
|
||||
return target.isAutoAttackable(me) && GeoData.getInstance().canSeeTarget(me, target);
|
||||
return target.isAutoAttackable(me) && GeoEngine.getInstance().canSeeTarget(me, target);
|
||||
}
|
||||
|
||||
public void startAITask()
|
||||
@@ -555,7 +555,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
|
||||
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
|
||||
final Location moveLoc = GeoData.getInstance().moveCheck(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
|
||||
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
|
||||
|
||||
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
|
||||
}
|
||||
@@ -696,7 +696,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
||||
{
|
||||
final int newZ = npc.getZ() + 30;
|
||||
if (GeoData.getInstance().canMove(npc, newX, newY, newZ))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
|
||||
{
|
||||
moveTo(newX, newY, newZ);
|
||||
}
|
||||
@@ -736,7 +736,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
posY = posY - 300;
|
||||
}
|
||||
|
||||
if (GeoData.getInstance().canMove(npc, posX, posY, posZ))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, npc.getInstanceWorld()))
|
||||
{
|
||||
setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(posX, posY, posZ, 0));
|
||||
}
|
||||
@@ -986,7 +986,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!GeoData.getInstance().canSeeTarget(npc, target))
|
||||
if (!GeoEngine.getInstance().canSeeTarget(npc, target))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -998,7 +998,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
}
|
||||
|
||||
return GeoData.getInstance().canMove(npc, target);
|
||||
return GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), target.getX(), target.getY(), target.getZ(), npc.getInstanceWorld());
|
||||
}
|
||||
|
||||
private L2Character skillTargetReconsider(Skill skill, boolean insideCastRange)
|
||||
|
@@ -33,7 +33,7 @@ import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||
import com.l2jmobius.gameserver.enums.ItemLocation;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
@@ -1094,7 +1094,7 @@ public class L2CharacterAI extends AbstractAI
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
return true;
|
||||
}
|
||||
if ((_actor != null) && (_skill != null) && _skill.isBad() && (_skill.getAffectRange() > 0) && !GeoData.getInstance().canSeeTarget(_actor, target))
|
||||
if ((_actor != null) && (_skill != null) && _skill.isBad() && (_skill.getAffectRange() > 0) && !GeoEngine.getInstance().canSeeTarget(_actor, target))
|
||||
{
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
return true;
|
||||
|
@@ -26,7 +26,7 @@ import java.util.concurrent.Future;
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@@ -161,7 +161,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
}
|
||||
// Los Check Here
|
||||
return (_actor.isAutoAttackable(target) && GeoData.getInstance().canSeeTarget(_actor, target));
|
||||
return (_actor.isAutoAttackable(target) && GeoEngine.getInstance().canSeeTarget(_actor, target));
|
||||
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!GeoData.getInstance().canSeeTarget(_actor, cha))
|
||||
if (!GeoEngine.getInstance().canSeeTarget(_actor, cha))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -460,7 +460,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
// && _actor.getAttackByList().contains(getTarget())
|
||||
&& ((npc.getAI()._intention == CtrlIntention.AI_INTENTION_IDLE) || (npc.getAI()._intention == CtrlIntention.AI_INTENTION_ACTIVE))
|
||||
// limiting aggro for siege guards
|
||||
&& npc.isInsideRadius(target, 1500, true, false) && GeoData.getInstance().canSeeTarget(npc, target))
|
||||
&& npc.isInsideRadius(target, 1500, true, false) && GeoEngine.getInstance().canSeeTarget(npc, target))
|
||||
{
|
||||
// Notify the L2Object AI with EVT_AGGRESSION
|
||||
npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, target, 1);
|
||||
@@ -489,7 +489,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!GeoData.getInstance().canSeeTarget(_actor, npc))
|
||||
if (!GeoEngine.getInstance().canSeeTarget(_actor, npc))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -558,7 +558,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GeoData.getInstance().canSeeTarget(_actor, attackTarget))
|
||||
if (!GeoEngine.getInstance().canSeeTarget(_actor, attackTarget))
|
||||
{
|
||||
// Siege guards differ from normal mobs currently:
|
||||
// If target cannot seen, don't attack any more
|
||||
|
@@ -26,7 +26,7 @@ import java.util.concurrent.Future;
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.GameTimeController;
|
||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||
import com.l2jmobius.gameserver.geodata.GeoData;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@@ -149,7 +149,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
}
|
||||
}
|
||||
// Los Check Here
|
||||
return (_actor.isAutoAttackable(target) && GeoData.getInstance().canSeeTarget(_actor, target));
|
||||
return (_actor.isAutoAttackable(target) && GeoEngine.getInstance().canSeeTarget(_actor, target));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,7 +403,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!GeoData.getInstance().canSeeTarget(_actor, cha))
|
||||
if (!GeoEngine.getInstance().canSeeTarget(_actor, cha))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -432,7 +432,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
// && _actor.getAttackByList().contains(getTarget())
|
||||
&& ((npc.getAI()._intention == CtrlIntention.AI_INTENTION_IDLE) || (npc.getAI()._intention == CtrlIntention.AI_INTENTION_ACTIVE))
|
||||
// limiting aggro for siege guards
|
||||
&& npc.isInsideRadius(target, 1500, true, false) && GeoData.getInstance().canSeeTarget(npc, target))
|
||||
&& npc.isInsideRadius(target, 1500, true, false) && GeoEngine.getInstance().canSeeTarget(npc, target))
|
||||
{
|
||||
// Notify the L2Object AI with EVT_AGGRESSION
|
||||
npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, target, 1);
|
||||
@@ -461,7 +461,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!GeoData.getInstance().canSeeTarget(_actor, npc))
|
||||
if (!GeoEngine.getInstance().canSeeTarget(_actor, npc))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -512,7 +512,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GeoData.getInstance().canSeeTarget(_actor, attackTarget))
|
||||
if (!GeoEngine.getInstance().canSeeTarget(_actor, attackTarget))
|
||||
{
|
||||
// Siege guards differ from normal mobs currently:
|
||||
// If target cannot seen, don't attack any more
|
||||
|
@@ -24,7 +24,7 @@ import java.util.concurrent.Future;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||
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.L2Summon;
|
||||
@@ -295,7 +295,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
|
||||
final int targetX = ownerX + (int) (AVOID_RADIUS * Math.cos(angle));
|
||||
final int targetY = ownerY + (int) (AVOID_RADIUS * Math.sin(angle));
|
||||
if (GeoData.getInstance().canMove(_actor, targetX, targetY, _actor.getZ()))
|
||||
if (GeoEngine.getInstance().canMoveToTarget(_actor.getX(), _actor.getY(), _actor.getZ(), targetX, targetY, _actor.getZ(), _actor.getInstanceWorld()))
|
||||
{
|
||||
moveTo(targetX, targetY, _actor.getZ());
|
||||
}
|
||||
|
Reference in New Issue
Block a user