summaryrefslogtreecommitdiff
path: root/src/map/pc.cpp
diff options
context:
space:
mode:
authorwushin <pasekei@gmail.com>2015-04-19 11:03:31 -0500
committerwushin <pasekei@gmail.com>2015-04-19 11:14:55 -0500
commit6de4da6e4aaf636b0047bc462628917ebeb344f3 (patch)
tree151238b7a32bb2f0d488ab109c29eefadeec157c /src/map/pc.cpp
parent0b04c49460a2e0c894c818ae190465fc2607bca8 (diff)
downloadtmwa-6de4da6e4aaf636b0047bc462628917ebeb344f3.tar.gz
tmwa-6de4da6e4aaf636b0047bc462628917ebeb344f3.tar.bz2
tmwa-6de4da6e4aaf636b0047bc462628917ebeb344f3.tar.xz
tmwa-6de4da6e4aaf636b0047bc462628917ebeb344f3.zip
Dynamic Xp percentage command @exprate
Diffstat (limited to 'src/map/pc.cpp')
-rw-r--r--src/map/pc.cpp13
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;