Forgotten Scroll skills have their own configuration.
This commit is contained in:
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll and Forgotten Power skills have their own configurations.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -668,7 +668,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -678,10 +678,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeByFp if {@code true} skills from Forgotten Power books will be included
|
* @param includeByFp if {@code true} skills from Forgotten Power books will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -701,6 +702,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll and Forgotten Power requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS() && ((skill.getSkillId() < 11400) || (skill.getSkillId() > 11404)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -748,7 +755,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -761,13 +768,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll and Forgotten Power skills have their own configurations.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -668,7 +668,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -678,10 +678,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeByFp if {@code true} skills from Forgotten Power books will be included
|
* @param includeByFp if {@code true} skills from Forgotten Power books will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -701,6 +702,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll and Forgotten Power requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS() && ((skill.getSkillId() < 11400) || (skill.getSkillId() > 11404)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -748,7 +755,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -761,13 +768,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll and Forgotten Power skills have their own configurations.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -668,7 +668,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -678,10 +678,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeByFp if {@code true} skills from Forgotten Power books will be included
|
* @param includeByFp if {@code true} skills from Forgotten Power books will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -701,6 +702,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll and Forgotten Power requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS() && ((skill.getSkillId() < 11400) || (skill.getSkillId() > 11404)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -748,7 +755,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -761,13 +768,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll and Forgotten Power skills have their own configurations.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -668,7 +668,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -678,10 +678,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeByFp if {@code true} skills from Forgotten Power books will be included
|
* @param includeByFp if {@code true} skills from Forgotten Power books will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -701,6 +702,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll and Forgotten Power requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS() && ((skill.getSkillId() < 11400) || (skill.getSkillId() > 11404)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -748,7 +755,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -761,13 +768,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll and Forgotten Power skills have their own configurations.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -668,7 +668,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -678,10 +678,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeByFp if {@code true} skills from Forgotten Power books will be included
|
* @param includeByFp if {@code true} skills from Forgotten Power books will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeByFp, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -701,6 +702,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll and Forgotten Power requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS() && ((skill.getSkillId() < 11400) || (skill.getSkillId() > 11404)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -748,7 +755,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeByFp, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -761,13 +768,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -518,10 +518,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new ArrayList<>();
|
final List<SkillLearn> result = new ArrayList<>();
|
||||||
final Map<Integer, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Integer, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -539,8 +540,17 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((includeAutoGet && skill.isAutoGet()) || skill.isLearnedByNpc() || (includeByFs && skill.isLearnedByFS())) && (player.getLevel() >= skill.getGetLevel()))
|
if (((!includeAutoGet || !skill.isAutoGet()) && !skill.isLearnedByNpc() && (!includeByFs || !skill.isLearnedByFS())) || (player.getLevel() < skill.getGetLevel()))
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
final Skill oldSkill = holder.getKnownSkill(skill.getSkillId());
|
final Skill oldSkill = holder.getKnownSkill(skill.getSkillId());
|
||||||
if (oldSkill != null)
|
if (oldSkill != null)
|
||||||
{
|
{
|
||||||
@@ -554,7 +564,6 @@ public class SkillTreeData implements IXmlReader
|
|||||||
result.add(skill);
|
result.add(skill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,22 +580,17 @@ public class SkillTreeData implements IXmlReader
|
|||||||
{
|
{
|
||||||
// Get available skills
|
// Get available skills
|
||||||
final PlayerSkillHolder holder = new PlayerSkillHolder(player);
|
final PlayerSkillHolder holder = new PlayerSkillHolder(player);
|
||||||
List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
holder.addSkill(skill);
|
holder.addSkill(skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get new available skills, some skills depend of previous skills to be available.
|
// Get new available skills, some skills depend of previous skills to be available.
|
||||||
learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
}
|
}
|
||||||
return holder.getSkills().values();
|
return holder.getSkills().values();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -518,10 +518,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new ArrayList<>();
|
final List<SkillLearn> result = new ArrayList<>();
|
||||||
final Map<Integer, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Integer, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -539,8 +540,17 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((includeAutoGet && skill.isAutoGet()) || skill.isLearnedByNpc() || (includeByFs && skill.isLearnedByFS())) && (player.getLevel() >= skill.getGetLevel()))
|
if (((!includeAutoGet || !skill.isAutoGet()) && !skill.isLearnedByNpc() && (!includeByFs || !skill.isLearnedByFS())) || (player.getLevel() < skill.getGetLevel()))
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
final Skill oldSkill = holder.getKnownSkill(skill.getSkillId());
|
final Skill oldSkill = holder.getKnownSkill(skill.getSkillId());
|
||||||
if (oldSkill != null)
|
if (oldSkill != null)
|
||||||
{
|
{
|
||||||
@@ -554,7 +564,6 @@ public class SkillTreeData implements IXmlReader
|
|||||||
result.add(skill);
|
result.add(skill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,22 +580,17 @@ public class SkillTreeData implements IXmlReader
|
|||||||
{
|
{
|
||||||
// Get available skills
|
// Get available skills
|
||||||
final PlayerSkillHolder holder = new PlayerSkillHolder(player);
|
final PlayerSkillHolder holder = new PlayerSkillHolder(player);
|
||||||
List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
holder.addSkill(skill);
|
holder.addSkill(skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get new available skills, some skills depend of previous skills to be available.
|
// Get new available skills, some skills depend of previous skills to be available.
|
||||||
learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
}
|
}
|
||||||
return holder.getSkills().values();
|
return holder.getSkills().values();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -666,7 +666,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -675,10 +675,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -698,6 +699,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
// if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
// {
|
// {
|
||||||
// continue;
|
// continue;
|
||||||
@@ -743,7 +750,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -756,13 +763,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -676,10 +676,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -699,6 +700,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -745,7 +752,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -758,13 +765,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -666,7 +666,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -675,10 +675,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -698,6 +699,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
// if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
// {
|
// {
|
||||||
// continue;
|
// continue;
|
||||||
@@ -743,7 +750,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -756,13 +763,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -666,7 +666,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -675,10 +675,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -698,6 +699,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
// if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
// {
|
// {
|
||||||
// continue;
|
// continue;
|
||||||
@@ -743,7 +750,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -756,13 +763,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ SkillReuseList =
|
|||||||
AutoLearnSkills = False
|
AutoLearnSkills = False
|
||||||
|
|
||||||
# Auto learn skills that need items to be learned.
|
# Auto learn skills that need items to be learned.
|
||||||
|
# Forgotten Scroll skills have their own configuration.
|
||||||
# Default: False
|
# Default: False
|
||||||
AutoLearnSkillsWithoutItems = False
|
AutoLearnSkillsWithoutItems = False
|
||||||
|
|
||||||
|
|||||||
@@ -666,7 +666,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
*/
|
*/
|
||||||
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
public List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet)
|
||||||
{
|
{
|
||||||
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, player);
|
return getAvailableSkills(player, classId, includeByFs, includeAutoGet, true, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -675,10 +675,11 @@ public class SkillTreeData implements IXmlReader
|
|||||||
* @param classId the learning skill class Id
|
* @param classId the learning skill class Id
|
||||||
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
* @param includeByFs if {@code true} skills from Forgotten Scroll will be included
|
||||||
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
* @param includeAutoGet if {@code true} Auto-Get skills will be included
|
||||||
|
* @param includeRequiredItems if {@code true} skills that have required items will be added
|
||||||
* @param holder
|
* @param holder
|
||||||
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
* @return all available skills for a given {@code player}, {@code classId}, {@code includeByFs} and {@code includeAutoGet}
|
||||||
*/
|
*/
|
||||||
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, ISkillsHolder holder)
|
private List<SkillLearn> getAvailableSkills(PlayerInstance player, ClassId classId, boolean includeByFs, boolean includeAutoGet, boolean includeRequiredItems, ISkillsHolder holder)
|
||||||
{
|
{
|
||||||
final List<SkillLearn> result = new LinkedList<>();
|
final List<SkillLearn> result = new LinkedList<>();
|
||||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||||
@@ -698,6 +699,12 @@ public class SkillTreeData implements IXmlReader
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forgotten Scroll requirements checked above.
|
||||||
|
if (!includeRequiredItems && !skill.getRequiredItems().isEmpty() && !skill.isLearnedByFS())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
// if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()) && !isAwakenSaveSkill(player.getClassId(), skill.getSkillId()))
|
||||||
// {
|
// {
|
||||||
// continue;
|
// continue;
|
||||||
@@ -743,7 +750,7 @@ public class SkillTreeData implements IXmlReader
|
|||||||
final Set<Integer> removed = new HashSet<>();
|
final Set<Integer> removed = new HashSet<>();
|
||||||
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
for (int i = 0; i < 1000; i++) // Infinite loop warning
|
||||||
{
|
{
|
||||||
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, holder);
|
final List<SkillLearn> learnable = getAvailableSkills(player, classId, includeByFs, includeAutoGet, includeRequiredItems, holder);
|
||||||
if (learnable.isEmpty())
|
if (learnable.isEmpty())
|
||||||
{
|
{
|
||||||
// No more skills to learn
|
// No more skills to learn
|
||||||
@@ -756,13 +763,8 @@ public class SkillTreeData implements IXmlReader
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEARCH: for (SkillLearn skillLearn : learnable)
|
for (SkillLearn skillLearn : learnable)
|
||||||
{
|
{
|
||||||
if (!includeRequiredItems && !skillLearn.getRequiredItems().isEmpty())
|
|
||||||
{
|
|
||||||
continue SEARCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||||
// Cleanup skills that has to be removed
|
// Cleanup skills that has to be removed
|
||||||
for (int skillId : skillLearn.getRemoveSkills())
|
for (int skillId : skillLearn.getRemoveSkills())
|
||||||
|
|||||||
Reference in New Issue
Block a user