summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordastgir <dastgirpojee@rocketmail.com>2015-02-27 05:20:12 -0500
committerDastgir <dastgirpojee@rocketmail.com>2015-08-09 13:49:47 +0530
commit31ed4cbe1a9fc11a914952f832719e458c8ceb9c (patch)
treedb93abe1395e31aeeb33421bacfa637c08745480 /src
parentc13095dc4b1308a7e3391dc93a1c678670a80ed3 (diff)
downloadhercules-31ed4cbe1a9fc11a914952f832719e458c8ceb9c.tar.gz
hercules-31ed4cbe1a9fc11a914952f832719e458c8ceb9c.tar.bz2
hercules-31ed4cbe1a9fc11a914952f832719e458c8ceb9c.tar.xz
hercules-31ed4cbe1a9fc11a914952f832719e458c8ceb9c.zip
Additional Status Calculation for Plugins.
Diffstat (limited to 'src')
-rw-r--r--src/map/status.c8
-rw-r--r--src/map/status.h1
2 files changed, 9 insertions, 0 deletions
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);