Fixed boxing auto skill parameters returning wrong values.
This commit is contained in:
@@ -31,7 +31,7 @@ public class AutoUseSettingsHolder
|
|||||||
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
||||||
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
||||||
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
||||||
private int _skillIndex = -1;
|
private int _skillIndex = 0;
|
||||||
|
|
||||||
public AutoUseSettingsHolder()
|
public AutoUseSettingsHolder()
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoBuffs;
|
return _autoBuffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<Integer> getAutoSkills()
|
public List<Integer> getAutoSkills()
|
||||||
{
|
{
|
||||||
return _autoSkills;
|
return _autoSkills;
|
||||||
}
|
}
|
||||||
@@ -67,15 +67,14 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNextSkillId()
|
public Integer getNextSkillId()
|
||||||
{
|
{
|
||||||
_skillIndex++;
|
|
||||||
if (_skillIndex >= _autoSkills.size())
|
if (_skillIndex >= _autoSkills.size())
|
||||||
{
|
{
|
||||||
_skillIndex = 0;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int skillId = 0;
|
Integer skillId = Integer.MIN_VALUE;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
skillId = _autoSkills.get(_skillIndex);
|
skillId = _autoSkills.get(_skillIndex);
|
||||||
@@ -88,9 +87,14 @@ public class AutoUseSettingsHolder
|
|||||||
return skillId;
|
return skillId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void incrementSkillOrder()
|
||||||
|
{
|
||||||
|
_skillIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
public void resetSkillOrder()
|
public void resetSkillOrder()
|
||||||
{
|
{
|
||||||
_skillIndex = -1;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty()
|
public boolean isEmpty()
|
||||||
|
@@ -229,11 +229,12 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Acquire next skill.
|
// Acquire next skill.
|
||||||
final int skillId = player.getAutoUseSettings().getNextSkillId();
|
final Integer skillId = player.getAutoUseSettings().getNextSkillId();
|
||||||
final Skill skill = player.getKnownSkill(skillId);
|
final Skill skill = player.getKnownSkill(skillId.intValue());
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
|
player.getAutoUseSettings().resetSkillOrder();
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,9 +257,9 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseMagic(player, target, skill))
|
if (canUseMagic(player, target, skill) && player.useMagic(skill, null, true, false))
|
||||||
{
|
{
|
||||||
player.useMagic(skill, null, true, false);
|
player.getAutoUseSettings().incrementSkillOrder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,19 +395,19 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoSkill(PlayerInstance player, int skillId)
|
public void addAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAutoSkill(PlayerInstance player, int skillId)
|
public void removeAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoAction(PlayerInstance player, Integer actionId)
|
public void addAutoAction(PlayerInstance player, int actionId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoActions().add(actionId);
|
player.getAutoUseSettings().getAutoActions().add(actionId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
|
@@ -31,7 +31,7 @@ public class AutoUseSettingsHolder
|
|||||||
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
||||||
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
||||||
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
||||||
private int _skillIndex = -1;
|
private int _skillIndex = 0;
|
||||||
|
|
||||||
public AutoUseSettingsHolder()
|
public AutoUseSettingsHolder()
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoBuffs;
|
return _autoBuffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<Integer> getAutoSkills()
|
public List<Integer> getAutoSkills()
|
||||||
{
|
{
|
||||||
return _autoSkills;
|
return _autoSkills;
|
||||||
}
|
}
|
||||||
@@ -67,15 +67,14 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNextSkillId()
|
public Integer getNextSkillId()
|
||||||
{
|
{
|
||||||
_skillIndex++;
|
|
||||||
if (_skillIndex >= _autoSkills.size())
|
if (_skillIndex >= _autoSkills.size())
|
||||||
{
|
{
|
||||||
_skillIndex = 0;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int skillId = 0;
|
Integer skillId = Integer.MIN_VALUE;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
skillId = _autoSkills.get(_skillIndex);
|
skillId = _autoSkills.get(_skillIndex);
|
||||||
@@ -88,9 +87,14 @@ public class AutoUseSettingsHolder
|
|||||||
return skillId;
|
return skillId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void incrementSkillOrder()
|
||||||
|
{
|
||||||
|
_skillIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
public void resetSkillOrder()
|
public void resetSkillOrder()
|
||||||
{
|
{
|
||||||
_skillIndex = -1;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty()
|
public boolean isEmpty()
|
||||||
|
@@ -229,11 +229,12 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Acquire next skill.
|
// Acquire next skill.
|
||||||
final int skillId = player.getAutoUseSettings().getNextSkillId();
|
final Integer skillId = player.getAutoUseSettings().getNextSkillId();
|
||||||
final Skill skill = player.getKnownSkill(skillId);
|
final Skill skill = player.getKnownSkill(skillId.intValue());
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
|
player.getAutoUseSettings().resetSkillOrder();
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,9 +257,9 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseMagic(player, target, skill))
|
if (canUseMagic(player, target, skill) && player.useMagic(skill, null, true, false))
|
||||||
{
|
{
|
||||||
player.useMagic(skill, null, true, false);
|
player.getAutoUseSettings().incrementSkillOrder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,19 +395,19 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoSkill(PlayerInstance player, int skillId)
|
public void addAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAutoSkill(PlayerInstance player, int skillId)
|
public void removeAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoAction(PlayerInstance player, Integer actionId)
|
public void addAutoAction(PlayerInstance player, int actionId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoActions().add(actionId);
|
player.getAutoUseSettings().getAutoActions().add(actionId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
|
@@ -31,7 +31,7 @@ public class AutoUseSettingsHolder
|
|||||||
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
||||||
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
||||||
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
||||||
private int _skillIndex = -1;
|
private int _skillIndex = 0;
|
||||||
|
|
||||||
public AutoUseSettingsHolder()
|
public AutoUseSettingsHolder()
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoBuffs;
|
return _autoBuffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<Integer> getAutoSkills()
|
public List<Integer> getAutoSkills()
|
||||||
{
|
{
|
||||||
return _autoSkills;
|
return _autoSkills;
|
||||||
}
|
}
|
||||||
@@ -67,15 +67,14 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNextSkillId()
|
public Integer getNextSkillId()
|
||||||
{
|
{
|
||||||
_skillIndex++;
|
|
||||||
if (_skillIndex >= _autoSkills.size())
|
if (_skillIndex >= _autoSkills.size())
|
||||||
{
|
{
|
||||||
_skillIndex = 0;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int skillId = 0;
|
Integer skillId = Integer.MIN_VALUE;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
skillId = _autoSkills.get(_skillIndex);
|
skillId = _autoSkills.get(_skillIndex);
|
||||||
@@ -88,9 +87,14 @@ public class AutoUseSettingsHolder
|
|||||||
return skillId;
|
return skillId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void incrementSkillOrder()
|
||||||
|
{
|
||||||
|
_skillIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
public void resetSkillOrder()
|
public void resetSkillOrder()
|
||||||
{
|
{
|
||||||
_skillIndex = -1;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty()
|
public boolean isEmpty()
|
||||||
|
@@ -229,11 +229,12 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Acquire next skill.
|
// Acquire next skill.
|
||||||
final int skillId = player.getAutoUseSettings().getNextSkillId();
|
final Integer skillId = player.getAutoUseSettings().getNextSkillId();
|
||||||
final Skill skill = player.getKnownSkill(skillId);
|
final Skill skill = player.getKnownSkill(skillId.intValue());
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
|
player.getAutoUseSettings().resetSkillOrder();
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,9 +257,9 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseMagic(player, target, skill))
|
if (canUseMagic(player, target, skill) && player.useMagic(skill, null, true, false))
|
||||||
{
|
{
|
||||||
player.useMagic(skill, null, true, false);
|
player.getAutoUseSettings().incrementSkillOrder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,19 +395,19 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoSkill(PlayerInstance player, int skillId)
|
public void addAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAutoSkill(PlayerInstance player, int skillId)
|
public void removeAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoAction(PlayerInstance player, Integer actionId)
|
public void addAutoAction(PlayerInstance player, int actionId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoActions().add(actionId);
|
player.getAutoUseSettings().getAutoActions().add(actionId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
|
@@ -31,7 +31,7 @@ public class AutoUseSettingsHolder
|
|||||||
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
||||||
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
||||||
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
||||||
private int _skillIndex = -1;
|
private int _skillIndex = 0;
|
||||||
|
|
||||||
public AutoUseSettingsHolder()
|
public AutoUseSettingsHolder()
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoBuffs;
|
return _autoBuffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<Integer> getAutoSkills()
|
public List<Integer> getAutoSkills()
|
||||||
{
|
{
|
||||||
return _autoSkills;
|
return _autoSkills;
|
||||||
}
|
}
|
||||||
@@ -67,15 +67,14 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNextSkillId()
|
public Integer getNextSkillId()
|
||||||
{
|
{
|
||||||
_skillIndex++;
|
|
||||||
if (_skillIndex >= _autoSkills.size())
|
if (_skillIndex >= _autoSkills.size())
|
||||||
{
|
{
|
||||||
_skillIndex = 0;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int skillId = 0;
|
Integer skillId = Integer.MIN_VALUE;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
skillId = _autoSkills.get(_skillIndex);
|
skillId = _autoSkills.get(_skillIndex);
|
||||||
@@ -88,9 +87,14 @@ public class AutoUseSettingsHolder
|
|||||||
return skillId;
|
return skillId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void incrementSkillOrder()
|
||||||
|
{
|
||||||
|
_skillIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
public void resetSkillOrder()
|
public void resetSkillOrder()
|
||||||
{
|
{
|
||||||
_skillIndex = -1;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty()
|
public boolean isEmpty()
|
||||||
|
@@ -229,11 +229,12 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Acquire next skill.
|
// Acquire next skill.
|
||||||
final int skillId = player.getAutoUseSettings().getNextSkillId();
|
final Integer skillId = player.getAutoUseSettings().getNextSkillId();
|
||||||
final Skill skill = player.getKnownSkill(skillId);
|
final Skill skill = player.getKnownSkill(skillId.intValue());
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
|
player.getAutoUseSettings().resetSkillOrder();
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,9 +257,9 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseMagic(player, target, skill))
|
if (canUseMagic(player, target, skill) && player.useMagic(skill, null, true, false))
|
||||||
{
|
{
|
||||||
player.useMagic(skill, null, true, false);
|
player.getAutoUseSettings().incrementSkillOrder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,19 +395,19 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoSkill(PlayerInstance player, int skillId)
|
public void addAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAutoSkill(PlayerInstance player, int skillId)
|
public void removeAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoAction(PlayerInstance player, Integer actionId)
|
public void addAutoAction(PlayerInstance player, int actionId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoActions().add(actionId);
|
player.getAutoUseSettings().getAutoActions().add(actionId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
|
@@ -31,7 +31,7 @@ public class AutoUseSettingsHolder
|
|||||||
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
||||||
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
||||||
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
||||||
private int _skillIndex = -1;
|
private int _skillIndex = 0;
|
||||||
|
|
||||||
public AutoUseSettingsHolder()
|
public AutoUseSettingsHolder()
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoBuffs;
|
return _autoBuffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<Integer> getAutoSkills()
|
public List<Integer> getAutoSkills()
|
||||||
{
|
{
|
||||||
return _autoSkills;
|
return _autoSkills;
|
||||||
}
|
}
|
||||||
@@ -67,15 +67,14 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNextSkillId()
|
public Integer getNextSkillId()
|
||||||
{
|
{
|
||||||
_skillIndex++;
|
|
||||||
if (_skillIndex >= _autoSkills.size())
|
if (_skillIndex >= _autoSkills.size())
|
||||||
{
|
{
|
||||||
_skillIndex = 0;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int skillId = 0;
|
Integer skillId = Integer.MIN_VALUE;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
skillId = _autoSkills.get(_skillIndex);
|
skillId = _autoSkills.get(_skillIndex);
|
||||||
@@ -88,9 +87,14 @@ public class AutoUseSettingsHolder
|
|||||||
return skillId;
|
return skillId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void incrementSkillOrder()
|
||||||
|
{
|
||||||
|
_skillIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
public void resetSkillOrder()
|
public void resetSkillOrder()
|
||||||
{
|
{
|
||||||
_skillIndex = -1;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty()
|
public boolean isEmpty()
|
||||||
|
@@ -229,11 +229,12 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Acquire next skill.
|
// Acquire next skill.
|
||||||
final int skillId = player.getAutoUseSettings().getNextSkillId();
|
final Integer skillId = player.getAutoUseSettings().getNextSkillId();
|
||||||
final Skill skill = player.getKnownSkill(skillId);
|
final Skill skill = player.getKnownSkill(skillId.intValue());
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
|
player.getAutoUseSettings().resetSkillOrder();
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,9 +257,9 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseMagic(player, target, skill))
|
if (canUseMagic(player, target, skill) && player.useMagic(skill, null, true, false))
|
||||||
{
|
{
|
||||||
player.useMagic(skill, null, true, false);
|
player.getAutoUseSettings().incrementSkillOrder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,19 +395,19 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoSkill(PlayerInstance player, int skillId)
|
public void addAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAutoSkill(PlayerInstance player, int skillId)
|
public void removeAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoAction(PlayerInstance player, Integer actionId)
|
public void addAutoAction(PlayerInstance player, int actionId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoActions().add(actionId);
|
player.getAutoUseSettings().getAutoActions().add(actionId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
|
@@ -31,7 +31,7 @@ public class AutoUseSettingsHolder
|
|||||||
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoActions = ConcurrentHashMap.newKeySet();
|
||||||
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
private final Collection<Integer> _autoBuffs = ConcurrentHashMap.newKeySet();
|
||||||
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
private final List<Integer> _autoSkills = new CopyOnWriteArrayList<>();
|
||||||
private int _skillIndex = -1;
|
private int _skillIndex = 0;
|
||||||
|
|
||||||
public AutoUseSettingsHolder()
|
public AutoUseSettingsHolder()
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoBuffs;
|
return _autoBuffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<Integer> getAutoSkills()
|
public List<Integer> getAutoSkills()
|
||||||
{
|
{
|
||||||
return _autoSkills;
|
return _autoSkills;
|
||||||
}
|
}
|
||||||
@@ -67,15 +67,14 @@ public class AutoUseSettingsHolder
|
|||||||
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
return _autoSkills.contains(skillId) || _autoBuffs.contains(skillId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNextSkillId()
|
public Integer getNextSkillId()
|
||||||
{
|
{
|
||||||
_skillIndex++;
|
|
||||||
if (_skillIndex >= _autoSkills.size())
|
if (_skillIndex >= _autoSkills.size())
|
||||||
{
|
{
|
||||||
_skillIndex = 0;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int skillId = 0;
|
Integer skillId = Integer.MIN_VALUE;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
skillId = _autoSkills.get(_skillIndex);
|
skillId = _autoSkills.get(_skillIndex);
|
||||||
@@ -88,9 +87,14 @@ public class AutoUseSettingsHolder
|
|||||||
return skillId;
|
return skillId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void incrementSkillOrder()
|
||||||
|
{
|
||||||
|
_skillIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
public void resetSkillOrder()
|
public void resetSkillOrder()
|
||||||
{
|
{
|
||||||
_skillIndex = -1;
|
_skillIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty()
|
public boolean isEmpty()
|
||||||
|
@@ -229,11 +229,12 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Acquire next skill.
|
// Acquire next skill.
|
||||||
final int skillId = player.getAutoUseSettings().getNextSkillId();
|
final Integer skillId = player.getAutoUseSettings().getNextSkillId();
|
||||||
final Skill skill = player.getKnownSkill(skillId);
|
final Skill skill = player.getKnownSkill(skillId.intValue());
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
|
player.getAutoUseSettings().resetSkillOrder();
|
||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,9 +257,9 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
break SKILLS;
|
break SKILLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canUseMagic(player, target, skill))
|
if (canUseMagic(player, target, skill) && player.useMagic(skill, null, true, false))
|
||||||
{
|
{
|
||||||
player.useMagic(skill, null, true, false);
|
player.getAutoUseSettings().incrementSkillOrder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,19 +395,19 @@ public class AutoUseTaskManager implements Runnable
|
|||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoSkill(PlayerInstance player, int skillId)
|
public void addAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
player.getAutoUseSettings().getAutoSkills().add(skillId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAutoSkill(PlayerInstance player, int skillId)
|
public void removeAutoSkill(PlayerInstance player, Integer skillId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
player.getAutoUseSettings().getAutoSkills().remove(skillId);
|
||||||
stopAutoUseTask(player);
|
stopAutoUseTask(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAutoAction(PlayerInstance player, Integer actionId)
|
public void addAutoAction(PlayerInstance player, int actionId)
|
||||||
{
|
{
|
||||||
player.getAutoUseSettings().getAutoActions().add(actionId);
|
player.getAutoUseSettings().getAutoActions().add(actionId);
|
||||||
startAutoUseTask(player);
|
startAutoUseTask(player);
|
||||||
|
Reference in New Issue
Block a user