summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am3
-rw-r--r--src/map/init.c1
-rw-r--r--src/map/npc.c22
-rw-r--r--src/map/npc.h3
4 files changed, 29 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 7fe4f14..2bf8f2f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,6 +19,9 @@ MAP_SRC = map/clif.c \
map/init.c \
map/lang.c \
map/lang.h \
+ map/mapd.c \
+ map/mapd.h \
+ map/mapdext.h \
map/npc.c \
map/npc.h \
map/parse.c \
diff --git a/src/map/init.c b/src/map/init.c
index 2f309da..030e02d 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -83,6 +83,7 @@ HPExport void plugin_init (void)
addHookPre("pc->equipitem_pos", epc_equipitem_pos);
addHookPre("pc->unequipitem_pos", epc_unequipitem_pos);
addHookPre("npc->checknear", enpc_checknear);
+ addHookPre("npc->parse_unknown_mapflag", enpc_parse_unknown_mapflag);
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 054505d..6252881 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -10,9 +10,12 @@
#include "../../../common/mmo.h"
#include "../../../common/socket.h"
#include "../../../common/strlib.h"
+#include "../../../map/map.h"
#include "../../../map/npc.h"
#include "../../../map/pc.h"
+#include "map/mapd.h"
+#include "map/mapdext.h"
#include "map/npc.h"
struct npc_data* enpc_checknear(struct map_session_data* sd, struct block_list* bl)
@@ -45,3 +48,22 @@ struct npc_data* enpc_checknear(struct map_session_data* sd, struct block_list*
return nd;
}
+
+void enpc_parse_unknown_mapflag(const char *name, char *w3, char *w4, const char* start,
+ const char* buffer, const char* filepath, int *retval)
+{
+ hookStop();
+ if (!strcmpi(w3, "invisible"))
+ {
+ int16 m = map->mapname2mapid(name);
+ struct MapdExt *data = mapd_get(m);
+ if (data)
+ data->invisible = true;
+ }
+ else
+ {
+ ShowError("npc_parse_mapflag: unrecognized mapflag '%s' in file '%s', line '%d'.\n", w3, filepath, strline(buffer,start-buffer));
+ if (retval)
+ *retval = EXIT_FAILURE;
+ }
+}
diff --git a/src/map/npc.h b/src/map/npc.h
index 8053352..e3cb31a 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -6,4 +6,7 @@
struct npc_data* enpc_checknear(struct map_session_data* sd, struct block_list* bl);
+void enpc_parse_unknown_mapflag(const char *name, char *w3, char *w4, const char* start,
+ const char* buffer, const char* filepath, int *retval);
+
#endif // EVOL_MAP_NPC