Adjustments for auto attacking players.
This commit is contained in:
@@ -169,7 +169,7 @@ public class AutoPlayTaskManager
|
|||||||
// Find target.
|
// Find target.
|
||||||
Creature creature = null;
|
Creature creature = null;
|
||||||
double closestDistance = Double.MAX_VALUE;
|
double closestDistance = Double.MAX_VALUE;
|
||||||
TARGET: for (Creature nearby : World.getInstance().getVisibleObjectsInRange(player, Creature.class, player.getAutoPlaySettings().isShortRange() ? 600 : 1400))
|
TARGET: for (Creature nearby : World.getInstance().getVisibleObjectsInRange(player, Creature.class, player.getAutoPlaySettings().isShortRange() && (targetMode != 2 /* Characters */) && (targetMode != 4 /* Counterattack */) ? 600 : 1400))
|
||||||
{
|
{
|
||||||
// Skip unavailable creatures.
|
// Skip unavailable creatures.
|
||||||
if ((nearby == null) || nearby.isAlikeDead())
|
if ((nearby == null) || nearby.isAlikeDead())
|
||||||
|
@@ -357,7 +357,13 @@ public class AutoUseTaskManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check bad skill target.
|
// Check bad skill target.
|
||||||
if ((target == null) || !target.isAttackable() || ((Creature) target).isDead())
|
if ((target == null) || ((Creature) target).isDead())
|
||||||
|
{
|
||||||
|
break SKILLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Peace zone and auto attackable checks.
|
||||||
|
if (target.isInsideZone(ZoneId.PEACE) || !target.isAutoAttackable(player))
|
||||||
{
|
{
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
@@ -366,7 +372,7 @@ public class AutoUseTaskManager
|
|||||||
if (target instanceof Guard)
|
if (target instanceof Guard)
|
||||||
{
|
{
|
||||||
final int targetMode = player.getAutoPlaySettings().getNextTargetMode();
|
final int targetMode = player.getAutoPlaySettings().getNextTargetMode();
|
||||||
if (((targetMode != 3 /* NPC */) && (targetMode != 0 /* Any Target */)) || target.isInsideZone(ZoneId.PEACE) || !target.isAutoAttackable(player))
|
if ((targetMode != 3 /* NPC */) && (targetMode != 0 /* Any Target */))
|
||||||
{
|
{
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
@@ -169,7 +169,7 @@ public class AutoPlayTaskManager
|
|||||||
// Find target.
|
// Find target.
|
||||||
Creature creature = null;
|
Creature creature = null;
|
||||||
double closestDistance = Double.MAX_VALUE;
|
double closestDistance = Double.MAX_VALUE;
|
||||||
TARGET: for (Creature nearby : World.getInstance().getVisibleObjectsInRange(player, Creature.class, player.getAutoPlaySettings().isShortRange() ? 600 : 1400))
|
TARGET: for (Creature nearby : World.getInstance().getVisibleObjectsInRange(player, Creature.class, player.getAutoPlaySettings().isShortRange() && (targetMode != 2 /* Characters */) && (targetMode != 4 /* Counterattack */) ? 600 : 1400))
|
||||||
{
|
{
|
||||||
// Skip unavailable creatures.
|
// Skip unavailable creatures.
|
||||||
if ((nearby == null) || nearby.isAlikeDead())
|
if ((nearby == null) || nearby.isAlikeDead())
|
||||||
|
@@ -357,7 +357,13 @@ public class AutoUseTaskManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check bad skill target.
|
// Check bad skill target.
|
||||||
if ((target == null) || !target.isAttackable() || ((Creature) target).isDead())
|
if ((target == null) || ((Creature) target).isDead())
|
||||||
|
{
|
||||||
|
break SKILLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Peace zone and auto attackable checks.
|
||||||
|
if (target.isInsideZone(ZoneId.PEACE) || !target.isAutoAttackable(player))
|
||||||
{
|
{
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
@@ -366,7 +372,7 @@ public class AutoUseTaskManager
|
|||||||
if (target instanceof Guard)
|
if (target instanceof Guard)
|
||||||
{
|
{
|
||||||
final int targetMode = player.getAutoPlaySettings().getNextTargetMode();
|
final int targetMode = player.getAutoPlaySettings().getNextTargetMode();
|
||||||
if (((targetMode != 3 /* NPC */) && (targetMode != 0 /* Any Target */)) || target.isInsideZone(ZoneId.PEACE) || !target.isAutoAttackable(player))
|
if ((targetMode != 3 /* NPC */) && (targetMode != 0 /* Any Target */))
|
||||||
{
|
{
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
@@ -169,7 +169,7 @@ public class AutoPlayTaskManager
|
|||||||
// Find target.
|
// Find target.
|
||||||
Creature creature = null;
|
Creature creature = null;
|
||||||
double closestDistance = Double.MAX_VALUE;
|
double closestDistance = Double.MAX_VALUE;
|
||||||
TARGET: for (Creature nearby : World.getInstance().getVisibleObjectsInRange(player, Creature.class, player.getAutoPlaySettings().isShortRange() ? 600 : 1400))
|
TARGET: for (Creature nearby : World.getInstance().getVisibleObjectsInRange(player, Creature.class, player.getAutoPlaySettings().isShortRange() && (targetMode != 2 /* Characters */) && (targetMode != 4 /* Counterattack */) ? 600 : 1400))
|
||||||
{
|
{
|
||||||
// Skip unavailable creatures.
|
// Skip unavailable creatures.
|
||||||
if ((nearby == null) || nearby.isAlikeDead())
|
if ((nearby == null) || nearby.isAlikeDead())
|
||||||
|
@@ -357,7 +357,13 @@ public class AutoUseTaskManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check bad skill target.
|
// Check bad skill target.
|
||||||
if ((target == null) || !target.isAttackable() || ((Creature) target).isDead())
|
if ((target == null) || ((Creature) target).isDead())
|
||||||
|
{
|
||||||
|
break SKILLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Peace zone and auto attackable checks.
|
||||||
|
if (target.isInsideZone(ZoneId.PEACE) || !target.isAutoAttackable(player))
|
||||||
{
|
{
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
@@ -366,7 +372,7 @@ public class AutoUseTaskManager
|
|||||||
if (target instanceof Guard)
|
if (target instanceof Guard)
|
||||||
{
|
{
|
||||||
final int targetMode = player.getAutoPlaySettings().getNextTargetMode();
|
final int targetMode = player.getAutoPlaySettings().getNextTargetMode();
|
||||||
if (((targetMode != 3 /* NPC */) && (targetMode != 0 /* Any Target */)) || target.isInsideZone(ZoneId.PEACE) || !target.isAutoAttackable(player))
|
if ((targetMode != 3 /* NPC */) && (targetMode != 0 /* Any Target */))
|
||||||
{
|
{
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user