I want to be able to show a warning if a player is trying to allocate a skill point on a higher job tab.
For example, a player resets their skills, normally you won't be able to allocate your skill point to your 4th job tab if you havent spent enough skpoint in all your 1st, 2nd, and 3rd job tab.
It would be very nice to be able to show a warning that basically says:
"You need to spend %d skill point(s) before spending it on your xx job tab"
I have tried doing it myself, but I just can't seem to get it right.
Am I right to tinker with this specific block on src/map/pc.cpp
/*==========================================
* Update skill_lv for player sd
* Skill point allocation
*------------------------------------------*/void pc_skillup(map_session_data *sd,uint16 skill_id){uint16 idx = skill_get_index(skill_id);
nullpo_retv(sd);if(!idx){if(skill_id)ShowError("pc_skillup: Player attempts to level up invalid skill '%d'\n", skill_id);return;}// Level up guild skillif(SKILL_CHK_GUILD(skill_id)){
guild_skillup(sd, skill_id);return;}// Level up homunculus skillelseif(sd->hd && SKILL_CHK_HOMUN(skill_id)){
hom_skillup(sd->hd, skill_id);return;}else{if( sd->status.skill_point >0&&
sd->status.skill[idx].id &&
sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT &&//Don't allow raising while you have granted skills. [Skotlex]
sd->status.skill[idx].lv < skill_tree_get_max(skill_id, sd->status.class_)){
sd->status.skill[idx].lv++;
sd->status.skill_point--;if(!skill_get_inf(skill_id)|| pc_checkskill_summoner(sd, SUMMONER_POWER_LAND)>=20|| pc_checkskill_summoner(sd, SUMMONER_POWER_SEA)>=20)
status_calc_pc(sd,SCO_NONE);// Only recalculate for passive skills.elseif( sd->status.skill_point ==0&& pc_is_taekwon_ranker(sd))
pc_calc_skilltree(sd);// Required to grant all TK Ranker skills.else
pc_check_skilltree(sd);// Check if a new skill can Lvlupuint16 lv = sd->status.skill[idx].lv;int32 range = skill_get_range2(&sd->bl, skill_id, lv,false);bool upgradable =( lv < skill_tree_get_max( sd->status.skill[idx].id, sd->status.class_ ));
clif_skillup(*sd, skill_id, lv, range, upgradable );
clif_updatestatus(*sd,SP_SKILLPOINT);if( skill_id == GN_REMODELING_CART )/* cart weight info was updated by status_calc_pc */
clif_updatestatus(*sd,SP_CARTINFO);if(pc_checkskill(sd, SG_DEVIL)&&((sd->class_&MAPID_THIRDMASK)== MAPID_STAR_EMPEROR || pc_is_maxjoblv(sd)))
clif_status_change(&sd->bl, EFST_DEVIL1,1,0,0,0,1);//Permanent blind effect from SG_DEVIL.if(!pc_has_permission(sd, PC_PERM_ALL_SKILL))// may skill everything at any time anyways, and this would cause a huge slowdown
clif_skillinfoblock(sd);}//else// ShowDebug("Skill Level up failed. ID:%d idx:%d (CID=%d. AID=%d)\n", skill_id, idx, sd->status.char_id, sd->status.account_id);}
I'm reading the function pc_calc_skilltree_normalize_job_sub as well, but I can't grasp it. Anyone willing to help me?
Question
exequens
I want to be able to show a warning if a player is trying to allocate a skill point on a higher job tab.
For example, a player resets their skills, normally you won't be able to allocate your skill point to your 4th job tab if you havent spent enough skpoint in all your 1st, 2nd, and 3rd job tab.
It would be very nice to be able to show a warning that basically says:
"You need to spend %d skill point(s) before spending it on your xx job tab"
I have tried doing it myself, but I just can't seem to get it right.
Am I right to tinker with this specific block on src/map/pc.cpp
I'm reading the function pc_calc_skilltree_normalize_job_sub as well, but I can't grasp it. Anyone willing to help me?
Edited by exequensLink to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.