Jump to content
MakeWebGames

Recommended Posts

Posted

OK so I have no idea how to do this, I was on my brothers account on my game testin some stuff, and I attacked someone like 50 levels higher and won because his stats are low. I left them, and got like 9000% exp, which is at least 25 levels...Which means you can be level 1000 in a day (maybe not a day but you know what i mean)

So is there any code that can cap this to say 75% exp?

Posted

Re: Code for capped EXP?

Yeah I know, but lots of people on my game are say level 100-200 with total stats of 1k...People can get that so quickly and just level up too fast.

Posted

Re: Code for capped EXP?

$expFromAttacking <-- this is set in the attack script somewhere, cant remember the name.

$maxExp = $ir['exp_needed'] * 0.75;

$expFromAttacking = ($expFromAttacking > $maxExp) ? $maxExp : $expFromAttacking;

 

something like that i think

Posted

Re: Code for capped EXP?

Ok so I found the following in attackleave.php

 

$qe=$r['level']*$r['level']*$r['level'];
$expgain=rand($qe/4,$qe/2);
$expperc=(int) ($expgain/$ir['exp_needed']*100);
print " and gained $expperc% EXP!";

 

What's $r mean? If it means them then the $qe=3*their level, so I'll edit according to that.

 

$qe=$r['level']*$r['level']*$r['level'];
$expgain=rand($qe/50,$qe/20);
$expperc=(int) ($expgain/$ir['exp_needed']*100);
print " and gained $expperc% EXP!";

 

Not sure though, tryna keep it so it's rand 1,50 or so. Used the example 10. Probably totally wrong but I tried

Posted

Re: Code for capped EXP?

 

So is there any code that can cap this to say 75% exp?

Yes there is a way, just stop being lazy and actually read the code for it. It isn't THAT hard. I've been away from coding for quite some time and I still have the thought process how to cap max or min exp gains for attacking.

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