diff options
author | Happy <markaizer@gmail.com> | 2014-08-21 04:50:46 +0800 |
---|---|---|
committer | Happy <markaizer@gmail.com> | 2014-08-21 04:50:46 +0800 |
commit | f52e1007fe08c67003c0bc4c78231904dd3fd5cc (patch) | |
tree | 99907d827264e501774e58ab4630e41fa7103c02 /src/map/instance.h | |
parent | 2410110dece79b4598c12f1c953219f1d0d1904a (diff) | |
parent | 769b1d05aa5cfa8cddfe7d21b35d5c5e4da3bbd6 (diff) | |
download | hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.tar.gz hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.tar.bz2 hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.tar.xz hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.zip |
Merge pull request #1 from HerculesWS/master
Update from original
Diffstat (limited to 'src/map/instance.h')
-rw-r--r-- | src/map/instance.h | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/src/map/instance.h b/src/map/instance.h index e86586e44..2ee77d3e3 100644 --- a/src/map/instance.h +++ b/src/map/instance.h @@ -2,8 +2,15 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _INSTANCE_H_ -#define _INSTANCE_H_ +#ifndef MAP_INSTANCE_H +#define MAP_INSTANCE_H + +#include "script.h" // struct reg_db +#include "../common/cbasetypes.h" +#include "../common/mmo.h" // struct point + +struct block_list; +struct map_session_data; #define INSTANCE_NAME_LENGTH (60+1) @@ -24,7 +31,7 @@ enum instance_owner_type { struct instance_data { unsigned short id; - char name[INSTANCE_NAME_LENGTH]; // Instance Name - required for clif functions. + char name[INSTANCE_NAME_LENGTH]; ///< Instance Name - required for clif functions. instance_state state; enum instance_owner_type owner_type; int owner_id; @@ -33,39 +40,52 @@ struct instance_data { unsigned short num_map; unsigned short users; - struct DBMap* vars; // Instance Variable for scripts - + struct reg_db regs; ///< Instance variables for scripts + int progress_timer; unsigned int progress_timeout; int idle_timer; unsigned int idle_timeout, idle_timeoutval; + + unsigned int original_progress_timeout; + + struct point respawn; ///< reload spawn + + /** HPM Custom Struct */ + struct HPluginData **hdata; + unsigned int hdatac; }; -struct instance_data *instances; - struct instance_interface { - void (*init) (void); + void (*init) (bool minimal); void (*final) (void); + void (*reload) (void); /* start point */ unsigned short start_id; - unsigned short instances; + unsigned short instances;/* count */ + /* */ + struct instance_data *list;/* pointer to a chunk of consecutive memory, access via instance->list[0]..etc */ /* */ int (*create) (int party_id, const char *name, enum instance_owner_type type); int (*add_map) (const char *name, int instance_id, bool usebasename, const char *map_name); void (*del_map) (int16 m); int (*map2imap) (int16 m, int instance_id); int (*mapid2imapid) (int16 m, int instance_id); + int (*mapname2imap) (const char *map_name, int instance_id); + int (*map_npcsub) (struct block_list* bl, va_list args); + int (*init_npc) (struct block_list* bl, va_list args); void (*destroy) (int instance_id); void (*start) (int instance_id); void (*check_idle) (int instance_id); void (*check_kick) (struct map_session_data *sd); void (*set_timeout) (int instance_id, unsigned int progress_timeout, unsigned int idle_timeout); bool (*valid) (int instance_id); -} instance_s; + int (*destroy_timer) (int tid, int64 tick, int id, intptr_t data); +}; struct instance_interface *instance; void instance_defaults(void); -#endif +#endif /* MAP_INSTANCE_H */ |