diff options
author | Wushin <pasekei@gmail.com> | 2015-04-20 19:43:52 -0500 |
---|---|---|
committer | Wushin <pasekei@gmail.com> | 2015-04-20 19:43:52 -0500 |
commit | b5397537f0672892ce628e2d9398abfd1d6fa724 (patch) | |
tree | cf81c681a1b905610e401005998b24ef39ac55e2 /src/map/pc.cpp | |
parent | 07a9d90e699f613ec97273a741811123247b2029 (diff) | |
parent | 6de4da6e4aaf636b0047bc462628917ebeb344f3 (diff) | |
download | tmwa-b5397537f0672892ce628e2d9398abfd1d6fa724.tar.gz tmwa-b5397537f0672892ce628e2d9398abfd1d6fa724.tar.bz2 tmwa-b5397537f0672892ce628e2d9398abfd1d6fa724.tar.xz tmwa-b5397537f0672892ce628e2d9398abfd1d6fa724.zip |
Merge pull request #55 from wushin/Double-Xp-On-Demand
Enable Dynamic Double Xp
Diffstat (limited to 'src/map/pc.cpp')
-rw-r--r-- | src/map/pc.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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<map_session_data> sd, int base_exp, int job_exp, } } + // Double Xp Weekends + base_exp = (base_exp * static_cast<double>(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<map_session_data> 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<map_session_data> sd, int base_exp, int job_exp, } } + // Double Xp Weekends + job_exp = (job_exp * static_cast<double>(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; |