Hiya i havent made any mods in a longgggg time :P so while on holiday i was thinking what could be improved in McCodes then i thought of the leveling system i use on Themercenary.net and thought McCodes was dull and boring and just takes the fun out of it and makes it a never ending click click click game
What this does
Displays a notice saying what level you are and what you have unlocked
Sends you an event
You can choose the option so the player gains money for each level they gain (ie $250 for each level)
You can set a max level
Set energy, brave, hp gain per level
ITS FREE!
First off in global_func.php you need to find
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'])
{
$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']+=50;
$ir['maxhp']+=50;
$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+50,maxhp=maxhp+50 where userid=$userid");
}
}
And replace it with
function check_level() {
global $ir;
$ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2);
}
What this does is removes the current system, so that mine is being used :)
Now we need to open up globals.php and before ?> add this
include 'levelup.php';
now we have to make a file called levelup.php and upload it to your server
<?php
$ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2);
if($ir['exp'] >= $ir['exp_needed'] && $ir['level']!=$set['max_level'])
{
$expu=$ir['exp']-$ir['exp_needed'];
$ir['exp']=$expu;
if ($set['level_gain']>0) {$gain='<br>You received $'.(($ir['level']+1)*$set['level_gain']); $gainsql=' `money`=`money`+'.(($ir['level']+1)*$set['level_gain']).',';}
$db->query("UPDATE `users` SET".$gainsql." `level`=`level`+1, `exp`=$expu, `energy`=`energy`+".$set['energy_gain'].", `brave`=`brave`+".$set['brave_gain'].", `maxenergy`=`maxenergy`+".$set['energy_gain'].", `maxbrave`=`maxbrave`+".$set['brave_gain'].", `hp`=`hp`+".$set['hp_gain'].", `maxhp`=`maxhp`+".$set['hp_gain']." WHERE `userid`=".$ir['userid']);
event_add($ir['userid'], 'You have leveled up you are now level <strong>'.($ir['level']+1).'</strong>'.$gain, $c);
$unlocks='<em>None</em>';
$q=mysql_query("SELECT `cityname` FROM `cities` WHERE `cityminlevel`=".($ir['level']+1));
if (mysql_num_rows($q)>0) {
$unlocks='<strong>You can travel to:</strong><ul>';
while ($c=mysql_fetch-array($q)) {
$unlocks=$unlocks.'<li>'.$c['cityname'].'</li>';
}
$unlocks=$unlocks.'</ul>';
}
echo '
<div align="center">
<table width="50%">
<tr>
<td>
<strong>You have leveled up!</strong>
</td>
</tr>
<tr>
<td>
You are now level: '.($ir['level']+1).'
</hr>
<strong>Unlocks:</strong><br>
'.$unlocks.'
</td>
</tr>
</table>
</div>';
}
?>
INSERT INTO `settings` (
`conf_id` ,
`conf_name` ,
`conf_value`
)
VALUES (
NULL , 'energy_gain', '2'
), (
NULL , 'brave_gain', '2'
), (
NULL , 'level_gain', ''
), (
NULL , 'max_level', '100'
), (
NULL , 'hp_gain' , '50'
);
change the settings values to what you like then you are done
screen shoot