I'm getting mad with this problem. Well, let's begin. I want to add some modifiers to different minecraft events (such as how much damage is dealed in the EntityDamageByEntityEvent) according to a level that is stored in a MySQL database.
This level system would have 99 levels (1 to 100), beeing 50 the default level; for example, in the case of the EntityDamageByEntityEvent I'd like to change the damage so:
a) If the player had a 50 level, the damage wouldn't be modified (just would would be multiplied by 1).
b) If the player had a 1 level, the damage dealed would be multiplied by 1/3.
c) If the player had level 100, the damage would be miltiplied by 3.
So far, so good, but how could I do it in the case of a player with level 17 or 89? What I want to know is how to convert, let's say, a 1 to 100 scale in a 1/3 to 3, beeing 50 = 1... A little bit mind blowing... Thanks in advance, hope you understood me!