summaryrefslogtreecommitdiff
path: root/src/map/npc.h
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-05 23:22:16 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-05 23:22:16 +0000
commit3fefab81425004d67c61fb911a417ddfdd089693 (patch)
treec7e4062a46ca24a5681950abb9a16bb5e2c56f29 /src/map/npc.h
parent1db41fdf364af26b0600a43a167d15f2d2ef8244 (diff)
downloadhercules-3fefab81425004d67c61fb911a417ddfdd089693.tar.gz
hercules-3fefab81425004d67c61fb911a417ddfdd089693.tar.bz2
hercules-3fefab81425004d67c61fb911a417ddfdd089693.tar.xz
hercules-3fefab81425004d67c61fb911a417ddfdd089693.zip
- Added a npc-script-event cache to avoid looking up event-scripts every time they need to be executed. Events cached are all those defined in script_config.
- Since the cache holds direct pointers to the npcs/events, do NOT unload the related NPCs or you'll get dangling pointers. However, @reloadscript will work fine. - Set the etc_log to on to see a summary of npcs/events loaded for script execution on startup. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6494 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.h')
-rw-r--r--src/map/npc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/map/npc.h b/src/map/npc.h
index 2ee4999c6..035c6ecf8 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -20,6 +20,18 @@ void npc_chat_finalize(struct npc_data *nd);
int mob_chat_sub(struct block_list *bl, va_list ap);
#endif
+//Script NPC events.
+enum {
+ NPCE_LOGIN,
+ NPCE_LOGOUT,
+ NPCE_LOADMAP,
+ NPCE_BASELVUP,
+ NPCE_JOBLVUP,
+ NPCE_DIE,
+ NPCE_KILLPC,
+ NPCE_KILLNPC,
+ NPCE_MAX
+};
struct view_data* npc_get_viewdata(int class_);
int npc_chat_sub(struct block_list *bl, va_list ap);
int npc_event_dequeue(struct map_session_data *sd);
@@ -65,6 +77,7 @@ int npc_settimerevent_tick(struct npc_data *nd,int newtimer);
int npc_remove_map(struct npc_data *nd);
int npc_unload(struct npc_data *nd);
int npc_reload(void);
+int npc_script_event(TBL_PC* sd, int type);
extern int dummy_npc_id;