Store replaced skills and skip learning them.
Thanks to marciox25.
This commit is contained in:
@@ -718,6 +718,11 @@ public class SkillTreeData implements IXmlReader
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player.hasReplacedSkill(skill.getSkillId()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player.getLevel() >= skill.getGetLevel())
|
||||
{
|
||||
if (skill.getSkillLevel() > SkillData.getInstance().getMaxLevel(skill.getSkillId()))
|
||||
@@ -1521,6 +1526,11 @@ public class SkillTreeData implements IXmlReader
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player.hasReplacedSkill(skill.getSkillId()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (minLevelForNewSkill <= skill.getGetLevel())
|
||||
{
|
||||
final Skill oldSkill = player.getKnownSkill(skill.getSkillId());
|
||||
|
@@ -838,6 +838,7 @@ public class Player extends Playable
|
||||
|
||||
/** Map containing all custom skills of this player. */
|
||||
private Map<Integer, Skill> _customSkills = null;
|
||||
public final Set<Integer> _replacedSkills = ConcurrentHashMap.newKeySet(1);
|
||||
|
||||
private volatile int _actionMask;
|
||||
|
||||
@@ -13485,6 +13486,21 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void addReplacedSkill(int skillId)
|
||||
{
|
||||
_replacedSkills.add(skillId);
|
||||
}
|
||||
|
||||
public void removeReplacedSkill(int skillId)
|
||||
{
|
||||
_replacedSkills.remove(skillId);
|
||||
}
|
||||
|
||||
public boolean hasReplacedSkill(int skillId)
|
||||
{
|
||||
return _replacedSkills.contains(skillId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if current player can revive and shows 'To Village' button upon death, {@code false} otherwise.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user