version 1.37 | | version 1.38 |
---|
| | |
/* | | /* |
* static char *rcsid_living_c = | | * static char *rcsid_living_c = |
* "$Id: living.c,v 1.37 2002/07/15 04:57:11 mwedel Exp $"; | | * "$Id: living.c,v 1.38 2002/09/11 06:21:46 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
#define MAX_EXP_IN_OBJ levels[MAXLEVEL]/(MAX_EXP_CAT - 1) | | #define MAX_EXP_IN_OBJ levels[MAXLEVEL]/(MAX_EXP_CAT - 1) |
| | |
static uint32 levels[MAXLEVEL+1]={ | | |
0, | | extern uint32 levels[MAXLEVEL+1]; |
0,1000,2000,4000, 8000, | | |
16000,32000,64000,125000,250000, /* 10 */ | | |
500000,900000,1400000,2000000,2600000, | | |
3300000,4100000,4900000,5700000,6600000, /* 20 */ | | |
7500000,8400000,9300000,10300000,11300000, | | |
12300000,13300000,14400000,15500000,16600000, /* 30 */ | | |
17700000,18800000,19900000,21100000,22300000, | | |
23500000,24700000,25900000,27100000,28300000, /* 40 */ | | |
29500000,30800000,32100000,33400000,34700000, | | |
36000000,37300000,38600000,39900000,41200000, /* 50 */ | | |
42600000,44000000,45400000,46800000,48200000, | | |
49600000,51000000,52400000,53800000,55200000, /* 60 */ | | |
56600000,58000000,59400000,60800000,62200000, | | |
63700000,65200000,66700000,68200000,69700000, /* 70 */ | | |
71200000,72700000,74200000,75700000,77200000, | | |
78700000,80200000,81700000,83200000,84700000, /* 80 */ | | |
86200000,87700000,89300000,90900000,92500000, | | |
94100000,95700000,97300000,98900000,100500000, /* 90 */ | | |
102100000,103700000,105300000,106900000,108500000, | | |
110100000,111700000,113300000,114900000,116500000, /* 100 */ | | |
118100000,119700000,121300000,122900000,124500000, | | |
126100000,127700000,129300000,130900000,785400000 /* 110 */}; | | |
| | |
static uint32 new_levels[MAXLEVEL+1]={ | | |
0, | | |
0,2000,4000, 8000, | | |
16000,32000,64000,125000,250000, /* 9 */ | | |
500000,900000,1400000,2000000,2600000, | | |
3300000,4100000,4900000,5700000,6600000, /* 19 */ | | |
7500000,8400000,9300000,10300000,11300000, | | |
12300000,13300000,14400000,15500000,16600000, /* 29 */ | | |
17700000,18800000,19900000,21100000,22300000, | | |
23500000,24700000,25900000,27100000,28300000, /* 39 */ | | |
29500000,30800000,32100000,33400000,34700000, | | |
36000000,37300000,38600000,39900000,41200000, /* 49 */ | | |
42600000,44000000,45400000,46800000,48200000, | | |
49600000,51000000,52400000,53800000,55200000, /* 59 */ | | |
56600000,58000000,59400000,60800000,62200000, | | |
63700000,65200000,66700000,68200000,69700000, /* 69 */ | | |
71200000,72700000,74200000,75700000,77200000, | | |
78700000,80200000,81700000,83200000,84700000, /* 79 */ | | |
86200000,87700000,89300000,90900000,92500000, | | |
94100000,95700000,97300000,98900000,100500000, /* 89 */ | | |
102100000,103700000,105300000,106900000,108500000, | | |
110100000,111700000,113300000,114900000,116500000, /* 99 */ | | |
118100000,119700000,121300000,122900000,124500000, | | |
126100000,127700000,129300000,130900000,785400000, | | |
1570800000 /* 110 */ | | |
}; | | |
| | |
/* Max level is 100. By making it 101, it means values 0->100 are valid. | | /* Max level is 100. By making it 101, it means values 0->100 are valid. |
* Thus, we can use op->level directly, and it also works for level 0 people. | | * Thus, we can use op->level directly, and it also works for level 0 people. |
| | |
static long int bleep=1650000; | | static long int bleep=1650000; |
| | |
if(level<=100) { | | if(level<=100) { |
if (settings.simple_exp) { | | |
return expmul * new_levels[level]; | | |
} else { | | |
return expmul * levels[level]; | | return expmul * levels[level]; |
} | | } |
} | | |
| | |
/* return required_exp; */ | | /* return required_exp; */ |
if (settings.simple_exp) { | | |
return expmul*(new_levels[100]+bleep*(level-100)); | | |
} else { | | |
return expmul*(levels[100]+bleep*(level-100)); | | return expmul*(levels[100]+bleep*(level-100)); |
} | | } |
} | | |
| | |
/* add_exp() - new algorithm. Revamped experience gain/loss routine. | | /* add_exp() - new algorithm. Revamped experience gain/loss routine. |
* Based on the old add_exp() function - but tailored to add experience | | * Based on the old add_exp() function - but tailored to add experience |
| | |
*/ | | */ |
| | |
if(exp_ob->level < MAXLEVEL) { | | if(exp_ob->level < MAXLEVEL) { |
if (settings.simple_exp) { | | |
limit=(new_levels[exp_ob->level+1]-new_levels[exp_ob->level])/2; | | |
} else { | | |
limit=(levels[exp_ob->level+1]-levels[exp_ob->level])/2; | | limit=(levels[exp_ob->level+1]-levels[exp_ob->level])/2; |
} | | |
if (exp > limit) exp=limit; | | if (exp > limit) exp=limit; |
} else { /* there is no going any higher! */ | | } else { /* there is no going any higher! */ |
return; | | return; |
| | |
if(tmp->type==EXPERIENCE && tmp->stats.exp) { | | if(tmp->type==EXPERIENCE && tmp->stats.exp) { |
exp_ob = tmp; | | exp_ob = tmp; |
loss_20p = exp_ob->stats.exp * 0.20; | | loss_20p = exp_ob->stats.exp * 0.20; |
loss_3l = exp_ob->stats.exp - new_levels[MAX(0,exp_ob->level -3)]; | | loss_3l = exp_ob->stats.exp - levels[MAX(0,exp_ob->level -3)]; |
if(loss_3l < loss_20p) | | if(loss_3l < loss_20p) |
del_exp+=adjust_exp(exp_ob,-loss_3l); | | del_exp+=adjust_exp(exp_ob,-loss_3l); |
else | | else |