diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking.c | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 88 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 22 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 696 | ||||
-rw-r--r-- | src/plugins/db2sql.c | 4 |
5 files changed, 755 insertions, 59 deletions
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c index 19d7ae2c5..e5483da5b 100644 --- a/src/plugins/HPMHooking.c +++ b/src/plugins/HPMHooking.c @@ -152,11 +152,10 @@ HPExport const char *Hooked (bool *fr) { return NULL; } - HPExport bool HPM_Plugin_AddHook(enum HPluginHookType type, const char *target, void *hook, unsigned int pID) { struct HookingPointData *hpd; - if( hp_db && (hpd = strdb_get(hp_db,target)) ) { + if (hp_db && (hpd = strdb_get(hp_db,target)) != NULL) { struct HPMHookPoint **hp = NULL; int *count = NULL; @@ -230,4 +229,3 @@ void HPM_HP_load(void) { #include HPM_SOURCES_INCLUDE } - diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index bf1aee21b..f36d91718 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -57,6 +57,10 @@ struct { struct HPMHookPoint *HP_atcommand_cleanfloor_sub_post; struct HPMHookPoint *HP_atcommand_mutearea_sub_pre; struct HPMHookPoint *HP_atcommand_mutearea_sub_post; + struct HPMHookPoint *HP_atcommand_getring_pre; + struct HPMHookPoint *HP_atcommand_getring_post; + struct HPMHookPoint *HP_atcommand_channel_help_pre; + struct HPMHookPoint *HP_atcommand_channel_help_post; struct HPMHookPoint *HP_atcommand_commands_sub_pre; struct HPMHookPoint *HP_atcommand_commands_sub_post; struct HPMHookPoint *HP_atcommand_cmd_db_clear_pre; @@ -493,6 +497,8 @@ struct { struct HPMHookPoint *HP_clif_send_actual_post; struct HPMHookPoint *HP_clif_parse_pre; struct HPMHookPoint *HP_clif_parse_post; + struct HPMHookPoint *HP_clif_packet_pre; + struct HPMHookPoint *HP_clif_packet_post; struct HPMHookPoint *HP_clif_parse_cmd_pre; struct HPMHookPoint *HP_clif_parse_cmd_post; struct HPMHookPoint *HP_clif_decrypt_cmd_pre; @@ -517,6 +523,10 @@ struct { struct HPMHookPoint *HP_clif_delitem_post; struct HPMHookPoint *HP_clif_takeitem_pre; struct HPMHookPoint *HP_clif_takeitem_post; + struct HPMHookPoint *HP_clif_item_equip_pre; + struct HPMHookPoint *HP_clif_item_equip_post; + struct HPMHookPoint *HP_clif_item_normal_pre; + struct HPMHookPoint *HP_clif_item_normal_post; struct HPMHookPoint *HP_clif_arrowequip_pre; struct HPMHookPoint *HP_clif_arrowequip_post; struct HPMHookPoint *HP_clif_arrow_fail_pre; @@ -4229,6 +4239,8 @@ struct { struct HPMHookPoint *HP_pc_autotrade_prepare_post; struct HPMHookPoint *HP_pc_autotrade_populate_pre; struct HPMHookPoint *HP_pc_autotrade_populate_post; + struct HPMHookPoint *HP_pc_autotrade_final_pre; + struct HPMHookPoint *HP_pc_autotrade_final_post; struct HPMHookPoint *HP_pc_check_job_name_pre; struct HPMHookPoint *HP_pc_check_job_name_post; struct HPMHookPoint *HP_pet_init_pre; @@ -4371,6 +4383,22 @@ struct { struct HPMHookPoint *HP_script_push_val_post; struct HPMHookPoint *HP_script_get_val_pre; 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_scope_str_pre; + struct HPMHookPoint *HP_script_get_val_scope_str_post; + struct HPMHookPoint *HP_script_get_val_npc_str_pre; + struct HPMHookPoint *HP_script_get_val_npc_str_post; + struct HPMHookPoint *HP_script_get_val_instance_str_pre; + 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_scope_num_pre; + struct HPMHookPoint *HP_script_get_val_scope_num_post; + struct HPMHookPoint *HP_script_get_val_npc_num_pre; + struct HPMHookPoint *HP_script_get_val_npc_num_post; + struct HPMHookPoint *HP_script_get_val_instance_num_pre; + struct HPMHookPoint *HP_script_get_val_instance_num_post; struct HPMHookPoint *HP_script_get_val2_pre; struct HPMHookPoint *HP_script_get_val2_post; struct HPMHookPoint *HP_script_push_str_pre; @@ -4501,6 +4529,22 @@ struct { struct HPMHookPoint *HP_script_errorwarning_sub_post; struct HPMHookPoint *HP_script_set_reg_pre; 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_scope_str_pre; + struct HPMHookPoint *HP_script_set_reg_scope_str_post; + struct HPMHookPoint *HP_script_set_reg_npc_str_pre; + struct HPMHookPoint *HP_script_set_reg_npc_str_post; + struct HPMHookPoint *HP_script_set_reg_instance_str_pre; + 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_scope_num_pre; + struct HPMHookPoint *HP_script_set_reg_scope_num_post; + struct HPMHookPoint *HP_script_set_reg_npc_num_pre; + struct HPMHookPoint *HP_script_set_reg_npc_num_post; + struct HPMHookPoint *HP_script_set_reg_instance_num_pre; + struct HPMHookPoint *HP_script_set_reg_instance_num_post; struct HPMHookPoint *HP_script_stack_expand_pre; struct HPMHookPoint *HP_script_stack_expand_post; struct HPMHookPoint *HP_script_push_retinfo_pre; @@ -5772,6 +5816,10 @@ struct { int HP_atcommand_cleanfloor_sub_post; int HP_atcommand_mutearea_sub_pre; int HP_atcommand_mutearea_sub_post; + int HP_atcommand_getring_pre; + int HP_atcommand_getring_post; + int HP_atcommand_channel_help_pre; + int HP_atcommand_channel_help_post; int HP_atcommand_commands_sub_pre; int HP_atcommand_commands_sub_post; int HP_atcommand_cmd_db_clear_pre; @@ -6208,6 +6256,8 @@ struct { int HP_clif_send_actual_post; int HP_clif_parse_pre; int HP_clif_parse_post; + int HP_clif_packet_pre; + int HP_clif_packet_post; int HP_clif_parse_cmd_pre; int HP_clif_parse_cmd_post; int HP_clif_decrypt_cmd_pre; @@ -6232,6 +6282,10 @@ struct { int HP_clif_delitem_post; int HP_clif_takeitem_pre; int HP_clif_takeitem_post; + int HP_clif_item_equip_pre; + int HP_clif_item_equip_post; + int HP_clif_item_normal_pre; + int HP_clif_item_normal_post; int HP_clif_arrowequip_pre; int HP_clif_arrowequip_post; int HP_clif_arrow_fail_pre; @@ -9944,6 +9998,8 @@ struct { int HP_pc_autotrade_prepare_post; int HP_pc_autotrade_populate_pre; int HP_pc_autotrade_populate_post; + int HP_pc_autotrade_final_pre; + int HP_pc_autotrade_final_post; int HP_pc_check_job_name_pre; int HP_pc_check_job_name_post; int HP_pet_init_pre; @@ -10086,6 +10142,22 @@ struct { int HP_script_push_val_post; int HP_script_get_val_pre; 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_scope_str_pre; + int HP_script_get_val_scope_str_post; + int HP_script_get_val_npc_str_pre; + int HP_script_get_val_npc_str_post; + int HP_script_get_val_instance_str_pre; + 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_scope_num_pre; + int HP_script_get_val_scope_num_post; + int HP_script_get_val_npc_num_pre; + int HP_script_get_val_npc_num_post; + int HP_script_get_val_instance_num_pre; + int HP_script_get_val_instance_num_post; int HP_script_get_val2_pre; int HP_script_get_val2_post; int HP_script_push_str_pre; @@ -10216,6 +10288,22 @@ struct { int HP_script_errorwarning_sub_post; int HP_script_set_reg_pre; 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_scope_str_pre; + int HP_script_set_reg_scope_str_post; + int HP_script_set_reg_npc_str_pre; + int HP_script_set_reg_npc_str_post; + int HP_script_set_reg_instance_str_pre; + 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_scope_num_pre; + int HP_script_set_reg_scope_num_post; + int HP_script_set_reg_npc_num_pre; + int HP_script_set_reg_npc_num_post; + int HP_script_set_reg_instance_num_pre; + int HP_script_set_reg_instance_num_post; int HP_script_stack_expand_pre; int HP_script_stack_expand_post; int HP_script_push_retinfo_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index d9d8dc230..dacb51580 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -33,6 +33,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(atcommand->get_jail_time, HP_atcommand_get_jail_time) }, { HP_POP(atcommand->cleanfloor_sub, HP_atcommand_cleanfloor_sub) }, { HP_POP(atcommand->mutearea_sub, HP_atcommand_mutearea_sub) }, + { HP_POP(atcommand->getring, HP_atcommand_getring) }, + { HP_POP(atcommand->channel_help, HP_atcommand_channel_help) }, { HP_POP(atcommand->commands_sub, HP_atcommand_commands_sub) }, { HP_POP(atcommand->cmd_db_clear, HP_atcommand_cmd_db_clear) }, { HP_POP(atcommand->cmd_db_clear_sub, HP_atcommand_cmd_db_clear_sub) }, @@ -258,6 +260,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->send_sub, HP_clif_send_sub) }, { HP_POP(clif->send_actual, HP_clif_send_actual) }, { HP_POP(clif->parse, HP_clif_parse) }, + { HP_POP(clif->packet, HP_clif_packet) }, { HP_POP(clif->parse_cmd, HP_clif_parse_cmd) }, { HP_POP(clif->decrypt_cmd, HP_clif_decrypt_cmd) }, { HP_POP(clif->authok, HP_clif_authok) }, @@ -270,6 +273,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->dropitem, HP_clif_dropitem) }, { HP_POP(clif->delitem, HP_clif_delitem) }, { HP_POP(clif->takeitem, HP_clif_takeitem) }, + { HP_POP(clif->item_equip, HP_clif_item_equip) }, + { HP_POP(clif->item_normal, HP_clif_item_normal) }, { HP_POP(clif->arrowequip, HP_clif_arrowequip) }, { HP_POP(clif->arrow_fail, HP_clif_arrow_fail) }, { HP_POP(clif->use_card, HP_clif_use_card) }, @@ -2155,6 +2160,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->autotrade_start, HP_pc_autotrade_start) }, { HP_POP(pc->autotrade_prepare, HP_pc_autotrade_prepare) }, { HP_POP(pc->autotrade_populate, HP_pc_autotrade_populate) }, + { HP_POP(pc->autotrade_final, HP_pc_autotrade_final) }, { HP_POP(pc->check_job_name, HP_pc_check_job_name) }, /* pet */ { HP_POP(pet->init, HP_pet_init) }, @@ -2229,6 +2235,14 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->detach_rid, HP_script_detach_rid) }, { 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_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_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) }, { HP_POP(script->get_val2, HP_script_get_val2) }, { HP_POP(script->push_str, HP_script_push_str) }, { HP_POP(script->push_copy, HP_script_push_copy) }, @@ -2294,6 +2308,14 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->print_line, HP_script_print_line) }, { 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_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_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) }, { HP_POP(script->stack_expand, HP_script_stack_expand) }, { HP_POP(script->push_retinfo, HP_script_push_retinfo) }, { HP_POP(script->op_3, HP_script_op_3) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 2454846f8..0dd8fbadc 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -735,6 +735,58 @@ int HP_atcommand_mutearea_sub(struct block_list *bl, va_list ap) { } return retVal___; } +void HP_atcommand_getring(struct map_session_data *sd) { + int hIndex = 0; + if( HPMHooks.count.HP_atcommand_getring_pre ) { + void (*preHookFunc) (struct map_session_data *sd); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_getring_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_atcommand_getring_pre[hIndex].func; + preHookFunc(sd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.atcommand.getring(sd); + } + if( HPMHooks.count.HP_atcommand_getring_post ) { + void (*postHookFunc) (struct map_session_data *sd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_getring_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_atcommand_getring_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +void HP_atcommand_channel_help(int fd, const char *command, bool can_create) { + int hIndex = 0; + if( HPMHooks.count.HP_atcommand_channel_help_pre ) { + void (*preHookFunc) (int *fd, const char *command, bool *can_create); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_channel_help_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_atcommand_channel_help_pre[hIndex].func; + preHookFunc(&fd, command, &can_create); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.atcommand.channel_help(fd, command, can_create); + } + if( HPMHooks.count.HP_atcommand_channel_help_post ) { + void (*postHookFunc) (int *fd, const char *command, bool *can_create); + for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_channel_help_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_atcommand_channel_help_post[hIndex].func; + postHookFunc(&fd, command, &can_create); + } + } + return; +} void HP_atcommand_commands_sub(struct map_session_data *sd, const int fd, AtCommandType type) { int hIndex = 0; if( HPMHooks.count.HP_atcommand_commands_sub_pre ) { @@ -6620,6 +6672,33 @@ int HP_clif_parse(int fd) { } return retVal___; } +const struct s_packet_db* HP_clif_packet(int packet_id) { + int hIndex = 0; + const struct s_packet_db* retVal___ = NULL; + if( HPMHooks.count.HP_clif_packet_pre ) { + const struct s_packet_db* (*preHookFunc) (int *packet_id); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_packet_pre[hIndex].func; + retVal___ = preHookFunc(&packet_id); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.clif.packet(packet_id); + } + if( HPMHooks.count.HP_clif_packet_post ) { + const struct s_packet_db* (*postHookFunc) (const struct s_packet_db* retVal___, int *packet_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_packet_post[hIndex].func; + retVal___ = postHookFunc(retVal___, &packet_id); + } + } + return retVal___; +} unsigned short HP_clif_parse_cmd(int fd, struct map_session_data *sd) { int hIndex = 0; unsigned short retVal___ = 0; @@ -6934,6 +7013,58 @@ void HP_clif_takeitem(struct block_list *src, struct block_list *dst) { } return; } +void HP_clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos) { + int hIndex = 0; + if( HPMHooks.count.HP_clif_item_equip_pre ) { + void (*preHookFunc) (short *idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int *eqp_pos); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_equip_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_item_equip_pre[hIndex].func; + preHookFunc(&idx, p, i, id, &eqp_pos); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.item_equip(idx, p, i, id, eqp_pos); + } + if( HPMHooks.count.HP_clif_item_equip_post ) { + void (*postHookFunc) (short *idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int *eqp_pos); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_equip_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_item_equip_post[hIndex].func; + postHookFunc(&idx, p, i, id, &eqp_pos); + } + } + return; +} +void HP_clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id) { + int hIndex = 0; + if( HPMHooks.count.HP_clif_item_normal_pre ) { + void (*preHookFunc) (short *idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_normal_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_item_normal_pre[hIndex].func; + preHookFunc(&idx, p, i, id); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.item_normal(idx, p, i, id); + } + if( HPMHooks.count.HP_clif_item_normal_post ) { + void (*postHookFunc) (short *idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_normal_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_item_normal_post[hIndex].func; + postHookFunc(&idx, p, i, id); + } + } + return; +} void HP_clif_arrowequip(struct map_session_data *sd, int val) { int hIndex = 0; if( HPMHooks.count.HP_clif_arrowequip_pre ) { @@ -38679,15 +38810,15 @@ void HP_map_zone_change2(int m, struct map_zone_data *zone) { } return; } -int HP_map_getcell(int16 m, int16 x, int16 y, cell_chk cellchk) { +int HP_map_getcell(int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_map_getcell_pre ) { - int (*preHookFunc) (int16 *m, int16 *x, int16 *y, cell_chk *cellchk); + int (*preHookFunc) (int16 *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcell_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_map_getcell_pre[hIndex].func; - retVal___ = preHookFunc(&m, &x, &y, &cellchk); + retVal___ = preHookFunc(&m, bl, &x, &y, &cellchk); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -38695,13 +38826,13 @@ int HP_map_getcell(int16 m, int16 x, int16 y, cell_chk cellchk) { } } { - retVal___ = HPMHooks.source.map.getcell(m, x, y, cellchk); + retVal___ = HPMHooks.source.map.getcell(m, bl, x, y, cellchk); } if( HPMHooks.count.HP_map_getcell_post ) { - int (*postHookFunc) (int retVal___, int16 *m, int16 *x, int16 *y, cell_chk *cellchk); + int (*postHookFunc) (int retVal___, int16 *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk); for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcell_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_map_getcell_post[hIndex].func; - retVal___ = postHookFunc(retVal___, &m, &x, &y, &cellchk); + retVal___ = postHookFunc(retVal___, &m, bl, &x, &y, &cellchk); } } return retVal___; @@ -39108,15 +39239,15 @@ int HP_map_search_freecell(struct block_list *src, int16 m, int16 *x, int16 *y, } return retVal___; } -bool HP_map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag) { +bool HP_map_closest_freecell(int16 m, const struct block_list *bl, int16 *x, int16 *y, int type, int flag) { int hIndex = 0; bool retVal___ = false; if( HPMHooks.count.HP_map_closest_freecell_pre ) { - bool (*preHookFunc) (int16 *m, int16 *x, int16 *y, int *type, int *flag); + bool (*preHookFunc) (int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *type, int *flag); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_map_closest_freecell_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_map_closest_freecell_pre[hIndex].func; - retVal___ = preHookFunc(&m, x, y, &type, &flag); + retVal___ = preHookFunc(&m, bl, x, y, &type, &flag); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -39124,13 +39255,13 @@ bool HP_map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag) { } } { - retVal___ = HPMHooks.source.map.closest_freecell(m, x, y, type, flag); + retVal___ = HPMHooks.source.map.closest_freecell(m, bl, x, y, type, flag); } if( HPMHooks.count.HP_map_closest_freecell_post ) { - bool (*postHookFunc) (bool retVal___, int16 *m, int16 *x, int16 *y, int *type, int *flag); + bool (*postHookFunc) (bool retVal___, int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *type, int *flag); for(hIndex = 0; hIndex < HPMHooks.count.HP_map_closest_freecell_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_map_closest_freecell_post[hIndex].func; - retVal___ = postHookFunc(retVal___, &m, x, y, &type, &flag); + retVal___ = postHookFunc(retVal___, &m, bl, x, y, &type, &flag); } } return retVal___; @@ -39269,15 +39400,15 @@ void HP_map_clearflooritem(struct block_list *bl) { } return; } -int HP_map_addflooritem(struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags) { +int HP_map_addflooritem(const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_map_addflooritem_pre ) { - int (*preHookFunc) (struct item *item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags); + int (*preHookFunc) (const struct block_list *bl, struct item *item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addflooritem_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_map_addflooritem_pre[hIndex].func; - retVal___ = preHookFunc(item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags); + retVal___ = preHookFunc(bl, item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -39285,13 +39416,13 @@ int HP_map_addflooritem(struct item *item_data, int amount, int16 m, int16 x, in } } { - retVal___ = HPMHooks.source.map.addflooritem(item_data, amount, m, x, y, first_charid, second_charid, third_charid, flags); + retVal___ = HPMHooks.source.map.addflooritem(bl, item_data, amount, m, x, y, first_charid, second_charid, third_charid, flags); } if( HPMHooks.count.HP_map_addflooritem_post ) { - int (*postHookFunc) (int retVal___, struct item *item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags); + int (*postHookFunc) (int retVal___, const struct block_list *bl, struct item *item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags); for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addflooritem_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_map_addflooritem_post[hIndex].func; - retVal___ = postHookFunc(retVal___, item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags); + retVal___ = postHookFunc(retVal___, bl, item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags); } } return retVal___; @@ -40911,15 +41042,15 @@ int HP_map_freeblock_timer(int tid, int64 tick, int id, intptr_t data) { } return retVal___; } -int HP_map_searchrandfreecell(int16 m, int16 *x, int16 *y, int stack) { +int HP_map_searchrandfreecell(int16 m, const struct block_list *bl, int16 *x, int16 *y, int stack) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_map_searchrandfreecell_pre ) { - int (*preHookFunc) (int16 *m, int16 *x, int16 *y, int *stack); + int (*preHookFunc) (int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *stack); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_map_searchrandfreecell_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_map_searchrandfreecell_pre[hIndex].func; - retVal___ = preHookFunc(&m, x, y, &stack); + retVal___ = preHookFunc(&m, bl, x, y, &stack); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -40927,13 +41058,13 @@ int HP_map_searchrandfreecell(int16 m, int16 *x, int16 *y, int stack) { } } { - retVal___ = HPMHooks.source.map.searchrandfreecell(m, x, y, stack); + retVal___ = HPMHooks.source.map.searchrandfreecell(m, bl, x, y, stack); } if( HPMHooks.count.HP_map_searchrandfreecell_post ) { - int (*postHookFunc) (int retVal___, int16 *m, int16 *x, int16 *y, int *stack); + int (*postHookFunc) (int retVal___, int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *stack); for(hIndex = 0; hIndex < HPMHooks.count.HP_map_searchrandfreecell_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_map_searchrandfreecell_post[hIndex].func; - retVal___ = postHookFunc(retVal___, &m, x, y, &stack); + retVal___ = postHookFunc(retVal___, &m, bl, x, y, &stack); } } return retVal___; @@ -41093,15 +41224,15 @@ int HP_map_cell2gat(struct mapcell cell) { } return retVal___; } -int HP_map_getcellp(struct map_data *m, int16 x, int16 y, cell_chk cellchk) { +int HP_map_getcellp(struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_map_getcellp_pre ) { - int (*preHookFunc) (struct map_data *m, int16 *x, int16 *y, cell_chk *cellchk); + int (*preHookFunc) (struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcellp_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_map_getcellp_pre[hIndex].func; - retVal___ = preHookFunc(m, &x, &y, &cellchk); + retVal___ = preHookFunc(m, bl, &x, &y, &cellchk); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -41109,13 +41240,13 @@ int HP_map_getcellp(struct map_data *m, int16 x, int16 y, cell_chk cellchk) { } } { - retVal___ = HPMHooks.source.map.getcellp(m, x, y, cellchk); + retVal___ = HPMHooks.source.map.getcellp(m, bl, x, y, cellchk); } if( HPMHooks.count.HP_map_getcellp_post ) { - int (*postHookFunc) (int retVal___, struct map_data *m, int16 *x, int16 *y, cell_chk *cellchk); + int (*postHookFunc) (int retVal___, struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk); for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcellp_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_map_getcellp_post[hIndex].func; - retVal___ = postHookFunc(retVal___, m, &x, &y, &cellchk); + retVal___ = postHookFunc(retVal___, m, bl, &x, &y, &cellchk); } } return retVal___; @@ -41146,15 +41277,15 @@ void HP_map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) { } return; } -int HP_map_sub_getcellp(struct map_data *m, int16 x, int16 y, cell_chk cellchk) { +int HP_map_sub_getcellp(struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_map_sub_getcellp_pre ) { - int (*preHookFunc) (struct map_data *m, int16 *x, int16 *y, cell_chk *cellchk); + int (*preHookFunc) (struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_getcellp_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_map_sub_getcellp_pre[hIndex].func; - retVal___ = preHookFunc(m, &x, &y, &cellchk); + retVal___ = preHookFunc(m, bl, &x, &y, &cellchk); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -41162,13 +41293,13 @@ int HP_map_sub_getcellp(struct map_data *m, int16 x, int16 y, cell_chk cellchk) } } { - retVal___ = HPMHooks.source.map.sub_getcellp(m, x, y, cellchk); + retVal___ = HPMHooks.source.map.sub_getcellp(m, bl, x, y, cellchk); } if( HPMHooks.count.HP_map_sub_getcellp_post ) { - int (*postHookFunc) (int retVal___, struct map_data *m, int16 *x, int16 *y, cell_chk *cellchk); + int (*postHookFunc) (int retVal___, struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk); for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_getcellp_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_map_sub_getcellp_post[hIndex].func; - retVal___ = postHookFunc(retVal___, m, &x, &y, &cellchk); + retVal___ = postHookFunc(retVal___, m, bl, &x, &y, &cellchk); } } return retVal___; @@ -50425,15 +50556,15 @@ int HP_party_db_final(DBKey key, DBData *data, va_list ap) { return retVal___; } /* path */ -int HP_path_blownpos(int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count) { +int HP_path_blownpos(struct block_list *bl, int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_path_blownpos_pre ) { - int (*preHookFunc) (int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count); + int (*preHookFunc) (struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_path_blownpos_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_path_blownpos_pre[hIndex].func; - retVal___ = preHookFunc(&m, &x0, &y0, &dx, &dy, &count); + retVal___ = preHookFunc(bl, &m, &x0, &y0, &dx, &dy, &count); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -50441,26 +50572,26 @@ int HP_path_blownpos(int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count) } } { - retVal___ = HPMHooks.source.path.blownpos(m, x0, y0, dx, dy, count); + retVal___ = HPMHooks.source.path.blownpos(bl, m, x0, y0, dx, dy, count); } if( HPMHooks.count.HP_path_blownpos_post ) { - int (*postHookFunc) (int retVal___, int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count); + int (*postHookFunc) (int retVal___, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count); for(hIndex = 0; hIndex < HPMHooks.count.HP_path_blownpos_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_path_blownpos_post[hIndex].func; - retVal___ = postHookFunc(retVal___, &m, &x0, &y0, &dx, &dy, &count); + retVal___ = postHookFunc(retVal___, bl, &m, &x0, &y0, &dx, &dy, &count); } } return retVal___; } -bool HP_path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell) { +bool HP_path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell) { int hIndex = 0; bool retVal___ = false; if( HPMHooks.count.HP_path_search_pre ) { - bool (*preHookFunc) (struct walkpath_data *wpd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell); + bool (*preHookFunc) (struct walkpath_data *wpd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_path_search_pre[hIndex].func; - retVal___ = preHookFunc(wpd, &m, &x0, &y0, &x1, &y1, &flag, &cell); + retVal___ = preHookFunc(wpd, bl, &m, &x0, &y0, &x1, &y1, &flag, &cell); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -50468,26 +50599,26 @@ bool HP_path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int1 } } { - retVal___ = HPMHooks.source.path.search(wpd, m, x0, y0, x1, y1, flag, cell); + retVal___ = HPMHooks.source.path.search(wpd, bl, m, x0, y0, x1, y1, flag, cell); } if( HPMHooks.count.HP_path_search_post ) { - bool (*postHookFunc) (bool retVal___, struct walkpath_data *wpd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell); + bool (*postHookFunc) (bool retVal___, struct walkpath_data *wpd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell); for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_path_search_post[hIndex].func; - retVal___ = postHookFunc(retVal___, wpd, &m, &x0, &y0, &x1, &y1, &flag, &cell); + retVal___ = postHookFunc(retVal___, wpd, bl, &m, &x0, &y0, &x1, &y1, &flag, &cell); } } return retVal___; } -bool HP_path_search_long(struct shootpath_data *spd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, cell_chk cell) { +bool HP_path_search_long(struct shootpath_data *spd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, cell_chk cell) { int hIndex = 0; bool retVal___ = false; if( HPMHooks.count.HP_path_search_long_pre ) { - bool (*preHookFunc) (struct shootpath_data *spd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell); + bool (*preHookFunc) (struct shootpath_data *spd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_long_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_path_search_long_pre[hIndex].func; - retVal___ = preHookFunc(spd, &m, &x0, &y0, &x1, &y1, &cell); + retVal___ = preHookFunc(spd, bl, &m, &x0, &y0, &x1, &y1, &cell); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -50495,13 +50626,13 @@ bool HP_path_search_long(struct shootpath_data *spd, int16 m, int16 x0, int16 y0 } } { - retVal___ = HPMHooks.source.path.search_long(spd, m, x0, y0, x1, y1, cell); + retVal___ = HPMHooks.source.path.search_long(spd, bl, m, x0, y0, x1, y1, cell); } if( HPMHooks.count.HP_path_search_long_post ) { - bool (*postHookFunc) (bool retVal___, struct shootpath_data *spd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell); + bool (*postHookFunc) (bool retVal___, struct shootpath_data *spd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell); for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_long_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_path_search_long_post[hIndex].func; - retVal___ = postHookFunc(retVal___, spd, &m, &x0, &y0, &x1, &y1, &cell); + retVal___ = postHookFunc(retVal___, spd, bl, &m, &x0, &y0, &x1, &y1, &cell); } } return retVal___; @@ -56614,6 +56745,39 @@ void HP_pc_autotrade_populate(struct map_session_data *sd) { } return; } +int HP_pc_autotrade_final(DBKey key, DBData *data, va_list ap) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_pc_autotrade_final_pre ) { + int (*preHookFunc) (DBKey *key, DBData *data, va_list ap); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_final_pre; hIndex++ ) { + va_list ap___copy; va_copy(ap___copy, ap); + preHookFunc = HPMHooks.list.HP_pc_autotrade_final_pre[hIndex].func; + retVal___ = preHookFunc(&key, data, ap___copy); + va_end(ap___copy); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list ap___copy; va_copy(ap___copy, ap); + retVal___ = HPMHooks.source.pc.autotrade_final(key, data, ap___copy); + va_end(ap___copy); + } + if( HPMHooks.count.HP_pc_autotrade_final_post ) { + int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_final_post; hIndex++ ) { + va_list ap___copy; va_copy(ap___copy, ap); + postHookFunc = HPMHooks.list.HP_pc_autotrade_final_post[hIndex].func; + retVal___ = postHookFunc(retVal___, &key, data, ap___copy); + va_end(ap___copy); + } + } + return retVal___; +} int HP_pc_check_job_name(const char *name) { int hIndex = 0; int retVal___ = 0; @@ -58540,6 +58704,222 @@ struct script_data* HP_script_get_val(struct script_state *st, struct script_dat } return retVal___; } +char* HP_script_get_val_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_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_ref_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_ref_str_pre[hIndex].func; + retVal___ = preHookFunc(st, n, data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_ref_str(st, n, data); + } + if( HPMHooks.count.HP_script_get_val_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_ref_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_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; + if( HPMHooks.count.HP_script_get_val_scope_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_scope_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_scope_str_pre[hIndex].func; + retVal___ = preHookFunc(st, n, data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_scope_str(st, n, data); + } + if( HPMHooks.count.HP_script_get_val_scope_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_scope_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_scope_str_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, n, data); + } + } + return retVal___; +} +char* HP_script_get_val_npc_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_npc_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_npc_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_npc_str_pre[hIndex].func; + retVal___ = preHookFunc(st, n, data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_npc_str(st, n, data); + } + if( HPMHooks.count.HP_script_get_val_npc_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_npc_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_npc_str_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, n, data); + } + } + return retVal___; +} +char* HP_script_get_val_instance_str(struct script_state *st, const char *name, struct script_data *data) { + int hIndex = 0; + char* retVal___ = NULL; + if( HPMHooks.count.HP_script_get_val_instance_str_pre ) { + char* (*preHookFunc) (struct script_state *st, const char *name, struct script_data *data); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_instance_str_pre[hIndex].func; + retVal___ = preHookFunc(st, name, data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_instance_str(st, name, data); + } + if( HPMHooks.count.HP_script_get_val_instance_str_post ) { + char* (*postHookFunc) (char* retVal___, struct script_state *st, const char *name, struct script_data *data); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_instance_str_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, name, data); + } + } + return retVal___; +} +int HP_script_get_val_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_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_ref_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_ref_num_pre[hIndex].func; + retVal___ = preHookFunc(st, n, data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_ref_num(st, n, data); + } + if( HPMHooks.count.HP_script_get_val_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_ref_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_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; + if( HPMHooks.count.HP_script_get_val_scope_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_scope_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_scope_num_pre[hIndex].func; + retVal___ = preHookFunc(st, n, data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_scope_num(st, n, data); + } + if( HPMHooks.count.HP_script_get_val_scope_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_scope_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_scope_num_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, n, data); + } + } + return retVal___; +} +int HP_script_get_val_npc_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_npc_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_npc_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_npc_num_pre[hIndex].func; + retVal___ = preHookFunc(st, n, data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_npc_num(st, n, data); + } + if( HPMHooks.count.HP_script_get_val_npc_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_npc_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_npc_num_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, n, data); + } + } + return retVal___; +} +int HP_script_get_val_instance_num(struct script_state *st, const char *name, struct script_data *data) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_script_get_val_instance_num_pre ) { + int (*preHookFunc) (struct script_state *st, const char *name, struct script_data *data); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_get_val_instance_num_pre[hIndex].func; + retVal___ = preHookFunc(st, name, data); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.get_val_instance_num(st, name, data); + } + if( HPMHooks.count.HP_script_get_val_instance_num_post ) { + int (*postHookFunc) (int retVal___, struct script_state *st, const char *name, struct script_data *data); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_get_val_instance_num_post[hIndex].func; + retVal___ = postHookFunc(retVal___, st, name, data); + } + } + return retVal___; +} void* HP_script_get_val2(struct script_state *st, int64 uid, struct reg_db *ref) { int hIndex = 0; void* retVal___ = NULL; @@ -60263,6 +60643,214 @@ int HP_script_set_reg(struct script_state *st, TBL_PC *sd, int64 num, const char } return retVal___; } +void HP_script_set_reg_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_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_ref_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_ref_str_pre[hIndex].func; + preHookFunc(st, n, &num, name, str); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_ref_str(st, n, num, name, str); + } + if( HPMHooks.count.HP_script_set_reg_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_ref_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_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 ) { + 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_scope_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_scope_str_pre[hIndex].func; + preHookFunc(st, n, &num, name, str); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_scope_str(st, n, num, name, str); + } + if( HPMHooks.count.HP_script_set_reg_scope_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_scope_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_scope_str_post[hIndex].func; + postHookFunc(st, n, &num, name, str); + } + } + return; +} +void HP_script_set_reg_npc_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_npc_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_npc_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_npc_str_pre[hIndex].func; + preHookFunc(st, n, &num, name, str); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_npc_str(st, n, num, name, str); + } + if( HPMHooks.count.HP_script_set_reg_npc_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_npc_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_npc_str_post[hIndex].func; + postHookFunc(st, n, &num, name, str); + } + } + return; +} +void HP_script_set_reg_instance_str(struct script_state *st, int64 num, const char *name, const char *str) { + int hIndex = 0; + if( HPMHooks.count.HP_script_set_reg_instance_str_pre ) { + void (*preHookFunc) (struct script_state *st, int64 *num, const char *name, const char *str); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_str_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_instance_str_pre[hIndex].func; + preHookFunc(st, &num, name, str); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_instance_str(st, num, name, str); + } + if( HPMHooks.count.HP_script_set_reg_instance_str_post ) { + void (*postHookFunc) (struct script_state *st, int64 *num, const char *name, const char *str); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_str_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_instance_str_post[hIndex].func; + postHookFunc(st, &num, name, str); + } + } + return; +} +void HP_script_set_reg_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_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_ref_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_ref_num_pre[hIndex].func; + preHookFunc(st, n, &num, name, &val); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_ref_num(st, n, num, name, val); + } + if( HPMHooks.count.HP_script_set_reg_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_ref_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_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 ) { + 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_scope_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_scope_num_pre[hIndex].func; + preHookFunc(st, n, &num, name, &val); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_scope_num(st, n, num, name, val); + } + if( HPMHooks.count.HP_script_set_reg_scope_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_scope_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_scope_num_post[hIndex].func; + postHookFunc(st, n, &num, name, &val); + } + } + return; +} +void HP_script_set_reg_npc_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_npc_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_npc_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_npc_num_pre[hIndex].func; + preHookFunc(st, n, &num, name, &val); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_npc_num(st, n, num, name, val); + } + if( HPMHooks.count.HP_script_set_reg_npc_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_npc_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_npc_num_post[hIndex].func; + postHookFunc(st, n, &num, name, &val); + } + } + return; +} +void HP_script_set_reg_instance_num(struct script_state *st, int64 num, const char *name, int val) { + int hIndex = 0; + if( HPMHooks.count.HP_script_set_reg_instance_num_pre ) { + void (*preHookFunc) (struct script_state *st, int64 *num, const char *name, int *val); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_num_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_set_reg_instance_num_pre[hIndex].func; + preHookFunc(st, &num, name, &val); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.set_reg_instance_num(st, num, name, val); + } + if( HPMHooks.count.HP_script_set_reg_instance_num_post ) { + void (*postHookFunc) (struct script_state *st, int64 *num, const char *name, int *val); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_num_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_set_reg_instance_num_post[hIndex].func; + postHookFunc(st, &num, name, &val); + } + } + return; +} void HP_script_stack_expand(struct script_stack *stack) { int hIndex = 0; if( HPMHooks.count.HP_script_stack_expand_pre ) { diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index ff2feefa0..79eda0e5e 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -139,10 +139,10 @@ int db2sql(config_setting_t *entry, int n, const char *source) { // bindonequip StrBuf->Printf(&buf, "'%u',", it->flag.bindonequip?1:0); - + // forceserial StrBuf->Printf(&buf, "'%u',", it->flag.force_serial?1:0); - + // buyingstore StrBuf->Printf(&buf, "'%u',", it->flag.buyingstore?1:0); |