From 6de4da6e4aaf636b0047bc462628917ebeb344f3 Mon Sep 17 00:00:00 2001 From: wushin Date: Sun, 19 Apr 2015 11:03:31 -0500 Subject: Dynamic Xp percentage command @exprate --- src/map/pc.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/map/pc.cpp') diff --git a/src/map/pc.cpp b/src/map/pc.cpp index e73d79f..1e840ea 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -2883,6 +2883,12 @@ int pc_gainexp_reason(dumb_ptr sd, int base_exp, int job_exp, } } + // Double Xp Weekends + base_exp = (base_exp * static_cast(battle_config.base_exp_rate) / 100.); + if (base_exp <= 0) + base_exp = 0; + else if (base_exp > 1000000000) + base_exp = 1000000000; sd->status.base_exp += base_exp; // [Fate] Adjust experience points that healers can extract from this character @@ -2890,7 +2896,6 @@ int pc_gainexp_reason(dumb_ptr sd, int base_exp, int job_exp, { const int max_heal_xp = 20 + (sd->status.base_level * sd->status.base_level); - sd->heal_xp += base_exp; if (sd->heal_xp > max_heal_xp) sd->heal_xp = max_heal_xp; @@ -2913,6 +2918,12 @@ int pc_gainexp_reason(dumb_ptr sd, int base_exp, int job_exp, } } + // Double Xp Weekends + job_exp = (job_exp * static_cast(battle_config.job_exp_rate) / 100.); + if (job_exp <= 0) + job_exp = 0; + else if (job_exp > 1000000000) + job_exp = 1000000000; sd->status.job_exp += job_exp; if (sd->status.job_exp < 0) sd->status.job_exp = 0; -- cgit v1.2.3-60-g2f50