Dazza Posted December 14, 2008 Share Posted December 14, 2008 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 Quote Link to comment Share on other sites More sharing options...
Savager Posted December 14, 2008 Share Posted December 14, 2008 Re: Level/health ratio global_func.php CTL+F function check_level() Quote Link to comment Share on other sites More sharing options...
Dazza Posted December 14, 2008 Author Share Posted December 14, 2008 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 Quote Link to comment Share on other sites More sharing options...
Savager Posted December 14, 2008 Share Posted December 14, 2008 Re: Level/health ratio I dont understand?!?!?! Quote Link to comment Share on other sites More sharing options...
Dazza Posted December 14, 2008 Author Share Posted December 14, 2008 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. Quote Link to comment Share on other sites More sharing options...
Savager Posted December 14, 2008 Share Posted December 14, 2008 Re: Level/health ratio $newhp=round(($ir['level']*.10)+50); $ir['maxhp']+=$newhp; I think that might work. Quote Link to comment Share on other sites More sharing options...
Savager Posted December 14, 2008 Share Posted December 14, 2008 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"); } } Quote Link to comment Share on other sites More sharing options...
Dazza Posted December 14, 2008 Author Share Posted December 14, 2008 Re: Level/health ratio Hmm tried the full function and it didnt work, even after I altered a users level (Tripping the new level upgrades) Quote Link to comment Share on other sites More sharing options...
Savager Posted December 14, 2008 Share Posted December 14, 2008 Re: Level/health ratio did you get an error or what? Quote Link to comment Share on other sites More sharing options...
Savager Posted December 14, 2008 Share Posted December 14, 2008 Re: Level/health ratio $newhp=(abs)(($ir['level']*.05)+50); $newhp=round($newhp); oh and just so you know that is 5% increase Quote Link to comment Share on other sites More sharing options...
Dazza Posted December 14, 2008 Author Share Posted December 14, 2008 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 Quote Link to comment Share on other sites More sharing options...
Savager Posted December 14, 2008 Share Posted December 14, 2008 Re: Level/health ratio lol so sorry im tired, cant think good $newhp=abs(($ir['level']*50)+(($ir['level']*50)*.10)); $newhp=round($newhp); Quote Link to comment Share on other sites More sharing options...
Dazza Posted December 14, 2008 Author Share Posted December 14, 2008 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 Quote Link to comment Share on other sites More sharing options...
Dazza Posted December 14, 2008 Author Share Posted December 14, 2008 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! 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.