diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 32 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 176 |
3 files changed, 203 insertions, 13 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 74e765cee..034b14b79 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -829,8 +829,8 @@ struct { struct HPMHookPoint *HP_clif_specialeffect_value_post; struct HPMHookPoint *HP_clif_millenniumshield_pre; struct HPMHookPoint *HP_clif_millenniumshield_post; - struct HPMHookPoint *HP_clif_charm_pre; - struct HPMHookPoint *HP_clif_charm_post; + struct HPMHookPoint *HP_clif_spiritcharm_pre; + struct HPMHookPoint *HP_clif_spiritcharm_post; struct HPMHookPoint *HP_clif_charm_single_pre; struct HPMHookPoint *HP_clif_charm_single_post; struct HPMHookPoint *HP_clif_snap_pre; @@ -2567,6 +2567,8 @@ struct { struct HPMHookPoint *HP_itemdb_gendercheck_post; struct HPMHookPoint *HP_itemdb_validate_entry_pre; struct HPMHookPoint *HP_itemdb_validate_entry_post; + struct HPMHookPoint *HP_itemdb_readdb_additional_fields_pre; + struct HPMHookPoint *HP_itemdb_readdb_additional_fields_post; struct HPMHookPoint *HP_itemdb_readdb_sql_sub_pre; struct HPMHookPoint *HP_itemdb_readdb_sql_sub_post; struct HPMHookPoint *HP_itemdb_readdb_libconfig_sub_pre; @@ -2587,6 +2589,10 @@ struct { struct HPMHookPoint *HP_itemdb_clear_post; struct HPMHookPoint *HP_itemdb_id2combo_pre; struct HPMHookPoint *HP_itemdb_id2combo_post; + struct HPMHookPoint *HP_itemdb_is_item_usable_pre; + struct HPMHookPoint *HP_itemdb_is_item_usable_post; + struct HPMHookPoint *HP_itemdb_lookup_const_pre; + struct HPMHookPoint *HP_itemdb_lookup_const_post; struct HPMHookPoint *HP_logs_pick_pc_pre; struct HPMHookPoint *HP_logs_pick_pc_post; struct HPMHookPoint *HP_logs_pick_mob_pre; @@ -3189,6 +3195,8 @@ struct { struct HPMHookPoint *HP_mob_load_post; struct HPMHookPoint *HP_mob_clear_spawninfo_pre; struct HPMHookPoint *HP_mob_clear_spawninfo_post; + struct HPMHookPoint *HP_mob_destroy_mob_db_pre; + struct HPMHookPoint *HP_mob_destroy_mob_db_post; struct HPMHookPoint *HP_npc_init_pre; struct HPMHookPoint *HP_npc_init_post; struct HPMHookPoint *HP_npc_final_pre; @@ -3205,6 +3213,8 @@ struct { struct HPMHookPoint *HP_npc_ontouch_event_post; struct HPMHookPoint *HP_npc_ontouch2_event_pre; struct HPMHookPoint *HP_npc_ontouch2_event_post; + struct HPMHookPoint *HP_npc_onuntouch_event_pre; + struct HPMHookPoint *HP_npc_onuntouch_event_post; struct HPMHookPoint *HP_npc_enable_sub_pre; struct HPMHookPoint *HP_npc_enable_sub_post; struct HPMHookPoint *HP_npc_enable_pre; @@ -3253,6 +3263,8 @@ struct { struct HPMHookPoint *HP_npc_touchnext_areanpc_post; struct HPMHookPoint *HP_npc_touch_areanpc_pre; struct HPMHookPoint *HP_npc_touch_areanpc_post; + struct HPMHookPoint *HP_npc_untouch_areanpc_pre; + struct HPMHookPoint *HP_npc_untouch_areanpc_post; struct HPMHookPoint *HP_npc_touch_areanpc2_pre; struct HPMHookPoint *HP_npc_touch_areanpc2_post; struct HPMHookPoint *HP_npc_check_areanpc_pre; @@ -5900,8 +5912,8 @@ struct { int HP_clif_specialeffect_value_post; int HP_clif_millenniumshield_pre; int HP_clif_millenniumshield_post; - int HP_clif_charm_pre; - int HP_clif_charm_post; + int HP_clif_spiritcharm_pre; + int HP_clif_spiritcharm_post; int HP_clif_charm_single_pre; int HP_clif_charm_single_post; int HP_clif_snap_pre; @@ -7638,6 +7650,8 @@ struct { int HP_itemdb_gendercheck_post; int HP_itemdb_validate_entry_pre; int HP_itemdb_validate_entry_post; + int HP_itemdb_readdb_additional_fields_pre; + int HP_itemdb_readdb_additional_fields_post; int HP_itemdb_readdb_sql_sub_pre; int HP_itemdb_readdb_sql_sub_post; int HP_itemdb_readdb_libconfig_sub_pre; @@ -7658,6 +7672,10 @@ struct { int HP_itemdb_clear_post; int HP_itemdb_id2combo_pre; int HP_itemdb_id2combo_post; + int HP_itemdb_is_item_usable_pre; + int HP_itemdb_is_item_usable_post; + int HP_itemdb_lookup_const_pre; + int HP_itemdb_lookup_const_post; int HP_logs_pick_pc_pre; int HP_logs_pick_pc_post; int HP_logs_pick_mob_pre; @@ -8260,6 +8278,8 @@ struct { int HP_mob_load_post; int HP_mob_clear_spawninfo_pre; int HP_mob_clear_spawninfo_post; + int HP_mob_destroy_mob_db_pre; + int HP_mob_destroy_mob_db_post; int HP_npc_init_pre; int HP_npc_init_post; int HP_npc_final_pre; @@ -8276,6 +8296,8 @@ struct { int HP_npc_ontouch_event_post; int HP_npc_ontouch2_event_pre; int HP_npc_ontouch2_event_post; + int HP_npc_onuntouch_event_pre; + int HP_npc_onuntouch_event_post; int HP_npc_enable_sub_pre; int HP_npc_enable_sub_post; int HP_npc_enable_pre; @@ -8324,6 +8346,8 @@ struct { int HP_npc_touchnext_areanpc_post; int HP_npc_touch_areanpc_pre; int HP_npc_touch_areanpc_post; + int HP_npc_untouch_areanpc_pre; + int HP_npc_untouch_areanpc_post; int HP_npc_touch_areanpc2_pre; int HP_npc_touch_areanpc2_post; int HP_npc_check_areanpc_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 5d0545f82..21f48134c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -424,7 +424,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->specialeffect_single, HP_clif_specialeffect_single) }, { HP_POP(clif->specialeffect_value, HP_clif_specialeffect_value) }, { HP_POP(clif->millenniumshield, HP_clif_millenniumshield) }, - { HP_POP(clif->charm, HP_clif_charm) }, + { HP_POP(clif->spiritcharm, HP_clif_spiritcharm) }, { HP_POP(clif->charm_single, HP_clif_charm_single) }, { HP_POP(clif->snap, HP_clif_snap) }, { HP_POP(clif->weather_check, HP_clif_weather_check) }, @@ -1302,6 +1302,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(itemdb->read_combos, HP_itemdb_read_combos) }, { HP_POP(itemdb->gendercheck, HP_itemdb_gendercheck) }, { HP_POP(itemdb->validate_entry, HP_itemdb_validate_entry) }, + { HP_POP(itemdb->readdb_additional_fields, HP_itemdb_readdb_additional_fields) }, { HP_POP(itemdb->readdb_sql_sub, HP_itemdb_readdb_sql_sub) }, { HP_POP(itemdb->readdb_libconfig_sub, HP_itemdb_readdb_libconfig_sub) }, { HP_POP(itemdb->readdb_libconfig, HP_itemdb_readdb_libconfig) }, @@ -1312,6 +1313,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(itemdb->final_sub, HP_itemdb_final_sub) }, { HP_POP(itemdb->clear, HP_itemdb_clear) }, { HP_POP(itemdb->id2combo, HP_itemdb_id2combo) }, + { HP_POP(itemdb->is_item_usable, HP_itemdb_is_item_usable) }, + { HP_POP(itemdb->lookup_const, HP_itemdb_lookup_const) }, /* logs */ { HP_POP(logs->pick_pc, HP_logs_pick_pc) }, { HP_POP(logs->pick_mob, HP_logs_pick_mob) }, @@ -1620,6 +1623,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mob->readdb_itemratio, HP_mob_readdb_itemratio) }, { HP_POP(mob->load, HP_mob_load) }, { HP_POP(mob->clear_spawninfo, HP_mob_clear_spawninfo) }, + { HP_POP(mob->destroy_mob_db, HP_mob_destroy_mob_db) }, /* npc */ { HP_POP(npc->init, HP_npc_init) }, { HP_POP(npc->final, HP_npc_final) }, @@ -1629,6 +1633,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(npc->isnear, HP_npc_isnear) }, { HP_POP(npc->ontouch_event, HP_npc_ontouch_event) }, { HP_POP(npc->ontouch2_event, HP_npc_ontouch2_event) }, + { HP_POP(npc->onuntouch_event, HP_npc_onuntouch_event) }, { HP_POP(npc->enable_sub, HP_npc_enable_sub) }, { HP_POP(npc->enable, HP_npc_enable) }, { HP_POP(npc->name2id, HP_npc_name2id) }, @@ -1653,6 +1658,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(npc->touch_areanpc_sub, HP_npc_touch_areanpc_sub) }, { HP_POP(npc->touchnext_areanpc, HP_npc_touchnext_areanpc) }, { HP_POP(npc->touch_areanpc, HP_npc_touch_areanpc) }, + { HP_POP(npc->untouch_areanpc, HP_npc_untouch_areanpc) }, { HP_POP(npc->touch_areanpc2, HP_npc_touch_areanpc2) }, { HP_POP(npc->check_areanpc, HP_npc_check_areanpc) }, { HP_POP(npc->checknear, HP_npc_checknear) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 0169d43c7..9078efe2e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -11012,13 +11012,13 @@ void HP_clif_millenniumshield(struct block_list *bl, short shields) { } return; } -void HP_clif_charm(struct map_session_data *sd, short type) { +void HP_clif_spiritcharm(struct map_session_data *sd, short type) { int hIndex = 0; - if( HPMHooks.count.HP_clif_charm_pre ) { + if( HPMHooks.count.HP_clif_spiritcharm_pre ) { void (*preHookFunc) (struct map_session_data *sd, short *type); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_charm_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_clif_charm_pre[hIndex].func; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritcharm_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_clif_spiritcharm_pre[hIndex].func; preHookFunc(sd, &type); } if( *HPMforce_return ) { @@ -11027,12 +11027,12 @@ void HP_clif_charm(struct map_session_data *sd, short type) { } } { - HPMHooks.source.clif.charm(sd, type); + HPMHooks.source.clif.spiritcharm(sd, type); } - if( HPMHooks.count.HP_clif_charm_post ) { + if( HPMHooks.count.HP_clif_spiritcharm_post ) { void (*postHookFunc) (struct map_session_data *sd, short *type); - for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_charm_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_clif_charm_post[hIndex].func; + for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritcharm_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_clif_spiritcharm_post[hIndex].func; postHookFunc(sd, &type); } } @@ -33991,6 +33991,32 @@ int HP_itemdb_validate_entry(struct item_data *entry, int n, const char *source) } return retVal___; } +void HP_itemdb_readdb_additional_fields(int itemid, config_setting_t *it, int n, const char *source) { + int hIndex = 0; + if( HPMHooks.count.HP_itemdb_readdb_additional_fields_pre ) { + void (*preHookFunc) (int *itemid, config_setting_t *it, int *n, const char *source); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_additional_fields_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_itemdb_readdb_additional_fields_pre[hIndex].func; + preHookFunc(&itemid, it, &n, source); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.itemdb.readdb_additional_fields(itemid, it, n, source); + } + if( HPMHooks.count.HP_itemdb_readdb_additional_fields_post ) { + void (*postHookFunc) (int *itemid, config_setting_t *it, int *n, const char *source); + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_additional_fields_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_itemdb_readdb_additional_fields_post[hIndex].func; + postHookFunc(&itemid, it, &n, source); + } + } + return; +} int HP_itemdb_readdb_sql_sub(Sql *handle, int n, const char *source) { int hIndex = 0; int retVal___ = 0; @@ -34264,6 +34290,60 @@ struct item_combo* HP_itemdb_id2combo(unsigned short id) { } return retVal___; } +bool HP_itemdb_is_item_usable(struct item_data *item) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_itemdb_is_item_usable_pre ) { + bool (*preHookFunc) (struct item_data *item); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_is_item_usable_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_itemdb_is_item_usable_pre[hIndex].func; + retVal___ = preHookFunc(item); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.itemdb.is_item_usable(item); + } + if( HPMHooks.count.HP_itemdb_is_item_usable_post ) { + bool (*postHookFunc) (bool retVal___, struct item_data *item); + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_is_item_usable_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_itemdb_is_item_usable_post[hIndex].func; + retVal___ = postHookFunc(retVal___, item); + } + } + return retVal___; +} +bool HP_itemdb_lookup_const(const config_setting_t *it, const char *name, int *value) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_itemdb_lookup_const_pre ) { + bool (*preHookFunc) (const config_setting_t *it, const char *name, int *value); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_lookup_const_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_itemdb_lookup_const_pre[hIndex].func; + retVal___ = preHookFunc(it, name, value); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.itemdb.lookup_const(it, name, value); + } + if( HPMHooks.count.HP_itemdb_lookup_const_post ) { + bool (*postHookFunc) (bool retVal___, const config_setting_t *it, const char *name, int *value); + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_lookup_const_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_itemdb_lookup_const_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, name, value); + } + } + return retVal___; +} /* logs */ void HP_logs_pick_pc(struct map_session_data *sd, e_log_pick_type type, int amount, struct item *itm, struct item_data *data) { int hIndex = 0; @@ -42561,6 +42641,32 @@ void HP_mob_clear_spawninfo(void) { } return; } +void HP_mob_destroy_mob_db(int index) { + int hIndex = 0; + if( HPMHooks.count.HP_mob_destroy_mob_db_pre ) { + void (*preHookFunc) (int *index); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_destroy_mob_db_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_destroy_mob_db_pre[hIndex].func; + preHookFunc(&index); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mob.destroy_mob_db(index); + } + if( HPMHooks.count.HP_mob_destroy_mob_db_post ) { + void (*postHookFunc) (int *index); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_destroy_mob_db_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_destroy_mob_db_post[hIndex].func; + postHookFunc(&index); + } + } + return; +} /* npc */ int HP_npc_init(bool minimal) { int hIndex = 0; @@ -42784,6 +42890,33 @@ int HP_npc_ontouch2_event(struct map_session_data *sd, struct npc_data *nd) { } return retVal___; } +int HP_npc_onuntouch_event(struct map_session_data *sd, struct npc_data *nd) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_npc_onuntouch_event_pre ) { + int (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_onuntouch_event_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_onuntouch_event_pre[hIndex].func; + retVal___ = preHookFunc(sd, nd); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.npc.onuntouch_event(sd, nd); + } + if( HPMHooks.count.HP_npc_onuntouch_event_post ) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct npc_data *nd); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_onuntouch_event_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_onuntouch_event_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, nd); + } + } + return retVal___; +} int HP_npc_enable_sub(struct block_list *bl, va_list ap) { int hIndex = 0; int retVal___ = 0; @@ -43454,6 +43587,33 @@ int HP_npc_touch_areanpc(struct map_session_data *sd, int16 m, int16 x, int16 y) } return retVal___; } +int HP_npc_untouch_areanpc(struct map_session_data *sd, int16 m, int16 x, int16 y) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_npc_untouch_areanpc_pre ) { + int (*preHookFunc) (struct map_session_data *sd, int16 *m, int16 *x, int16 *y); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_untouch_areanpc_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_untouch_areanpc_pre[hIndex].func; + retVal___ = preHookFunc(sd, &m, &x, &y); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.npc.untouch_areanpc(sd, m, x, y); + } + if( HPMHooks.count.HP_npc_untouch_areanpc_post ) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 *m, int16 *x, int16 *y); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_untouch_areanpc_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_untouch_areanpc_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, &m, &x, &y); + } + } + return retVal___; +} int HP_npc_touch_areanpc2(struct mob_data *md) { int hIndex = 0; int retVal___ = 0; |