Skip to content
Permalink
Browse files

Merge pull request #2507 from Emistry/homun_exp

Update Homunculus obtain EXP from master
  • Loading branch information...
MishimaHaruna committed Jul 28, 2019
2 parents 1fe63a8 + 5ac507e commit cd04fd96954ccb9fbbe33d05ad1eb3e2f7ce98c5
Showing with 16 additions and 0 deletions.
  1. +3 −0 conf/map/battle/homunc.conf
  2. +1 −0 src/map/battle.c
  3. +1 −0 src/map/battle.h
  4. +6 −0 src/map/homunculus.c
  5. +5 −0 src/map/pc.c
@@ -66,3 +66,6 @@ homunculus_max_level: 99

// Max level for Homunculus S
homunculus_S_max_level: 150

// Bonus EXP homunculus received from master? (Note 2)
hom_bonus_exp_from_master: 10
@@ -7449,6 +7449,7 @@ static const struct battle_data {
{ "hit_min_limit", &battle_config.hit_min, 1, 1, INT_MAX, },
{ "hit_max_limit", &battle_config.hit_max, SHRT_MAX, 1, INT_MAX, },
{ "autoloot_adjust", &battle_config.autoloot_adjust, 0, 0, 1, },
{ "hom_bonus_exp_from_master", &battle_config.hom_bonus_exp_from_master, 10, 0, 100, },
};

static bool battle_set_value_sub(int index, int value)
@@ -478,6 +478,7 @@ struct Battle_Config {
int client_emblem_max_blank_percent;
int hom_max_level;
int hom_S_max_level;
int hom_bonus_exp_from_master;

// [BattleGround Settings]
int bg_update_interval;
@@ -552,6 +552,12 @@ static int homunculus_gainexp(struct homun_data *hd, unsigned int exp)

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);
}

if(hd->homunculus.exp < hd->exp_next) {
clif->hominfo(hd->master,hd,0);
return 0;
@@ -7143,6 +7143,11 @@ static bool pc_gainexp(struct map_session_data *sd, struct block_list *src, uint
clif_disp_onlyself(sd, output);
}

// Share master EXP to homunculus
if (sd->hd != NULL && battle_config.hom_bonus_exp_from_master > 0) {
homun->gainexp(sd->hd, apply_percentrate((int)base_exp, battle_config.hom_bonus_exp_from_master, 100));
}

return true;
}

0 comments on commit cd04fd9

Please sign in to comment.
You can’t perform that action at this time.