Fixed skills ignoring social class.

This commit is contained in:
MobiusDev
2018-07-01 00:23:30 +00:00
parent 5934fac571
commit 581cae366f
26 changed files with 196 additions and 165 deletions

View File

@@ -41,6 +41,7 @@ import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.instancemanager.CastleManager;
import com.l2jmobius.gameserver.instancemanager.FortManager;
import com.l2jmobius.gameserver.instancemanager.SiegeManager;
@@ -1414,19 +1415,24 @@ public class L2Clan implements IIdentifiable, INamable
return;
}
final int playerSocialClass = player.getPledgeClass() + 1;
for (Skill skill : _skills.values())
{
if (skill.getMinPledgeClass() <= player.getPledgeClass())
final L2SkillLearn skillLearn = SkillTreesData.getInstance().getPledgeSkill(skill.getId(), skill.getLevel());
if ((skillLearn == null) || (skillLearn.getSocialClass() == null) || (playerSocialClass >= skillLearn.getSocialClass().ordinal()))
{
player.addSkill(skill, false); // Skill is not saved to player DB
}
}
if (player.getPledgeType() == 0)
{
for (Skill skill : _subPledgeSkills.values())
{
player.addSkill(skill, false); // Skill is not saved to player DB
final L2SkillLearn skillLearn = SkillTreesData.getInstance().getSubPledgeSkill(skill.getId(), skill.getLevel());
if ((skillLearn == null) || (skillLearn.getSocialClass() == null) || (playerSocialClass >= skillLearn.getSocialClass().ordinal()))
{
player.addSkill(skill, false); // Skill is not saved to player DB
}
}
}
else