Results 1 to 5 of 5
Thread: Algorithm I wrote.
03-25-2014, 01:58 PM #1
Algorithm I wrote.
This is an algorithm I wrote a while ago for a plugin I'm working on, and I'm pretty proud of it.
Basically, it takes a player's current level, and how much a potion the player will drink will drop that level, and if that amount is below the next multiple of ten (i.e. 20, 30, 40, etc.), it will only drop the player's level down to that multiple of ten.
To explain better, say the player's level is 43. And he drinks a potion that would drop his level 5 points normally. This method calculates that he can only drop 3 levels before hitting a multiple of ten, which is a no-no.
The point of this was to enforce one of the rules of the game.
03-26-2014, 05:51 AM #2
- Join Date
- Feb 2012
That's really cool man
I wish I had the patients to do that kind of shit
03-26-2014, 07:55 AM #3
And what is the rule this algorithm is enforcing?
It looks very good either way.
03-26-2014, 10:29 AM #4
I would think it's evident from the OP; basically, once a multiple of ten level is reached, a player physically can't drop below that level, and this ensures that it never happens.
03-26-2014, 12:48 PM #5
Tags for this Thread