This is my first mod ever. I know it is simple but i tmay be a bit useful I also liked to give credit to Sniko from who i got this idea from.
Please dont give rude comments it is my first mod ever
Here it goes first the queries:
ALTER TABLE `users` ADD `gexp_needed` decimal(11,4) NOT NULL default '50.0000';
ALTER TABLE `users` ADD `gymlevel` int(11) NOT NULL default '1';
ALTER TABLE `users` ADD `gymxp` decimal(11,4) NOT NULL default '0.0000';
Then open up global_func.php and add this under above ?>
function check_gymlevel()
{
global $db;
global $ir,$c,$userid;
if($ir['gymxp'] >= $ir['gexp_needed'])
{
$gexpu=$ir['gymxp']-$ir['gexp_needed'];
$gneeded=$ir['gexp_needed']*$ir['gymlevel'];
$ir['gymlevel']+=1;
$ir['gymexp']=$gexpu;
$ir['gexp_needed']+=$gneeded;
$db->query("UPDATE users SET gymlevel=gymlevel+1,gymxp=$gexpu,gexp_needed=gexp_needed+$gneeded where userid=$userid");
}
}
Then open up globals.php and find
check_level();
add underneath
check_gymlevel();
Then open header.php and find
$enperc=(int) ($ir['energy']/$ir['maxenergy']*100);
$wiperc=(int) ($ir['will']/$ir['maxwill']*100);
$experc=(int) ( $ir['exp']/$ir['exp_needed']*100);
$brperc=(int) ($ir['brave']/$ir['maxbrave']*100);
$hpperc=(int) ($ir['hp']/$ir['maxhp']*100);
$enopp=100-$enperc;
$wiopp=100-$wiperc;
$exopp=100-$experc;
$bropp=100-$brperc;
$hpopp=100-$hpperc;
Replace with:
$enperc=(int) ($ir['energy']/$ir['maxenergy']*100);
$wiperc=(int) ($ir['will']/$ir['maxwill']*100);
$experc=(int) ( $ir['exp']/$ir['exp_needed']*100);
$brperc=(int) ($ir['brave']/$ir['maxbrave']*100);
$hpperc=(int) ($ir['hp']/$ir['maxhp']*100);
$gymperc=(int) ($ir['gymxp']/$ir['gexp_needed']*100);
$enopp=100-$enperc;
$wiopp=100-$wiperc;
$exopp=100-$experc;
$bropp=100-$brperc;
$hpopp=100-$hpperc;
$gymopp=100-$gymperc;
Then in the same file find
<b>Energy:</b> {$enperc}%<br />
<img src=greenbar.png width=$enperc height=10><img src=redbar.png width=$enopp height=10><br />
<b>Will:</b> {$wiperc}%<br />
<img src=bluebar.png width=$wiperc height=10><img src=redbar.png width=$wiopp height=10><br />
<b>Brave:</b> {$ir['brave']}/{$ir['maxbrave']}<br />
<img src=yellowbar.png width=$brperc height=10><img src=redbar.png width=$bropp height=10><br />
<b>EXP:</b> {$experc}%<br />
<img src=navybar.png width=$experc height=10><img src=redbar.png width=$exopp height=10><br />
<b>Health:</b> {$hpperc}%<br />
<img src=greenbar.png width=$hpperc height=10><img src=redbar.png width=$hpopp height=10><br /><hr />
Add underneath:
<b>Gym Exp:</b> {$gymperc}%<br />
<img src=greenbar.png width=$gymperc height=10><img src=redbar.png width=$gymopp height=10><br /><hr />
Then in header find:
<b>Crystals:</b> {$ir['crystals']}<br />
Add underneath
<b>Gym Level:</b> {$ir['gymlevel']}<br />
Then open Gym.php find
else
{
$gain=0;
for($i=0; $i<$_POST['amnt']; $i++)
{
$gain+=rand(1,3)/rand(800,1000)*rand(800,1000)*(($ir['will']+20)/150);
$ir['will']-=rand(1,3);
if($ir['will'] < 0) { $ir['will']=0; }
}
if($ir['jail']) { $gain/=2; }
$db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid");
$db->query("UPDATE `users` SET `will` = {$ir['will']}, energy = energy - {$_POST['amnt']} WHERE `userid` = $userid");
replace it with
else
{
$gain=0;
for($i=0; $i<$_POST['amnt']; $i++)
{
$gain+=rand(1,3)/rand(800,1000)*rand(800,1000)*(($ir['will']+20)*(($ir['gymlevel']/rand(3,12))/150));
$ir['will']-=rand(1,3);
if($ir['will'] < 0) { $ir['will']=0; }
}
if($ir['jail']) { $gain/=2; }
$db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid");
$db->query("UPDATE `users` SET `will` = {$ir['will']}, energy = energy - {$_POST['amnt']} WHERE `userid` = $userid");
$db->query("UPDATE users SET gymxp=gymxp+{$_POST['amnt']} WHERE userid=$userid");
That is it i know it is a bit long but that is because i am not a good coder I hpe u like it.
P.S For People with a Gym Level Under 12 it sometimes decreases the gain of a stat then the normal one but once u have a gym level of lets say 20-30 u have a increase in the gain of a stat then the normal one
If there is prob plz post
Tested on my game
I am savage on MWG so plz dont think that i copyed this mod from there