jaymo Posted June 3, 2011 Share Posted June 3, 2011 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 Quote Link to comment Share on other sites More sharing options...
Kieran-R Posted June 3, 2011 Share Posted June 3, 2011 (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 June 3, 2011 by Dominion removed content linked to posts. Quote Link to comment Share on other sites More sharing options...
Danny696 Posted June 3, 2011 Share Posted June 3, 2011 (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 June 3, 2011 by Dominion Quote Link to comment Share on other sites More sharing options...
jaymo Posted June 3, 2011 Author Share Posted June 3, 2011 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 ;) Quote Link to comment Share on other sites More sharing options...
ShadyCoco Posted July 23, 2011 Share Posted July 23, 2011 Have you changed the default in the DB? Quote Link to comment Share on other sites More sharing options...
jaymo Posted November 18, 2011 Author Share Posted November 18, 2011 No I haven't and sorry for long overdue reply...this is really confusing.... really getting nowhere with this :( Quote Link to comment Share on other sites More sharing options...
Cronic Posted November 19, 2011 Share Posted November 19, 2011 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. Quote Link to comment Share on other sites More sharing options...
jaymo Posted November 19, 2011 Author Share Posted November 19, 2011 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 Quote Link to comment Share on other sites More sharing options...
Cronic Posted November 19, 2011 Share Posted November 19, 2011 (edited) Have you added it to the Classes.php file? Edited November 19, 2011 by Cronic Quote Link to comment Share on other sites More sharing options...
jaymo Posted March 13, 2012 Author Share Posted March 13, 2012 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... :/ Quote Link to comment Share on other sites More sharing options...
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.