From 31ed4cbe1a9fc11a914952f832719e458c8ceb9c Mon Sep 17 00:00:00 2001 From: dastgir Date: Fri, 27 Feb 2015 05:20:12 -0500 Subject: Additional Status Calculation for Plugins. --- src/map/status.c | 8 ++++++++ src/map/status.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/map/status.c b/src/map/status.c index 7985e58c6..16f5f3906 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2149,6 +2149,11 @@ unsigned int status_base_pc_maxsp(struct map_session_data* sd, struct status_dat return (unsigned int)cap_value(val,0,UINT_MAX); } +void status_calc_pc_additional(struct map_session_data* sd, enum e_status_calc_opt opt) { + /* Just used for Plugin to give bonuses. */ + return; +} + //Calculates player data from scratch without counting SC adjustments. //Should be invoked whenever players raise stats, learn passive skills or change equipment. int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { @@ -2530,6 +2535,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { if( data && data->script ) script->run(data->script,0,sd->bl.id,0); } + + status->calc_pc_additional(sd, opt); if( sd->pd ) { // Pet Bonus struct pet_data *pd = sd->pd; @@ -12319,6 +12326,7 @@ void status_defaults(void) { status->calc_mob_ = status_calc_mob_; status->calc_pet_ = status_calc_pet_; status->calc_pc_ = status_calc_pc_; + status->calc_pc_additional = status_calc_pc_additional; status->calc_homunculus_ = status_calc_homunculus_; status->calc_mercenary_ = status_calc_mercenary_; status->calc_elemental_ = status_calc_elemental_; diff --git a/src/map/status.h b/src/map/status.h index f281a4d08..1a8d7ef51 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -2055,6 +2055,7 @@ struct status_interface { int (*calc_mob_) (struct mob_data* md, enum e_status_calc_opt opt); int (*calc_pet_) (struct pet_data* pd, enum e_status_calc_opt opt); int (*calc_pc_) (struct map_session_data* sd, enum e_status_calc_opt opt); + void (*calc_pc_additional) (struct map_session_data* sd, enum e_status_calc_opt opt); int (*calc_homunculus_) (struct homun_data *hd, enum e_status_calc_opt opt); int (*calc_mercenary_) (struct mercenary_data *md, enum e_status_calc_opt opt); int (*calc_elemental_) (struct elemental_data *ed, enum e_status_calc_opt opt); -- cgit v1.2.3-70-g09d2