Ignore:
Timestamp:
Jan 16, 2012 7:56:19 AM (4 months ago)
Author:
MELERIX
Message:

STABLE: Sync with BETA [8629]

Location:
trunk/L2J_DataPack
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/L2J_DataPack

  • trunk/L2J_DataPack/dist/game/data/scripts/handlers/bypasshandlers/SkillList.java

    r8501 r8630  
    1515package handlers.bypasshandlers; 
    1616 
     17import java.util.List; 
    1718import java.util.logging.Level; 
    1819 
     
    3940        { 
    4041                if (!(target instanceof L2NpcInstance)) 
     42                { 
    4143                        return false; 
     44                } 
    4245                 
    4346                if (Config.ALT_GAME_SKILL_LEARN) 
     
    4851                                if (id.length() != 0) 
    4952                                { 
    50                                         L2NpcInstance.showSkillList(activeChar, (L2Npc)target, ClassId.values()[Integer.parseInt(id)]); 
     53                                        L2NpcInstance.showSkillList(activeChar, (L2Npc) target, ClassId.values()[Integer.parseInt(id)]); 
    5154                                } 
    5255                                else 
     
    5457                                        boolean own_class = false; 
    5558                                         
    56                                         ClassId[] classesToTeach = ((L2NpcInstance)target).getClassesToTeach(); 
    57                                         if (classesToTeach != null) 
     59                                        final List<ClassId> classesToTeach = ((L2NpcInstance) target).getClassesToTeach(); 
     60                                        for (ClassId cid : classesToTeach) 
    5861                                        { 
    59                                                 for (ClassId cid : classesToTeach) 
     62                                                if (cid.equalsOrChildOf(activeChar.getClassId())) 
    6063                                                { 
    61                                                         if (cid.equalsOrChildOf(activeChar.getClassId())) 
    62                                                         { 
    63                                                                 own_class = true; 
    64                                                                 break; 
    65                                                         } 
     64                                                        own_class = true; 
     65                                                        break; 
    6666                                                } 
    6767                                        } 
     
    7272                                        { 
    7373                                                String charType = activeChar.getClassId().isMage() ? "fighter" : "mage"; 
    74                                                 text += 
    75                                                         "Skills of your class are the easiest to learn.<br>"+ 
    76                                                         "Skills of another class of your race are a little harder.<br>"+ 
    77                                                         "Skills for classes of another race are extremely difficult.<br>"+ 
    78                                                         "But the hardest of all to learn are the  "+ charType +"skills!<br>"; 
     74                                                text += "Skills of your class are the easiest to learn.<br>" + "Skills of another class of your race are a little harder.<br>" + "Skills for classes of another race are extremely difficult.<br>" + "But the hardest of all to learn are the  " + charType + "skills!<br>"; 
    7975                                        } 
    8076                                         
    8177                                        // make a list of classes 
    82                                         if (classesToTeach != null) 
     78                                        if (!classesToTeach.isEmpty()) 
    8379                                        { 
    8480                                                int count = 0; 
     
    9086                                                        { 
    9187                                                                if (cid.level() > classCheck.level()) 
     88                                                                { 
    9289                                                                        continue; 
     90                                                                } 
    9391                                                                 
    9492                                                                if (SkillTreesData.getInstance().getAvailableSkills(activeChar, cid, false, false).isEmpty()) 
     93                                                                { 
    9594                                                                        continue; 
     95                                                                } 
    9696                                                                 
    97                                                                 text += "<a action=\"bypass -h npc_%objectId%_SkillList "+cid.getId()+"\">Learn "+cid+"'s class Skills</a><br>\n"; 
     97                                                                text += "<a action=\"bypass -h npc_%objectId%_SkillList " + cid.getId() + "\">Learn " + cid + "'s class Skills</a><br>\n"; 
    9898                                                                count++; 
    9999                                                        } 
     
    103103                                        } 
    104104                                        else 
     105                                        { 
    105106                                                text += "No Skills.<br>"; 
    106                                          
     107                                        } 
    107108                                        text += "</body></html>"; 
    108109                                         
    109                                         NpcHtmlMessage html = new NpcHtmlMessage(((L2Npc)target).getObjectId()); 
     110                                        NpcHtmlMessage html = new NpcHtmlMessage(((L2Npc) target).getObjectId()); 
    110111                                        html.setHtml(text); 
    111                                         html.replace("%objectId%", String.valueOf(((L2Npc)target).getObjectId())); 
     112                                        html.replace("%objectId%", String.valueOf(((L2Npc) target).getObjectId())); 
    112113                                        activeChar.sendPacket(html); 
    113114                                         
Note: See TracChangeset for help on using the changeset viewer.