Converted penalty db to YAML (#5562)

Fixes #5463

Added penalty for MVP exp and MVP drops
Removed penalty support for monster classes

Thanks to @attackjom and @aleos89
This commit is contained in:
Lemongrass3110
2020-11-21 01:05:07 +01:00
committed by GitHub
parent c349c82f60
commit 81e7d8ef89
14 changed files with 455 additions and 144 deletions

View File

@@ -2713,7 +2713,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if(base_exp || job_exp) {
if( md->dmglog[i].flag != MDLF_PET || battle_config.pet_attack_exp_to_master ) {
#ifdef RENEWAL_EXP
int rate = pc_level_penalty_mod(md->level - tmpsd[i]->status.base_level, md->status.class_, md->status.mode, 1);
int rate = pc_level_penalty_mod( tmpsd[i], PENALTY_EXP, nullptr, md );
if (rate != 100) {
if (base_exp)
base_exp = (unsigned int)cap_value(apply_rate(base_exp, rate), 1, UINT_MAX);
@@ -2748,10 +2748,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
struct item_data* it = NULL;
int drop_rate;
#ifdef RENEWAL_DROP
int drop_modifier = mvp_sd ? pc_level_penalty_mod(md->level - mvp_sd->status.base_level, md->status.class_, md->status.mode, 2) :
second_sd ? pc_level_penalty_mod(md->level - second_sd->status.base_level, md->status.class_, md->status.mode, 2):
third_sd ? pc_level_penalty_mod(md->level - third_sd->status.base_level, md->status.class_, md->status.mode, 2) :
100; // No player was attached, we don't use any modifier (100 = rates are not touched)
int drop_modifier = pc_level_penalty_mod( mvp_sd != nullptr ? mvp_sd : second_sd != nullptr ? second_sd : third_sd, PENALTY_DROP, nullptr, md );
#endif
dlist->m = md->bl.m;
dlist->x = md->bl.x;
@@ -2931,6 +2928,13 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
exp =1;
else {
exp = md->db->mexp;
#if defined(RENEWAL_EXP)
int penalty = pc_level_penalty_mod( mvp_sd, PENALTY_MVP_EXP, nullptr, md );
exp = cap_value( apply_rate( exp, penalty ), 0, MAX_EXP );
#endif
if (count > 1)
exp += exp*(battle_config.exp_bonus_attacker*(count-1))/100.; //[Gengar]
}
@@ -2968,6 +2972,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
}
#if defined(RENEWAL_DROP)
int penalty = pc_level_penalty_mod( mvp_sd, PENALTY_MVP_DROP, nullptr, md );
#endif
for(i = 0; i < MAX_MVP_DROP_TOTAL; i++) {
struct item_data *i_data;
@@ -2975,6 +2983,11 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
continue;
temp = mdrop[i].rate;
#if defined(RENEWAL_DROP)
temp = cap_value( apply_rate( temp, penalty ), 0, 10000 );
#endif
if (temp != 10000) {
if(temp <= 0 && !battle_config.drop_rate0item)
temp = 1;