summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/pc.c27
-rw-r--r--src/emap/status.c7
2 files changed, 20 insertions, 14 deletions
diff --git a/src/emap/pc.c b/src/emap/pc.c
index 92f0f27..7cf35e1 100644
--- a/src/emap/pc.c
+++ b/src/emap/pc.c
@@ -1108,28 +1108,30 @@ int epc_bonus_preHook(struct map_session_data **sd, int *type, int *val)
// int bHomunculusAtk = -1;
if (*type == bHomunculusAtkID) {
- struct s_homunculus_atk *data;
+ struct s_homunculus_atk *hdatk;
- if ((data = getFromMSD(*sd, 0)) == NULL) { /* don't have, create */
- CREATE(data, struct s_homunculus_atk, 1); /* alloc */
- data->rate = 0; /* default */
- addToMSD(*sd, data, 0, true); /* link to sd */
+ if ((hdatk = getFromMSD(*sd, 0)) == NULL) { /* don't have, create */
+ CREATE(hdatk, struct s_homunculus_atk, 1); /* alloc */
+ hdatk->rate = 0; /* default */
+ addToMSD(*sd, hdatk, 0, true); /* link to sd */
}
- data->rate += *val;
+ hdatk->rate += *val;
+ ShowDebug("ATK Bonus found (%d)\n", hdatk->rate);
hookStop(); /* don't need to run the original */
}
// int bHomunculusDef = -1;
if (*type == bHomunculusDefID) {
- struct s_homunculus_def *data;
+ struct s_homunculus_def *hddef;
- if ((data = getFromMSD(*sd, 0)) == NULL) {
- CREATE(data, struct s_homunculus_def, 1);
- data->rate = 0;
- addToMSD(*sd, data, 0, true);
+ if ((hddef = getFromMSD(*sd, 0)) == NULL) {
+ CREATE(hddef, struct s_homunculus_def, 1);
+ hddef->rate = 0;
+ addToMSD(*sd, hddef, 0, true);
}
- data->rate += *val;
+ hddef->rate += *val;
+ ShowDebug("DEF Bonus found (%d)\n", hddef->rate);
hookStop();
}
@@ -1144,6 +1146,7 @@ int epc_bonus_preHook(struct map_session_data **sd, int *type, int *val)
addToMSD(*sd, data, 0, true);
}
data->rate += *val;
+ ShowDebug("MHP Bonus found (%d)\n", data->rate);
hookStop();
}
diff --git a/src/emap/status.c b/src/emap/status.c
index eead81f..2ab6b97 100644
--- a/src/emap/status.c
+++ b/src/emap/status.c
@@ -299,19 +299,22 @@ int estatus_calc_homunculus_postHook(int retVal, struct homun_data *hd, enum e_s
// Bonus (not capped, BEWARE)
const struct s_homunculus_atk *hdatk;
- const struct s_homunculus_def *hddef;
- const struct s_homunculus_maxhp *hdmaxhp;
if ((hdatk = getFromMSD(sd,0)) != NULL) {
hd->battle_status.rhw.atk+=hdatk->rate;
+ ShowDebug("ATK Bonus applied (now %u)\n", hd->battle_status.rhw.atk);
}
+ const struct s_homunculus_def *hddef;
if ((hddef = getFromMSD(sd,0)) != NULL) {
hd->battle_status.def+=hddef->rate;
+ ShowDebug("DEF Bonus applied (now %d)\n", hd->battle_status.def);
}
+ const struct s_homunculus_maxhp *hdmaxhp;
if ((hdmaxhp = getFromMSD(sd,0)) != NULL) {
hd->battle_status.max_hp+=hdmaxhp->rate;
+ ShowDebug("MHP Bonus applied (now %u)\n", hd->battle_status.max_hp);
}
// We're done