Use geoengine for target LoS.

This commit is contained in:
MobiusDev 2018-03-21 14:48:07 +00:00
parent 5b5e8cb622
commit 0257ad4433
6 changed files with 6 additions and 6 deletions

View File

@ -84,7 +84,7 @@ public class L2NpcAction implements IActionHandler
if (target.isAutoAttackable(activeChar) && !((L2Character) target).isAlikeDead())
{
// Check the height difference
if (Math.abs(activeChar.getZ() - target.getZ()) < 400) // this max height difference might need some tweaking
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);

View File

@ -84,7 +84,7 @@ public class L2NpcAction implements IActionHandler
if (target.isAutoAttackable(activeChar) && !((L2Character) target).isAlikeDead())
{
// Check the height difference
if (Math.abs(activeChar.getZ() - target.getZ()) < 400) // this max height difference might need some tweaking
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);

View File

@ -84,7 +84,7 @@ public class L2NpcAction implements IActionHandler
if (target.isAutoAttackable(activeChar) && !((L2Character) target).isAlikeDead())
{
// Check the height difference
if (Math.abs(activeChar.getZ() - target.getZ()) < 400) // this max height difference might need some tweaking
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);

View File

@ -84,7 +84,7 @@ public class L2NpcAction implements IActionHandler
if (target.isAutoAttackable(activeChar) && !((L2Character) target).isAlikeDead())
{
// Check the height difference
if (Math.abs(activeChar.getZ() - target.getZ()) < 400) // this max height difference might need some tweaking
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);

View File

@ -84,7 +84,7 @@ public class L2NpcAction implements IActionHandler
if (target.isAutoAttackable(activeChar) && !((L2Character) target).isAlikeDead())
{
// Check the height difference
if (Math.abs(activeChar.getZ() - target.getZ()) < 400) // this max height difference might need some tweaking
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);

View File

@ -84,7 +84,7 @@ public class L2NpcAction implements IActionHandler
if (target.isAutoAttackable(activeChar) && !((L2Character) target).isAlikeDead())
{
// Check the height difference
if (Math.abs(activeChar.getZ() - target.getZ()) < 400) // this max height difference might need some tweaking
if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{
// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);