Use geoengine for target LoS.
This commit is contained in:
parent
5b5e8cb622
commit
0257ad4433
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user