viewing paste ra_skill_tree | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
Index: src/map/pc.c
===================================================================
--- src/map/pc.c    (revision 17256)
+++ src/map/pc.c    (working copy)
@@ -1392,8 +1392,13 @@
                        }
                    }
                }
-               if( sd->status.job_level < skill_tree[c][i].joblv )
-                   f = 0; // job level requirement wasn't satisfied
+               if( sd->status.job_level < skill_tree[c][i].joblv ) { //We need to get the "true" class tree value in this case
+                   int class = pc_mapid2jobid(sd->class_, sd->status.sex);
+                   class = pc_class2idx(class);
+                   ShowDebug("pc_calc_skilltree: tree class= %d player class= %d\n", c, class);
+                   if (class == c || (class != c && sd->status.job_level < skill_tree[class][i].joblv))
+                       f = 0; // job level requirement wasn't satisfied
+               }
            }
 
            if( f ) {
@@ -1494,8 +1499,13 @@
            }
            if( !f )
                continue;
-           if( sd->status.job_level < skill_tree[c][i].joblv )
-               continue;
+           if( sd->status.job_level < skill_tree[c][i].joblv ) { //We need to get the "true" class tree value in this case
+               int class = pc_mapid2jobid(sd->class_, sd->status.sex);
+               class = pc_class2idx(class);
+               ShowDebug("pc_check_skilltree: tree class= %d player class= %d\n", c, class);
+               if (class == c || (class != c && sd->status.job_level < skill_tree[class][i].joblv))
+                   continue; // job level requirement wasn't satisfied
+           }
 
            j = skill_get_inf2(id);
            if( !sd->status.skill[id].lv && (
Viewed 737 times, submitted by Guest.