Attempt to fix revelation skill list issue.

This commit is contained in:
MobiusDev
2017-12-17 06:21:02 +00:00
parent fe3783f992
commit 7f8a736aba
27 changed files with 204 additions and 42 deletions

View File

@@ -1695,12 +1695,6 @@ public final class SkillTreesData implements IGameXmlReader
return true;
}
// Exclude Revelation Skills from this check.
if (getRevelationSkill(player.isDualClassActive() ? SubclassType.DUALCLASS : SubclassType.BASECLASS, skill.getId(), Math.min(skill.getLevel(), maxLvl)) != null)
{
return true;
}
return false;
}

View File

@@ -11705,6 +11705,34 @@ public final class L2PcInstance extends L2Playable
{
// Include transformation skills and those skills that are allowed during transformation.
currentSkills = currentSkills.stream().filter(Skill::allowOnTransform).collect(Collectors.toList());
// Revelation skills.
if (isDualClassActive())
{
int revelationSkill = getVariables().getInt(PlayerVariables.REVELATION_SKILL_1_DUAL_CLASS, 0);
if (revelationSkill != 0)
{
addSkill(SkillData.getInstance().getSkill(revelationSkill, 1), false);
}
revelationSkill = getVariables().getInt(PlayerVariables.REVELATION_SKILL_2_DUAL_CLASS, 0);
if (revelationSkill != 0)
{
addSkill(SkillData.getInstance().getSkill(revelationSkill, 1), false);
}
}
else if (!isSubClassActive())
{
int revelationSkill = getVariables().getInt(PlayerVariables.REVELATION_SKILL_1_MAIN_CLASS, 0);
if (revelationSkill != 0)
{
addSkill(SkillData.getInstance().getSkill(revelationSkill, 1), false);
}
revelationSkill = getVariables().getInt(PlayerVariables.REVELATION_SKILL_2_MAIN_CLASS, 0);
if (revelationSkill != 0)
{
addSkill(SkillData.getInstance().getSkill(revelationSkill, 1), false);
}
}
}
// Include transformation skills.
currentSkills.addAll(transformSkills.values());
@@ -11716,6 +11744,7 @@ public final class L2PcInstance extends L2Playable
.filter(Objects::nonNull)
.filter(s -> !s.isBlockActionUseSkill()) // Skills that are blocked from player use are not shown in skill list.
.filter(s -> !SkillTreesData.getInstance().isAlchemySkill(s.getId(), s.getLevel()))
.filter(s -> s.isDisplayInList())
.collect(Collectors.toList());
//@formatter:on
}

View File

@@ -209,6 +209,7 @@ public final class Skill implements IIdentifiable
private final double _magicCriticalRate;
private final SkillBuffType _buffType;
private final boolean _displayInList;
public Skill(StatsSet set)
{
@@ -441,6 +442,7 @@ public final class Skill implements IIdentifiable
_magicCriticalRate = set.getDouble("magicCriticalRate", 0);
_buffType = isTriggeredSkill() ? SkillBuffType.TRIGGER : isToggle() ? SkillBuffType.TOGGLE : isDance() ? SkillBuffType.DANCE : isDebuff() ? SkillBuffType.DEBUFF : !isHealingPotionSkill() ? SkillBuffType.BUFF : SkillBuffType.NONE;
_displayInList = set.getBoolean("displayInList", true);
}
public TraitType getTraitType()
@@ -1805,6 +1807,11 @@ public final class Skill implements IIdentifiable
return _irreplacableBuff;
}
public boolean isDisplayInList()
{
return _displayInList;
}
/**
* @return if skill could not be requested for use by players.
*/