Jump to content
MakeWebGames

Recommended Posts

Posted

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 :)

Posted

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

  • 1 month later...
Posted

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:

Posted

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'];
Posted

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']
Posted

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

Posted

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? ;)

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...