Jump to content
MakeWebGames

Recommended Posts

Posted

Hello,

Could someoneone advise me where I would be able to find the level/code ratio. At the moment even my test account thats lvl100 only have 5k health, I'd like to change this if possible

Thanks

Posted

Re: Level/health ratio

Thanks mate

Its currently set at 50, is there a way I could set it so its maybe percentage based?

As you can tell this is new to me

Posted

Re: Level/health ratio

This is what I have now:

$ir['maxhp']+=50;

So I assume every level you go up adds 50 health, I wanted to make it % based so every level you go up gives say 10% more health.

Posted

Re: Level/health ratio

Full Function

 

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'])
{
$newhp=round(($ir['level']*.05)+50);
$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']+=$newhp;
$ir['maxhp']+=$newhp;
$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+$newhp,maxhp=maxhp+$newhp where userid=$userid");
}
}
Posted

Re: Level/health ratio

Had to change it to this to avoid unexpected ( or )

$newhp=(abs);

$ir['level']*.05+50;

$newhp=round($newhp);

Hasnt worked am afraid though

Posted

Re: Level/health ratio

Nope, I'm adding this

$newhp=abs(($ir['level']*.05)+50);

$newhp=round($newhp);

Below

$ir['maxhp']+=$newhp;

Not working. By the way thanks for trying

Posted

Re: Level/health ratio

Just to confirm for others this works beautifully:

Open global_func.php

Find

$ir['maxhp']+=$newhp;

Add this under

$newhp=abs(($ir['level']*50)+(($ir['level']*50)*.10));

$newhp=round($newhp);

This gives the normal extra 50hp per level plus 10%

If you alter the .10 to whatever you want i.e you could have .20 for 20%

Savager done all the work on this, I just tested it - Top man and top mod!

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