if (Config.AUTO_LEARN_SKILLS) { boolean countUnlearnable = true; int unLearnable = 0; int skillCounter = 0; L2SkillLearn[] skills = SkillTreeTable.getInstance().getAvailableSkills(this, this.getClassId()); while (skills.length > unLearnable) { for (L2SkillLearn s : skills) { L2Skill sk = SkillTable.getInstance().getInfo(s.getId(), s.getLevel()); if (sk == null || !sk.getCanLearn(this.getClassId())) { if (countUnlearnable) unLearnable++; continue; } if (this.getSkillLevel(sk.getId()) == -1) { skillCounter++; } addSkill(sk); } countUnlearnable = false; skills = SkillTreeTable.getInstance().getAvailableSkills(this, this.getClassId()); } this.sendMessage("You have learn new " + skillCounter + " skills."); }