EineyEntertainment Posted February 10, 2009 Posted February 10, 2009 I apologize in advance, if this topic has already been answered. I ran a forum search to no avail. I was wondering if anyone knew the formula for the exp needed to gain a level. Like at level 1 do you need 100 exp and at level 2 you need 200 exp. Please help, I want to see how much I should configure my crimes for :) Quote
TMan Posted February 13, 2009 Posted February 13, 2009 Re: Exp needed per Level To find your formula on V2 you go to global_func.php find the check_level function ... //Level function check_level() { global $db; global $ir,$c,$userid; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*3.2); $ir['rexp_needed']=(int) (($ir['rlevel']+1)*($ir['rlevel']+1)*($ir['rlevel']+1)*3.2); $ir['cexp_needed']=(int) (($ir['clevel']+1)*($ir['clevel']+1)*($ir['clevel']+1)*3.2); $ir['dexp_needed']=(int) (($ir['dlevel']+1)*($ir['dlevel']+1)*($ir['dlevel']+1)*3.2); //modify for new game COMMANDER LVL if($ir['exp'] >= $ir['exp_needed']) { $expu=$ir['exp']-$ir['exp_needed']; $ir['level']+=1; $ir['exp']=$expu; $ir['energy']+=2; $ir['maxenergy']+=2; $ir['will']+=5; $ir['maxwill']+=5; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*3.2); $db->query("UPDATE users SET level=level+1,exp=$expu,energy=energy+2,maxenergy=maxenergy+2,will=will+5,maxwill=maxwill+5 where userid=$userid"); mind you mine has alot changed to it but there is where you need to edit it(ignore what mine says with rexp rlvl... thats cause i added more levels) $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*3.2); hope you figure it out i dont feel like going farther in depth :-D Quote
vampireduff Posted April 4, 2009 Posted April 4, 2009 Re: Exp needed per Level In the main menu on a site, where you have this Energy: Soul: (will) Brave: EXP: Health: is there a way to show how much EXP is needed to get to the next level? so it could look like this Energy: Soul: (will) Brave: EXP: EXP Needed: Health: Quote
gurpreet Posted April 4, 2009 Posted April 4, 2009 Re: Exp needed per Level exp needed to level - exp they have. Quote
Magictallguy Posted April 5, 2009 Posted April 5, 2009 Re: Exp needed per Level In the main menu on a site, where you have this Energy: Soul: (will) Brave: EXP: Health: is there a way to show how much EXP is needed to get to the next level? so it could look like this Energy: Soul: (will) Brave: EXP: EXP Needed: Health: echo $ir['exp_needed']; Quote
Lithium Posted April 6, 2009 Posted April 6, 2009 Re: Exp needed per Level In the main menu on a site, where you have this Energy: Soul: (will) Brave: EXP: Health: is there a way to show how much EXP is needed to get to the next level? so it could look like this Energy: Soul: (will) Brave: EXP: EXP Needed: Health: echo $ir['exp_needed']; Minor correction to MTG ;) $ir['exp_needed'] - $ir['exp'] Quote
Magictallguy Posted April 6, 2009 Posted April 6, 2009 Re: Exp needed per Level In the main menu on a site, where you have this Energy: Soul: (will) Brave: EXP: Health: is there a way to show how much EXP is needed to get to the next level? so it could look like this Energy: Soul: (will) Brave: EXP: EXP Needed: Health: echo $ir['exp_needed']; Minor correction to MTG ;) $ir['exp_needed'] - $ir['exp'] Check the code, simply using $ir['exp_needed']; does the trick perfectly well Quote
Lithium Posted April 6, 2009 Posted April 6, 2009 Re: Exp needed per Level Check the code, simply using $ir['exp_needed']; does the trick perfectly well Correct and apologize me if i am wrong... doesn't $ir['exp_needed'] show you the amount of experience you need to have to go to next level? If so, if you want to show HOW MUCH you need to reach next level you need to subtract the $ir['exp'] you already have, in order to know how much more you need right? ;) Quote
Magictallguy Posted April 6, 2009 Posted April 6, 2009 Re: Exp needed per Level The check_level() function does that for you :P Quote
Lithium Posted April 6, 2009 Posted April 6, 2009 Re: Exp needed per Level The check_level() function does that for you :P True enough but if you want to print out that info to the user... :P Quote
Magictallguy Posted April 6, 2009 Posted April 6, 2009 Re: Exp needed per Level The check_level() function does that for you :P True enough but if you want to print out that info to the user... :P Then simply echo the $ir['exp_needed']! :P Quote
Lithium Posted April 6, 2009 Posted April 6, 2009 Re: Exp needed per Level lol still not convinced! need to get home (in 8 days) to see!!1 but see what i am thinking... $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*3.2); let's say that $ir['exp_needed']=(int) ((1+1)*(1+1)*(1+1)*3.2); $ir['exp_needed']= 25.6; that would be how much experience i would need to reach level 2 and i currently have $ir['exp'] = 15 So to show to the user that should be... $show_user = $ir['exp_needed']-$ir['exp']; and display it then like... print 'You need more '.$show_user.' Experience to reach level '.$ir['level']+1; Am i still wrong? ;) hehe Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.