gurpreet Posted January 2, 2009 Posted January 2, 2009 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? Quote
gurpreet Posted January 2, 2009 Author Posted January 2, 2009 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. Quote
POG1 Posted January 2, 2009 Posted January 2, 2009 Re: Code for capped EXP? change the leveling algorithm then. Quote
Magictallguy Posted January 3, 2009 Posted January 3, 2009 Re: Code for capped EXP? ALTER TABLE users CHANGE `exp` `exp` DECIMAL( 45,4 ) NOT NULL DEFAULT '0.0000'; Not hard. Quote
gurpreet Posted January 3, 2009 Author Posted January 3, 2009 Re: Code for capped EXP? I mean the EXP gains from leaving people, hosping and mugging. Want it to be capped at 75% not be able to go into the thousands. Quote
POG1 Posted January 3, 2009 Posted January 3, 2009 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 Quote
gurpreet Posted January 3, 2009 Author Posted January 3, 2009 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 Quote
Godhand Posted January 6, 2009 Posted January 6, 2009 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. Quote
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.