summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-01 16:52:15 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-01 16:52:15 +0300
commitdc7c6e13e5535e4fe78bb84f9920347880022327 (patch)
treedc07f3964e1f3a360256ebf9a82744a1961f059b
parent359730d16f0444da91d678302260a903b18be607 (diff)
downloadevol-hercules-dc7c6e13e5535e4fe78bb84f9920347880022327.tar.gz
evol-hercules-dc7c6e13e5535e4fe78bb84f9920347880022327.tar.bz2
evol-hercules-dc7c6e13e5535e4fe78bb84f9920347880022327.tar.xz
evol-hercules-dc7c6e13e5535e4fe78bb84f9920347880022327.zip
map: allow use npc with any id in allowed range.
-rw-r--r--src/map/init.c1
-rw-r--r--src/map/npc.c6
-rw-r--r--src/map/npc.h2
3 files changed, 9 insertions, 0 deletions
diff --git a/src/map/init.c b/src/map/init.c
index 8a09c3d..f5e9e1a 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -108,6 +108,7 @@ HPExport void plugin_init (void)
addHookPre("pc->takeitem", epc_takeitem);
addHookPre("npc->parse_unknown_mapflag", enpc_parse_unknown_mapflag);
addHookPre("npc->buysellsel", enpc_buysellsel);
+ addHookPre("npc->db_checkid", enpc_db_checkid);
addHookPre("clif->quest_send_list", eclif_quest_send_list);
addHookPre("clif->quest_add", eclif_quest_add);
addHookPre("clif->charnameack", eclif_charnameack);
diff --git a/src/map/npc.c b/src/map/npc.c
index aba7288..9ccca29 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -111,3 +111,9 @@ int enpc_buysellsel(struct map_session_data* sd, int *id, int *type)
return 0;
}
+bool enpc_db_checkid(int *idPtr)
+{
+ const int id = *idPtr;
+ hookStop();
+ return ((id >= 46 && id < MAX_NPC_CLASS) || id == HIDDEN_WARP_CLASS || id == INVISIBLE_CLASS || (id > MAX_NPC_CLASS2_START && id < MAX_NPC_CLASS2_END));
+}
diff --git a/src/map/npc.h b/src/map/npc.h
index f4ca1b9..5e424e9 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -9,4 +9,6 @@ void enpc_parse_unknown_mapflag(const char *name, char *w3, char *w4, const char
int enpc_buysellsel(struct map_session_data* sd, int *id, int *type);
+bool enpc_db_checkid(int *idPtr);
+
#endif // EVOL_MAP_NPC