summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-19 20:26:20 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-19 20:26:20 +0300
commita3c0c9731cc4115694c5931695e67f2c73c2a3ac (patch)
treed49afa00b6dc14ec94b2058e96df859ee2703c9d
parentab9b7f47d44a95fb5b70ff4f679b6cb338599df4 (diff)
downloadplugin-a3c0c9731cc4115694c5931695e67f2c73c2a3ac.tar.gz
plugin-a3c0c9731cc4115694c5931695e67f2c73c2a3ac.tar.bz2
plugin-a3c0c9731cc4115694c5931695e67f2c73c2a3ac.tar.xz
plugin-a3c0c9731cc4115694c5931695e67f2c73c2a3ac.zip
Dont reset NV_TRICKDEAD from non human races.
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/pc.c29
-rw-r--r--src/emap/pc.h2
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