<?php
include "globals.php";
if($ir['safehouse'] > 0)
{
Print "You are in a safehouse, how can you mine?";
$h->endpage();
exit;
}
if($ir['jail'] or $ir['hospital'])
{
print "This Page Cannot be Accessed while in Jail or Hospital.";
$h->endpage();
exit;
}
global $c,$db,$ir;
$is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die($db->error());
$ir=$db->fetch_row($is);
get_mine();
switch($_GET['action'])
{
case 'mine': mine_1(); break;
case 'minesub': mine_1_sub(); break;
case 'mine2': mine_2(); break;
case 'mine2sub': mine_2_sub(); break;
case 'mine3': mine_3(); break;
case 'mine3sub': mine_3_sub(); break;
case 'mine4': mine_4(); break;
case 'mine4sub': mine_4_sub(); break;
case 'mine5': mine_5(); break;
case 'mine5sub': mine_6_sub(); break;
case 'mine6': mine_6(); break;
case 'mine6sub': mine_6_sub(); break;
case 'mine7': mine_7(); break;
case 'mine7sub': mine_7_sub(); break;
case 'mine8': mine_8(); break;
case 'mine8sub': mine_8_sub(); break;
case 'mine9': mine_9(); break;
case 'mine9sub': mine_9_sub(); break;
case 'mine10': mine_10(); break;
case 'mine10sub': mine_10_sub(); break;
case 'mine11': mine_11(); break;
case 'mine11sub': mine_11_sub(); break;
default: mine_index(); break;
}
function mine_index()
{
global $ir,$c,$userid;
print "<p><p><img src='headings/Go-Mining.jpg' /> <p>
<center>
There are 10 spots to go mining but thay are restricted depending on your mine level. The mine level is seperate to your game level.
<br /><br />Your mining level is <font color=yellow><b>{$ir['mine_level']}</b></font>and you have <font color=yellow><b>{$ir['mine_exp']}/{$ir['mine_needed']}</b></font>mining experience
</center>";
print "<center><br /><b>CRYSTAL MINES</b><br />
<a href='mine.php?action=mine'>Level 1 Mine</a><br />
<a href='mine.php?action=mine2'>Level 5 Mine</a><br />
<a href='mine.php?action=mine3'>Level 10 Mine</a><br />
<a href='mine.php?action=mine4'>Level 15 Mine</a><br />
<a href='mine.php?action=mine5'>Level 20 Mine</a><br />
<a href='mine.php?action=mine6'>Level 25 Mine</a><br />
<a href='mine.php?action=mine7'>Level 30 Mine</a><br />
<a href='mine.php?action=mine8'>Level 35 Mine</a><br />
<a href='mine.php?action=mine9'>Level 40 Mine</a><br />
<a href='mine.php?action=mine10'>Level 45 Mine</a><br />
<a href='mine.php?action=mine11'>Level 50 Mine</a><br />
<p><b><a href=explore.php>CONTINUE TO EXPLORE</a></b><br />
</center>";
}
function mine_1()
{
global $ir,$c,$userid,$db;$domain;
//level 1 mines
if($ir['power'] < 10)
{
echo sprintf('
<center>
You need 10 power to mine here your have %u
</center>
'
, $ir['power']
);
print "<p> <a href='mine.php'>Back</a></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,7);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 10, $userid);
$db->query($query);
$rand_gems = rand(1,4);
$rand_exp = mt_rand(1,75);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 6)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
if ($chance == 7)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
function mine_2()
{
global $ir,$c,$userid,$db;
//level 5 mines
if($ir['power'] < 10){
print "You need 10 power to mine here your have {$ir['power']} <p> <a href='explore.php'>Back</a></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
if($ir['mine_level'] < 5){
print "<center>You need to be mining level 5 to mine here you are mining level {$ir['mine_level']} <p> <a href='explore.php'>Back</a></center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,5);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 10, $userid);
$db->query($query);
$rand_exp = mt_rand(1,120);
$rand_gems = rand(1,5);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine2'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
function mine_3()
{
global $ir,$c,$userid,$db;
//level 10 mines
if($ir['power'] < 10){
print "You need 10 power to mine here your have {$ir['power']} <p> <a href='explore.php'>Back</a></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
if($ir['mine_level'] < 10){
print "<center>You need to be mining level 10 to mine here you are mining level {$ir['mine_level']} <p> <a href='explore.php'>Back</a></center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,5);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 10, $userid);
$db->query($query);
$rand_exp = mt_rand(1,150);
$rand_gems = rand(1,6);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine3'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
function mine_4()
{
global $ir,$c,$userid,$db;
//level 15 mines
if($ir['power'] < 10){
print "You need 10 power to mine here your have {$ir['power']} <p> <a href='explore.php'>Back</a></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
if($ir['mine_level'] < 15){
print "<center>You need to be mining level 15 to mine here you are mining level {$ir['mine_level']} <p> <a href='explore.php'>Back</a></center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,5);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 10, $userid);
$db->query($query);
$rand_exp = mt_rand(1,200);
$rand_gems = rand(1,8);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine4'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
function mine_5()
{
global $ir,$c,$userid,$db;
//level 20 mines
if($ir['power'] < 15){
print "<center>You need 15 power to mine here your have {$ir['power']}</center> </table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
if($ir['mine_level'] < 20){
print "<center>You need to be mining level 20 to mine here you are mining level {$ir['mine_level']}</center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,7);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 15, $userid);
$db->query($query);
$rand_gems = rand(1,10);
$rand_exp = mt_rand(1,250);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
if ($chance == 6)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 7)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine5'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
function mine_6()
{
global $ir,$c,$userid,$db;
//level 25 mines
if($ir['power'] < 15){
print "You need 15 power to mine here your have {$ir['power']} <p> <a href='explore.php'>Back</a></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
if($ir['mine_level'] < 25){
print "<center>You need to be mining level 25 to mine here you are mining level {$ir['mine_level']} <p> <a href='explore.php'>Back</a></center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,5);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 15, $userid);
$db->query($query);
$rand_exp = mt_rand(1,300);
$rand_gems = rand(1,12);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine6'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
function mine_7()
{
global $ir,$c,$userid,$db;
//level 30 mines
if($ir['power'] < 20){
print "<center>You need 20 power to mine here your have {$ir['power']} <p> <a href='explore.php'>Back</a></center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
if($ir['mine_level'] < 30){
print "<center>You need to be mining level 30 to mine here you are mining level {$ir['mine_level']} <p> <a href='explore.php'>Back</a></center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,5);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 20, $userid);
$db->query($query);
$rand_gems = rand(1,15);
$rand_exp = mt_rand(1,350);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine7'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
function mine_8()
{
global $ir,$c,$userid,$db;
//level 35 mines
if($ir['power'] < 20){
print "<center>You need 20 power to mine here your have {$ir['power']}</center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
if($ir['mine_level'] < 35){
print "<center>You need to be mining level 35 to mine here you are mining level {$ir['mine_level']}</center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,5);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 20, $userid);
$db->query($query);
$rand_gems = rand(1,20);
$rand_exp = mt_rand(1,400);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine8'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
function mine_9()
{
global $ir,$c,$userid,$db;
//level 40 mines
if($ir['power'] < 20){
print "<center>You need 20 power to mine here your have {$ir['power']}</center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
if($ir['mine_level'] < 40){
print "<center>You need to be mining level 40 to mine here you are mining level {$ir['mine_level']}</center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,5);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 20, $userid);
$db->query($query);
$rand_gems = rand(1,25);
$rand_exp = mt_rand(1,450);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine9'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
function mine_10()
{
global $ir,$c,$userid,$db;
//level 45 mines
if($ir['power'] < 20){
print "<center>You need 20 power to mine here your have {$ir['power']}</center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
if($ir['mine_level'] < 45){
print "<center>You need to be mining level 45 to mine here you are mining level {$ir['mine_level']}</center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,5);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 20, $userid);
$db->query($query);
$rand_gems = rand(1,25);
$rand_exp = mt_rand(1,450);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine10'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
function mine_11()
{
global $ir,$c,$userid,$db;
//level 50 mines
if($ir['power'] < 25){
print "<center>You need 25 Power to mine here your have {$ir['energy']} <p> <a href='explore.php'>Back</a></center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
if($ir['mine_level'] < 50){
print "<center>You need to be mining level 50 to mine here you are mining level {$ir['mine_level']} <p> <a href='explore.php'>Back</a></center></table><tr><td><image src='bottom1.png'></td></tr></table>";
$h->endpage();
exit;
}
$chance = mt_rand(1,5);
$query = sprintf('UPDATE `users` SET power = power - %u WHERE userid = %u', 25, $userid);
$db->query($query);
$$rand_gems = rand(1,30);
$rand_exp = mt_rand(1,500);
$rand_hosp = mt_rand(5,30);
if ($chance == 1)
{
print "You searched long and hard but come up short!<p>";
}
if ($chance == 2)
{
print "Looks like you found something Matey! You see a short clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 134;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 3)
{
print "Looks like you found something Matey! You see a mini health on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 30;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 4)
{
print "Looks like you found something Matey! You see some clippers on the ground, and decide to pick it up.<p> this might come in handy...";
$itemidexplore = 22;
$db->query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1,0)",$c); print"<br /><br />";
}
if ($chance == 5)
{
echo sprintf('
<center>
You begin mining and find %u crystal(s).
</center>
<br />
'
, $rand_gems
);
$query = sprintf('UPDATE `users` SET crystals = crystals + %u, mine_exp = mine_exp + %u WHERE userid = %u', $rand_gems, $rand_exp, $userid);
$db->query($query);
}
print "<center>[<a href='mine.php?action=mine11'>Mine again</a>]</center><br />";
print "<center>[<a href='mine.php'>Back</a>]</center><br />";
}
$h->endpage();
?>
Try that out ... create a page called mine.php