summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-10 23:35:23 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-10 23:35:23 +0300
commit293793b7027029efc87c8b657a0c45d26e0840c5 (patch)
treecb41a385a1bd6e3f01704a0ec07549c3d8157c39
parent48f6d35d2c293a17a863bb540e686b1c780b9005 (diff)
downloadevol-hercules-293793b7027029efc87c8b657a0c45d26e0840c5.tar.gz
evol-hercules-293793b7027029efc87c8b657a0c45d26e0840c5.tar.bz2
evol-hercules-293793b7027029efc87c8b657a0c45d26e0840c5.tar.xz
evol-hercules-293793b7027029efc87c8b657a0c45d26e0840c5.zip
map: add support for own job names.
-rw-r--r--src/map/init.c1
-rw-r--r--src/map/pc.c12
-rw-r--r--src/map/pc.h2
3 files changed, 15 insertions, 0 deletions
diff --git a/src/map/init.c b/src/map/init.c
index 98623d6..e825346 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -131,6 +131,7 @@ HPExport void plugin_init (void)
addHookPre("pc->can_attack", epc_can_attack);
addHookPre("pc->takeitem", epc_takeitem);
addHookPre("pc->validate_levels", epc_validate_levels);
+ addHookPre("pc->check_job_name", epc_check_job_name);
addHookPre("mob->deleteslave_sub", emob_deleteslave_sub);
addHookPre("npc->parse_unknown_mapflag", enpc_parse_unknown_mapflag);
addHookPre("npc->buysellsel", enpc_buysellsel);
diff --git a/src/map/pc.c b/src/map/pc.c
index 504d5c6..2bc8d79 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -279,3 +279,15 @@ int epc_unequipitem_post(int retVal, struct map_session_data *sd,
equippost_effect(sd, *nPtr, retVal, false);
return retVal;
}
+
+int epc_check_job_name(const char *name)
+{
+ int val = -1;
+ if (script->get_constant(name, &val))
+ {
+ hookStop();
+ return val;
+ }
+ hookStop();
+ return -1;
+}
diff --git a/src/map/pc.h b/src/map/pc.h
index 37f3974..459d836 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -33,4 +33,6 @@ int epc_equipitem_post(int retVal, struct map_session_data *sd,
int epc_unequipitem_post(int retVal, struct map_session_data *sd,
int *nPtr, int *data);
+int epc_check_job_name(const char *name);
+
#endif // EVOL_MAP_PC