101 double att_mult, prot_mult, spec_mult;
106 att_mult = prot_mult = spec_mult = 1.0;
135 exp =
MAX(
ob->stats.maxhp, 5);
137 exp *= (80.0/(70.0+
ob->stats.wc))*(80.0/(70.0+
ob->stats.ac))*(50.0+
ob->stats.dam)/50.0;
138 exp *= att_mult*prot_mult*spec_mult;
140 exp *= 2.0/(2.0-
FABS(
ob->speed));
141 exp *= (20.0+
ob->stats.Con)/20.0;
170 int64_t lastexp = -1, tmpexp;
174 if ((fp = fopen(
buf,
"r")) == NULL) {
175 LOG(
llevError,
"Fatal error: could not open experience table (%s)\n",
buf);
183 if ((cp = strrchr(
buf,
'\n')) != NULL)
188 while (isspace(*cp) && *cp != 0)
190 if ( *cp == 0 )
continue;
193 if (!strncasecmp(cp,
"max_level", 9)) {
195 LOG(
llevDebug,
"Got more than one max_level value from exp_table file?\n");
198 int ml = atoi(cp + 9);
199 if (ml <= 0 || ml > 10000) {
200 LOG(
llevError,
"max_level must be between 1 and 10000\n");
206 while (isdigit(*cp) && *cp != 0) {
208 LOG(
llevError,
"max_level is not set in exp_table file. Did you remember to update it?\n");
216 if (tmpexp <= lastexp) {
217 LOG(
llevError,
"Experience for level %d is lower than previous level (%" FMT64 " <= %" FMT64 ")\n", lastlevel+1, tmpexp, lastexp);
225 levels[lastlevel] = tmpexp;
230 while (isdigit(*cp) && *cp != 0)
232 while (!isdigit(*cp) && *cp != 0)