Re: [Free] [v1] Scuba Diving
V2:
<?php
/*-----------------------------------------------------
-- Isomerizer Copright 2007+.
-- Scuba Dive (Free Mod)
-- Property of isomerizer.com
-----------------------------------------------------*/
require "globals.php";
echo "<h3>Scuba Diving</h3>";
echo "Current Oxygen: {$ir['oxygen']} / 100
Hello there im Scuba Steve, I'll be your scuba diving instructor today
Would you like to go scuba diving today? (20 Oxygen required)
<form action=scubadive.php method=POST><select name=scuba>
<option value=yes>Yes</option>
<option value=no>No</option>
</select>
<input type=submit value='Scuba Dive!'></form><hr />";
if (isset($_POST['scuba']))
{
if ($select==no) { echo "Dont scuba dive then, Your loss!"; $h->endpage(); exit; }
if ($ir['oxygen'] < 20) { echo "20 oxygen is required to scuba dive"; $h->endpage(); exit; }
if ($ir['hospital'] > 0 || $ir['prison'] > 0) { echo "You cannot scuba while in hospital / prison"; $h->endpage(); exit; }
$rand=rand(1,120);
//* Start Location 0 *\\
if ($rand <= 20)
{
if ($ir['oxygen'] < 20) { echo "20 oxygen is required to scuba dive"; $h->endpage(); exit; }
if ($ir['hospital'] > 0 || $ir['prison'] > 0) { echo "You cannot scuba while in hospital / prison"; $h->endpage(); exit; }
$db->query("UPDATE users SET oxygen=oxygen-20 WHERE userid=$userid", $c);
$moneyfound=rand(10,50);
echo "You find a small treausure chest containing <font color=green>$$moneyfound</font>";
$query1 = sprintf("UPDATE users SET money=money+$moneyfound WHERE userid=$userid", $c);
mysql_real_escape_string($moneyfound, $c);
$db->query($query1, $c);
$h->endpage();
exit;
}
//* End Location 0 *\\
//* Start Location 1 *\\
if ($rand > 20 && $rand < 41)
{
if ($ir['oxygen'] < 20) { echo "20 oxygen is required to scuba dive"; $h->endpage(); exit; }
if ($ir['hospital'] > 0 || $ir['prison'] > 0) { echo "You cannot scuba while in hospital / prison"; $h->endpage(); exit; }
$db->query("UPDATE users SET oxygen=oxygen-20 WHERE userid=$userid", $c);
$moneyfind=rand(10,50);
echo "You find a small coral, and pick up <font color=green>$$moneyfind</font>";
$query2 = sprintf("UPDATE users SET money=money+$moneyfind WHERE userid=$userid", $c);
mysql_real_escape_string($moneyfind, $c);
$db->query($query2, $c);
$h->endpage();
exit;
}
//* End Location 1 *\\
//* Start Location 2 *\\
if ($rand > 40 && $rand < 61)
{
if ($ir['oxygen'] < 20) { echo "20 oxygen is required to scuba dive"; $h->endpage(); exit; }
$db->query("UPDATE users SET oxygen=oxygen-20 WHERE userid=$userid", $c);
if ($ir['hospital'] > 0 || $ir['prison'] > 0) { echo "You cannot scuba while in hospital / prison"; $h->endpage(); exit; }
$success=rand(1,10);
$crystalfinding=rand(1,10);
if ($sucess > 5)
{
echo "You explore the sea finding a dead whale, inside you find <font color=green>$crystalfinding</font> crystals!";
$query3 = sprintf("UPDATE users SET crystals=crystals+$crystalfinding WHERE userid=$userid", $c);
mysql_real_escape_string($query3, $c);
$db->query($query3, $c);
$h->endpage();
exit;
}
if ($success <=5)
{
echo "A whale bash's into you, Taking away some power";
$db->query("UPDATE users SET energy=energy-1 WHERE userid=$userid", $c);
$h->endpage();
exit;
}
}
//* End Location 2 *\\
//* Start Location 3 *\\
if ($rand > 60 && $rand < 81)
{
if ($ir['oxygen'] < 20) { echo "20 oxygen is required to scuba dive"; $h->endpage(); exit; }
$db->query("UPDATE users SET oxygen=oxygen-20 WHERE userid=$userid", $c);
if ($ir['hospital'] > 0 || $ir['prison'] > 0) { echo "You cannot scuba while in hospital / prison"; $h->endpage(); exit; }
$find=rand(1,2);
if ($find==1)
{
echo "Bah, You cant seem to find anything in the sea! Except for a bit of dead sea weed!";
$h->endpage();
exit;
}
if ($find==2)
{
echo "Bah, You cant seem to find anything in the sea! Wait, you spot a bit of shark poop!";
$h->endpage();
exit;
}
}
//* End Location 3 *\\
//* Start Location 4 *\\
if ($rand > 80 && $rand < 100)
{
if ($ir['oxygen'] < 20) { echo "20 oxygen is required to scuba dive"; $h->endpage(); exit; }
$db->query("UPDATE users SET oxygen=oxygen-20 WHERE userid=$userid", $c);
if ($ir['hospital'] > 0 || $ir['prison'] > 0) { echo "You cannot scuba while in hospital / prison"; $h->endpage(); exit; }
$unit=rand(1,2);
if ($unit==1)
{
$cashhh=rand(50,70);
echo "While swimming around you find $<font color=green>$cashhh</font>";
$query4 = sprintf("UPDATE users SET money=money+$cash WHERE userid=$userid", $c);
mysql_real_escape_string($cash, $c);
$db->query($query4, $c);
$h->endpage();
exit;
}
if ($unit==2)
{
$crystalss=rand(3,5);
echo "While swimming around you find <font color=green>$$crytalss</font>";
$query5 = sprintf("UPDATE users SET crystals=crystals+$crystalss WHERE userid=$userid", $c);
mysql_real_escape_string($crystalss, $c);
$db->query($query5, $c);
$h->endpage();
exit;
}
}
//* End Location 4 *\\
//* Start Location 5 *\\
if ($rand == 100)
{
if ($ir['oxygen'] < 20) { echo "20 oxygen is required to scuba dive"; $h->endpage(); exit; }
$db->query("UPDATE users SET oxygen=oxygen-20 WHERE userid=$userid", $c);
if ($ir['hospital'] > 0 || $ir['prison'] > 0) { echo "You cannot scuba while in hospital / prison"; $h->endpage(); exit; }
echo "You find a cave in it you find <font color=green>$1000</font>!";
$db->query("UPDATE users SET money=money+1000 WHERE userid=$userid", $c);
$h->endpage();
exit;
}
//* End Location 5 *\\
//* Start Location 6 *\\
if ($rand > 100 && $rand < 121)
{
if ($ir['oxygen'] < 20) { echo "20 oxygen is required to scuba dive"; $h->endpage(); exit; }
$db->query("UPDATE users SET oxygen=oxygen-20 WHERE userid=$userid", $c);
if ($ir['hospital'] > 0 || $ir['prison'] > 0) { echo "You cannot scuba while in hospital / prison"; $h->endpage(); exit; }
echo "A shark takes a chunk out of you!";
$db->query("UPDATE users SET hospital='50' WHERE userid=$userid", $c);
$db->query("UPDATE users SET hospreason='Bit by a shark' WHERE userid=$userid", $c);
$h->endpage();
exit;
}
//* End Location 6 *\\
}
?>