This script allows you to specify a “level difference” exp modifier. It introduces a “level difference” exp formula which takes the level difference
between an actor and an enemy and determines how the exp will be adjusted. This means that the amount of exp that an actor gains from an enemy is dependent on the difference between the actor’s level and the enemy’s level.
For example, if the actor’s level is higher than the enemy level, then the actor may receive less exp than if the levels were about the same. On the other hand, if the actor’s level is lower than the enemy level, then the actor may receive more exp than usual.
Place this script below Core – Enemy Levels and Actor Victory Exp,
and above Main
Each enemy will have their own level difference exp formula, which you define
using the notetag
<level diff exp> FORMULA </level diff exp>
The formula takes two variables and returns a new number:
exp - the amount of exp that the actor could obtain from this enemy diff - the level difference between the actor and the enemy
The level difference is from the perspective of the actor. For example, if
your actor is level 1 and it defeats a level 10 enemy, then the difference
is +9 (that is, the enemy is 9 levels higher than the actor)
If no formula is defined for the enemy, then this modifier does nothing.
Suppose a level 10 slime gives 100 EXP
If your actor’s level is lower, then you want to give a bonus 10 EXP for each
level that you’re lower. However, if your actor’s level is higher, then you
want to give a 10 EXP penalty for each level. Your formula would look like this
exp + (diff * 10)
This works because if your actor is level 1, then the difference between the
actor and the slime is 9, so you will receive a total of (exp + 90). However,
if your actor was level 20, then the difference is -10, and so you will receive
a total of (exp – 100)
Suppose instead that we wanted to reward players for taking on challenges,
but didn’t want to penalize them for killing easy enemies. We can use
conditional branches in our formula like this
if diff > 0 exp + (diff * 10) else exp end
This means that if the level difference is greater than 0, that is, the actor’s
level is lower than the enemy, then the actor receives bonus EXP for each
level of difference. However, if the actor’s level isn’t lower, then the
exp rewarded is just the usual exp.