summaryrefslogtreecommitdiff
path: root/src/map/homunculus.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-09-22 16:36:01 +0200
committerGitHub <noreply@github.com>2019-09-22 16:36:01 +0200
commita51b2d2093826eca6f813570876e40768581da9b (patch)
tree02fdb32184ca9a82efc748e38a56c8bf4b4104c7 /src/map/homunculus.c
parent6dbabae7003990369d1c9ce965c3c4409c879499 (diff)
parent523f76a74a48374416065ca02520554eac4ba198 (diff)
downloadhercules-a51b2d2093826eca6f813570876e40768581da9b.tar.gz
hercules-a51b2d2093826eca6f813570876e40768581da9b.tar.bz2
hercules-a51b2d2093826eca6f813570876e40768581da9b.tar.xz
hercules-a51b2d2093826eca6f813570876e40768581da9b.zip
Merge pull request #2528 from 4144/updatepackets
Update packets up to 2019-08-28
Diffstat (limited to 'src/map/homunculus.c')
-rw-r--r--src/map/homunculus.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index 31744f479..bb940fd44 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -525,6 +525,21 @@ static bool homunculus_mutate(struct homun_data *hd, int homun_id)
return true;
}
+static int homunculus_gainexp_real(struct homun_data *hd, unsigned int exp)
+{
+ nullpo_ret(hd);
+ nullpo_ret(hd->master);
+
+ hd->homunculus.exp += exp;
+
+ if (hd->master->state.showexp && hd->exp_next > 0) {
+ char output[256];
+ sprintf(output, msg_fd(hd->master->fd, 449), exp, ((float)exp / (float)hd->exp_next * (float)100));
+ clif_disp_onlyself(hd->master, output);
+ }
+ return 1;
+}
+
static int homunculus_gainexp(struct homun_data *hd, unsigned int exp)
{
enum homun_type htype;
@@ -550,16 +565,10 @@ static int homunculus_gainexp(struct homun_data *hd, unsigned int exp)
break;
}
- hd->homunculus.exp += exp;
-
- if (hd->master->state.showexp && hd->exp_next > 0) {
- char output[256];
- sprintf(output, "Homunculus Experience Gained Base:%u (%.2f%%)", exp, ((float)exp / (float)hd->exp_next * (float)100));
- clif_disp_onlyself(hd->master, output);
- }
+ homun->gainexp_real(hd, exp);
- if(hd->homunculus.exp < hd->exp_next) {
- clif->hominfo(hd->master,hd,0);
+ if (hd->homunculus.exp < hd->exp_next) {
+ clif->hominfo(hd->master, hd, 0);
return 0;
}
@@ -1439,6 +1448,7 @@ void homunculus_defaults(void)
homun->evolve = homunculus_evolve;
homun->mutate = homunculus_mutate;
homun->gainexp = homunculus_gainexp;
+ homun->gainexp_real = homunculus_gainexp_real;
homun->add_intimacy = homunculus_add_intimacy;
homun->consume_intimacy = homunculus_consume_intimacy;
homun->healed = homunculus_healed;