All pastes #632664 Raw Edit

Stuff

public text v1 · immutable
#632664 ·published 2007-07-25 01:31 UTC
rendered paste body
        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.");
        }