MakeWebGames

# GRPG Experience, anyone understand it?

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

##### 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
##### Share on other sites

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

##### Share on other sites

• 1 month later...

Have you changed the default in the DB?

##### Share on other sites

• 3 months later...

No I haven't and sorry for long overdue reply...this is really confusing.... really getting nowhere with this :(

##### Share on other sites

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

##### Share on other sites

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

##### Share on other sites

Have you added it to the Classes.php file?

Edited by Cronic
##### Share on other sites

• 3 months later...

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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×

• #### Marketplace

• Discord Chat
• PBBG Directory
×
• Create New...