Adjustments for auto attacking players.
This commit is contained in:
parent
4956142361
commit
a12f034e68
@ -169,7 +169,7 @@ public class AutoPlayTaskManager
|
||||
// Find target.
|
||||
Creature creature = null;
|
||||
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.
|
||||
if ((nearby == null) || nearby.isAlikeDead())
|
||||
|
@ -357,7 +357,13 @@ public class AutoUseTaskManager
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
@ -366,7 +372,7 @@ public class AutoUseTaskManager
|
||||
if (target instanceof Guard)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class AutoPlayTaskManager
|
||||
// Find target.
|
||||
Creature creature = null;
|
||||
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.
|
||||
if ((nearby == null) || nearby.isAlikeDead())
|
||||
|
@ -357,7 +357,13 @@ public class AutoUseTaskManager
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
@ -366,7 +372,7 @@ public class AutoUseTaskManager
|
||||
if (target instanceof Guard)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class AutoPlayTaskManager
|
||||
// Find target.
|
||||
Creature creature = null;
|
||||
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.
|
||||
if ((nearby == null) || nearby.isAlikeDead())
|
||||
|
@ -357,7 +357,13 @@ public class AutoUseTaskManager
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
@ -366,7 +372,7 @@ public class AutoUseTaskManager
|
||||
if (target instanceof Guard)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user