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 | 20 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 5 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 245 | ||||
-rw-r--r-- | src/plugins/db2sql.c | 4 |
5 files changed, 219 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 eab1d007e..408d7d0cd 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; @@ -517,6 +521,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 +4237,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; @@ -5770,6 +5780,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; @@ -6230,6 +6244,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; @@ -9942,6 +9960,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; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 4656f01c2..d0d97192e 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) }, @@ -270,6 +272,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 +2159,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) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index e6aad6dad..5602014eb 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 ) { @@ -6934,6 +6986,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 +38783,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 +38799,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 +39212,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 +39228,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 +39373,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 +39389,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 +41015,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 +41031,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 +41197,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 +41213,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 +41250,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 +41266,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 +50529,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 +50545,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 +50572,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 +50599,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 +56718,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; 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); |