diff options
Diffstat (limited to 'src/plugins')
9 files changed, 187 insertions, 96 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index 09d6ce1b6..bcda4332d 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -219,8 +219,8 @@ struct { struct HPMHookPoint *HP_chr_search_mapserver_post; struct HPMHookPoint *HP_chr_mapif_init_pre; struct HPMHookPoint *HP_chr_mapif_init_post; - struct HPMHookPoint *HP_chr_lan_subnetcheck_pre; - struct HPMHookPoint *HP_chr_lan_subnetcheck_post; + struct HPMHookPoint *HP_chr_lan_subnet_check_pre; + struct HPMHookPoint *HP_chr_lan_subnet_check_post; struct HPMHookPoint *HP_chr_delete2_ack_pre; struct HPMHookPoint *HP_chr_delete2_ack_post; struct HPMHookPoint *HP_chr_delete2_accept_actual_ack_pre; @@ -317,8 +317,6 @@ struct { struct HPMHookPoint *HP_chr_online_data_cleanup_sub_post; struct HPMHookPoint *HP_chr_online_data_cleanup_pre; struct HPMHookPoint *HP_chr_online_data_cleanup_post; - struct HPMHookPoint *HP_chr_lan_config_read_pre; - struct HPMHookPoint *HP_chr_lan_config_read_post; struct HPMHookPoint *HP_chr_sql_config_read_pre; struct HPMHookPoint *HP_chr_sql_config_read_post; struct HPMHookPoint *HP_chr_config_dispatch_pre; @@ -1118,8 +1116,8 @@ struct { int HP_chr_search_mapserver_post; int HP_chr_mapif_init_pre; int HP_chr_mapif_init_post; - int HP_chr_lan_subnetcheck_pre; - int HP_chr_lan_subnetcheck_post; + int HP_chr_lan_subnet_check_pre; + int HP_chr_lan_subnet_check_post; int HP_chr_delete2_ack_pre; int HP_chr_delete2_ack_post; int HP_chr_delete2_accept_actual_ack_pre; @@ -1216,8 +1214,6 @@ struct { int HP_chr_online_data_cleanup_sub_post; int HP_chr_online_data_cleanup_pre; int HP_chr_online_data_cleanup_post; - int HP_chr_lan_config_read_pre; - int HP_chr_lan_config_read_post; int HP_chr_sql_config_read_pre; int HP_chr_sql_config_read_post; int HP_chr_config_dispatch_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 631544248..b11149cf1 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -113,7 +113,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(chr->parse_frommap, HP_chr_parse_frommap) }, { HP_POP(chr->search_mapserver, HP_chr_search_mapserver) }, { HP_POP(chr->mapif_init, HP_chr_mapif_init) }, - { HP_POP(chr->lan_subnetcheck, HP_chr_lan_subnetcheck) }, + { HP_POP(chr->lan_subnet_check, HP_chr_lan_subnet_check) }, { HP_POP(chr->delete2_ack, HP_chr_delete2_ack) }, { HP_POP(chr->delete2_accept_actual_ack, HP_chr_delete2_accept_actual_ack) }, { HP_POP(chr->delete2_accept_ack, HP_chr_delete2_accept_ack) }, @@ -162,7 +162,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(chr->check_connect_login_server, HP_chr_check_connect_login_server) }, { HP_POP(chr->online_data_cleanup_sub, HP_chr_online_data_cleanup_sub) }, { HP_POP(chr->online_data_cleanup, HP_chr_online_data_cleanup) }, - { HP_POP(chr->lan_config_read, HP_chr_lan_config_read) }, { HP_POP(chr->sql_config_read, HP_chr_sql_config_read) }, { HP_POP(chr->config_dispatch, HP_chr_config_dispatch) }, { HP_POP(chr->config_read, HP_chr_config_read) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index c6cca0b0c..f8d01cb28 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -2847,14 +2847,14 @@ int HP_chr_mapif_init(int fd) { } return retVal___; } -int HP_chr_lan_subnetcheck(uint32 ip) { +uint32 HP_chr_lan_subnet_check(uint32 ip) { int hIndex = 0; - int retVal___ = 0; - if( HPMHooks.count.HP_chr_lan_subnetcheck_pre ) { - int (*preHookFunc) (uint32 *ip); + uint32 retVal___ = 0; + if( HPMHooks.count.HP_chr_lan_subnet_check_pre ) { + uint32 (*preHookFunc) (uint32 *ip); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_lan_subnetcheck_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_chr_lan_subnetcheck_pre[hIndex].func; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_lan_subnet_check_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_lan_subnet_check_pre[hIndex].func; retVal___ = preHookFunc(&ip); } if( *HPMforce_return ) { @@ -2863,12 +2863,12 @@ int HP_chr_lan_subnetcheck(uint32 ip) { } } { - retVal___ = HPMHooks.source.chr.lan_subnetcheck(ip); + retVal___ = HPMHooks.source.chr.lan_subnet_check(ip); } - if( HPMHooks.count.HP_chr_lan_subnetcheck_post ) { - int (*postHookFunc) (int retVal___, uint32 *ip); - for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_lan_subnetcheck_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_chr_lan_subnetcheck_post[hIndex].func; + if( HPMHooks.count.HP_chr_lan_subnet_check_post ) { + uint32 (*postHookFunc) (uint32 retVal___, uint32 *ip); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_lan_subnet_check_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_lan_subnet_check_post[hIndex].func; retVal___ = postHookFunc(retVal___, &ip); } } @@ -4143,33 +4143,6 @@ int HP_chr_online_data_cleanup(int tid, int64 tick, int id, intptr_t data) { } return retVal___; } -int HP_chr_lan_config_read(const char *lancfgName) { - int hIndex = 0; - int retVal___ = 0; - if( HPMHooks.count.HP_chr_lan_config_read_pre ) { - int (*preHookFunc) (const char *lancfgName); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_lan_config_read_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_chr_lan_config_read_pre[hIndex].func; - retVal___ = preHookFunc(lancfgName); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.chr.lan_config_read(lancfgName); - } - if( HPMHooks.count.HP_chr_lan_config_read_post ) { - int (*postHookFunc) (int retVal___, const char *lancfgName); - for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_lan_config_read_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_chr_lan_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, lancfgName); - } - } - return retVal___; -} void HP_chr_sql_config_read(const char *cfgName) { int hIndex = 0; if( HPMHooks.count.HP_chr_sql_config_read_pre ) { diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index af7e7250c..31cd3d710 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc @@ -29,10 +29,8 @@ struct { struct HPMHookPoint *HP_login_check_encrypted_post; struct HPMHookPoint *HP_login_check_password_pre; struct HPMHookPoint *HP_login_check_password_post; - struct HPMHookPoint *HP_login_lan_subnetcheck_pre; - struct HPMHookPoint *HP_login_lan_subnetcheck_post; - struct HPMHookPoint *HP_login_lan_config_read_pre; - struct HPMHookPoint *HP_login_lan_config_read_post; + struct HPMHookPoint *HP_login_lan_subnet_check_pre; + struct HPMHookPoint *HP_login_lan_subnet_check_post; struct HPMHookPoint *HP_login_fromchar_accinfo_pre; struct HPMHookPoint *HP_login_fromchar_accinfo_post; struct HPMHookPoint *HP_login_fromchar_account_pre; @@ -142,10 +140,8 @@ struct { int HP_login_check_encrypted_post; int HP_login_check_password_pre; int HP_login_check_password_post; - int HP_login_lan_subnetcheck_pre; - int HP_login_lan_subnetcheck_post; - int HP_login_lan_config_read_pre; - int HP_login_lan_config_read_post; + int HP_login_lan_subnet_check_pre; + int HP_login_lan_subnet_check_post; int HP_login_fromchar_accinfo_pre; int HP_login_fromchar_accinfo_post; int HP_login_fromchar_account_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index a4a9db119..00cdfc8c9 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc @@ -18,8 +18,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(login->sync_ip_addresses, HP_login_sync_ip_addresses) }, { HP_POP(login->check_encrypted, HP_login_check_encrypted) }, { HP_POP(login->check_password, HP_login_check_password) }, - { HP_POP(login->lan_subnetcheck, HP_login_lan_subnetcheck) }, - { HP_POP(login->lan_config_read, HP_login_lan_config_read) }, + { HP_POP(login->lan_subnet_check, HP_login_lan_subnet_check) }, { HP_POP(login->fromchar_accinfo, HP_login_fromchar_accinfo) }, { HP_POP(login->fromchar_account, HP_login_fromchar_account) }, { HP_POP(login->fromchar_account_update_other, HP_login_fromchar_account_update_other) }, diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 375b78e11..18195af77 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -347,14 +347,14 @@ bool HP_login_check_password(const char *md5key, int passwdenc, const char *pass } return retVal___; } -int HP_login_lan_subnetcheck(uint32 ip) { +uint32 HP_login_lan_subnet_check(uint32 ip) { int hIndex = 0; - int retVal___ = 0; - if( HPMHooks.count.HP_login_lan_subnetcheck_pre ) { - int (*preHookFunc) (uint32 *ip); + uint32 retVal___ = 0; + if( HPMHooks.count.HP_login_lan_subnet_check_pre ) { + uint32 (*preHookFunc) (uint32 *ip); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_login_lan_subnetcheck_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_login_lan_subnetcheck_pre[hIndex].func; + for(hIndex = 0; hIndex < HPMHooks.count.HP_login_lan_subnet_check_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_login_lan_subnet_check_pre[hIndex].func; retVal___ = preHookFunc(&ip); } if( *HPMforce_return ) { @@ -363,44 +363,17 @@ int HP_login_lan_subnetcheck(uint32 ip) { } } { - retVal___ = HPMHooks.source.login.lan_subnetcheck(ip); + retVal___ = HPMHooks.source.login.lan_subnet_check(ip); } - if( HPMHooks.count.HP_login_lan_subnetcheck_post ) { - int (*postHookFunc) (int retVal___, uint32 *ip); - for(hIndex = 0; hIndex < HPMHooks.count.HP_login_lan_subnetcheck_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_login_lan_subnetcheck_post[hIndex].func; + if( HPMHooks.count.HP_login_lan_subnet_check_post ) { + uint32 (*postHookFunc) (uint32 retVal___, uint32 *ip); + for(hIndex = 0; hIndex < HPMHooks.count.HP_login_lan_subnet_check_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_login_lan_subnet_check_post[hIndex].func; retVal___ = postHookFunc(retVal___, &ip); } } return retVal___; } -int HP_login_lan_config_read(const char *lancfgName) { - int hIndex = 0; - int retVal___ = 0; - if( HPMHooks.count.HP_login_lan_config_read_pre ) { - int (*preHookFunc) (const char *lancfgName); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_login_lan_config_read_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_login_lan_config_read_pre[hIndex].func; - retVal___ = preHookFunc(lancfgName); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.login.lan_config_read(lancfgName); - } - if( HPMHooks.count.HP_login_lan_config_read_post ) { - int (*postHookFunc) (int retVal___, const char *lancfgName); - for(hIndex = 0; hIndex < HPMHooks.count.HP_login_lan_config_read_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_login_lan_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, lancfgName); - } - } - return retVal___; -} void HP_login_fromchar_accinfo(int fd, int account_id, int u_fd, int u_aid, int u_group, int map_fd, struct mmo_account *acc) { int hIndex = 0; if( HPMHooks.count.HP_login_fromchar_accinfo_pre ) { diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 650f31d35..33c991933 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4159,6 +4159,10 @@ struct { struct HPMHookPoint *HP_script_label_add_post; struct HPMHookPoint *HP_script_run_pre; struct HPMHookPoint *HP_script_run_post; + struct HPMHookPoint *HP_script_run_npc_pre; + struct HPMHookPoint *HP_script_run_npc_post; + struct HPMHookPoint *HP_script_run_pet_pre; + struct HPMHookPoint *HP_script_run_pet_post; struct HPMHookPoint *HP_script_run_main_pre; struct HPMHookPoint *HP_script_run_main_post; struct HPMHookPoint *HP_script_run_timer_pre; @@ -4391,6 +4395,12 @@ struct { struct HPMHookPoint *HP_script_get_translation_file_name_post; struct HPMHookPoint *HP_script_parser_clean_leftovers_pre; struct HPMHookPoint *HP_script_parser_clean_leftovers_post; + struct HPMHookPoint *HP_script_run_use_script_pre; + struct HPMHookPoint *HP_script_run_use_script_post; + struct HPMHookPoint *HP_script_run_item_equip_script_pre; + struct HPMHookPoint *HP_script_run_item_equip_script_post; + struct HPMHookPoint *HP_script_run_item_unequip_script_pre; + struct HPMHookPoint *HP_script_run_item_unequip_script_post; struct HPMHookPoint *HP_searchstore_open_pre; struct HPMHookPoint *HP_searchstore_open_post; struct HPMHookPoint *HP_searchstore_query_pre; @@ -9380,6 +9390,10 @@ struct { int HP_script_label_add_post; int HP_script_run_pre; int HP_script_run_post; + int HP_script_run_npc_pre; + int HP_script_run_npc_post; + int HP_script_run_pet_pre; + int HP_script_run_pet_post; int HP_script_run_main_pre; int HP_script_run_main_post; int HP_script_run_timer_pre; @@ -9612,6 +9626,12 @@ struct { int HP_script_get_translation_file_name_post; int HP_script_parser_clean_leftovers_pre; int HP_script_parser_clean_leftovers_post; + int HP_script_run_use_script_pre; + int HP_script_run_use_script_post; + int HP_script_run_item_equip_script_pre; + int HP_script_run_item_equip_script_post; + int HP_script_run_item_unequip_script_pre; + int HP_script_run_item_unequip_script_post; int HP_searchstore_open_pre; int HP_searchstore_open_post; int HP_searchstore_query_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 33e6cd053..720d76b6c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2114,6 +2114,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->get_constant, HP_script_get_constant) }, { HP_POP(script->label_add, HP_script_label_add) }, { HP_POP(script->run, HP_script_run) }, + { HP_POP(script->run_npc, HP_script_run_npc) }, + { HP_POP(script->run_pet, HP_script_run_pet) }, { HP_POP(script->run_main, HP_script_run_main) }, { HP_POP(script->run_timer, HP_script_run_timer) }, { HP_POP(script->set_var, HP_script_set_var) }, @@ -2230,6 +2232,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->add_language, HP_script_add_language) }, { HP_POP(script->get_translation_file_name, HP_script_get_translation_file_name) }, { HP_POP(script->parser_clean_leftovers, HP_script_parser_clean_leftovers) }, + { HP_POP(script->run_use_script, HP_script_run_use_script) }, + { HP_POP(script->run_item_equip_script, HP_script_run_item_equip_script) }, + { HP_POP(script->run_item_unequip_script, HP_script_run_item_unequip_script) }, /* searchstore */ { HP_POP(searchstore->open, HP_searchstore_open) }, { HP_POP(searchstore->query, HP_searchstore_query) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index b8dd9db2f..402f146ba 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -55686,6 +55686,58 @@ void HP_script_run(struct script_code *rootscript, int pos, int rid, int oid) { } return; } +void HP_script_run_npc(struct script_code *rootscript, int pos, int rid, int oid) { + int hIndex = 0; + if( HPMHooks.count.HP_script_run_npc_pre ) { + void (*preHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_npc_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_run_npc_pre[hIndex].func; + preHookFunc(rootscript, &pos, &rid, &oid); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.run_npc(rootscript, pos, rid, oid); + } + if( HPMHooks.count.HP_script_run_npc_post ) { + void (*postHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_npc_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_run_npc_post[hIndex].func; + postHookFunc(rootscript, &pos, &rid, &oid); + } + } + return; +} +void HP_script_run_pet(struct script_code *rootscript, int pos, int rid, int oid) { + int hIndex = 0; + if( HPMHooks.count.HP_script_run_pet_pre ) { + void (*preHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_pet_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_run_pet_pre[hIndex].func; + preHookFunc(rootscript, &pos, &rid, &oid); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.run_pet(rootscript, pos, rid, oid); + } + if( HPMHooks.count.HP_script_run_pet_post ) { + void (*postHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_pet_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_run_pet_post[hIndex].func; + postHookFunc(rootscript, &pos, &rid, &oid); + } + } + return; +} void HP_script_run_main(struct script_state *st) { int hIndex = 0; if( HPMHooks.count.HP_script_run_main_pre ) { @@ -58915,6 +58967,84 @@ void HP_script_parser_clean_leftovers(void) { } return; } +void HP_script_run_use_script(struct map_session_data *sd, struct item_data *data, int oid) { + int hIndex = 0; + if( HPMHooks.count.HP_script_run_use_script_pre ) { + void (*preHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_use_script_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_run_use_script_pre[hIndex].func; + preHookFunc(sd, data, &oid); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.run_use_script(sd, data, oid); + } + if( HPMHooks.count.HP_script_run_use_script_post ) { + void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_use_script_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_run_use_script_post[hIndex].func; + postHookFunc(sd, data, &oid); + } + } + return; +} +void HP_script_run_item_equip_script(struct map_session_data *sd, struct item_data *data, int oid) { + int hIndex = 0; + if( HPMHooks.count.HP_script_run_item_equip_script_pre ) { + void (*preHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_equip_script_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_run_item_equip_script_pre[hIndex].func; + preHookFunc(sd, data, &oid); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.run_item_equip_script(sd, data, oid); + } + if( HPMHooks.count.HP_script_run_item_equip_script_post ) { + void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_equip_script_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_run_item_equip_script_post[hIndex].func; + postHookFunc(sd, data, &oid); + } + } + return; +} +void HP_script_run_item_unequip_script(struct map_session_data *sd, struct item_data *data, int oid) { + int hIndex = 0; + if( HPMHooks.count.HP_script_run_item_unequip_script_pre ) { + void (*preHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_unequip_script_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_run_item_unequip_script_pre[hIndex].func; + preHookFunc(sd, data, &oid); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.run_item_unequip_script(sd, data, oid); + } + if( HPMHooks.count.HP_script_run_item_unequip_script_post ) { + void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_unequip_script_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_run_item_unequip_script_post[hIndex].func; + postHookFunc(sd, data, &oid); + } + } + return; +} /* searchstore */ bool HP_searchstore_open(struct map_session_data *sd, unsigned int uses, unsigned short effect) { int hIndex = 0; |