diff options
Diffstat (limited to 'src/emap')
-rw-r--r-- | src/emap/init.c | 1 | ||||
-rw-r--r-- | src/emap/pc.c | 29 | ||||
-rw-r--r-- | src/emap/pc.h | 2 |
3 files changed, 32 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c index 9063735..26a2d02 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -234,6 +234,7 @@ HPExport void plugin_init (void) addHookPre(pc, dropitem, epc_dropitem_pre); addHookPre(pc, insert_card, epc_insert_card_pre); addHookPre(pc, process_chat_message, epc_process_chat_message_pre); + addHookPre(pc, calc_skilltree_clear, epc_calc_skilltree_clear_pre); addHookPre(mob, deleteslave_sub, emob_deleteslave_sub_pre); addHookPre(mob, read_db_additional_fields, emob_read_db_additional_fields_pre); addHookPre(mob, dead, emob_dead_pre); diff --git a/src/emap/pc.c b/src/emap/pc.c index 1898cf2..ff9a49e 100644 --- a/src/emap/pc.c +++ b/src/emap/pc.c @@ -1011,3 +1011,32 @@ int epc_jobchange(struct map_session_data *sd, return 0; } + +// copy from pc_calc_skilltree_clear, disabled NV_TRICKDEAD. +void epc_calc_skilltree_clear_pre(struct map_session_data **sdPtr) +{ + struct map_session_data *sd = *sdPtr; + nullpo_retv(sd); + + for (int i = 0; i < MAX_SKILL_DB; i++) + { + if (sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED && sd->status.skill[i].flag != SKILL_FLAG_PERM_GRANTED) //Don't touch these + sd->status.skill[i].id = 0; //First clear skills. + /* permanent skills that must be re-checked */ +// if (sd->status.skill[i].flag == SKILL_FLAG_PERMANENT) +// { +// switch (skill->dbs->db[i].nameid) +// { +// case NV_TRICKDEAD: +// if ((sd->job & MAPID_UPPERMASK) != MAPID_NOVICE) +// { +// sd->status.skill[i].id = 0; +// sd->status.skill[i].lv = 0; +// sd->status.skill[i].flag = 0; +// } +// break; +// } +// } + } + hookStop(); +} diff --git a/src/emap/pc.h b/src/emap/pc.h index b758852..8579d6f 100644 --- a/src/emap/pc.h +++ b/src/emap/pc.h @@ -129,4 +129,6 @@ int epc_jobchange(struct map_session_data *sd, int job, int upper); +void epc_calc_skilltree_clear_pre(struct map_session_data **sdPtr); + #endif // EVOL_MAP_PC |