Jump to content
MakeWebGames

GRPG Experience, anyone understand it?


jaymo

Recommended Posts

Basically Ive been at it for days now trying to figure out how to fix the experience, the max level anyone can get upto is around level 70 and the exp is like in the millions. Maybe if anyone is familiar with the script more and they could comment on parts of the functions??

I would like it atleast like max level of 500 or something, maybe I'm asking for too much, but perhaps a little guidence?

Thanks so much.

Here is the code for the experience.

function experience($L) {

 $a=0;

 $end=0;

 for($x=2; $x<$L; $x++) {

   $a += floor($x+1500*pow(2, ($x/7)));

 }

 return floor($a/2);

}



function Get_The_Level($exp) {

 $a=0;

 $end =0;

 for($x=2; ($end==0 && $x<100); $x++) {

   $a += floor($x+1500*pow(4, ($x/7)));

   if ($exp >= floor($a/4)){

} else {

  return $x;

  $end=1;

}

 }

}



function Get_Max_Exp($L){

$end=0;

if ($exp == 0){

return 457;

$end =1;

 }

for($L=1;($L<100 && $end==0);$L++) {

  $exp = experience($L);

  //echo $exp;

  if ($exp >= $user_class->exp){

	return $exp;

	$end=1;

  }

}

}

 

Just baffles me 0.0

Link to comment
Share on other sites

Just switch about some of the numbers in the code.

floor($x+1500*pow(2, ($x/7))); << Looks like the part which decides the max EXP. But make sure you make it the same for all the functions.

Edited by Dominion
removed content linked to posts.
Link to comment
Share on other sites

I think ive messed my code up now.

I changed the levels but Ive done something, when new users register they start at like level 29...Its ssoo confusing. Maybe Ill try again another time. Thanks for your help guys ;)

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
function experience($L) {
 $a=0;
 $end=0;

 for($x=1; $x<$L; $x++) {
   $a += round($x+1500*pow(4, ($x/190)));
 }


if ($x > 349){
   $a += round($x+2000*pow(4, ($x/190)));
}

if ($x > 478){
   $a += round($x+2000*pow(6, ($x/150)));
}

if ($x > 499){
   $a += round($x+10000*pow(6, ($x/120)));
}
 return round($a/4);
}

 

Try this.

Link to comment
Share on other sites

  • 3 months later...

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...