summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-17 00:40:26 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-17 00:40:26 +0300
commit428c65b5c8d000d1cf3b3540de5bd91124c76113 (patch)
tree9d93af42c22aa95d61a2c06e5f73786fdbca75d2 /src
parent30b7aeb3fc9ccec754f404d8c7b73b80983388aa (diff)
downloadplugin-428c65b5c8d000d1cf3b3540de5bd91124c76113.tar.gz
plugin-428c65b5c8d000d1cf3b3540de5bd91124c76113.tar.bz2
plugin-428c65b5c8d000d1cf3b3540de5bd91124c76113.tar.xz
plugin-428c65b5c8d000d1cf3b3540de5bd91124c76113.zip
map: change exp table validation for only used classes.
Diffstat (limited to 'src')
-rw-r--r--src/map/init.c1
-rw-r--r--src/map/pc.c16
-rw-r--r--src/map/pc.h2
3 files changed, 19 insertions, 0 deletions
diff --git a/src/map/init.c b/src/map/init.c
index 22bb403..90ecffb 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -110,6 +110,7 @@ HPExport void plugin_init (void)
addHookPre("pc->unequipitem_pos", epc_unequipitem_pos);
addHookPre("pc->can_attack", epc_can_attack);
addHookPre("pc->takeitem", epc_takeitem);
+ addHookPre("pc->validate_levels", epc_validate_levels);
addHookPre("npc->parse_unknown_mapflag", enpc_parse_unknown_mapflag);
addHookPre("npc->buysellsel", enpc_buysellsel);
addHookPre("npc->db_checkid", enpc_db_checkid);
diff --git a/src/map/pc.c b/src/map/pc.c
index fba2441..612393f 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -165,3 +165,19 @@ int epc_takeitem(struct map_session_data *sd __attribute__ ((unused)),
}
return 1;
}
+
+void epc_validate_levels(void)
+{
+ int i;
+ for (i = 0; i < 7; i++) {
+ if (!pc->db_checkid(i)) continue;
+ if (i == JOB_WEDDING || i == JOB_XMAS || i == JOB_SUMMER)
+ continue; //Classes that do not need exp tables.
+ int j = pc->class2idx(i);
+ if (!pc->max_level[j][0])
+ ShowWarning("Class %d does not has a base exp table.\n", i);
+ if (!pc->max_level[j][1])
+ ShowWarning("Class %d does not has a job exp table.\n", i);
+ }
+ hookStop();
+}
diff --git a/src/map/pc.h b/src/map/pc.h
index cfc37a0..429a74d 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -21,4 +21,6 @@ bool epc_can_attack (struct map_session_data *sd, int *target_id);
int epc_takeitem(struct map_session_data *sd, struct flooritem_data *fitem);
+void epc_validate_levels(void);
+
#endif // EVOL_MAP_PC