diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-01-04 09:33:19 +0000 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-01-04 09:33:19 +0000 |
commit | 1c1d8d3aba481db177c72800d863d1fc0c840058 (patch) | |
tree | b206f09058ff3828eefcd83e9db0645f17301542 /src | |
parent | 97e3980d2f2facaf710c881023cad9199e28b2c5 (diff) | |
download | tmwa-1c1d8d3aba481db177c72800d863d1fc0c840058.tar.gz tmwa-1c1d8d3aba481db177c72800d863d1fc0c840058.tar.bz2 tmwa-1c1d8d3aba481db177c72800d863d1fc0c840058.tar.xz tmwa-1c1d8d3aba481db177c72800d863d1fc0c840058.zip |
Fix a type bug in exp formula and add modified exp
Diffstat (limited to 'src')
-rw-r--r-- | src/map/mob.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 34d1b83..719cc78 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -271,8 +271,9 @@ mob_gen_exp(struct mob_db *mob) double dodge_factor = pow(mob->lv + mob->agi + mob->luk / 2.0, 4.0 / 3.0); double persuit_factor = (3 + mob->range) * (mob->mode % 2) * 1000 / mob->speed; double aggression_factor = (mob->mode & 4) == 4 ? 10.0 / 9.0 : 1.0; - double xp = floor(effective_hp * pow(sqrt(attack_factor) + sqrt(dodge_factor) + sqrt(persuit_factor) + 55, 3) * aggression_factor / 2000000.0); + int xp = (int) floor(effective_hp * pow(sqrt(attack_factor) + sqrt(dodge_factor) + sqrt(persuit_factor) + 55, 3) * aggression_factor / 2000000.0 * (double) battle_config.base_exp_rate / 100.); if (xp < 1) xp = 1; + printf("Exp for mob '%s' generated: %d\n", mob->name, xp); return xp; } |