Jump to content
MakeWebGames

problems with exp and leveling


tonyd

Recommended Posts

Hello everyone,

I am having trouble with experience from attacks that equal more than 100%

I talked to Djkanna and he helped me out with the image bar going over 100%

But I would like to have the exp go directly into levels so the user does not have to refresh for the credit to level.

I have searched the forums and google extensivley and even tried editing the header file with no luck...

has anyone else experienced this.. Its a paid version of v2.o3

Link to comment
Share on other sites

For the part where users dont refresh, think you would run it with a javascript code, I have yet seen one on this forum..

as for exp going into levels that is kind of stupid, why would you want your players to level quickly? if your wanting them to level quickly just update the level in a query it's that simple!!

Link to comment
Share on other sites

For the part where users dont refresh, think you would run it with a javascript code, I have yet seen one on this forum..

as for exp going into levels that is kind of stupid, why would you want your players to level quickly? if your wanting them to level quickly just update the level in a query it's that simple!!

I think the poster means, rather than displaying over 100% exp just automatically update the level instead.

A way this could be done is after crediting them their exp just call the check_level(); function again.

Link to comment
Share on other sites

Should I call the check level function in the attack leave file?

Or could I add it to the header file?

I have a few level 20 guys that can beat a level hundred so when they get exp from him the return is above 100%

Thanks for the help I'm going to try creating a link for the results page that includes check level if exp is greater than 100

Link to comment
Share on other sites

I tried to add the global function and check level to attack leave . With no results

I'm not sure if its due to the percentage calculations.

Should I create an experience equals level table and base the experience gained and submit it to that database?

I'm really stuck on this.

I think it will be a rare occasion that a player will gain over 100% needed for next level but it is possible.

Link to comment
Share on other sites

I've tried adding Check_level()

to no avail.

In my globals should the check_level ()<---- curly brackets be empty?

If not would it be correct to add experc or exper?

This is what the globals looks like now

function check_level()

{

global $db;

global $ir,$c,$userid;

$ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2);

if($ir['exp'] >= $ir['exp_needed'])

{

$expu=$ir['exp']-$ir['exp_needed'];

$ir['level']+=1;

$ir['exp']=$expu;

$ir['energy']+=2;

$ir['brave']+=2;

$ir['maxenergy']+=2;

$ir['maxbrave']+=2;

$ir['hp']+=50;

$ir['maxhp']+=50;

$ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2);

$db->query("UPDATE users SET level=level+1,exp=$expu,energy=energy+2,brave=brave+2,maxenergy=maxenergy+2,maxbrave=maxbrave+2,

hp=hp+50,maxhp=maxhp+50 where userid=$userid");

}

Link to comment
Share on other sites

Thank you PHP is new to me,

Basically what im trying to do is have the home index page refresh and calculate total experience gained.. if that makes sense.

I created a weapon that does a lot of damage so attacking a level 100 player nets over 100% experience, if experience =300% you would have to refresh home 3 times.

I tried to call check_level in index and it still requires you to refresh.

If you call a global function in the index? is the correct format $check_level ();

Link to comment
Share on other sites

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