Auto hunt short range related cleanup.

This commit is contained in:
MobiusDevelopment 2021-09-23 14:10:09 +00:00
parent 62bcff8d76
commit 72789d9a0c
30 changed files with 114 additions and 114 deletions

View File

@ -10437,7 +10437,7 @@ public class PlayerInstance extends Playable
// Stop auto play.
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
AutoUseTaskManager.getInstance().stopAutoUseTask(this);
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isLongRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isShortRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
restoreAutoShortcutVisual();
// Send info to nearby players.
@ -14329,7 +14329,7 @@ public class PlayerInstance extends Playable
final boolean active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
final boolean pickUp = settings.get(2) == 1;
final int nextTargetMode = settings.get(3);
final boolean longRange = settings.get(4) == 1;
final boolean shortRange = settings.get(4) == 1;
final int potionPercent = settings.get(5);
final boolean respectfulHunting = settings.get(6) == 1;
@ -14337,10 +14337,10 @@ public class PlayerInstance extends Playable
getAutoPlaySettings().setOptions(options);
getAutoPlaySettings().setPickup(pickUp);
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
getAutoPlaySettings().setLongRange(!longRange);
getAutoPlaySettings().setShortRange(shortRange);
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, longRange, potionPercent, respectfulHunting));
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, shortRange, potionPercent, respectfulHunting));
if (active)
{

View File

@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
private final AtomicInteger _options = new AtomicInteger();
private final AtomicBoolean _pickup = new AtomicBoolean();
private final AtomicInteger _nextTargetMode = new AtomicInteger();
private final AtomicBoolean _longRange = new AtomicBoolean();
private final AtomicBoolean _shortRange = new AtomicBoolean();
private final AtomicBoolean _respectfulHunting = new AtomicBoolean();
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
_nextTargetMode.set(nextTargetMode);
}
public boolean isLongRange()
public boolean isShortRange()
{
return _longRange.get();
return _shortRange.get();
}
public void setLongRange(boolean value)
public void setShortRange(boolean value)
{
_longRange.set(value);
_shortRange.set(value);
}
public boolean isRespectfulHunting()

View File

@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
private boolean _active;
private boolean _pickUp;
private int _nextTargetMode;
private boolean _longRange;
private boolean _shortRange;
private int _potionPercent;
private boolean _respectfulHunting;
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
_active = packet.readC() == 1;
_pickUp = packet.readC() == 1;
_nextTargetMode = packet.readH();
_longRange = packet.readC() != 0;
_shortRange = packet.readC() == 1;
_potionPercent = packet.readD();
_respectfulHunting = packet.readC() == 1;
return true;
@ -71,7 +71,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
return;
}
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _longRange, _potionPercent, _respectfulHunting));
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _shortRange, _potionPercent, _respectfulHunting));
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
if (!Config.ENABLE_AUTO_PLAY)
@ -84,7 +84,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
settings.add(1, _active ? 1 : 0);
settings.add(2, _pickUp ? 1 : 0);
settings.add(3, _nextTargetMode);
settings.add(4, _longRange ? 1 : 0);
settings.add(4, _shortRange ? 1 : 0);
settings.add(5, _potionPercent);
settings.add(6, _respectfulHunting ? 1 : 0);
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
@ -92,7 +92,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
player.getAutoPlaySettings().setOptions(_options);
player.getAutoPlaySettings().setPickup(_pickUp);
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
player.getAutoPlaySettings().setLongRange(!_longRange);
player.getAutoPlaySettings().setShortRange(_shortRange);
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
if (_active)

View File

@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
private final boolean _active;
private final boolean _pickUp;
private final int _nextTargetMode;
private final boolean _longRange;
private final boolean _shortRange;
private final int _potionPercent;
private final boolean _respectfulHunting;
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean longRange, int potionPercent, boolean respectfulHunting)
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean shortRange, int potionPercent, boolean respectfulHunting)
{
_options = options;
_active = active;
_pickUp = pickUp;
_nextTargetMode = nextTargetMode;
_longRange = longRange;
_shortRange = shortRange;
_potionPercent = potionPercent;
_respectfulHunting = respectfulHunting;
}
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
packet.writeC(_active ? 1 : 0);
packet.writeC(_pickUp ? 1 : 0);
packet.writeH(_nextTargetMode);
packet.writeC(_longRange ? 1 : 0);
packet.writeC(_shortRange ? 1 : 0);
packet.writeD(_potionPercent);
packet.writeC(_respectfulHunting ? 1 : 0);
return true;

View File

@ -123,7 +123,7 @@ public class AutoPlayTaskManager
// Find target.
MonsterInstance monster = null;
double closestDistance = Double.MAX_VALUE;
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isLongRange() ? 1400 : 600))
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isShortRange() ? 600 : 1400))
{
// Skip unavailable monsters.
if ((nearby == null) || nearby.isAlikeDead())

View File

@ -10547,7 +10547,7 @@ public class PlayerInstance extends Playable
// Stop auto play.
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
AutoUseTaskManager.getInstance().stopAutoUseTask(this);
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isLongRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isShortRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
restoreAutoShortcutVisual();
// Send info to nearby players.
@ -14399,7 +14399,7 @@ public class PlayerInstance extends Playable
final boolean active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
final boolean pickUp = settings.get(2) == 1;
final int nextTargetMode = settings.get(3);
final boolean longRange = settings.get(4) == 1;
final boolean shortRange = settings.get(4) == 1;
final int potionPercent = settings.get(5);
final boolean respectfulHunting = settings.get(6) == 1;
@ -14407,10 +14407,10 @@ public class PlayerInstance extends Playable
getAutoPlaySettings().setOptions(options);
getAutoPlaySettings().setPickup(pickUp);
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
getAutoPlaySettings().setLongRange(!longRange);
getAutoPlaySettings().setShortRange(shortRange);
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, longRange, potionPercent, respectfulHunting));
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, shortRange, potionPercent, respectfulHunting));
if (active)
{

View File

@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
private final AtomicInteger _options = new AtomicInteger();
private final AtomicBoolean _pickup = new AtomicBoolean();
private final AtomicInteger _nextTargetMode = new AtomicInteger();
private final AtomicBoolean _longRange = new AtomicBoolean();
private final AtomicBoolean _shortRange = new AtomicBoolean();
private final AtomicBoolean _respectfulHunting = new AtomicBoolean();
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
_nextTargetMode.set(nextTargetMode);
}
public boolean isLongRange()
public boolean isShortRange()
{
return _longRange.get();
return _shortRange.get();
}
public void setLongRange(boolean value)
public void setShortRange(boolean value)
{
_longRange.set(value);
_shortRange.set(value);
}
public boolean isRespectfulHunting()

View File

@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
private boolean _active;
private boolean _pickUp;
private int _nextTargetMode;
private boolean _longRange;
private boolean _shortRange;
private int _potionPercent;
private boolean _respectfulHunting;
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
_active = packet.readC() == 1;
_pickUp = packet.readC() == 1;
_nextTargetMode = packet.readH();
_longRange = packet.readC() != 0;
_shortRange = packet.readC() == 1;
_potionPercent = packet.readD();
packet.readD(); // 272
_respectfulHunting = packet.readC() == 1;
@ -72,7 +72,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
return;
}
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _longRange, _potionPercent, _respectfulHunting));
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _shortRange, _potionPercent, _respectfulHunting));
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
if (!Config.ENABLE_AUTO_PLAY)
@ -85,7 +85,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
settings.add(1, _active ? 1 : 0);
settings.add(2, _pickUp ? 1 : 0);
settings.add(3, _nextTargetMode);
settings.add(4, _longRange ? 1 : 0);
settings.add(4, _shortRange ? 1 : 0);
settings.add(5, _potionPercent);
settings.add(6, _respectfulHunting ? 1 : 0);
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
@ -93,7 +93,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
player.getAutoPlaySettings().setOptions(_options);
player.getAutoPlaySettings().setPickup(_pickUp);
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
player.getAutoPlaySettings().setLongRange(!_longRange);
player.getAutoPlaySettings().setShortRange(_shortRange);
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
if (_active)

View File

@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
private final boolean _active;
private final boolean _pickUp;
private final int _nextTargetMode;
private final boolean _longRange;
private final boolean _shortRange;
private final int _potionPercent;
private final boolean _respectfulHunting;
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean longRange, int potionPercent, boolean respectfulHunting)
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean shortRange, int potionPercent, boolean respectfulHunting)
{
_options = options;
_active = active;
_pickUp = pickUp;
_nextTargetMode = nextTargetMode;
_longRange = longRange;
_shortRange = shortRange;
_potionPercent = potionPercent;
_respectfulHunting = respectfulHunting;
}
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
packet.writeC(_active ? 1 : 0);
packet.writeC(_pickUp ? 1 : 0);
packet.writeH(_nextTargetMode);
packet.writeC(_longRange ? 1 : 0);
packet.writeC(_shortRange ? 1 : 0);
packet.writeD(_potionPercent);
packet.writeD(0); // 272
packet.writeC(_respectfulHunting ? 1 : 0);

View File

@ -123,7 +123,7 @@ public class AutoPlayTaskManager
// Find target.
MonsterInstance monster = null;
double closestDistance = Double.MAX_VALUE;
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isLongRange() ? 1400 : 600))
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isShortRange() ? 600 : 1400))
{
// Skip unavailable monsters.
if ((nearby == null) || nearby.isAlikeDead())

View File

@ -10573,7 +10573,7 @@ public class PlayerInstance extends Playable
// Stop auto play.
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
AutoUseTaskManager.getInstance().stopAutoUseTask(this);
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isLongRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isShortRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
restoreAutoShortcutVisual();
// Send info to nearby players.
@ -14436,7 +14436,7 @@ public class PlayerInstance extends Playable
final boolean active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
final boolean pickUp = settings.get(2) == 1;
final int nextTargetMode = settings.get(3);
final boolean longRange = settings.get(4) == 1;
final boolean shortRange = settings.get(4) == 1;
final int potionPercent = settings.get(5);
final boolean respectfulHunting = settings.get(6) == 1;
@ -14444,10 +14444,10 @@ public class PlayerInstance extends Playable
getAutoPlaySettings().setOptions(options);
getAutoPlaySettings().setPickup(pickUp);
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
getAutoPlaySettings().setLongRange(!longRange);
getAutoPlaySettings().setShortRange(shortRange);
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, longRange, potionPercent, respectfulHunting));
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, shortRange, potionPercent, respectfulHunting));
if (active)
{

View File

@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
private final AtomicInteger _options = new AtomicInteger();
private final AtomicBoolean _pickup = new AtomicBoolean();
private final AtomicInteger _nextTargetMode = new AtomicInteger();
private final AtomicBoolean _longRange = new AtomicBoolean();
private final AtomicBoolean _shortRange = new AtomicBoolean();
private final AtomicBoolean _respectfulHunting = new AtomicBoolean();
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
_nextTargetMode.set(nextTargetMode);
}
public boolean isLongRange()
public boolean isShortRange()
{
return _longRange.get();
return _shortRange.get();
}
public void setLongRange(boolean value)
public void setShortRange(boolean value)
{
_longRange.set(value);
_shortRange.set(value);
}
public boolean isRespectfulHunting()

View File

@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
private boolean _active;
private boolean _pickUp;
private int _nextTargetMode;
private boolean _longRange;
private boolean _shortRange;
private int _potionPercent;
private boolean _respectfulHunting;
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
_active = packet.readC() == 1;
_pickUp = packet.readC() == 1;
_nextTargetMode = packet.readH();
_longRange = packet.readC() != 0;
_shortRange = packet.readC() == 1;
_potionPercent = packet.readD();
packet.readD(); // 272
_respectfulHunting = packet.readC() == 1;
@ -72,7 +72,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
return;
}
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _longRange, _potionPercent, _respectfulHunting));
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _shortRange, _potionPercent, _respectfulHunting));
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
if (!Config.ENABLE_AUTO_PLAY)
@ -85,7 +85,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
settings.add(1, _active ? 1 : 0);
settings.add(2, _pickUp ? 1 : 0);
settings.add(3, _nextTargetMode);
settings.add(4, _longRange ? 1 : 0);
settings.add(4, _shortRange ? 1 : 0);
settings.add(5, _potionPercent);
settings.add(6, _respectfulHunting ? 1 : 0);
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
@ -93,7 +93,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
player.getAutoPlaySettings().setOptions(_options);
player.getAutoPlaySettings().setPickup(_pickUp);
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
player.getAutoPlaySettings().setLongRange(!_longRange);
player.getAutoPlaySettings().setShortRange(_shortRange);
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
if (_active)

View File

@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
private final boolean _active;
private final boolean _pickUp;
private final int _nextTargetMode;
private final boolean _longRange;
private final boolean _shortRange;
private final int _potionPercent;
private final boolean _respectfulHunting;
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean longRange, int potionPercent, boolean respectfulHunting)
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean shortRange, int potionPercent, boolean respectfulHunting)
{
_options = options;
_active = active;
_pickUp = pickUp;
_nextTargetMode = nextTargetMode;
_longRange = longRange;
_shortRange = shortRange;
_potionPercent = potionPercent;
_respectfulHunting = respectfulHunting;
}
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
packet.writeC(_active ? 1 : 0);
packet.writeC(_pickUp ? 1 : 0);
packet.writeH(_nextTargetMode);
packet.writeC(_longRange ? 1 : 0);
packet.writeC(_shortRange ? 1 : 0);
packet.writeD(_potionPercent);
packet.writeD(0); // 272
packet.writeC(_respectfulHunting ? 1 : 0);

View File

@ -123,7 +123,7 @@ public class AutoPlayTaskManager
// Find target.
MonsterInstance monster = null;
double closestDistance = Double.MAX_VALUE;
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isLongRange() ? 1400 : 600))
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isShortRange() ? 600 : 1400))
{
// Skip unavailable monsters.
if ((nearby == null) || nearby.isAlikeDead())

View File

@ -10297,7 +10297,7 @@ public class PlayerInstance extends Playable
// Stop auto play.
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
AutoUseTaskManager.getInstance().stopAutoUseTask(this);
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isLongRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isShortRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
restoreAutoShortcutVisual();
// Send info to nearby players.
@ -14309,7 +14309,7 @@ public class PlayerInstance extends Playable
final boolean active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
final boolean pickUp = settings.get(2) == 1;
final int nextTargetMode = settings.get(3);
final boolean longRange = settings.get(4) == 1;
final boolean shortRange = settings.get(4) == 1;
final int potionPercent = settings.get(5);
final boolean respectfulHunting = settings.get(6) == 1;
@ -14317,10 +14317,10 @@ public class PlayerInstance extends Playable
getAutoPlaySettings().setOptions(options);
getAutoPlaySettings().setPickup(pickUp);
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
getAutoPlaySettings().setLongRange(!longRange);
getAutoPlaySettings().setShortRange(shortRange);
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, longRange, potionPercent, respectfulHunting));
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, shortRange, potionPercent, respectfulHunting));
if (active)
{

View File

@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
private final AtomicInteger _options = new AtomicInteger();
private final AtomicBoolean _pickup = new AtomicBoolean();
private final AtomicInteger _nextTargetMode = new AtomicInteger();
private final AtomicBoolean _longRange = new AtomicBoolean();
private final AtomicBoolean _shortRange = new AtomicBoolean();
private final AtomicBoolean _respectfulHunting = new AtomicBoolean();
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
_nextTargetMode.set(nextTargetMode);
}
public boolean isLongRange()
public boolean isShortRange()
{
return _longRange.get();
return _shortRange.get();
}
public void setLongRange(boolean value)
public void setShortRange(boolean value)
{
_longRange.set(value);
_shortRange.set(value);
}
public boolean isRespectfulHunting()

View File

@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
private boolean _active;
private boolean _pickUp;
private int _nextTargetMode;
private boolean _longRange;
private boolean _shortRange;
private int _potionPercent;
private boolean _respectfulHunting;
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
_active = packet.readC() == 1;
_pickUp = packet.readC() == 1;
_nextTargetMode = packet.readH();
_longRange = packet.readC() != 0;
_shortRange = packet.readC() == 1;
_potionPercent = packet.readD();
_respectfulHunting = packet.readC() == 1;
return true;
@ -71,7 +71,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
return;
}
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _longRange, _potionPercent, _respectfulHunting));
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _shortRange, _potionPercent, _respectfulHunting));
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
if (!Config.ENABLE_AUTO_PLAY)
@ -84,7 +84,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
settings.add(1, _active ? 1 : 0);
settings.add(2, _pickUp ? 1 : 0);
settings.add(3, _nextTargetMode);
settings.add(4, _longRange ? 1 : 0);
settings.add(4, _shortRange ? 1 : 0);
settings.add(5, _potionPercent);
settings.add(6, _respectfulHunting ? 1 : 0);
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
@ -92,7 +92,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
player.getAutoPlaySettings().setOptions(_options);
player.getAutoPlaySettings().setPickup(_pickUp);
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
player.getAutoPlaySettings().setLongRange(!_longRange);
player.getAutoPlaySettings().setShortRange(_shortRange);
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
if (_active)

View File

@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
private final boolean _active;
private final boolean _pickUp;
private final int _nextTargetMode;
private final boolean _longRange;
private final boolean _shortRange;
private final int _potionPercent;
private final boolean _respectfulHunting;
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean longRange, int potionPercent, boolean respectfulHunting)
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean shortRange, int potionPercent, boolean respectfulHunting)
{
_options = options;
_active = active;
_pickUp = pickUp;
_nextTargetMode = nextTargetMode;
_longRange = longRange;
_shortRange = shortRange;
_potionPercent = potionPercent;
_respectfulHunting = respectfulHunting;
}
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
packet.writeC(_active ? 1 : 0);
packet.writeC(_pickUp ? 1 : 0);
packet.writeH(_nextTargetMode);
packet.writeC(_longRange ? 1 : 0);
packet.writeC(_shortRange ? 1 : 0);
packet.writeD(_potionPercent);
packet.writeC(_respectfulHunting ? 1 : 0);
return true;

View File

@ -123,7 +123,7 @@ public class AutoPlayTaskManager
// Find target.
MonsterInstance monster = null;
double closestDistance = Double.MAX_VALUE;
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isLongRange() ? 1400 : 600))
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isShortRange() ? 600 : 1400))
{
// Skip unavailable monsters.
if ((nearby == null) || nearby.isAlikeDead())

View File

@ -10452,7 +10452,7 @@ public class PlayerInstance extends Playable
// Stop auto play.
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
AutoUseTaskManager.getInstance().stopAutoUseTask(this);
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isLongRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isShortRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
restoreAutoShortcutVisual();
// Send info to nearby players.
@ -14569,7 +14569,7 @@ public class PlayerInstance extends Playable
final boolean active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
final boolean pickUp = settings.get(2) == 1;
final int nextTargetMode = settings.get(3);
final boolean longRange = settings.get(4) == 1;
final boolean shortRange = settings.get(4) == 1;
final int potionPercent = settings.get(5);
final boolean respectfulHunting = settings.get(6) == 1;
@ -14577,10 +14577,10 @@ public class PlayerInstance extends Playable
getAutoPlaySettings().setOptions(options);
getAutoPlaySettings().setPickup(pickUp);
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
getAutoPlaySettings().setLongRange(!longRange);
getAutoPlaySettings().setShortRange(shortRange);
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, longRange, potionPercent, respectfulHunting));
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, shortRange, potionPercent, respectfulHunting));
if (active)
{

View File

@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
private final AtomicInteger _options = new AtomicInteger();
private final AtomicBoolean _pickup = new AtomicBoolean();
private final AtomicInteger _nextTargetMode = new AtomicInteger();
private final AtomicBoolean _longRange = new AtomicBoolean();
private final AtomicBoolean _shortRange = new AtomicBoolean();
private final AtomicBoolean _respectfulHunting = new AtomicBoolean();
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
_nextTargetMode.set(nextTargetMode);
}
public boolean isLongRange()
public boolean isShortRange()
{
return _longRange.get();
return _shortRange.get();
}
public void setLongRange(boolean value)
public void setShortRange(boolean value)
{
_longRange.set(value);
_shortRange.set(value);
}
public boolean isRespectfulHunting()

View File

@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
private boolean _active;
private boolean _pickUp;
private int _nextTargetMode;
private boolean _longRange;
private boolean _shortRange;
private int _potionPercent;
private boolean _respectfulHunting;
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
_active = packet.readC() == 1;
_pickUp = packet.readC() == 1;
_nextTargetMode = packet.readH();
_longRange = packet.readC() != 0;
_shortRange = packet.readC() == 1;
_potionPercent = packet.readD();
packet.readD(); // 272
_respectfulHunting = packet.readC() == 1;
@ -72,7 +72,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
return;
}
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _longRange, _potionPercent, _respectfulHunting));
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _shortRange, _potionPercent, _respectfulHunting));
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
if (!Config.ENABLE_AUTO_PLAY)
@ -85,7 +85,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
settings.add(1, _active ? 1 : 0);
settings.add(2, _pickUp ? 1 : 0);
settings.add(3, _nextTargetMode);
settings.add(4, _longRange ? 1 : 0);
settings.add(4, _shortRange ? 1 : 0);
settings.add(5, _potionPercent);
settings.add(6, _respectfulHunting ? 1 : 0);
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
@ -93,7 +93,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
player.getAutoPlaySettings().setOptions(_options);
player.getAutoPlaySettings().setPickup(_pickUp);
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
player.getAutoPlaySettings().setLongRange(!_longRange);
player.getAutoPlaySettings().setShortRange(_shortRange);
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
if (_active)

View File

@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
private final boolean _active;
private final boolean _pickUp;
private final int _nextTargetMode;
private final boolean _longRange;
private final boolean _shortRange;
private final int _potionPercent;
private final boolean _respectfulHunting;
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean longRange, int potionPercent, boolean respectfulHunting)
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean shortRange, int potionPercent, boolean respectfulHunting)
{
_options = options;
_active = active;
_pickUp = pickUp;
_nextTargetMode = nextTargetMode;
_longRange = longRange;
_shortRange = shortRange;
_potionPercent = potionPercent;
_respectfulHunting = respectfulHunting;
}
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
packet.writeC(_active ? 1 : 0);
packet.writeC(_pickUp ? 1 : 0);
packet.writeH(_nextTargetMode);
packet.writeC(_longRange ? 1 : 0);
packet.writeC(_shortRange ? 1 : 0);
packet.writeD(_potionPercent);
packet.writeD(0); // 272
packet.writeC(_respectfulHunting ? 1 : 0);

View File

@ -123,7 +123,7 @@ public class AutoPlayTaskManager
// Find target.
MonsterInstance monster = null;
double closestDistance = Double.MAX_VALUE;
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isLongRange() ? 1400 : 600))
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isShortRange() ? 600 : 1400))
{
// Skip unavailable monsters.
if ((nearby == null) || nearby.isAlikeDead())

View File

@ -10518,7 +10518,7 @@ public class PlayerInstance extends Playable
// Stop auto play.
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
AutoUseTaskManager.getInstance().stopAutoUseTask(this);
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isLongRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
sendPacket(new ExAutoPlaySettingSend(_autoPlaySettings.getOptions(), false, _autoPlaySettings.doPickup(), _autoPlaySettings.getNextTargetMode(), _autoPlaySettings.isShortRange(), _autoPlaySettings.getAutoPotionPercent(), _autoPlaySettings.isRespectfulHunting()));
restoreAutoShortcutVisual();
// Send info to nearby players.
@ -14646,7 +14646,7 @@ public class PlayerInstance extends Playable
final boolean active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
final boolean pickUp = settings.get(2) == 1;
final int nextTargetMode = settings.get(3);
final boolean longRange = settings.get(4) == 1;
final boolean shortRange = settings.get(4) == 1;
final int potionPercent = settings.get(5);
final boolean respectfulHunting = settings.get(6) == 1;
@ -14654,10 +14654,10 @@ public class PlayerInstance extends Playable
getAutoPlaySettings().setOptions(options);
getAutoPlaySettings().setPickup(pickUp);
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
getAutoPlaySettings().setLongRange(!longRange);
getAutoPlaySettings().setShortRange(shortRange);
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, longRange, potionPercent, respectfulHunting));
sendPacket(new ExAutoPlaySettingSend(options, active, pickUp, nextTargetMode, shortRange, potionPercent, respectfulHunting));
if (active)
{

View File

@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
private final AtomicInteger _options = new AtomicInteger();
private final AtomicBoolean _pickup = new AtomicBoolean();
private final AtomicInteger _nextTargetMode = new AtomicInteger();
private final AtomicBoolean _longRange = new AtomicBoolean();
private final AtomicBoolean _shortRange = new AtomicBoolean();
private final AtomicBoolean _respectfulHunting = new AtomicBoolean();
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
_nextTargetMode.set(nextTargetMode);
}
public boolean isLongRange()
public boolean isShortRange()
{
return _longRange.get();
return _shortRange.get();
}
public void setLongRange(boolean value)
public void setShortRange(boolean value)
{
_longRange.set(value);
_shortRange.set(value);
}
public boolean isRespectfulHunting()

View File

@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
private boolean _active;
private boolean _pickUp;
private int _nextTargetMode;
private boolean _longRange;
private boolean _shortRange;
private int _potionPercent;
private boolean _respectfulHunting;
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
_active = packet.readC() == 1;
_pickUp = packet.readC() == 1;
_nextTargetMode = packet.readH();
_longRange = packet.readC() != 0;
_shortRange = packet.readC() == 1;
_potionPercent = packet.readD();
packet.readD(); // 272
_respectfulHunting = packet.readC() == 1;
@ -72,7 +72,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
return;
}
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _longRange, _potionPercent, _respectfulHunting));
player.sendPacket(new ExAutoPlaySettingSend(_options, _active, _pickUp, _nextTargetMode, _shortRange, _potionPercent, _respectfulHunting));
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
if (!Config.ENABLE_AUTO_PLAY)
@ -85,7 +85,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
settings.add(1, _active ? 1 : 0);
settings.add(2, _pickUp ? 1 : 0);
settings.add(3, _nextTargetMode);
settings.add(4, _longRange ? 1 : 0);
settings.add(4, _shortRange ? 1 : 0);
settings.add(5, _potionPercent);
settings.add(6, _respectfulHunting ? 1 : 0);
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
@ -93,7 +93,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
player.getAutoPlaySettings().setOptions(_options);
player.getAutoPlaySettings().setPickup(_pickUp);
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
player.getAutoPlaySettings().setLongRange(!_longRange);
player.getAutoPlaySettings().setShortRange(_shortRange);
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
if (_active)

View File

@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
private final boolean _active;
private final boolean _pickUp;
private final int _nextTargetMode;
private final boolean _longRange;
private final boolean _shortRange;
private final int _potionPercent;
private final boolean _respectfulHunting;
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean longRange, int potionPercent, boolean respectfulHunting)
public ExAutoPlaySettingSend(int options, boolean active, boolean pickUp, int nextTargetMode, boolean shortRange, int potionPercent, boolean respectfulHunting)
{
_options = options;
_active = active;
_pickUp = pickUp;
_nextTargetMode = nextTargetMode;
_longRange = longRange;
_shortRange = shortRange;
_potionPercent = potionPercent;
_respectfulHunting = respectfulHunting;
}
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
packet.writeC(_active ? 1 : 0);
packet.writeC(_pickUp ? 1 : 0);
packet.writeH(_nextTargetMode);
packet.writeC(_longRange ? 1 : 0);
packet.writeC(_shortRange ? 1 : 0);
packet.writeD(_potionPercent);
packet.writeD(0); // 272
packet.writeC(_respectfulHunting ? 1 : 0);

View File

@ -123,7 +123,7 @@ public class AutoPlayTaskManager
// Find target.
MonsterInstance monster = null;
double closestDistance = Double.MAX_VALUE;
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isLongRange() ? 1400 : 600))
TARGET: for (MonsterInstance nearby : World.getInstance().getVisibleObjectsInRange(player, MonsterInstance.class, player.getAutoPlaySettings().isShortRange() ? 600 : 1400))
{
// Skip unavailable monsters.
if ((nearby == null) || nearby.isAlikeDead())