Jump to content
MakeWebGames

Recommended Posts

Posted

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

Posted (edited)

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.
Posted (edited)

Try looking for a function that increases the users level, or something that increases it, and add a level that checks if their level is 500, if it is, stop the level up..

Edited by Dominion
Posted

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

  • 1 month later...
  • 3 months later...
Posted
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.

Posted

really sorry, I really appreciate the help but how do I put this into the game, I put the level and it gives the experience so how can I do it the other way around? To fit with the other code...in grpg thankyou very much

  • 3 months later...
Posted

sorry for the very late reply :S, but yes, Ive added it to the classes file. All it does is make the exp go up, but its not actually changing the level. if you know what I mean... :/

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