int merc_hom_calc_skilltree(struct homun_data *hd, int flag_evolve) { int i, id = 0; int j, f = 1; int c = 0; nullpo_ret(hd); /* load previous homunculus form skills first. */ if( hd->homunculus.prev_class != 0 ) { c = hd->homunculus.prev_class - HM_CLASS_BASE; for( i = 0; i < MAX_SKILL_TREE && ( id = hskill_tree[c][i].id ) > 0; i++ ) { if( hd->homunculus.hskill[ id - HM_SKILLBASE ].id ) continue; //Skill already known. if(!battle_config.skillfree) { for( j = 0; j < MAX_PC_SKILL_REQUIRE; j++ ) { if( hskill_tree[c][i].need[j].id && merc_hom_checkskill(hd,hskill_tree[c][i].need[j].id) < hskill_tree[c][i].need[j].lv ) { f = 0; break; } } } if ( f ) hd->homunculus.hskill[id-HM_SKILLBASE].id = id; } f = 1; } c = hd->homunculus.class_ - HM_CLASS_BASE; for( i = 0; i < MAX_SKILL_TREE && ( id = hskill_tree[c][i].id ) > 0; i++ ) { if( hd->homunculus.hskill[ id - HM_SKILLBASE ].id ) continue; //Skill already known. j = ( flag_evolve ) ? 10 : hd->homunculus.intimacy; if( j < hskill_tree[c][i].intimacylv ) continue; if(!battle_config.skillfree) { for( j = 0; j < MAX_PC_SKILL_REQUIRE; j++ ) { if( hskill_tree[c][i].need[j].id && merc_hom_checkskill(hd,hskill_tree[c][i].need[j].id) < hskill_tree[c][i].need[j].lv ) { f = 0; break; } } } if ( f ) hd->homunculus.hskill[id-HM_SKILLBASE].id = id; } if( hd->master ) clif_homskillinfoblock(hd->master); return 0; }
int merc_hom_calc_skilltree(struct homun_data *hd) { int i,id=0 ; int j,f=1; int c=0; nullpo_ret(hd); c = hd->homunculus.class_ - HM_CLASS_BASE; for(i=0;i < MAX_SKILL_TREE && (id = hskill_tree[c][i].id) > 0;i++) { if(hd->homunculus.hskill[id-HM_SKILLBASE].id) continue; //Skill already known. if(!battle_config.skillfree) { for(j=0;j<MAX_PC_SKILL_REQUIRE;j++) { if( hskill_tree[c][i].need[j].id && merc_hom_checkskill(hd,hskill_tree[c][i].need[j].id) < hskill_tree[c][i].need[j].lv) { f=0; break; } } } if (f) hd->homunculus.hskill[id-HM_SKILLBASE].id = id ; } return 0; }
int merc_hom_calc_skilltree(struct homun_data *hd) { int i,id=0 ; int j,f=1; int c=0; nullpo_ret(hd); c = hd->homunculus.class_ - HM_CLASS_BASE; for(i=0;i < MAX_SKILL_TREE && (id = hskill_tree[c][i].id) > 0;i++) { if(hd->homunculus.hskill[id-HM_SKILLBASE].id) continue; //Skill already known. f = 1; if(!battle_config.skillfree) { for(j=0;j<MAX_PC_SKILL_REQUIRE;j++) { if( hskill_tree[c][i].need[j].id && merc_hom_checkskill(hd,hskill_tree[c][i].need[j].id) < hskill_tree[c][i].need[j].lv) { f=0; break; } } //If a base level requirement is set, the skill will only be unlocked when //the homunculus reaches the required base level for the skill. [Rytech] if( hd->homunculus.level < hskill_tree[c][i].joblv ) f = 0; } if (f) hd->homunculus.hskill[id-HM_SKILLBASE].id = id ; } return 0; }