Added multi level up level caps (#3646)

This commit is contained in:
Lemongrass3110 2018-11-01 23:47:45 +01:00 committed by GitHub
parent a7d8fbae14
commit a47e6cb427
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 2 deletions

View File

@ -18,6 +18,12 @@ job_exp_rate: 100
// Turn this on to allow a player to level up more than once from a kill. (Note 1)
multi_level_up: no
// Allow multi level up until a certain level?
// This only triggers if multi_level_up is enabled.
// Default: 0 (Unlimited)
multi_level_up_base: 0
multi_level_up_job: 0
// Setting this can cap the max experience one can get per kill specified as a
// % of the current exp bar. (Every 10 = 1.0%)
// For example, set it to 500 and no matter how much exp the mob gives,

View File

@ -8256,6 +8256,8 @@ static const struct _battle_data {
{ "manner_system", &battle_config.manner_system, 0xFFF, 0, 0xFFF, },
{ "pet_equip_required", &battle_config.pet_equip_required, 0, 0, 1, },
{ "multi_level_up", &battle_config.multi_level_up, 0, 0, 1, },
{ "multi_level_up_base", &battle_config.multi_level_up_base, 0, 0, MAX_LEVEL, },
{ "multi_level_up_job", &battle_config.multi_level_up_job, 0, 0, MAX_LEVEL, },
{ "max_exp_gain_rate", &battle_config.max_exp_gain_rate, 0, 0, INT_MAX, },
{ "backstab_bow_penalty", &battle_config.backstab_bow_penalty, 0, 0, 1, },
{ "night_at_start", &battle_config.night_at_start, 0, 0, 1, },

View File

@ -352,6 +352,8 @@ struct Battle_Config
int equip_self_break_rate; //Natural & Penalty skills break rate
int equip_skill_break_rate; //Offensive skills break rate
int multi_level_up;
int multi_level_up_base;
int multi_level_up_job;
int max_exp_gain_rate; //Max amount of exp bar % you can get in one go.
int pk_mode;
int pk_mode_mes;

View File

@ -6565,7 +6565,7 @@ int pc_checkbaselevelup(struct map_session_data *sd) {
do {
sd->status.base_exp -= next;
//Kyoki pointed out that the max overcarry exp is the exp needed for the previous level -1. [Skotlex]
if(!battle_config.multi_level_up && sd->status.base_exp > next-1)
if( ( !battle_config.multi_level_up || ( battle_config.multi_level_up_base > 0 && sd->status.base_level >= battle_config.multi_level_up_base ) ) && sd->status.base_exp > next-1 )
sd->status.base_exp = next-1;
next = pc_gets_status_point(sd->status.base_level);
@ -6634,7 +6634,7 @@ int pc_checkjoblevelup(struct map_session_data *sd)
do {
sd->status.job_exp -= next;
//Kyoki pointed out that the max overcarry exp is the exp needed for the previous level -1. [Skotlex]
if(!battle_config.multi_level_up && sd->status.job_exp > next-1)
if( ( !battle_config.multi_level_up || ( battle_config.multi_level_up_job > 0 && sd->status.job_level >= battle_config.multi_level_up_job ) ) && sd->status.job_exp > next-1 )
sd->status.job_exp = next-1;
sd->status.job_level ++;