diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script.c | 174 | ||||
-rw-r--r-- | src/map/script.h | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 16 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 106 |
6 files changed, 281 insertions, 31 deletions
diff --git a/src/map/script.c b/src/map/script.c index a43052bc5..8604b62f7 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2786,6 +2786,14 @@ char *get_val_npcscope_str(struct script_state* st, struct reg_db *n, struct scr return NULL; } +char *get_val_pc_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) { + struct script_reg_str *p = NULL; + nullpo_retr(NULL, n); + + p = i64db_get(n->vars, reference_getuid(data)); + return p ? p->value : NULL; +} + char *get_val_instance_str(struct script_state* st, const char* name, struct script_data* data) { nullpo_retr(NULL, st); if (st->instance_id >= 0) { @@ -2803,6 +2811,14 @@ int get_val_npcscope_num(struct script_state* st, struct reg_db *n, struct scrip return 0; } +int get_val_pc_ref_num(struct script_state *st, struct reg_db *n, struct script_data *data) { + struct script_reg_num *p = NULL; + nullpo_retr(0, n); + + p = i64db_get(n->vars, reference_getuid(data)); + return p ? p->value : 0; +} + int get_val_instance_num(struct script_state* st, const char* name, struct script_data* data) { if (st->instance_id >= 0) return (int)i64db_iget(instance->list[st->instance_id].regs.vars, reference_getuid(data)); @@ -2873,7 +2889,7 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) { break; case '#': if (data->ref) { - str = script->get_val_ref_str(st, data->ref, data); + str = script->get_val_pc_ref_str(st, data->ref, data); } else if (name[1] == '#') { str = pc_readaccountreg2str(sd, data->u.num);// global } else { @@ -2894,7 +2910,7 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) { break; default: if (data->ref) { - str = script->get_val_ref_str(st, data->ref, data); + str = script->get_val_pc_ref_str(st, data->ref, data); } else { str = pc_readglobalreg_str(sd, data->u.num); } @@ -2932,7 +2948,7 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) { break; case '#': if (data->ref) { - data->u.num = script->get_val_ref_num(st, data->ref, data); + data->u.num = script->get_val_pc_ref_num(st, data->ref, data); } else if (name[1] == '#') { data->u.num = pc_readaccountreg2(sd, data->u.num);// global } else { @@ -2953,7 +2969,7 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) { break; default: if (data->ref) { - data->u.num = script->get_val_ref_num(st, data->ref, data); + data->u.num = script->get_val_pc_ref_num(st, data->ref, data); } else { data->u.num = pc_readglobalreg(sd, data->u.num); } @@ -3239,6 +3255,99 @@ void set_reg_npcscope_str(struct script_state* st, struct reg_db *n, int64 num, } } +void set_reg_pc_ref_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) +{ + struct script_reg_str *p = NULL; + unsigned int index = script_getvaridx(num); + + nullpo_retv(n); + + if ((p = i64db_get(n->vars, num)) != NULL) { + if (str[0]) { + if (p->value) { + aFree(p->value); + } else if (index) { + script->array_update(n, num, false); + } + p->value = aStrdup(str); + } else { + p->value = NULL; + if (index) { + script->array_update(n, num, true); + } + } + + if (!pc->reg_load) { + p->flag.update = 1; + } + } else if (str[0]) { + struct DBData prev; + if (index) { + script->array_update(n, num, false); + } + + p = ers_alloc(pc->str_reg_ers, struct script_reg_str); + p->value = aStrdup(str); + + if (!pc->reg_load) { + p->flag.update = 1; + } + p->flag.type = 1; + + if(n->vars->put(n->vars, DB->i642key(num), DB->ptr2data(p), &prev)) { + p = DB->data2ptr(&prev); + if (p->value) { + aFree(p->value); + } + ers_free(pc->str_reg_ers, p); + } + } +} + +void set_reg_pc_ref_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) +{ + struct script_reg_num *p = NULL; + unsigned int index = script_getvaridx(num); + + nullpo_retv(n); + + if ((p = i64db_get(n->vars, num)) != NULL) { + if (val) { + if (!p->value && index) { + script->array_update(n, num, false); + } + p->value = val; + } else { + p->value = 0; + if (index) { + script->array_update(n, num, true); + } + } + + if (!pc->reg_load) { + p->flag.update = 1; + } + } else if (val) { + struct DBData prev; + if (index) { + script->array_update(n, num, false); + } + + p = ers_alloc(pc->num_reg_ers, struct script_reg_num); + p->value = val; + + if (!pc->reg_load) { + p->flag.update = 1; + } + p->flag.type = 1; + + if(n->vars->put(n->vars, DB->i642key(num), DB->ptr2data(p), &prev)) { + p = DB->data2ptr(&prev); + ers_free(pc->num_reg_ers, p); + } + } +} + void set_reg_npcscope_num(struct script_state* st, struct reg_db *n, int64 num, const char* name, int val) { if (n) { @@ -3337,7 +3446,7 @@ int set_reg(struct script_state *st, struct map_session_data *sd, int64 num, con return 1; case '#': if (ref) { - script->set_reg_ref_str(st, ref, num, name, str); + script->set_reg_pc_ref_str(st, ref, num, name, str); } else if (name[1] == '#') { pc_setaccountreg2str(sd, num, str); } else { @@ -3358,7 +3467,7 @@ int set_reg(struct script_state *st, struct map_session_data *sd, int64 num, con return 1; default: if (ref) { - script->set_reg_ref_str(st, ref, num, name, str); + script->set_reg_pc_ref_str(st, ref, num, name, str); } else { pc_setglobalreg_str(sd, num, str); } @@ -3399,7 +3508,7 @@ int set_reg(struct script_state *st, struct map_session_data *sd, int64 num, con return 1; case '#': if (ref) { - script->set_reg_ref_num(st, ref, num, name, val); + script->set_reg_pc_ref_num(st, ref, num, name, val); } else if (name[1] == '#') { pc_setaccountreg2(sd, num, val); } else { @@ -3420,7 +3529,7 @@ int set_reg(struct script_state *st, struct map_session_data *sd, int64 num, con return 1; default: if (ref) { - script->set_reg_ref_num(st, ref, num, name, val); + script->set_reg_pc_ref_num(st, ref, num, name, val); } else { pc_setglobalreg(sd, num, val); } @@ -9109,7 +9218,7 @@ BUILDIN(getequipisenableref) /** * Checks if the equipped item allows options. * *getequipisenableopt(<equipment_index>); - * + * * @param equipment_index as the inventory index of the equipment. * @return 1 on enabled 0 on disabled. */ @@ -9117,21 +9226,21 @@ BUILDIN(getequipisenableopt) { int i = -1, index = script_getnum(st, 2); struct map_session_data *sd = script->rid2sd(st); - + if (sd == NULL) { script_pushint(st, -1); ShowError("buildin_getequipisenableopt: player is not attached!"); return false; } - + if (index > 0 && index <= ARRAYLENGTH(script->equip)) i = pc->checkequip(sd, script->equip[index - 1]); - + if (i >=0 && sd->inventory_data[i] && !sd->inventory_data[i]->flag.no_options && !sd->status.inventory[i].expire_time) script_pushint(st, 1); else script_pushint(st, 0); - + return true; } @@ -13878,13 +13987,13 @@ BUILDIN(getequippedoptioninfo) { int val = 0, type = script_getnum(st, 2); struct map_session_data *sd = NULL; - + if ((sd = script->rid2sd(st)) == NULL || status->current_equip_item_index == -1 || status->current_equip_option_index == -1 || !sd->status.inventory[status->current_equip_item_index].option[status->current_equip_option_index].index) { script_pushint(st, -1); return false; } - + switch (type) { case IT_OPT_INDEX: val = sd->status.inventory[status->current_equip_item_index].option[status->current_equip_option_index].index; @@ -13897,9 +14006,9 @@ BUILDIN(getequippedoptioninfo) script_pushint(st, -1); return false; } - + script_pushint(st, val); - + return true; } @@ -13919,7 +14028,7 @@ BUILDIN(getequipoption) int opt_type = script_getnum(st, 4); int i = -1; struct map_session_data *sd = script->rid2sd(st); - + if (sd == NULL) { script_pushint(st, -1); ShowError("buildin_getequipoptioninfo: Player not attached!\n"); @@ -13958,9 +14067,9 @@ BUILDIN(getequipoption) break; } } - + script_pushint(st, val); - + return true; } @@ -13983,10 +14092,10 @@ BUILDIN(setequipoption) int opt_index = script_getnum(st, 4); int value = script_getnum(st, 5); int i = -1; - + struct map_session_data *sd = script->rid2sd(st); struct item_option *ito = NULL; - + if (sd == NULL) { script_pushint(st, 0); ShowError("buildin_setequipoption: Player not attached!\n"); @@ -14010,9 +14119,9 @@ BUILDIN(setequipoption) script_pushint(st, 0); return false; } - + if (sd->status.inventory[i].nameid != 0) { - + if ((ito = itemdb->option_exists(opt_index)) == NULL) { script_pushint(st, 0); ShowError("buildin_setequipotion: Option index %d does not exist!\n", opt_index); @@ -14026,7 +14135,7 @@ BUILDIN(setequipoption) sd->status.inventory[i].option[slot-1].index = ito->index; /* Add Option Value */ sd->status.inventory[i].option[slot-1].value = value; - + /* Unequip and simulate deletion of the item. */ pc->unequipitem(sd, i, PCUNEQUIPITEM_FORCE); // status calc will happen in pc->equipitem() below clif->refine(sd->fd, 0, i, sd->status.inventory[i].refine); // notify client of a refine. @@ -14040,11 +14149,11 @@ BUILDIN(setequipoption) pc->equipitem(sd, i, sd->status.inventory[i].equip); // force equip the item at the original position. clif->misceffect(&sd->bl, 2); // show effect } - + script_pushint(st, 1); - + return true; - + } /*========================================== @@ -18067,7 +18176,6 @@ BUILDIN(getvariableofpc) switch (*name) { - case '#': case '$': case '.': case '\'': @@ -22076,10 +22184,10 @@ void script_hardcoded_constants(void) script->set_constant("IT_OPT_INDEX", IT_OPT_INDEX, false, false); script->set_constant("IT_OPT_VALUE", IT_OPT_VALUE, false, false); script->set_constant("IT_OPT_PARAM", IT_OPT_PARAM, false, false); - + script->constdb_comment("Maximum Item Options"); script->set_constant("MAX_ITEM_OPTIONS", MAX_ITEM_OPTIONS, false, false); - + script->constdb_comment("Navigation constants, use with *navigateto*"); script->set_constant("NAV_NONE", NAV_NONE, false, false); script->set_constant("NAV_AIRSHIP_ONLY", NAV_AIRSHIP_ONLY, false, false); @@ -22250,10 +22358,12 @@ void script_defaults(void) script->get_val = get_val; script->get_val2 = get_val2; script->get_val_ref_str = get_val_npcscope_str; + script->get_val_pc_ref_str = get_val_pc_ref_str; script->get_val_scope_str = get_val_npcscope_str; script->get_val_npc_str = get_val_npcscope_str; script->get_val_instance_str = get_val_instance_str; script->get_val_ref_num = get_val_npcscope_num; + script->get_val_pc_ref_num = get_val_pc_ref_num; script->get_val_scope_num = get_val_npcscope_num; script->get_val_npc_num = get_val_npcscope_num; script->get_val_instance_num = get_val_instance_num; @@ -22332,10 +22442,12 @@ void script_defaults(void) script->errorwarning_sub = script_errorwarning_sub; script->set_reg = set_reg; script->set_reg_ref_str = set_reg_npcscope_str; + script->set_reg_pc_ref_str = set_reg_pc_ref_str; script->set_reg_scope_str = set_reg_npcscope_str; script->set_reg_npc_str = set_reg_npcscope_str; script->set_reg_instance_str = set_reg_instance_str; script->set_reg_ref_num = set_reg_npcscope_num; + script->set_reg_pc_ref_num = set_reg_pc_ref_num; script->set_reg_scope_num = set_reg_npcscope_num; script->set_reg_npc_num = set_reg_npcscope_num; script->set_reg_instance_num = set_reg_instance_num; diff --git a/src/map/script.h b/src/map/script.h index a69000991..0c967a94e 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -672,10 +672,12 @@ struct script_interface { 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_pc_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_pc_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); @@ -755,10 +757,12 @@ struct script_interface { 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, struct map_session_data *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_pc_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_pc_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); diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index cc9501d98..7042a43a7 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -5798,6 +5798,8 @@ typedef struct script_data* (*HPMHOOK_pre_script_get_val) (struct script_state * typedef struct script_data* (*HPMHOOK_post_script_get_val) (struct script_data* retVal___, struct script_state *st, struct script_data *data); typedef char* (*HPMHOOK_pre_script_get_val_ref_str) (struct script_state **st, struct reg_db **n, struct script_data **data); typedef char* (*HPMHOOK_post_script_get_val_ref_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); +typedef char* (*HPMHOOK_pre_script_get_val_pc_ref_str) (struct script_state **st, struct reg_db **n, struct script_data **data); +typedef char* (*HPMHOOK_post_script_get_val_pc_ref_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); typedef char* (*HPMHOOK_pre_script_get_val_scope_str) (struct script_state **st, struct reg_db **n, struct script_data **data); typedef char* (*HPMHOOK_post_script_get_val_scope_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); typedef char* (*HPMHOOK_pre_script_get_val_npc_str) (struct script_state **st, struct reg_db **n, struct script_data **data); @@ -5806,6 +5808,8 @@ typedef char* (*HPMHOOK_pre_script_get_val_instance_str) (struct script_state ** typedef char* (*HPMHOOK_post_script_get_val_instance_str) (char* retVal___, struct script_state *st, const char *name, struct script_data *data); typedef int (*HPMHOOK_pre_script_get_val_ref_num) (struct script_state **st, struct reg_db **n, struct script_data **data); typedef int (*HPMHOOK_post_script_get_val_ref_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); +typedef int (*HPMHOOK_pre_script_get_val_pc_ref_num) (struct script_state **st, struct reg_db **n, struct script_data **data); +typedef int (*HPMHOOK_post_script_get_val_pc_ref_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); typedef int (*HPMHOOK_pre_script_get_val_scope_num) (struct script_state **st, struct reg_db **n, struct script_data **data); typedef int (*HPMHOOK_post_script_get_val_scope_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); typedef int (*HPMHOOK_pre_script_get_val_npc_num) (struct script_state **st, struct reg_db **n, struct script_data **data); @@ -5960,6 +5964,8 @@ typedef int (*HPMHOOK_pre_script_set_reg) (struct script_state **st, struct map_ typedef int (*HPMHOOK_post_script_set_reg) (int retVal___, struct script_state *st, struct map_session_data *sd, int64 num, const char *name, const void *value, struct reg_db *ref); typedef void (*HPMHOOK_pre_script_set_reg_ref_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str); typedef void (*HPMHOOK_post_script_set_reg_ref_str) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str); +typedef void (*HPMHOOK_pre_script_set_reg_pc_ref_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str); +typedef void (*HPMHOOK_post_script_set_reg_pc_ref_str) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str); typedef void (*HPMHOOK_pre_script_set_reg_scope_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str); typedef void (*HPMHOOK_post_script_set_reg_scope_str) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str); typedef void (*HPMHOOK_pre_script_set_reg_npc_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str); @@ -5968,6 +5974,8 @@ typedef void (*HPMHOOK_pre_script_set_reg_instance_str) (struct script_state **s typedef void (*HPMHOOK_post_script_set_reg_instance_str) (struct script_state *st, int64 num, const char *name, const char *str); typedef void (*HPMHOOK_pre_script_set_reg_ref_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val); typedef void (*HPMHOOK_post_script_set_reg_ref_num) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val); +typedef void (*HPMHOOK_pre_script_set_reg_pc_ref_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val); +typedef void (*HPMHOOK_post_script_set_reg_pc_ref_num) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val); typedef void (*HPMHOOK_pre_script_set_reg_scope_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val); typedef void (*HPMHOOK_post_script_set_reg_scope_num) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val); typedef void (*HPMHOOK_pre_script_set_reg_npc_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index cdd2386a6..762acb747 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4594,6 +4594,8 @@ struct { struct HPMHookPoint *HP_script_get_val_post; struct HPMHookPoint *HP_script_get_val_ref_str_pre; struct HPMHookPoint *HP_script_get_val_ref_str_post; + struct HPMHookPoint *HP_script_get_val_pc_ref_str_pre; + struct HPMHookPoint *HP_script_get_val_pc_ref_str_post; struct HPMHookPoint *HP_script_get_val_scope_str_pre; struct HPMHookPoint *HP_script_get_val_scope_str_post; struct HPMHookPoint *HP_script_get_val_npc_str_pre; @@ -4602,6 +4604,8 @@ struct { struct HPMHookPoint *HP_script_get_val_instance_str_post; struct HPMHookPoint *HP_script_get_val_ref_num_pre; struct HPMHookPoint *HP_script_get_val_ref_num_post; + struct HPMHookPoint *HP_script_get_val_pc_ref_num_pre; + struct HPMHookPoint *HP_script_get_val_pc_ref_num_post; struct HPMHookPoint *HP_script_get_val_scope_num_pre; struct HPMHookPoint *HP_script_get_val_scope_num_post; struct HPMHookPoint *HP_script_get_val_npc_num_pre; @@ -4756,6 +4760,8 @@ struct { struct HPMHookPoint *HP_script_set_reg_post; struct HPMHookPoint *HP_script_set_reg_ref_str_pre; struct HPMHookPoint *HP_script_set_reg_ref_str_post; + struct HPMHookPoint *HP_script_set_reg_pc_ref_str_pre; + struct HPMHookPoint *HP_script_set_reg_pc_ref_str_post; struct HPMHookPoint *HP_script_set_reg_scope_str_pre; struct HPMHookPoint *HP_script_set_reg_scope_str_post; struct HPMHookPoint *HP_script_set_reg_npc_str_pre; @@ -4764,6 +4770,8 @@ struct { struct HPMHookPoint *HP_script_set_reg_instance_str_post; struct HPMHookPoint *HP_script_set_reg_ref_num_pre; struct HPMHookPoint *HP_script_set_reg_ref_num_post; + struct HPMHookPoint *HP_script_set_reg_pc_ref_num_pre; + struct HPMHookPoint *HP_script_set_reg_pc_ref_num_post; struct HPMHookPoint *HP_script_set_reg_scope_num_pre; struct HPMHookPoint *HP_script_set_reg_scope_num_post; struct HPMHookPoint *HP_script_set_reg_npc_num_pre; @@ -10641,6 +10649,8 @@ struct { int HP_script_get_val_post; int HP_script_get_val_ref_str_pre; int HP_script_get_val_ref_str_post; + int HP_script_get_val_pc_ref_str_pre; + int HP_script_get_val_pc_ref_str_post; int HP_script_get_val_scope_str_pre; int HP_script_get_val_scope_str_post; int HP_script_get_val_npc_str_pre; @@ -10649,6 +10659,8 @@ struct { int HP_script_get_val_instance_str_post; int HP_script_get_val_ref_num_pre; int HP_script_get_val_ref_num_post; + int HP_script_get_val_pc_ref_num_pre; + int HP_script_get_val_pc_ref_num_post; int HP_script_get_val_scope_num_pre; int HP_script_get_val_scope_num_post; int HP_script_get_val_npc_num_pre; @@ -10803,6 +10815,8 @@ struct { int HP_script_set_reg_post; int HP_script_set_reg_ref_str_pre; int HP_script_set_reg_ref_str_post; + int HP_script_set_reg_pc_ref_str_pre; + int HP_script_set_reg_pc_ref_str_post; int HP_script_set_reg_scope_str_pre; int HP_script_set_reg_scope_str_post; int HP_script_set_reg_npc_str_pre; @@ -10811,6 +10825,8 @@ struct { int HP_script_set_reg_instance_str_post; int HP_script_set_reg_ref_num_pre; int HP_script_set_reg_ref_num_post; + int HP_script_set_reg_pc_ref_num_pre; + int HP_script_set_reg_pc_ref_num_post; int HP_script_set_reg_scope_num_pre; int HP_script_set_reg_scope_num_post; int HP_script_set_reg_npc_num_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 9075901c4..65cd9ea82 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2357,10 +2357,12 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->push_val, HP_script_push_val) }, { HP_POP(script->get_val, HP_script_get_val) }, { HP_POP(script->get_val_ref_str, HP_script_get_val_ref_str) }, + { HP_POP(script->get_val_pc_ref_str, HP_script_get_val_pc_ref_str) }, { HP_POP(script->get_val_scope_str, HP_script_get_val_scope_str) }, { HP_POP(script->get_val_npc_str, HP_script_get_val_npc_str) }, { HP_POP(script->get_val_instance_str, HP_script_get_val_instance_str) }, { HP_POP(script->get_val_ref_num, HP_script_get_val_ref_num) }, + { HP_POP(script->get_val_pc_ref_num, HP_script_get_val_pc_ref_num) }, { HP_POP(script->get_val_scope_num, HP_script_get_val_scope_num) }, { HP_POP(script->get_val_npc_num, HP_script_get_val_npc_num) }, { HP_POP(script->get_val_instance_num, HP_script_get_val_instance_num) }, @@ -2438,10 +2440,12 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->errorwarning_sub, HP_script_errorwarning_sub) }, { HP_POP(script->set_reg, HP_script_set_reg) }, { HP_POP(script->set_reg_ref_str, HP_script_set_reg_ref_str) }, + { HP_POP(script->set_reg_pc_ref_str, HP_script_set_reg_pc_ref_str) }, { HP_POP(script->set_reg_scope_str, HP_script_set_reg_scope_str) }, { HP_POP(script->set_reg_npc_str, HP_script_set_reg_npc_str) }, { HP_POP(script->set_reg_instance_str, HP_script_set_reg_instance_str) }, { HP_POP(script->set_reg_ref_num, HP_script_set_reg_ref_num) }, + { HP_POP(script->set_reg_pc_ref_num, HP_script_set_reg_pc_ref_num) }, { HP_POP(script->set_reg_scope_num, HP_script_set_reg_scope_num) }, { HP_POP(script->set_reg_npc_num, HP_script_set_reg_npc_num) }, { HP_POP(script->set_reg_instance_num, HP_script_set_reg_instance_num) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 322d60e46..3175bab5e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -61250,6 +61250,33 @@ char* HP_script_get_val_ref_str(struct script_state *st, struct reg_db *n, struc } return retVal___; } +char* HP_script_get_val_pc_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) { + int hIndex = 0; + char* retVal___ = NULL; + if( HPMHooks.count.HP_script_get_val_pc_ref_str_pre ) { + char* (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_str_pre[hIndex].func; + retVal___ = preHookFunc(&st, &n, &data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_pc_ref_str(st, n, data); + } + if( HPMHooks.count.HP_script_get_val_pc_ref_str_post ) { + char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_str_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, n, data); + } + } + return retVal___; +} char* HP_script_get_val_scope_str(struct script_state *st, struct reg_db *n, struct script_data *data) { int hIndex = 0; char* retVal___ = NULL; @@ -61358,6 +61385,33 @@ int HP_script_get_val_ref_num(struct script_state *st, struct reg_db *n, struct } return retVal___; } +int HP_script_get_val_pc_ref_num(struct script_state *st, struct reg_db *n, struct script_data *data) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_script_get_val_pc_ref_num_pre ) { + int (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_num_pre[hIndex].func; + retVal___ = preHookFunc(&st, &n, &data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_pc_ref_num(st, n, data); + } + if( HPMHooks.count.HP_script_get_val_pc_ref_num_post ) { + int (*postHookFunc) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_num_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, n, data); + } + } + return retVal___; +} int HP_script_get_val_scope_num(struct script_state *st, struct reg_db *n, struct script_data *data) { int hIndex = 0; int retVal___ = 0; @@ -63402,6 +63456,32 @@ void HP_script_set_reg_ref_str(struct script_state *st, struct reg_db *n, int64 } return; } +void HP_script_set_reg_pc_ref_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) { + int hIndex = 0; + if( HPMHooks.count.HP_script_set_reg_pc_ref_str_pre ) { + void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_str_pre[hIndex].func; + preHookFunc(&st, &n, &num, &name, &str); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_pc_ref_str(st, n, num, name, str); + } + if( HPMHooks.count.HP_script_set_reg_pc_ref_str_post ) { + void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_str_post[hIndex].func; + postHookFunc(st, n, num, name, str); + } + } + return; +} void HP_script_set_reg_scope_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) { int hIndex = 0; if( HPMHooks.count.HP_script_set_reg_scope_str_pre ) { @@ -63506,6 +63586,32 @@ void HP_script_set_reg_ref_num(struct script_state *st, struct reg_db *n, int64 } return; } +void HP_script_set_reg_pc_ref_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) { + int hIndex = 0; + if( HPMHooks.count.HP_script_set_reg_pc_ref_num_pre ) { + void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_num_pre[hIndex].func; + preHookFunc(&st, &n, &num, &name, &val); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_pc_ref_num(st, n, num, name, val); + } + if( HPMHooks.count.HP_script_set_reg_pc_ref_num_post ) { + void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_num_post[hIndex].func; + postHookFunc(st, n, num, name, val); + } + } + return; +} void HP_script_set_reg_scope_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) { int hIndex = 0; if( HPMHooks.count.HP_script_set_reg_scope_num_pre ) { |