You can do it with cases check Switch, also you can do it by mathematical equations
You can check about elo rating system...
http://en.wikipedia.org/wiki/Elo_rating
An example of Switch is
switch(g_level[id]) {
case 0 ... 10 : { //xp * 20 }
case 11 ... 20 : { //xp * 10 }
}
... etc, Is is only an example but, the equation would be more pretty. Check about ELO rating system, is interesting.
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))