Auto hunt short range related cleanup.
This commit is contained in:
parent
62bcff8d76
commit
72789d9a0c
@ -10437,7 +10437,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Stop auto play.
|
// Stop auto play.
|
||||||
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
||||||
AutoUseTaskManager.getInstance().stopAutoUseTask(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();
|
restoreAutoShortcutVisual();
|
||||||
|
|
||||||
// Send info to nearby players.
|
// 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 active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
|
||||||
final boolean pickUp = settings.get(2) == 1;
|
final boolean pickUp = settings.get(2) == 1;
|
||||||
final int nextTargetMode = settings.get(3);
|
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 int potionPercent = settings.get(5);
|
||||||
final boolean respectfulHunting = settings.get(6) == 1;
|
final boolean respectfulHunting = settings.get(6) == 1;
|
||||||
|
|
||||||
@ -14337,10 +14337,10 @@ public class PlayerInstance extends Playable
|
|||||||
getAutoPlaySettings().setOptions(options);
|
getAutoPlaySettings().setOptions(options);
|
||||||
getAutoPlaySettings().setPickup(pickUp);
|
getAutoPlaySettings().setPickup(pickUp);
|
||||||
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
||||||
getAutoPlaySettings().setLongRange(!longRange);
|
getAutoPlaySettings().setShortRange(shortRange);
|
||||||
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
|
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)
|
if (active)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
|
|||||||
private final AtomicInteger _options = new AtomicInteger();
|
private final AtomicInteger _options = new AtomicInteger();
|
||||||
private final AtomicBoolean _pickup = new AtomicBoolean();
|
private final AtomicBoolean _pickup = new AtomicBoolean();
|
||||||
private final AtomicInteger _nextTargetMode = new AtomicInteger();
|
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 AtomicBoolean _respectfulHunting = new AtomicBoolean();
|
||||||
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
||||||
|
|
||||||
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
|
|||||||
_nextTargetMode.set(nextTargetMode);
|
_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()
|
public boolean isRespectfulHunting()
|
||||||
|
@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
private boolean _active;
|
private boolean _active;
|
||||||
private boolean _pickUp;
|
private boolean _pickUp;
|
||||||
private int _nextTargetMode;
|
private int _nextTargetMode;
|
||||||
private boolean _longRange;
|
private boolean _shortRange;
|
||||||
private int _potionPercent;
|
private int _potionPercent;
|
||||||
private boolean _respectfulHunting;
|
private boolean _respectfulHunting;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
_active = packet.readC() == 1;
|
_active = packet.readC() == 1;
|
||||||
_pickUp = packet.readC() == 1;
|
_pickUp = packet.readC() == 1;
|
||||||
_nextTargetMode = packet.readH();
|
_nextTargetMode = packet.readH();
|
||||||
_longRange = packet.readC() != 0;
|
_shortRange = packet.readC() == 1;
|
||||||
_potionPercent = packet.readD();
|
_potionPercent = packet.readD();
|
||||||
_respectfulHunting = packet.readC() == 1;
|
_respectfulHunting = packet.readC() == 1;
|
||||||
return true;
|
return true;
|
||||||
@ -71,7 +71,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
return;
|
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);
|
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
|
||||||
|
|
||||||
if (!Config.ENABLE_AUTO_PLAY)
|
if (!Config.ENABLE_AUTO_PLAY)
|
||||||
@ -84,7 +84,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
settings.add(1, _active ? 1 : 0);
|
settings.add(1, _active ? 1 : 0);
|
||||||
settings.add(2, _pickUp ? 1 : 0);
|
settings.add(2, _pickUp ? 1 : 0);
|
||||||
settings.add(3, _nextTargetMode);
|
settings.add(3, _nextTargetMode);
|
||||||
settings.add(4, _longRange ? 1 : 0);
|
settings.add(4, _shortRange ? 1 : 0);
|
||||||
settings.add(5, _potionPercent);
|
settings.add(5, _potionPercent);
|
||||||
settings.add(6, _respectfulHunting ? 1 : 0);
|
settings.add(6, _respectfulHunting ? 1 : 0);
|
||||||
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
||||||
@ -92,7 +92,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
player.getAutoPlaySettings().setOptions(_options);
|
player.getAutoPlaySettings().setOptions(_options);
|
||||||
player.getAutoPlaySettings().setPickup(_pickUp);
|
player.getAutoPlaySettings().setPickup(_pickUp);
|
||||||
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
||||||
player.getAutoPlaySettings().setLongRange(!_longRange);
|
player.getAutoPlaySettings().setShortRange(_shortRange);
|
||||||
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
||||||
|
|
||||||
if (_active)
|
if (_active)
|
||||||
|
@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
private final boolean _active;
|
private final boolean _active;
|
||||||
private final boolean _pickUp;
|
private final boolean _pickUp;
|
||||||
private final int _nextTargetMode;
|
private final int _nextTargetMode;
|
||||||
private final boolean _longRange;
|
private final boolean _shortRange;
|
||||||
private final int _potionPercent;
|
private final int _potionPercent;
|
||||||
private final boolean _respectfulHunting;
|
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;
|
_options = options;
|
||||||
_active = active;
|
_active = active;
|
||||||
_pickUp = pickUp;
|
_pickUp = pickUp;
|
||||||
_nextTargetMode = nextTargetMode;
|
_nextTargetMode = nextTargetMode;
|
||||||
_longRange = longRange;
|
_shortRange = shortRange;
|
||||||
_potionPercent = potionPercent;
|
_potionPercent = potionPercent;
|
||||||
_respectfulHunting = respectfulHunting;
|
_respectfulHunting = respectfulHunting;
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
packet.writeC(_active ? 1 : 0);
|
packet.writeC(_active ? 1 : 0);
|
||||||
packet.writeC(_pickUp ? 1 : 0);
|
packet.writeC(_pickUp ? 1 : 0);
|
||||||
packet.writeH(_nextTargetMode);
|
packet.writeH(_nextTargetMode);
|
||||||
packet.writeC(_longRange ? 1 : 0);
|
packet.writeC(_shortRange ? 1 : 0);
|
||||||
packet.writeD(_potionPercent);
|
packet.writeD(_potionPercent);
|
||||||
packet.writeC(_respectfulHunting ? 1 : 0);
|
packet.writeC(_respectfulHunting ? 1 : 0);
|
||||||
return true;
|
return true;
|
||||||
|
@ -123,7 +123,7 @@ public class AutoPlayTaskManager
|
|||||||
// Find target.
|
// Find target.
|
||||||
MonsterInstance monster = null;
|
MonsterInstance monster = null;
|
||||||
double closestDistance = Double.MAX_VALUE;
|
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.
|
// Skip unavailable monsters.
|
||||||
if ((nearby == null) || nearby.isAlikeDead())
|
if ((nearby == null) || nearby.isAlikeDead())
|
||||||
|
@ -10547,7 +10547,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Stop auto play.
|
// Stop auto play.
|
||||||
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
||||||
AutoUseTaskManager.getInstance().stopAutoUseTask(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();
|
restoreAutoShortcutVisual();
|
||||||
|
|
||||||
// Send info to nearby players.
|
// 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 active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
|
||||||
final boolean pickUp = settings.get(2) == 1;
|
final boolean pickUp = settings.get(2) == 1;
|
||||||
final int nextTargetMode = settings.get(3);
|
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 int potionPercent = settings.get(5);
|
||||||
final boolean respectfulHunting = settings.get(6) == 1;
|
final boolean respectfulHunting = settings.get(6) == 1;
|
||||||
|
|
||||||
@ -14407,10 +14407,10 @@ public class PlayerInstance extends Playable
|
|||||||
getAutoPlaySettings().setOptions(options);
|
getAutoPlaySettings().setOptions(options);
|
||||||
getAutoPlaySettings().setPickup(pickUp);
|
getAutoPlaySettings().setPickup(pickUp);
|
||||||
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
||||||
getAutoPlaySettings().setLongRange(!longRange);
|
getAutoPlaySettings().setShortRange(shortRange);
|
||||||
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
|
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)
|
if (active)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
|
|||||||
private final AtomicInteger _options = new AtomicInteger();
|
private final AtomicInteger _options = new AtomicInteger();
|
||||||
private final AtomicBoolean _pickup = new AtomicBoolean();
|
private final AtomicBoolean _pickup = new AtomicBoolean();
|
||||||
private final AtomicInteger _nextTargetMode = new AtomicInteger();
|
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 AtomicBoolean _respectfulHunting = new AtomicBoolean();
|
||||||
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
||||||
|
|
||||||
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
|
|||||||
_nextTargetMode.set(nextTargetMode);
|
_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()
|
public boolean isRespectfulHunting()
|
||||||
|
@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
private boolean _active;
|
private boolean _active;
|
||||||
private boolean _pickUp;
|
private boolean _pickUp;
|
||||||
private int _nextTargetMode;
|
private int _nextTargetMode;
|
||||||
private boolean _longRange;
|
private boolean _shortRange;
|
||||||
private int _potionPercent;
|
private int _potionPercent;
|
||||||
private boolean _respectfulHunting;
|
private boolean _respectfulHunting;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
_active = packet.readC() == 1;
|
_active = packet.readC() == 1;
|
||||||
_pickUp = packet.readC() == 1;
|
_pickUp = packet.readC() == 1;
|
||||||
_nextTargetMode = packet.readH();
|
_nextTargetMode = packet.readH();
|
||||||
_longRange = packet.readC() != 0;
|
_shortRange = packet.readC() == 1;
|
||||||
_potionPercent = packet.readD();
|
_potionPercent = packet.readD();
|
||||||
packet.readD(); // 272
|
packet.readD(); // 272
|
||||||
_respectfulHunting = packet.readC() == 1;
|
_respectfulHunting = packet.readC() == 1;
|
||||||
@ -72,7 +72,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
return;
|
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);
|
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
|
||||||
|
|
||||||
if (!Config.ENABLE_AUTO_PLAY)
|
if (!Config.ENABLE_AUTO_PLAY)
|
||||||
@ -85,7 +85,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
settings.add(1, _active ? 1 : 0);
|
settings.add(1, _active ? 1 : 0);
|
||||||
settings.add(2, _pickUp ? 1 : 0);
|
settings.add(2, _pickUp ? 1 : 0);
|
||||||
settings.add(3, _nextTargetMode);
|
settings.add(3, _nextTargetMode);
|
||||||
settings.add(4, _longRange ? 1 : 0);
|
settings.add(4, _shortRange ? 1 : 0);
|
||||||
settings.add(5, _potionPercent);
|
settings.add(5, _potionPercent);
|
||||||
settings.add(6, _respectfulHunting ? 1 : 0);
|
settings.add(6, _respectfulHunting ? 1 : 0);
|
||||||
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
||||||
@ -93,7 +93,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
player.getAutoPlaySettings().setOptions(_options);
|
player.getAutoPlaySettings().setOptions(_options);
|
||||||
player.getAutoPlaySettings().setPickup(_pickUp);
|
player.getAutoPlaySettings().setPickup(_pickUp);
|
||||||
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
||||||
player.getAutoPlaySettings().setLongRange(!_longRange);
|
player.getAutoPlaySettings().setShortRange(_shortRange);
|
||||||
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
||||||
|
|
||||||
if (_active)
|
if (_active)
|
||||||
|
@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
private final boolean _active;
|
private final boolean _active;
|
||||||
private final boolean _pickUp;
|
private final boolean _pickUp;
|
||||||
private final int _nextTargetMode;
|
private final int _nextTargetMode;
|
||||||
private final boolean _longRange;
|
private final boolean _shortRange;
|
||||||
private final int _potionPercent;
|
private final int _potionPercent;
|
||||||
private final boolean _respectfulHunting;
|
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;
|
_options = options;
|
||||||
_active = active;
|
_active = active;
|
||||||
_pickUp = pickUp;
|
_pickUp = pickUp;
|
||||||
_nextTargetMode = nextTargetMode;
|
_nextTargetMode = nextTargetMode;
|
||||||
_longRange = longRange;
|
_shortRange = shortRange;
|
||||||
_potionPercent = potionPercent;
|
_potionPercent = potionPercent;
|
||||||
_respectfulHunting = respectfulHunting;
|
_respectfulHunting = respectfulHunting;
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
packet.writeC(_active ? 1 : 0);
|
packet.writeC(_active ? 1 : 0);
|
||||||
packet.writeC(_pickUp ? 1 : 0);
|
packet.writeC(_pickUp ? 1 : 0);
|
||||||
packet.writeH(_nextTargetMode);
|
packet.writeH(_nextTargetMode);
|
||||||
packet.writeC(_longRange ? 1 : 0);
|
packet.writeC(_shortRange ? 1 : 0);
|
||||||
packet.writeD(_potionPercent);
|
packet.writeD(_potionPercent);
|
||||||
packet.writeD(0); // 272
|
packet.writeD(0); // 272
|
||||||
packet.writeC(_respectfulHunting ? 1 : 0);
|
packet.writeC(_respectfulHunting ? 1 : 0);
|
||||||
|
@ -123,7 +123,7 @@ public class AutoPlayTaskManager
|
|||||||
// Find target.
|
// Find target.
|
||||||
MonsterInstance monster = null;
|
MonsterInstance monster = null;
|
||||||
double closestDistance = Double.MAX_VALUE;
|
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.
|
// Skip unavailable monsters.
|
||||||
if ((nearby == null) || nearby.isAlikeDead())
|
if ((nearby == null) || nearby.isAlikeDead())
|
||||||
|
@ -10573,7 +10573,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Stop auto play.
|
// Stop auto play.
|
||||||
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
||||||
AutoUseTaskManager.getInstance().stopAutoUseTask(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();
|
restoreAutoShortcutVisual();
|
||||||
|
|
||||||
// Send info to nearby players.
|
// 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 active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
|
||||||
final boolean pickUp = settings.get(2) == 1;
|
final boolean pickUp = settings.get(2) == 1;
|
||||||
final int nextTargetMode = settings.get(3);
|
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 int potionPercent = settings.get(5);
|
||||||
final boolean respectfulHunting = settings.get(6) == 1;
|
final boolean respectfulHunting = settings.get(6) == 1;
|
||||||
|
|
||||||
@ -14444,10 +14444,10 @@ public class PlayerInstance extends Playable
|
|||||||
getAutoPlaySettings().setOptions(options);
|
getAutoPlaySettings().setOptions(options);
|
||||||
getAutoPlaySettings().setPickup(pickUp);
|
getAutoPlaySettings().setPickup(pickUp);
|
||||||
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
||||||
getAutoPlaySettings().setLongRange(!longRange);
|
getAutoPlaySettings().setShortRange(shortRange);
|
||||||
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
|
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)
|
if (active)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
|
|||||||
private final AtomicInteger _options = new AtomicInteger();
|
private final AtomicInteger _options = new AtomicInteger();
|
||||||
private final AtomicBoolean _pickup = new AtomicBoolean();
|
private final AtomicBoolean _pickup = new AtomicBoolean();
|
||||||
private final AtomicInteger _nextTargetMode = new AtomicInteger();
|
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 AtomicBoolean _respectfulHunting = new AtomicBoolean();
|
||||||
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
||||||
|
|
||||||
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
|
|||||||
_nextTargetMode.set(nextTargetMode);
|
_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()
|
public boolean isRespectfulHunting()
|
||||||
|
@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
private boolean _active;
|
private boolean _active;
|
||||||
private boolean _pickUp;
|
private boolean _pickUp;
|
||||||
private int _nextTargetMode;
|
private int _nextTargetMode;
|
||||||
private boolean _longRange;
|
private boolean _shortRange;
|
||||||
private int _potionPercent;
|
private int _potionPercent;
|
||||||
private boolean _respectfulHunting;
|
private boolean _respectfulHunting;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
_active = packet.readC() == 1;
|
_active = packet.readC() == 1;
|
||||||
_pickUp = packet.readC() == 1;
|
_pickUp = packet.readC() == 1;
|
||||||
_nextTargetMode = packet.readH();
|
_nextTargetMode = packet.readH();
|
||||||
_longRange = packet.readC() != 0;
|
_shortRange = packet.readC() == 1;
|
||||||
_potionPercent = packet.readD();
|
_potionPercent = packet.readD();
|
||||||
packet.readD(); // 272
|
packet.readD(); // 272
|
||||||
_respectfulHunting = packet.readC() == 1;
|
_respectfulHunting = packet.readC() == 1;
|
||||||
@ -72,7 +72,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
return;
|
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);
|
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
|
||||||
|
|
||||||
if (!Config.ENABLE_AUTO_PLAY)
|
if (!Config.ENABLE_AUTO_PLAY)
|
||||||
@ -85,7 +85,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
settings.add(1, _active ? 1 : 0);
|
settings.add(1, _active ? 1 : 0);
|
||||||
settings.add(2, _pickUp ? 1 : 0);
|
settings.add(2, _pickUp ? 1 : 0);
|
||||||
settings.add(3, _nextTargetMode);
|
settings.add(3, _nextTargetMode);
|
||||||
settings.add(4, _longRange ? 1 : 0);
|
settings.add(4, _shortRange ? 1 : 0);
|
||||||
settings.add(5, _potionPercent);
|
settings.add(5, _potionPercent);
|
||||||
settings.add(6, _respectfulHunting ? 1 : 0);
|
settings.add(6, _respectfulHunting ? 1 : 0);
|
||||||
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
||||||
@ -93,7 +93,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
player.getAutoPlaySettings().setOptions(_options);
|
player.getAutoPlaySettings().setOptions(_options);
|
||||||
player.getAutoPlaySettings().setPickup(_pickUp);
|
player.getAutoPlaySettings().setPickup(_pickUp);
|
||||||
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
||||||
player.getAutoPlaySettings().setLongRange(!_longRange);
|
player.getAutoPlaySettings().setShortRange(_shortRange);
|
||||||
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
||||||
|
|
||||||
if (_active)
|
if (_active)
|
||||||
|
@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
private final boolean _active;
|
private final boolean _active;
|
||||||
private final boolean _pickUp;
|
private final boolean _pickUp;
|
||||||
private final int _nextTargetMode;
|
private final int _nextTargetMode;
|
||||||
private final boolean _longRange;
|
private final boolean _shortRange;
|
||||||
private final int _potionPercent;
|
private final int _potionPercent;
|
||||||
private final boolean _respectfulHunting;
|
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;
|
_options = options;
|
||||||
_active = active;
|
_active = active;
|
||||||
_pickUp = pickUp;
|
_pickUp = pickUp;
|
||||||
_nextTargetMode = nextTargetMode;
|
_nextTargetMode = nextTargetMode;
|
||||||
_longRange = longRange;
|
_shortRange = shortRange;
|
||||||
_potionPercent = potionPercent;
|
_potionPercent = potionPercent;
|
||||||
_respectfulHunting = respectfulHunting;
|
_respectfulHunting = respectfulHunting;
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
packet.writeC(_active ? 1 : 0);
|
packet.writeC(_active ? 1 : 0);
|
||||||
packet.writeC(_pickUp ? 1 : 0);
|
packet.writeC(_pickUp ? 1 : 0);
|
||||||
packet.writeH(_nextTargetMode);
|
packet.writeH(_nextTargetMode);
|
||||||
packet.writeC(_longRange ? 1 : 0);
|
packet.writeC(_shortRange ? 1 : 0);
|
||||||
packet.writeD(_potionPercent);
|
packet.writeD(_potionPercent);
|
||||||
packet.writeD(0); // 272
|
packet.writeD(0); // 272
|
||||||
packet.writeC(_respectfulHunting ? 1 : 0);
|
packet.writeC(_respectfulHunting ? 1 : 0);
|
||||||
|
@ -123,7 +123,7 @@ public class AutoPlayTaskManager
|
|||||||
// Find target.
|
// Find target.
|
||||||
MonsterInstance monster = null;
|
MonsterInstance monster = null;
|
||||||
double closestDistance = Double.MAX_VALUE;
|
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.
|
// Skip unavailable monsters.
|
||||||
if ((nearby == null) || nearby.isAlikeDead())
|
if ((nearby == null) || nearby.isAlikeDead())
|
||||||
|
@ -10297,7 +10297,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Stop auto play.
|
// Stop auto play.
|
||||||
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
||||||
AutoUseTaskManager.getInstance().stopAutoUseTask(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();
|
restoreAutoShortcutVisual();
|
||||||
|
|
||||||
// Send info to nearby players.
|
// 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 active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
|
||||||
final boolean pickUp = settings.get(2) == 1;
|
final boolean pickUp = settings.get(2) == 1;
|
||||||
final int nextTargetMode = settings.get(3);
|
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 int potionPercent = settings.get(5);
|
||||||
final boolean respectfulHunting = settings.get(6) == 1;
|
final boolean respectfulHunting = settings.get(6) == 1;
|
||||||
|
|
||||||
@ -14317,10 +14317,10 @@ public class PlayerInstance extends Playable
|
|||||||
getAutoPlaySettings().setOptions(options);
|
getAutoPlaySettings().setOptions(options);
|
||||||
getAutoPlaySettings().setPickup(pickUp);
|
getAutoPlaySettings().setPickup(pickUp);
|
||||||
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
||||||
getAutoPlaySettings().setLongRange(!longRange);
|
getAutoPlaySettings().setShortRange(shortRange);
|
||||||
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
|
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)
|
if (active)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
|
|||||||
private final AtomicInteger _options = new AtomicInteger();
|
private final AtomicInteger _options = new AtomicInteger();
|
||||||
private final AtomicBoolean _pickup = new AtomicBoolean();
|
private final AtomicBoolean _pickup = new AtomicBoolean();
|
||||||
private final AtomicInteger _nextTargetMode = new AtomicInteger();
|
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 AtomicBoolean _respectfulHunting = new AtomicBoolean();
|
||||||
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
||||||
|
|
||||||
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
|
|||||||
_nextTargetMode.set(nextTargetMode);
|
_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()
|
public boolean isRespectfulHunting()
|
||||||
|
@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
private boolean _active;
|
private boolean _active;
|
||||||
private boolean _pickUp;
|
private boolean _pickUp;
|
||||||
private int _nextTargetMode;
|
private int _nextTargetMode;
|
||||||
private boolean _longRange;
|
private boolean _shortRange;
|
||||||
private int _potionPercent;
|
private int _potionPercent;
|
||||||
private boolean _respectfulHunting;
|
private boolean _respectfulHunting;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
_active = packet.readC() == 1;
|
_active = packet.readC() == 1;
|
||||||
_pickUp = packet.readC() == 1;
|
_pickUp = packet.readC() == 1;
|
||||||
_nextTargetMode = packet.readH();
|
_nextTargetMode = packet.readH();
|
||||||
_longRange = packet.readC() != 0;
|
_shortRange = packet.readC() == 1;
|
||||||
_potionPercent = packet.readD();
|
_potionPercent = packet.readD();
|
||||||
_respectfulHunting = packet.readC() == 1;
|
_respectfulHunting = packet.readC() == 1;
|
||||||
return true;
|
return true;
|
||||||
@ -71,7 +71,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
return;
|
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);
|
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
|
||||||
|
|
||||||
if (!Config.ENABLE_AUTO_PLAY)
|
if (!Config.ENABLE_AUTO_PLAY)
|
||||||
@ -84,7 +84,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
settings.add(1, _active ? 1 : 0);
|
settings.add(1, _active ? 1 : 0);
|
||||||
settings.add(2, _pickUp ? 1 : 0);
|
settings.add(2, _pickUp ? 1 : 0);
|
||||||
settings.add(3, _nextTargetMode);
|
settings.add(3, _nextTargetMode);
|
||||||
settings.add(4, _longRange ? 1 : 0);
|
settings.add(4, _shortRange ? 1 : 0);
|
||||||
settings.add(5, _potionPercent);
|
settings.add(5, _potionPercent);
|
||||||
settings.add(6, _respectfulHunting ? 1 : 0);
|
settings.add(6, _respectfulHunting ? 1 : 0);
|
||||||
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
||||||
@ -92,7 +92,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
player.getAutoPlaySettings().setOptions(_options);
|
player.getAutoPlaySettings().setOptions(_options);
|
||||||
player.getAutoPlaySettings().setPickup(_pickUp);
|
player.getAutoPlaySettings().setPickup(_pickUp);
|
||||||
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
||||||
player.getAutoPlaySettings().setLongRange(!_longRange);
|
player.getAutoPlaySettings().setShortRange(_shortRange);
|
||||||
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
||||||
|
|
||||||
if (_active)
|
if (_active)
|
||||||
|
@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
private final boolean _active;
|
private final boolean _active;
|
||||||
private final boolean _pickUp;
|
private final boolean _pickUp;
|
||||||
private final int _nextTargetMode;
|
private final int _nextTargetMode;
|
||||||
private final boolean _longRange;
|
private final boolean _shortRange;
|
||||||
private final int _potionPercent;
|
private final int _potionPercent;
|
||||||
private final boolean _respectfulHunting;
|
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;
|
_options = options;
|
||||||
_active = active;
|
_active = active;
|
||||||
_pickUp = pickUp;
|
_pickUp = pickUp;
|
||||||
_nextTargetMode = nextTargetMode;
|
_nextTargetMode = nextTargetMode;
|
||||||
_longRange = longRange;
|
_shortRange = shortRange;
|
||||||
_potionPercent = potionPercent;
|
_potionPercent = potionPercent;
|
||||||
_respectfulHunting = respectfulHunting;
|
_respectfulHunting = respectfulHunting;
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
packet.writeC(_active ? 1 : 0);
|
packet.writeC(_active ? 1 : 0);
|
||||||
packet.writeC(_pickUp ? 1 : 0);
|
packet.writeC(_pickUp ? 1 : 0);
|
||||||
packet.writeH(_nextTargetMode);
|
packet.writeH(_nextTargetMode);
|
||||||
packet.writeC(_longRange ? 1 : 0);
|
packet.writeC(_shortRange ? 1 : 0);
|
||||||
packet.writeD(_potionPercent);
|
packet.writeD(_potionPercent);
|
||||||
packet.writeC(_respectfulHunting ? 1 : 0);
|
packet.writeC(_respectfulHunting ? 1 : 0);
|
||||||
return true;
|
return true;
|
||||||
|
@ -123,7 +123,7 @@ public class AutoPlayTaskManager
|
|||||||
// Find target.
|
// Find target.
|
||||||
MonsterInstance monster = null;
|
MonsterInstance monster = null;
|
||||||
double closestDistance = Double.MAX_VALUE;
|
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.
|
// Skip unavailable monsters.
|
||||||
if ((nearby == null) || nearby.isAlikeDead())
|
if ((nearby == null) || nearby.isAlikeDead())
|
||||||
|
@ -10452,7 +10452,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Stop auto play.
|
// Stop auto play.
|
||||||
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
||||||
AutoUseTaskManager.getInstance().stopAutoUseTask(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();
|
restoreAutoShortcutVisual();
|
||||||
|
|
||||||
// Send info to nearby players.
|
// 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 active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
|
||||||
final boolean pickUp = settings.get(2) == 1;
|
final boolean pickUp = settings.get(2) == 1;
|
||||||
final int nextTargetMode = settings.get(3);
|
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 int potionPercent = settings.get(5);
|
||||||
final boolean respectfulHunting = settings.get(6) == 1;
|
final boolean respectfulHunting = settings.get(6) == 1;
|
||||||
|
|
||||||
@ -14577,10 +14577,10 @@ public class PlayerInstance extends Playable
|
|||||||
getAutoPlaySettings().setOptions(options);
|
getAutoPlaySettings().setOptions(options);
|
||||||
getAutoPlaySettings().setPickup(pickUp);
|
getAutoPlaySettings().setPickup(pickUp);
|
||||||
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
||||||
getAutoPlaySettings().setLongRange(!longRange);
|
getAutoPlaySettings().setShortRange(shortRange);
|
||||||
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
|
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)
|
if (active)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
|
|||||||
private final AtomicInteger _options = new AtomicInteger();
|
private final AtomicInteger _options = new AtomicInteger();
|
||||||
private final AtomicBoolean _pickup = new AtomicBoolean();
|
private final AtomicBoolean _pickup = new AtomicBoolean();
|
||||||
private final AtomicInteger _nextTargetMode = new AtomicInteger();
|
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 AtomicBoolean _respectfulHunting = new AtomicBoolean();
|
||||||
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
||||||
|
|
||||||
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
|
|||||||
_nextTargetMode.set(nextTargetMode);
|
_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()
|
public boolean isRespectfulHunting()
|
||||||
|
@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
private boolean _active;
|
private boolean _active;
|
||||||
private boolean _pickUp;
|
private boolean _pickUp;
|
||||||
private int _nextTargetMode;
|
private int _nextTargetMode;
|
||||||
private boolean _longRange;
|
private boolean _shortRange;
|
||||||
private int _potionPercent;
|
private int _potionPercent;
|
||||||
private boolean _respectfulHunting;
|
private boolean _respectfulHunting;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
_active = packet.readC() == 1;
|
_active = packet.readC() == 1;
|
||||||
_pickUp = packet.readC() == 1;
|
_pickUp = packet.readC() == 1;
|
||||||
_nextTargetMode = packet.readH();
|
_nextTargetMode = packet.readH();
|
||||||
_longRange = packet.readC() != 0;
|
_shortRange = packet.readC() == 1;
|
||||||
_potionPercent = packet.readD();
|
_potionPercent = packet.readD();
|
||||||
packet.readD(); // 272
|
packet.readD(); // 272
|
||||||
_respectfulHunting = packet.readC() == 1;
|
_respectfulHunting = packet.readC() == 1;
|
||||||
@ -72,7 +72,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
return;
|
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);
|
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
|
||||||
|
|
||||||
if (!Config.ENABLE_AUTO_PLAY)
|
if (!Config.ENABLE_AUTO_PLAY)
|
||||||
@ -85,7 +85,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
settings.add(1, _active ? 1 : 0);
|
settings.add(1, _active ? 1 : 0);
|
||||||
settings.add(2, _pickUp ? 1 : 0);
|
settings.add(2, _pickUp ? 1 : 0);
|
||||||
settings.add(3, _nextTargetMode);
|
settings.add(3, _nextTargetMode);
|
||||||
settings.add(4, _longRange ? 1 : 0);
|
settings.add(4, _shortRange ? 1 : 0);
|
||||||
settings.add(5, _potionPercent);
|
settings.add(5, _potionPercent);
|
||||||
settings.add(6, _respectfulHunting ? 1 : 0);
|
settings.add(6, _respectfulHunting ? 1 : 0);
|
||||||
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
||||||
@ -93,7 +93,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
player.getAutoPlaySettings().setOptions(_options);
|
player.getAutoPlaySettings().setOptions(_options);
|
||||||
player.getAutoPlaySettings().setPickup(_pickUp);
|
player.getAutoPlaySettings().setPickup(_pickUp);
|
||||||
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
||||||
player.getAutoPlaySettings().setLongRange(!_longRange);
|
player.getAutoPlaySettings().setShortRange(_shortRange);
|
||||||
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
||||||
|
|
||||||
if (_active)
|
if (_active)
|
||||||
|
@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
private final boolean _active;
|
private final boolean _active;
|
||||||
private final boolean _pickUp;
|
private final boolean _pickUp;
|
||||||
private final int _nextTargetMode;
|
private final int _nextTargetMode;
|
||||||
private final boolean _longRange;
|
private final boolean _shortRange;
|
||||||
private final int _potionPercent;
|
private final int _potionPercent;
|
||||||
private final boolean _respectfulHunting;
|
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;
|
_options = options;
|
||||||
_active = active;
|
_active = active;
|
||||||
_pickUp = pickUp;
|
_pickUp = pickUp;
|
||||||
_nextTargetMode = nextTargetMode;
|
_nextTargetMode = nextTargetMode;
|
||||||
_longRange = longRange;
|
_shortRange = shortRange;
|
||||||
_potionPercent = potionPercent;
|
_potionPercent = potionPercent;
|
||||||
_respectfulHunting = respectfulHunting;
|
_respectfulHunting = respectfulHunting;
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
packet.writeC(_active ? 1 : 0);
|
packet.writeC(_active ? 1 : 0);
|
||||||
packet.writeC(_pickUp ? 1 : 0);
|
packet.writeC(_pickUp ? 1 : 0);
|
||||||
packet.writeH(_nextTargetMode);
|
packet.writeH(_nextTargetMode);
|
||||||
packet.writeC(_longRange ? 1 : 0);
|
packet.writeC(_shortRange ? 1 : 0);
|
||||||
packet.writeD(_potionPercent);
|
packet.writeD(_potionPercent);
|
||||||
packet.writeD(0); // 272
|
packet.writeD(0); // 272
|
||||||
packet.writeC(_respectfulHunting ? 1 : 0);
|
packet.writeC(_respectfulHunting ? 1 : 0);
|
||||||
|
@ -123,7 +123,7 @@ public class AutoPlayTaskManager
|
|||||||
// Find target.
|
// Find target.
|
||||||
MonsterInstance monster = null;
|
MonsterInstance monster = null;
|
||||||
double closestDistance = Double.MAX_VALUE;
|
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.
|
// Skip unavailable monsters.
|
||||||
if ((nearby == null) || nearby.isAlikeDead())
|
if ((nearby == null) || nearby.isAlikeDead())
|
||||||
|
@ -10518,7 +10518,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Stop auto play.
|
// Stop auto play.
|
||||||
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
AutoPlayTaskManager.getInstance().stopAutoPlay(this);
|
||||||
AutoUseTaskManager.getInstance().stopAutoUseTask(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();
|
restoreAutoShortcutVisual();
|
||||||
|
|
||||||
// Send info to nearby players.
|
// 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 active = Config.RESUME_AUTO_PLAY && (settings.get(1) == 1);
|
||||||
final boolean pickUp = settings.get(2) == 1;
|
final boolean pickUp = settings.get(2) == 1;
|
||||||
final int nextTargetMode = settings.get(3);
|
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 int potionPercent = settings.get(5);
|
||||||
final boolean respectfulHunting = settings.get(6) == 1;
|
final boolean respectfulHunting = settings.get(6) == 1;
|
||||||
|
|
||||||
@ -14654,10 +14654,10 @@ public class PlayerInstance extends Playable
|
|||||||
getAutoPlaySettings().setOptions(options);
|
getAutoPlaySettings().setOptions(options);
|
||||||
getAutoPlaySettings().setPickup(pickUp);
|
getAutoPlaySettings().setPickup(pickUp);
|
||||||
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
getAutoPlaySettings().setNextTargetMode(nextTargetMode);
|
||||||
getAutoPlaySettings().setLongRange(!longRange);
|
getAutoPlaySettings().setShortRange(shortRange);
|
||||||
getAutoPlaySettings().setRespectfulHunting(respectfulHunting);
|
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)
|
if (active)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ public class AutoPlaySettingsHolder
|
|||||||
private final AtomicInteger _options = new AtomicInteger();
|
private final AtomicInteger _options = new AtomicInteger();
|
||||||
private final AtomicBoolean _pickup = new AtomicBoolean();
|
private final AtomicBoolean _pickup = new AtomicBoolean();
|
||||||
private final AtomicInteger _nextTargetMode = new AtomicInteger();
|
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 AtomicBoolean _respectfulHunting = new AtomicBoolean();
|
||||||
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
private final AtomicInteger _autoPotionPercent = new AtomicInteger();
|
||||||
|
|
||||||
@ -65,14 +65,14 @@ public class AutoPlaySettingsHolder
|
|||||||
_nextTargetMode.set(nextTargetMode);
|
_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()
|
public boolean isRespectfulHunting()
|
||||||
|
@ -37,7 +37,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
private boolean _active;
|
private boolean _active;
|
||||||
private boolean _pickUp;
|
private boolean _pickUp;
|
||||||
private int _nextTargetMode;
|
private int _nextTargetMode;
|
||||||
private boolean _longRange;
|
private boolean _shortRange;
|
||||||
private int _potionPercent;
|
private int _potionPercent;
|
||||||
private boolean _respectfulHunting;
|
private boolean _respectfulHunting;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
_active = packet.readC() == 1;
|
_active = packet.readC() == 1;
|
||||||
_pickUp = packet.readC() == 1;
|
_pickUp = packet.readC() == 1;
|
||||||
_nextTargetMode = packet.readH();
|
_nextTargetMode = packet.readH();
|
||||||
_longRange = packet.readC() != 0;
|
_shortRange = packet.readC() == 1;
|
||||||
_potionPercent = packet.readD();
|
_potionPercent = packet.readD();
|
||||||
packet.readD(); // 272
|
packet.readD(); // 272
|
||||||
_respectfulHunting = packet.readC() == 1;
|
_respectfulHunting = packet.readC() == 1;
|
||||||
@ -72,7 +72,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
return;
|
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);
|
player.getAutoPlaySettings().setAutoPotionPercent(_potionPercent);
|
||||||
|
|
||||||
if (!Config.ENABLE_AUTO_PLAY)
|
if (!Config.ENABLE_AUTO_PLAY)
|
||||||
@ -85,7 +85,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
settings.add(1, _active ? 1 : 0);
|
settings.add(1, _active ? 1 : 0);
|
||||||
settings.add(2, _pickUp ? 1 : 0);
|
settings.add(2, _pickUp ? 1 : 0);
|
||||||
settings.add(3, _nextTargetMode);
|
settings.add(3, _nextTargetMode);
|
||||||
settings.add(4, _longRange ? 1 : 0);
|
settings.add(4, _shortRange ? 1 : 0);
|
||||||
settings.add(5, _potionPercent);
|
settings.add(5, _potionPercent);
|
||||||
settings.add(6, _respectfulHunting ? 1 : 0);
|
settings.add(6, _respectfulHunting ? 1 : 0);
|
||||||
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
player.getVariables().setIntegerList(PlayerVariables.AUTO_USE_SETTINGS, settings);
|
||||||
@ -93,7 +93,7 @@ public class ExAutoPlaySetting implements IClientIncomingPacket
|
|||||||
player.getAutoPlaySettings().setOptions(_options);
|
player.getAutoPlaySettings().setOptions(_options);
|
||||||
player.getAutoPlaySettings().setPickup(_pickUp);
|
player.getAutoPlaySettings().setPickup(_pickUp);
|
||||||
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
player.getAutoPlaySettings().setNextTargetMode(_nextTargetMode);
|
||||||
player.getAutoPlaySettings().setLongRange(!_longRange);
|
player.getAutoPlaySettings().setShortRange(_shortRange);
|
||||||
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
player.getAutoPlaySettings().setRespectfulHunting(_respectfulHunting);
|
||||||
|
|
||||||
if (_active)
|
if (_active)
|
||||||
|
@ -29,17 +29,17 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
private final boolean _active;
|
private final boolean _active;
|
||||||
private final boolean _pickUp;
|
private final boolean _pickUp;
|
||||||
private final int _nextTargetMode;
|
private final int _nextTargetMode;
|
||||||
private final boolean _longRange;
|
private final boolean _shortRange;
|
||||||
private final int _potionPercent;
|
private final int _potionPercent;
|
||||||
private final boolean _respectfulHunting;
|
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;
|
_options = options;
|
||||||
_active = active;
|
_active = active;
|
||||||
_pickUp = pickUp;
|
_pickUp = pickUp;
|
||||||
_nextTargetMode = nextTargetMode;
|
_nextTargetMode = nextTargetMode;
|
||||||
_longRange = longRange;
|
_shortRange = shortRange;
|
||||||
_potionPercent = potionPercent;
|
_potionPercent = potionPercent;
|
||||||
_respectfulHunting = respectfulHunting;
|
_respectfulHunting = respectfulHunting;
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ public class ExAutoPlaySettingSend implements IClientOutgoingPacket
|
|||||||
packet.writeC(_active ? 1 : 0);
|
packet.writeC(_active ? 1 : 0);
|
||||||
packet.writeC(_pickUp ? 1 : 0);
|
packet.writeC(_pickUp ? 1 : 0);
|
||||||
packet.writeH(_nextTargetMode);
|
packet.writeH(_nextTargetMode);
|
||||||
packet.writeC(_longRange ? 1 : 0);
|
packet.writeC(_shortRange ? 1 : 0);
|
||||||
packet.writeD(_potionPercent);
|
packet.writeD(_potionPercent);
|
||||||
packet.writeD(0); // 272
|
packet.writeD(0); // 272
|
||||||
packet.writeC(_respectfulHunting ? 1 : 0);
|
packet.writeC(_respectfulHunting ? 1 : 0);
|
||||||
|
@ -123,7 +123,7 @@ public class AutoPlayTaskManager
|
|||||||
// Find target.
|
// Find target.
|
||||||
MonsterInstance monster = null;
|
MonsterInstance monster = null;
|
||||||
double closestDistance = Double.MAX_VALUE;
|
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.
|
// Skip unavailable monsters.
|
||||||
if ((nearby == null) || nearby.isAlikeDead())
|
if ((nearby == null) || nearby.isAlikeDead())
|
||||||
|
Loading…
Reference in New Issue
Block a user