summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-09 17:26:55 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-09 17:26:55 +0000
commit3a562499db31496d4595910760560743d55b478f (patch)
tree21fadbbf4e85cbfde48fbeac30b76171a3ebbef5 /src/map/pc.c
parent97ef7dfb68da9a3abccb78add4666c648c668884 (diff)
downloadhercules-3a562499db31496d4595910760560743d55b478f.tar.gz
hercules-3a562499db31496d4595910760560743d55b478f.tar.bz2
hercules-3a562499db31496d4595910760560743d55b478f.tar.xz
hercules-3a562499db31496d4595910760560743d55b478f.zip
- Added setting max_exp_gain_rate which caps how much exp you can get from a single kill.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5239 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 66a14f9db..2d55bb46c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4711,13 +4711,30 @@ int pc_gainexp(struct map_session_data *sd,unsigned int base_exp,unsigned int jo
base_exp-=guild_payexp(sd,base_exp);
}
- if(sd->state.showexp){
- nextb = pc_nextbaseexp(sd);
- nextj = pc_nextjobexp(sd);
+ nextb = pc_nextbaseexp(sd);
+ nextj = pc_nextjobexp(sd);
+
+
+ if(sd->state.showexp || battle_config.max_exp_gain_rate){
if (nextb > 0)
nextbp = (float) base_exp / (float) nextb;
if (nextj > 0)
nextjp = (float) job_exp / (float) nextj;
+
+ if(battle_config.max_exp_gain_rate) {
+ if (nextbp > battle_config.max_exp_gain_rate/1000.) {
+ //Note that this value should never be greater than the original
+ //base_exp, therefore no overflow checks are needed. [Skotlex]
+ base_exp = (unsigned int)(battle_config.max_exp_gain_rate/1000.*nextb);
+ if (sd->state.showexp)
+ nextbp = (float) base_exp / (float) nextb;
+ }
+ if (nextjp > battle_config.max_exp_gain_rate/1000.) {
+ job_exp = (unsigned int)(battle_config.max_exp_gain_rate/1000.*nextj);
+ if (sd->state.showexp)
+ nextjp = (float) job_exp / (float) nextj;
+ }
+ }
}
//Overflow checks... think we'll ever really need'em? [Skotlex]