diff options
Diffstat (limited to 'src/map/script.h')
-rw-r--r-- | src/map/script.h | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/src/map/script.h b/src/map/script.h index 25c4283ca..ff660dec8 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -5,20 +5,21 @@ #ifndef MAP_SCRIPT_H #define MAP_SCRIPT_H +#include "map/map.h" //EVENT_NAME_LENGTH +#include "common/hercules.h" +#include "common/db.h" +#include "common/mmo.h" // struct item +#include "common/sql.h" // Sql +#include "common/strlib.h" //StringBuf + #include <errno.h> #include <setjmp.h> -#include "map.h" //EVENT_NAME_LENGTH -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/mmo.h" // struct item -#include "../common/sql.h" // Sql -#include "../common/strlib.h" //StringBuf - /** * Declarations **/ struct eri; +struct item_data; /** * Defines @@ -628,6 +629,14 @@ struct script_interface { void (*detach_rid) (struct script_state* st); struct script_data* (*push_val)(struct script_stack* stack, enum c_op type, int64 val, struct reg_db *ref); struct script_data *(*get_val) (struct script_state* st, struct script_data* data); + char* (*get_val_ref_str) (struct script_state* st, struct reg_db *n, struct script_data* data); + char* (*get_val_scope_str) (struct script_state* st, struct reg_db *n, struct script_data* data); + char* (*get_val_npc_str) (struct script_state* st, struct reg_db *n, struct script_data* data); + char* (*get_val_instance_str) (struct script_state* st, const char* name, struct script_data* data); + int (*get_val_ref_num) (struct script_state* st, struct reg_db *n, struct script_data* data); + int (*get_val_scope_num) (struct script_state* st, struct reg_db *n, struct script_data* data); + int (*get_val_npc_num) (struct script_state* st, struct reg_db *n, struct script_data* data); + int (*get_val_instance_num) (struct script_state* st, const char* name, struct script_data* data); void* (*get_val2) (struct script_state* st, int64 uid, struct reg_db *ref); struct script_data* (*push_str) (struct script_stack* stack, enum c_op type, char* str); struct script_data* (*push_copy) (struct script_stack* stack, int pos); @@ -636,7 +645,9 @@ struct script_interface { void (*set_constant2) (const char *name, int value, bool isparameter); bool (*get_constant) (const char* name, int* value); void (*label_add)(int key, int pos); - void (*run) (struct script_code *rootscript,int pos,int rid,int oid); + void (*run) (struct script_code *rootscript, int pos, int rid, int oid); + void (*run_npc) (struct script_code *rootscript, int pos, int rid, int oid); + void (*run_pet) (struct script_code *rootscript, int pos, int rid, int oid); void (*run_main) (struct script_state *st); int (*run_timer) (int tid, int64 tick, int id, intptr_t data); int (*set_var) (struct map_session_data *sd, char *name, void *val); @@ -693,6 +704,14 @@ struct script_interface { const char* (*print_line) (StringBuf *buf, const char *p, const char *mark, int line); void (*errorwarning_sub) (StringBuf *buf, const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos); int (*set_reg) (struct script_state *st, TBL_PC *sd, int64 num, const char *name, const void *value, struct reg_db *ref); + void (*set_reg_ref_str) (struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str); + void (*set_reg_scope_str) (struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str); + void (*set_reg_npc_str) (struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str); + void (*set_reg_instance_str) (struct script_state* st, int64 num, const char* name, const char *str); + void (*set_reg_ref_num) (struct script_state* st, struct reg_db *n, int64 num, const char* name, int val); + void (*set_reg_scope_num) (struct script_state* st, struct reg_db *n, int64 num, const char* name, int val); + void (*set_reg_npc_num) (struct script_state* st, struct reg_db *n, int64 num, const char* name, int val); + void (*set_reg_instance_num) (struct script_state* st, int64 num, const char* name, int val); void (*stack_expand) (struct script_stack *stack); struct script_data* (*push_retinfo) (struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref); void (*op_3) (struct script_state *st, int op); @@ -765,12 +784,15 @@ struct script_interface { uint8 (*add_language) (const char *name); const char *(*get_translation_file_name) (const char *file); void (*parser_clean_leftovers) (void); + void (*run_use_script) (struct map_session_data *sd, struct item_data *data, int oid); + void (*run_item_equip_script) (struct map_session_data *sd, struct item_data *data, int oid); + void (*run_item_unequip_script) (struct map_session_data *sd, struct item_data *data, int oid); }; -struct script_interface *script; - #ifdef HERCULES_CORE void script_defaults(void); #endif // HERCULES_CORE +HPShared struct script_interface *script; + #endif /* MAP_SCRIPT_H */ |