Xagul
deathzot.net
- Joined
- Jun 30, 2008
- Messages
- 1,294
- Solutions
- 3
- Reaction score
- 1,037
Hello, I recently found myself in need of a function like this... after about an hour of tearing my hair out working with a friend trying to reverse the getExperienceForLevel function we finally figured it out!
This function will output the level of given experience. For example:
returns 8
Without further delay, here is the belly of the beast:
I don't know if this will be useful to anyone... but its here now, waiting for that 1 person like me that happens to have a use for it!
Credits to:
Lizardo (Original formula)
&
Myself (Converting the formula to lua)
This function will output the level of given experience. For example:
Code:
getLevelByExperience(4200)
Without further delay, here is the belly of the beast:
Code:
function getLevelByExperience(cexp)
return math.floor(math.pow((math.sqrt(3)*math.sqrt(243*math.pow(cexp, 2)-48600*cexp+3680000)+27*cexp-2700),1/3) / math.pow(30,2/3)-((5*math.pow(10,2/3)) / (math.pow(3,1/3)*math.pow((math.sqrt(3)*math.sqrt(243*math.pow(cexp,2)-48600*cexp+3680000)+27*cexp-2700),1/3)))+1)+1
end
I don't know if this will be useful to anyone... but its here now, waiting for that 1 person like me that happens to have a use for it!
Credits to:
Lizardo (Original formula)
&
Myself (Converting the formula to lua)