diff options
author | Hercules.ws <Hercules@efficiently.awesome> | 2015-09-17 14:02:30 +0200 |
---|---|---|
committer | HerculesWSAPI <Hercules@efficiently.awesome> | 2015-09-17 14:02:30 +0200 |
commit | 09f5d716e5471e652867194aa8bcd8d7a62e85fd (patch) | |
tree | fbbb4fad5c6ccdcfe8b31c44525b63727f6394a5 /src | |
parent | c366543d6daa724fd2f9ebc1a258b103c7906828 (diff) | |
download | hercules-09f5d716e5471e652867194aa8bcd8d7a62e85fd.tar.gz hercules-09f5d716e5471e652867194aa8bcd8d7a62e85fd.tar.bz2 hercules-09f5d716e5471e652867194aa8bcd8d7a62e85fd.tar.xz hercules-09f5d716e5471e652867194aa8bcd8d7a62e85fd.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
Diffstat (limited to 'src')
-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 | 104 |
3 files changed, 124 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index eab1d007e..0a36d76fe 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; @@ -5770,6 +5778,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 +6242,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; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 4656f01c2..99fa38cd6 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) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 32c0d8cca..7c53c0e6f 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 ) { |