Skip to content

Commit

Permalink
Merge pull request #2507 from Emistry/homun_exp
Browse files Browse the repository at this point in the history
Update Homunculus obtain EXP from master
  • Loading branch information
MishimaHaruna committed Jul 28, 2019
2 parents 1fe63a8 + 5ac507e commit cd04fd9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conf/map/battle/homunc.conf
Expand Up @@ -66,3 +66,6 @@ homunculus_max_level: 99


// Max level for Homunculus S // Max level for Homunculus S
homunculus_S_max_level: 150 homunculus_S_max_level: 150

// Bonus EXP homunculus received from master? (Note 2)
hom_bonus_exp_from_master: 10
1 change: 1 addition & 0 deletions src/map/battle.c
Expand Up @@ -7449,6 +7449,7 @@ static const struct battle_data {
{ "hit_min_limit", &battle_config.hit_min, 1, 1, INT_MAX, }, { "hit_min_limit", &battle_config.hit_min, 1, 1, INT_MAX, },
{ "hit_max_limit", &battle_config.hit_max, SHRT_MAX, 1, INT_MAX, }, { "hit_max_limit", &battle_config.hit_max, SHRT_MAX, 1, INT_MAX, },
{ "autoloot_adjust", &battle_config.autoloot_adjust, 0, 0, 1, }, { "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) static bool battle_set_value_sub(int index, int value)
Expand Down
1 change: 1 addition & 0 deletions src/map/battle.h
Expand Up @@ -478,6 +478,7 @@ struct Battle_Config {
int client_emblem_max_blank_percent; int client_emblem_max_blank_percent;
int hom_max_level; int hom_max_level;
int hom_S_max_level; int hom_S_max_level;
int hom_bonus_exp_from_master;


// [BattleGround Settings] // [BattleGround Settings]
int bg_update_interval; int bg_update_interval;
Expand Down
6 changes: 6 additions & 0 deletions src/map/homunculus.c
Expand Up @@ -552,6 +552,12 @@ static int homunculus_gainexp(struct homun_data *hd, unsigned int exp)


hd->homunculus.exp += 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) { if(hd->homunculus.exp < hd->exp_next) {
clif->hominfo(hd->master,hd,0); clif->hominfo(hd->master,hd,0);
return 0; return 0;
Expand Down
5 changes: 5 additions & 0 deletions src/map/pc.c
Expand Up @@ -7143,6 +7143,11 @@ static bool pc_gainexp(struct map_session_data *sd, struct block_list *src, uint
clif_disp_onlyself(sd, output); 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; return true;
} }


Expand Down

0 comments on commit cd04fd9

Please sign in to comment.