From e809003ebc015acc98728ba6f4515da173d8aabd Mon Sep 17 00:00:00 2001 From: malufett Date: Tue, 17 Feb 2015 03:37:30 +0800 Subject: Fixed Bug#7938 -http://hercules.ws/board/tracker/issue-7938-frenzy/?gopid=21566#entry21566 Signed-off-by: malufett --- src/map/pc.c | 27 +++++++++++++++++++++------ src/map/pc.h | 1 + 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'src/map') diff --git a/src/map/pc.c b/src/map/pc.c index f41665fad..6b6c27e0a 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1502,8 +1502,15 @@ int pc_calc_skilltree(struct map_session_data *sd) } } } - if( sd->status.job_level < pc->skill_tree[c][i].joblv ) - f = 0; // job level requirement wasn't satisfied + if ( sd->status.job_level < pc->skill_tree[c][i].joblv ) { + int x = pc->mapid2jobid(sd->class_, sd->status.sex); // need to get its own skilltree + if ( x > -1 ) { + x = pc->class2idx(x); + if ( !pc->skill_tree[x][i].inherited ) + f = 0; // job level requirement wasn't satisfied + } else + f = 0; + } } if( f ) { int inf2; @@ -1597,8 +1604,16 @@ void pc_check_skilltree(struct map_session_data *sd, int skill_id) } if( !f ) continue; - if( sd->status.job_level < pc->skill_tree[c][i].joblv ) - continue; + + if ( sd->status.job_level < pc->skill_tree[c][i].joblv ) { + int x = pc->mapid2jobid(sd->class_, sd->status.sex); // need to get its own skilltree + if ( x > -1 ) { + x = pc->class2idx(x); + if ( !pc->skill_tree[x][i].inherited ) + continue; + } else + continue; + } j = skill->db[idx].inf2; if( !sd->status.skill[idx].lv && ( @@ -10255,8 +10270,8 @@ void pc_read_skill_tree(void) { break; } else if ( pc->skill_tree[idx][a].id || ( pc->skill_tree[idx][a].id == NV_TRICKDEAD && ((pc->jobid2mapid(jnames[k].id)&(MAPID_BASEMASK|JOBL_2))!=MAPID_NOVICE) ) ) /* we skip trickdead for non-novices */ continue;/* skip */ - - memcpy(&pc->skill_tree[idx][a],&pc->skill_tree[fidx][f],sizeof(pc->skill_tree[fidx][f])); + memcpy(&pc->skill_tree[idx][a], &pc->skill_tree[fidx][f], sizeof(pc->skill_tree[fidx][f])); + pc->skill_tree[idx][a].inherited = 1; } } diff --git a/src/map/pc.h b/src/map/pc.h index f6b6329b4..1f7c72837 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -684,6 +684,7 @@ struct skill_tree_entry { unsigned short idx; unsigned char max; unsigned char joblv; + short inherited; struct { short id; unsigned short idx; -- cgit v1.2.3-70-g09d2