diff options
author | malufett <malufett.eat.my.binaries@gmail.com> | 2015-03-27 11:07:54 +0800 |
---|---|---|
committer | malufett <malufett.eat.my.binaries@gmail.com> | 2015-03-27 11:07:54 +0800 |
commit | fb88a56b9519adedfca06085de6c2ccc5da72582 (patch) | |
tree | 395d1287daa1c97b0ec3e6f4c7b360fd378a7b00 /src/plugins/HPMHooking | |
parent | 7401d98649558d58d97d4543db1d74d33652127b (diff) | |
download | hercules-fb88a56b9519adedfca06085de6c2ccc5da72582.tar.gz hercules-fb88a56b9519adedfca06085de6c2ccc5da72582.tar.bz2 hercules-fb88a56b9519adedfca06085de6c2ccc5da72582.tar.xz hercules-fb88a56b9519adedfca06085de6c2ccc5da72582.zip |
Hercules 'job_db1.txt' Redesign
-Initial and for review
Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src/plugins/HPMHooking')
-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 | 138 |
3 files changed, 89 insertions, 89 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index e394711d1..5275e6fde 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -3987,6 +3987,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_check_job_name_pre; + struct HPMHookPoint *HP_pc_check_job_name_post; struct HPMHookPoint *HP_pet_init_pre; struct HPMHookPoint *HP_pet_init_post; struct HPMHookPoint *HP_pet_final_pre; @@ -4977,12 +4979,10 @@ struct { struct HPMHookPoint *HP_status_base_amotion_pc_post; struct HPMHookPoint *HP_status_base_atk_pre; struct HPMHookPoint *HP_status_base_atk_post; - struct HPMHookPoint *HP_status_calc_sigma_pre; - struct HPMHookPoint *HP_status_calc_sigma_post; - struct HPMHookPoint *HP_status_base_pc_maxhp_pre; - struct HPMHookPoint *HP_status_base_pc_maxhp_post; - struct HPMHookPoint *HP_status_base_pc_maxsp_pre; - struct HPMHookPoint *HP_status_base_pc_maxsp_post; + struct HPMHookPoint *HP_status_get_base_maxhp_pre; + struct HPMHookPoint *HP_status_get_base_maxhp_post; + struct HPMHookPoint *HP_status_get_base_maxsp_pre; + struct HPMHookPoint *HP_status_get_base_maxsp_post; struct HPMHookPoint *HP_status_calc_npc__pre; struct HPMHookPoint *HP_status_calc_npc__post; struct HPMHookPoint *HP_status_calc_str_pre; @@ -5041,8 +5041,6 @@ struct { struct HPMHookPoint *HP_status_natural_heal_post; struct HPMHookPoint *HP_status_natural_heal_timer_pre; struct HPMHookPoint *HP_status_natural_heal_timer_post; - struct HPMHookPoint *HP_status_readdb_job1_pre; - struct HPMHookPoint *HP_status_readdb_job1_post; struct HPMHookPoint *HP_status_readdb_job2_pre; struct HPMHookPoint *HP_status_readdb_job2_post; struct HPMHookPoint *HP_status_readdb_sizefix_pre; @@ -5051,6 +5049,8 @@ struct { struct HPMHookPoint *HP_status_readdb_refine_post; struct HPMHookPoint *HP_status_readdb_scconfig_pre; struct HPMHookPoint *HP_status_readdb_scconfig_post; + struct HPMHookPoint *HP_status_read_job_db_pre; + struct HPMHookPoint *HP_status_read_job_db_post; struct HPMHookPoint *HP_storage_reconnect_pre; struct HPMHookPoint *HP_storage_reconnect_post; struct HPMHookPoint *HP_storage_delitem_pre; @@ -9192,6 +9192,8 @@ struct { int HP_pc_autotrade_prepare_post; int HP_pc_autotrade_populate_pre; int HP_pc_autotrade_populate_post; + int HP_pc_check_job_name_pre; + int HP_pc_check_job_name_post; int HP_pet_init_pre; int HP_pet_init_post; int HP_pet_final_pre; @@ -10182,12 +10184,10 @@ struct { int HP_status_base_amotion_pc_post; int HP_status_base_atk_pre; int HP_status_base_atk_post; - int HP_status_calc_sigma_pre; - int HP_status_calc_sigma_post; - int HP_status_base_pc_maxhp_pre; - int HP_status_base_pc_maxhp_post; - int HP_status_base_pc_maxsp_pre; - int HP_status_base_pc_maxsp_post; + int HP_status_get_base_maxhp_pre; + int HP_status_get_base_maxhp_post; + int HP_status_get_base_maxsp_pre; + int HP_status_get_base_maxsp_post; int HP_status_calc_npc__pre; int HP_status_calc_npc__post; int HP_status_calc_str_pre; @@ -10246,8 +10246,6 @@ struct { int HP_status_natural_heal_post; int HP_status_natural_heal_timer_pre; int HP_status_natural_heal_timer_post; - int HP_status_readdb_job1_pre; - int HP_status_readdb_job1_post; int HP_status_readdb_job2_pre; int HP_status_readdb_job2_post; int HP_status_readdb_sizefix_pre; @@ -10256,6 +10254,8 @@ struct { int HP_status_readdb_refine_post; int HP_status_readdb_scconfig_pre; int HP_status_readdb_scconfig_post; + int HP_status_read_job_db_pre; + int HP_status_read_job_db_post; int HP_storage_reconnect_pre; int HP_storage_reconnect_post; int HP_storage_delitem_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 0b9804a1c..3f0cec7e1 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2025,6 +2025,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->check_job_name, HP_pc_check_job_name) }, /* pet */ { HP_POP(pet->init, HP_pet_init) }, { HP_POP(pet->final, HP_pet_final) }, @@ -2526,9 +2527,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->initDummyData, HP_status_initDummyData) }, { HP_POP(status->base_amotion_pc, HP_status_base_amotion_pc) }, { HP_POP(status->base_atk, HP_status_base_atk) }, - { HP_POP(status->calc_sigma, HP_status_calc_sigma) }, - { HP_POP(status->base_pc_maxhp, HP_status_base_pc_maxhp) }, - { HP_POP(status->base_pc_maxsp, HP_status_base_pc_maxsp) }, + { HP_POP(status->get_base_maxhp, HP_status_get_base_maxhp) }, + { HP_POP(status->get_base_maxsp, HP_status_get_base_maxsp) }, { HP_POP(status->calc_npc_, HP_status_calc_npc_) }, { HP_POP(status->calc_str, HP_status_calc_str) }, { HP_POP(status->calc_agi, HP_status_calc_agi) }, @@ -2558,11 +2558,11 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->display_remove, HP_status_display_remove) }, { HP_POP(status->natural_heal, HP_status_natural_heal) }, { HP_POP(status->natural_heal_timer, HP_status_natural_heal_timer) }, - { HP_POP(status->readdb_job1, HP_status_readdb_job1) }, { HP_POP(status->readdb_job2, HP_status_readdb_job2) }, { HP_POP(status->readdb_sizefix, HP_status_readdb_sizefix) }, { HP_POP(status->readdb_refine, HP_status_readdb_refine) }, { HP_POP(status->readdb_scconfig, HP_status_readdb_scconfig) }, + { HP_POP(status->read_job_db, HP_status_read_job_db) }, /* storage */ { HP_POP(storage->reconnect, HP_storage_reconnect) }, { HP_POP(storage->delitem, HP_storage_delitem) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index aadf7a6f5..1c8b3d17a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -53363,6 +53363,33 @@ void HP_pc_autotrade_populate(struct map_session_data *sd) { } return; } +int HP_pc_check_job_name(const char *name) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_pc_check_job_name_pre ) { + int (*preHookFunc) (const char *name); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_job_name_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pc_check_job_name_pre[hIndex].func; + retVal___ = preHookFunc(name); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.check_job_name(name); + } + if( HPMHooks.count.HP_pc_check_job_name_post ) { + int (*postHookFunc) (int retVal___, const char *name); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_job_name_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pc_check_job_name_post[hIndex].func; + retVal___ = postHookFunc(retVal___, name); + } + } + return retVal___; +} /* pet */ int HP_pet_init(bool minimal) { int hIndex = 0; @@ -66936,40 +66963,14 @@ unsigned short HP_status_base_atk(const struct block_list *bl, const struct stat } return retVal___; } -void HP_status_calc_sigma(void) { - int hIndex = 0; - if( HPMHooks.count.HP_status_calc_sigma_pre ) { - void (*preHookFunc) (void); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_sigma_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_status_calc_sigma_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.status.calc_sigma(); - } - if( HPMHooks.count.HP_status_calc_sigma_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_sigma_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_status_calc_sigma_post[hIndex].func; - postHookFunc(); - } - } - return; -} -unsigned int HP_status_base_pc_maxhp(struct map_session_data *sd, struct status_data *st) { +unsigned int HP_status_get_base_maxhp(struct map_session_data *sd, struct status_data *st) { int hIndex = 0; unsigned int retVal___ = 0; - if( HPMHooks.count.HP_status_base_pc_maxhp_pre ) { + if( HPMHooks.count.HP_status_get_base_maxhp_pre ) { unsigned int (*preHookFunc) (struct map_session_data *sd, struct status_data *st); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_pc_maxhp_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_status_base_pc_maxhp_pre[hIndex].func; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxhp_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_status_get_base_maxhp_pre[hIndex].func; retVal___ = preHookFunc(sd, st); } if( *HPMforce_return ) { @@ -66978,25 +66979,25 @@ unsigned int HP_status_base_pc_maxhp(struct map_session_data *sd, struct status_ } } { - retVal___ = HPMHooks.source.status.base_pc_maxhp(sd, st); + retVal___ = HPMHooks.source.status.get_base_maxhp(sd, st); } - if( HPMHooks.count.HP_status_base_pc_maxhp_post ) { + if( HPMHooks.count.HP_status_get_base_maxhp_post ) { unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd, struct status_data *st); - for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_pc_maxhp_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_status_base_pc_maxhp_post[hIndex].func; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxhp_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_status_get_base_maxhp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, st); } } return retVal___; } -unsigned int HP_status_base_pc_maxsp(struct map_session_data *sd, struct status_data *st) { +unsigned int HP_status_get_base_maxsp(struct map_session_data *sd, struct status_data *st) { int hIndex = 0; unsigned int retVal___ = 0; - if( HPMHooks.count.HP_status_base_pc_maxsp_pre ) { + if( HPMHooks.count.HP_status_get_base_maxsp_pre ) { unsigned int (*preHookFunc) (struct map_session_data *sd, struct status_data *st); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_pc_maxsp_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_status_base_pc_maxsp_pre[hIndex].func; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxsp_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_status_get_base_maxsp_pre[hIndex].func; retVal___ = preHookFunc(sd, st); } if( *HPMforce_return ) { @@ -67005,12 +67006,12 @@ unsigned int HP_status_base_pc_maxsp(struct map_session_data *sd, struct status_ } } { - retVal___ = HPMHooks.source.status.base_pc_maxsp(sd, st); + retVal___ = HPMHooks.source.status.get_base_maxsp(sd, st); } - if( HPMHooks.count.HP_status_base_pc_maxsp_post ) { + if( HPMHooks.count.HP_status_get_base_maxsp_post ) { unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd, struct status_data *st); - for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_pc_maxsp_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_status_base_pc_maxsp_post[hIndex].func; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxsp_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_status_get_base_maxsp_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, st); } } @@ -67802,33 +67803,6 @@ int HP_status_natural_heal_timer(int tid, int64 tick, int id, intptr_t data) { } return retVal___; } -bool HP_status_readdb_job1(char *fields[], int columns, int current) { - int hIndex = 0; - bool retVal___ = false; - if( HPMHooks.count.HP_status_readdb_job1_pre ) { - bool (*preHookFunc) (char *fields[], int *columns, int *current); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_job1_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_status_readdb_job1_pre[hIndex].func; - retVal___ = preHookFunc(fields, &columns, ¤t); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.status.readdb_job1(fields, columns, current); - } - if( HPMHooks.count.HP_status_readdb_job1_post ) { - bool (*postHookFunc) (bool retVal___, char *fields[], int *columns, int *current); - for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_job1_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_status_readdb_job1_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fields, &columns, ¤t); - } - } - return retVal___; -} bool HP_status_readdb_job2(char *fields[], int columns, int current) { int hIndex = 0; bool retVal___ = false; @@ -67937,6 +67911,32 @@ bool HP_status_readdb_scconfig(char *fields[], int columns, int current) { } return retVal___; } +void HP_status_read_job_db(void) { + int hIndex = 0; + if( HPMHooks.count.HP_status_read_job_db_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_read_job_db_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_status_read_job_db_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.status.read_job_db(); + } + if( HPMHooks.count.HP_status_read_job_db_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_status_read_job_db_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_status_read_job_db_post[hIndex].func; + postHookFunc(); + } + } + return; +} /* storage */ void HP_storage_reconnect(void) { int hIndex = 0; |