Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- include 'dbconf.php';
- if(!isset($_SESSION['id'])){
- header ("Location: login.php");
- }else{
- $pagel = "Map";
- $isitabattle = 1;
- $_GET['map'] = abs((int) $_GET['map']);
- $_GET['map'] = mysql_real_escape_string($_GET['map']);
- $mappy1 = mysql_query("SELECT * FROM `maps` WHERE `id`='" . $_GET['map'] . "'");
- $mappy = mysql_fetch_object($mappy1);
- include 'map_locations1337.php';
- if($_POST['pokeball']){
- $_POST['pokeball'] = abs((int) $_POST['pokeball']);
- $_POST['pokeball'] = mysql_real_escape_string($_POST['pokeball']);
- setcookie("lastpokeball", $_POST['pokeball'], time()+43200);
- $_COOKIE['lastpokeball'] = $_POST['pokeball'];
- }
- $_SESSION['lastactive'] = $_SESSION['lastactive'] - 1;
- include 'leftmenu.php';
- if($mappy->id < 1){
- echo Message("Please don't change links.");
- include 'rightmenu.php';
- die();
- }
- include 'shopstuff.php';
- $x=$left-177;$y=$top-112;
- $x = 0 - $x;
- $y = 0 - $y;
- $alandu = rand(1,8);
- //START RANDOM POKEMON
- if($alandu == 5 && $block != 1){
- $catchy1=rand(1,15);
- if($catchy1==1){$catchy = $mappy->poke1;}
- if($catchy1==2){$catchy = $mappy->poke2;}
- if($catchy1==3){$catchy = $mappy->poke3;}
- if($catchy1==4){$catchy = $mappy->poke4;}
- if($catchy1==5){$catchy = $mappy->poke5;}
- if($catchy1==6){$catchy = $mappy->poke6;}
- if($catchy1==7){$catchy = $mappy->poke7;}
- if($catchy1==8){$catchy = $mappy->poke8;}
- if($catchy1==9){$catchy = $mappy->poke9;}
- if($catchy1==10){$catchy = $mappy->poke10;}
- if($catchy1==13){$catchy = $mappy->poke13;}
- if($catchy1==14){$catchy = $mappy->poke14;}
- if($catchy1==15){$catchy = $mappy->poke15;}
- if(rand(1,300) == 137){$catchy = "2222".$catchy;}
- if($catchy1==11){$catchy = $mappy->poke11;
- if(rand(1,4) == 1){
- $unown = rand(1,26);
- $catchy = "201201".$unown;
- if($unown == 1){$catchy=201;}}
- }
- if($catchy1==12){
- $catchy = $mappy->poke12;
- if(rand(1,4) == 1){
- $unown = rand(1,26);
- $catchy = "201201".$unown;
- if($unown == 1){$catchy=201;}}
- }
- if($catchy < 1){$catchy = $mappy->poke1;}
- $catchedchacha=mysql_query("SELECT * FROM `pokemon` WHERE `id`='$catchy'");
- $catched4u=mysql_fetch_object($catchedchacha);
- if($move == "Left"){$pokx = 16;$poky = -8;}
- if($move == "Right"){$pokx = -24;$poky = -8;}
- if($move == "Up"){$poky = 16;}
- if($move == "Down"){$poky = -24;}
- $pokx = 176 + $pokx;
- $poky = 105 + $poky;
- }
- // END RANDOM POKEMON
- ?>
- <script type='text/javascript'>
- document.onkeydown = keyCheck;
- function keyCheck(e){
- var KeyID = (window.event) ? event.keyCode : e.keyCode;
- switch(KeyID)
- {
- case 38:
- move("up");
- break;
- case 40:
- move("down");
- break;
- case 37:
- move("left");
- break;
- case 39:
- move("right");
- break;
- }
- return false;
- }
- function move(direction){
- window.location = "map.php?map=<? echo $mappy->id; ?>&id=<? $laid = rand(1,1000); echo $laid; ?>&move="+direction;
- }
- function catcho(){
- var radio=document.getElementsByTagName('input'),bool=false;
- for(var i=0;i<radio.length;i++){
- if(radio[i].type=='radio'&&radio[i].checked==true) bool=true;
- }
- if(bool == false){
- alert('Please select a pokeball.');
- }
- return bool;
- }
- </script>
- <script language="JavaScript" src="items/qtip.js" type="text/JavaScript"></script>
- <link rel="stylesheet" href="maps/map.css" type="text/css" media="screen" />
- <div class="title"><? echo $mappy->name; ?></div>
- <div class="contentcontent">
- <table class="ranks">
- <tr>
- <th width="498" rowspan="6">
- <center>
- <div style="z-index:0;width:336px;height:240px;background-image: url('maps/map<?echo$_GET['map'];?>.png');background-repeat: no-repeat;background-position: <? echo $x; ?>px <? echo $y; ?>px; border: 1px solid darkred;">
- <?if($pokx != ""){?><div style="z-index:5;width:336px;height:240px;background-image: url('<? echo $catched4u->minipic; ?>');background-repeat: no-repeat;background-position: <? echo $pokx; ?>px <? echo $poky; ?>px;"><?}?>
- <div style="position: relative;z-index:50;">
- <?
- $see = time() - 43400;
- $leftmin = $left - 176 - 1;
- $leftmax = $left + 144 + 1;
- $topmin = $top - 112 - 1;
- $topmax = $top + 112 + 1;
- $resulta = mysql_query("SELECT username, mapx, mapy, mavatar, direction FROM `users` WHERE `id`='$user->id' OR (`mapx` != '$left' OR `mapy` != '$top') AND `currentmap` = '".$_GET['map']."' AND `lastactive` > '".$see."' AND `mapx` > '$leftmin' AND `mapx` < '$leftmax' AND `mapy` > '$topmin' AND `mapy` < '$topmax' GROUP BY mapx, mapy ORDER BY `mapy` ASC");
- while($ussie = mysql_fetch_object($resulta)) {
- $others++;
- $mapx = 176 + ($ussie->mapx - $left);
- $mapy = 102 + ($ussie->mapy - $top);
- if($ussie->direction == ""){$ussie->direction="Down";}
- #if($ussie->username == $user->username){$own="own";}else{$own="";}
- if($ussie->username == $user->username){$ussie->direction=$move;}
- ?><div style="z-index:5;width:336px;height:240px;background-image: url('maps/avatars/<? echo $ussie->mavatar.$ussie->direction; ?>.png');background-repeat: no-repeat;background-position: <? echo $mapx; ?>px <? echo $mapy; ?>px;">
- <label title="<? echo $ussie->username; ?>"><a href='prof.php?user=<? echo $ussie->username; ?>' target='_blank'><img src="maps/nothing.png" style="position:absolute;left:<? echo $mapx; ?>px;top:<? echo $mapy; ?>px;overflow:visible"></a></label><?
- }
- ?>
- <div style="z-index:100;width:336px;height:240px;background-image: url('maps/map<?echo$_GET['map'];?>over.png');background-repeat: no-repeat;background-position: <? echo $x; ?>px <? echo $y; ?>px;">
- </div>
- <?
- while($za < $others){
- $za++;
- echo "</div>";
- }
- ?>
- </div>
- </div>
- </div>
- <?if($pokx != ""){?></div><?}?>
- </center>
- </th>
- <th>Movement</th>
- </tr>
- <td height="100">
- <table style="text-align: center;margin: auto;align:center;" align="center">
- <tr>
- <td colspan="3" width="20" style="border: 0;text-align: center;"><a href="?map=<?echo$_GET['map'];?>&id=<? echo $laid; ?>&move=up"><img src="img/arrow_up.png" border="0"></a></td>
- </tr>
- <tr>
- <td width="20" style="border: 0;text-align: center;"><a href="?map=<?echo$_GET['map'];?>&id=<? echo $laid; ?>&move=left"><img src="img/arrow_left.png" border="0"></td>
- <td width="20" style="border: 0;text-align: center;"><a href="?map=<?echo$_GET['map'];?>&id=<? echo $laid; ?>&move=down"><img src="img/arrow_down.png" border="0"></td>
- <td width="20" style="border: 0;text-align: center;"><a href="?map=<?echo$_GET['map'];?>&id=<? echo $laid; ?>&move=right"><img src="img/arrow_right.png" border="0"></td>
- </tr>
- </table>
- <br>
- <small><b><font color=red>Controls:</font></b> Either click using these green arrows or use your arrow keys.<br>Hover your mouse over the players to view their usernames.</small>
- </td>
- <tr><th>Map Result(s)</th></tr>
- <tr>
- <td>
- <br>
- <?
- if($_GET['move'] == "" && $_GET['catch'] == "" && $_GET['item'] == ""){
- ?>
- <b><? echo $mappy->desc; ?></b>
- <?
- }else{
- if($_GET['item'] != "" && $user->gender == "T"){
- $item1 = mysql_query("SELECT * from `items` WHERE `id` = '$user->pok'");
- $item = mysql_fetch_object($item1);
- $same = $item->id * $top;
- if($item->id > 0 && $user->gender == "T" && $_GET['item'] == $same){
- Give_Item($item->id, $user->id);
- $user->itemcatch = $user->itemcatch + 1;
- mysql_query("UPDATE `users` SET `itemcatch` = '$user->itemcatch', `pok` = '0' WHERE `id`='$user->id'");
- echo "<table border='0' width='120' height='120' align='center' style='border: 0'><td style='border: 0' align='center'><img src='".$item->image."'></td></table><br>You've picked up the ".strtolower($item->name)." and placed it in your backpack!";
- require_once 'figg.php';
- $end = 1;
- }
- }
- if($_GET['catch'] != "" && $end != 1 && $_POST['pokeball'] != ""){
- $same = $user->pok * $left;
- $catched1 = mysql_query("SELECT id,name,pic FROM `pokemon` WHERE `id`='$user->pok'");
- $catched = mysql_fetch_object($catched1);
- $ptwo = Check_Item($_POST['pokeball'], $user->id);
- if($_POST['pokeball'] == 2 && $catched->id != 555595 ){$chance = 70;}
- if($_POST['pokeball'] == 3 && $catched->id != 555595){$chance = 77;}
- if($_POST['pokeball'] == 4 && $catched->id != 555595){$chance = 90;}
- if($_POST['pokeball'] == 63 && $catched->id != 555595){$chance = 100;}
- if($_POST['pokeball'] == 5 && $catched->id != 555595){$chance = 100;}
- if($_POST['pokeball'] == 36 && $catched->id == 555595){$chance = 100;}
- if($_POST['pokeball'] == 102 && $catched->id == 555595){$chance = 100;}
- if(rand(1,100) > $chance && $ptwo != 0){
- Take_Multi($_POST['pokeball'], $user->id, 1);
- echo "<font color=red><b>You failed to catch the wild pokemon with your pokeball.</b></font>";
- $end = 1;
- }else{
- if($catched->id > 0 && $user->gender != "T" && $same == $_GET['catch'] && $ptwo != 0){
- Take_Multi($_POST['pokeball'], $user->id, 1);
- echo "The following pokemon has been added to your box:<br>";
- $gender = $user->gender;
- $admin = 1337;
- $addpoke = $catched->id;
- include 'addpoke.php';
- $user->catch = $user->catch + 1;
- mysql_query("UPDATE `users` SET `catch` = '$user->catch', `pok` = '0' WHERE `id`='$user->id'");
- require_once 'figg.php';
- $end = 1;
- }
- }
- }
- if($end == 1){$alandu = "";}
- if($alandu != 5){
- $where = rand(1,28);
- if ($where == "1"){$whereone = "Nope. Nothing there.";}
- if ($where == "2"){$whereone = "Oh finally found something! Oh, it's just the wind!";}
- if ($where == "3"){$whereone = "I've been searching all day. Where's all the pokemon gone!?";}
- if ($where == "4"){$whereone = "I'm sure I saw a pokemon somewhere near here.";}
- if ($where == "5"){$whereone = "What's that pokemon? Oh, it's just a cat!";}
- if ($where == "6"){$whereone = "Awww.. Tough luck... I can't find anything!";}
- if ($where == "7"){$whereone = "Come out, come out, wherever you are.";}
- if ($where == "8"){$whereone = "There must be some pokemon around here!?";}
- if ($where == "9"){$whereone = "Oh I found one! Oh.. it's a rock!";}
- if ($where == "10"){$whereone = "I still can't find the pokemon I'm looking for...";}
- if ($where == "11"){$whereone = "Pokemon! I gotta catch 'em all!";}
- if ($where == "12"){$whereone = "Oh pokemon... where are you?";}
- if ($where == "13"){$whereone = "Why won't you just come out!?";}
- if ($where == "14"){$whereone = "If you won't come to me I'll just find you!";}
- if ($where == "15"){$whereone = "I found something! Oh, it's just a bucket!";}
- if ($where == "16"){$whereone = "Just exactly where are all the pokemon hiding?";}
- if ($where == "17"){$whereone = "What's that pokemon in the sky?! Oh, It's just a cloud.";}
- if ($where == "18"){$whereone = "Finally! I hear something! Oh, it was my footsteps!";}
- if ($where == "19"){$whereone = "What's that behind me!? Oh, my shadow.";}
- if ($where == "20"){$whereone = "Ooh.. what was that? I just felt a nice breeze through my hair!";}
- if ($where == "21"){$whereone = "What? What's that on my head? Did a bird just... Oh no..";}
- if ($where == "22"){$whereone = "Yes! I stepped on something squishy... Oh no! Don't tell me it's...!";}
- if ($where == "23"){$whereone = "Never give up!";}
- if ($where == "24"){$whereone = "I'm sure the next step I take I'll be able to find a pokemon.";}
- if ($where == "25"){$whereone = "These pokemon are too good at hiding!";}
- if ($where == "26"){$whereone = "Oh no! I almost slipped over my own shoe!";}
- if ($where == "27"){$whereone = "Oops... I stood on a slug.";}
- if ($where == "28"){$whereone = "Shhhh... I hear footsteps... Oh, they were only mine, silly buns...";}
- if ($block == 1){
- $blocky = rand(1,8);
- if($blocky == 1){$whereone = "<font color='red'>Nope, I can't move there...</font>";}
- if($blocky == 2){$whereone = "<font color='red'>There seems to be something blocking me...</font>";}
- if($blocky == 3){$whereone = "<font color='red'>It's blocked, I'll need to find another way in.</font>";}
- if($blocky == 4){$whereone = "<font color='red'>Hmmm, I don't think I can go there.</font>";}
- if($blocky == 5){$whereone = "<font color='red'>I already said, I can't go there!</font>";}
- if($blocky == 6){$whereone = "<font color='red'>It looks impossible to walk over there.</font>";}
- if($blocky == 7){$whereone = "<font color='red'>I wish there wasn't so many obstacles.</font>";}
- if($blocky == 8){$whereone = "<font color='red'>Why bother? It's obvious I can't move there!</font>";}
- if($blocky == 9){$whereone = "<font color='red'></font>";}
- }
- }
- if($message != ""){
- $whereone = $message;
- $alandu = 1;
- }
- //found results
- //HWEEN START
- if(rand(1,120) == 1 && $end == "1337"){
- $item1 = mysql_query("SELECT id,name,image from `items` WHERE `id` = '74'");
- $item = mysql_fetch_object($item1);
- $obj = 74;
- $genderz = "T";
- mysql_query("UPDATE `users` SET `gender` = '".$genderz."', `pok` = '$obj' WHERE `id`='$user->id'");
- echo "<form action='map.php?map=".$mappy->id."&item=".$obj * $top."' method='post'><table style='border: 0' width='100' height='100' align='center'><td style='vertical-align:middle;border: 0' align='center'><img src='".$item->image."'></td></table><br><br>You feel a breeze and look up. A Spooky Scarf is floating around you!<br>Will you take this item?<br><br><input type='submit' value='Take Item' name='submit' class='longbutton'></form>";
- $end = 1;
- $alandu = 1;
- }
- //HWEEN END
- if ($alandu == "5"){
- //start find items
- if($user->handhelds == 41 || $user->handhelds == 42){
- if($user->handhelds == 41){$name="Itemfinder";}else{$name="Dowsing Machine";}
- $anitem = rand(1,2000);
- if($anitem == 1){
- $obj = 43;
- }
- if($anitem > 1994){
- $select = 1;
- $item1 = mysql_query("SELECT id,name,image from `items` WHERE `map` > '10000' ORDER BY RAND() Limit 0,1");
- $item = mysql_fetch_object($item1);
- $obj = $item->id;
- }elseif($anitem > 1970){
- $select = 1;
- $item1 = mysql_query("SELECT id,name,image from `items` WHERE `map` = '2' ORDER BY RAND() Limit 0,1");
- $item = mysql_fetch_object($item1);
- $obj = $item->id;
- }elseif($anitem > 1950){
- $select = 1;
- $item1 = mysql_query("SELECT id,name,image from `items` WHERE `map` = '1' ORDER BY RAND() Limit 0,1");
- $item = mysql_fetch_object($item1);
- $obj = $item->id;
- }elseif($anitem > 1930){
- $select = 1;
- $item1 = mysql_query("SELECT id,name,image from `items` WHERE `map` = '3' ORDER BY RAND() Limit 0,1");
- $item = mysql_fetch_object($item1);
- $obj = $item->id;
- }
- if($obj > 0){
- if($item->id < 1){
- $item1 = mysql_query("SELECT id,name,image from `items` WHERE `id` = '$obj'");
- $item = mysql_fetch_object($item1);
- }
- $genderz = "T";
- mysql_query("UPDATE `users` SET `gender` = '".$genderz."', `pok` = '$obj' WHERE `id`='$user->id'");
- echo "<form action='map.php?map=".$mappy->id."&item=".$obj * $top."' method='post'><img src='".$item->image."'><br><br><br><br>Your ".$name." has detected a ".strtolower($item->name)."!<br>Will you pick up this item?<br><br><input type='submit' value='Take Item' name='submit' class='longbutton'></form>";
- $end = 1;
- }
- }
- }
- //end find items
- if($_GET['map'] == 10 && $where == 1 && $user->city == "Fuchsia City" && $left > 816 && $left < 1568){
- mysql_query("UPDATE `users` SET `pok` = '1337' WHERE `id`='$user->id'");
- echo '<img src="img/pokemon/000.png"> <br><br>Wild Missingno. appeared!<br>Will you catch this pokemon?<br><br>
- <INPUT TYPE="longbutton" onClick="parent.location=\'battle.php?opp=Missingno.\'" value="Catch Pokemon!" class="longbutton">';
- $catchy=0;$end=1;$alandu=1;
- }
- if($alandu == 5 && $obj < 1 && $block != 1){
- $gendy1=rand(0,1);
- if($gendy1==0){
- $gendy=M;
- }
- if($gendy1==1){
- $gendy=F;
- }
- mysql_query("UPDATE `users` SET `pok` = '".$catchy."', `gender` = '".$gendy."' WHERE `id`='$user->id'");
- echo "<form action='map.php?map=".$mappy->id."&catch=".$catchy*$left."' method='post' background= url(\'maps/1.png\') onsubmit='return catcho ( );'><img src='$catched4u->pic'> <br><br>Wild ".$catched4u->name." appeared!<br>Will you catch this pokemon?<br><br><input type='submit' name='submit' value='Catch Pokemon' class='longbutton'>";
- $form = 1;
- }
- if($alandu != 5 && $end != 1){
- echo $whereone;
- }
- }
- if($addpoke == ""){echo"<br><br>";}
- ?>
- </td>
- </tr>
- <tr><th>Your Pokéball(s)</th></tr>
- <td>
- <table width="100%">
- <tr>
- <?
- $errormez = ' onClick="alert(\'You don\\\'t have any of these.\');this.checked=false;"';
- $ptwo = Check_Item(2, $user->id);if($ptwo == 0){$locktwo = $errormez;}elseif($_COOKIE['lastpokeball'] == 2){$locktwo=" checked";}
- $pthree = Check_Item(3, $user->id);if($pthree == 0){$lockthree = $errormez;}elseif($_COOKIE['lastpokeball'] == 3){$lockthree=" checked";}
- $pfour = Check_Item(4, $user->id);if($pfour == 0){$lockfour = $errormez;}elseif($_COOKIE['lastpokeball'] == 4){$lockfour=" checked";}
- $psixtythree = Check_Item(63, $user->id);if($psixtythree == 0){$locksixtythree = $errormez;}elseif($_COOKIE['lastpokeball'] == 63){$locksixtythree=" checked";}
- $pgl = Check_Item(5, $user->id);if($pgl == 0){$lockpgl = $errormez;}elseif($_COOKIE['lastpokeball'] == 3){$lockpgl=" checked";}
- $ps = Check_Item(36, $user->id);if($ps == 0){$locks = $errormez;}elseif($_COOKIE['lastpokeball'] == 3){$locks=" checked";}
- $plegend = Check_Item(102, $user->id);if($plegend == 0){$locklegend = $errormez;}elseif($_COOKIE['lastpokeball'] == 3){$locklegend=" checked";}
- ?>
- <td style="border: 1px solid darkred; background-color: black;width:14.5%;"><img src="items/pokeball.png" border="0"><br><input type="radio" name="pokeball" value="2"<?echo$locktwo;?>> <small>[x<? echo number_format($ptwo); ?>]</small></td>
- <td style="border: 1px solid darkred; background-color: black;width:14.5%;"><img src="items/greatball.png" border="0"><br><input type="radio" name="pokeball" value="3"<?echo$lockthree;?>> <small>[x<? echo number_format($pthree); ?>]</small></td>
- <td style="border: 1px solid darkred; background-color: black;width:14.5%;"><img src="items/ultraball.png" border="0"><br><input type="radio" name="pokeball" value="4"<?echo$lockfour;?>> <small>[x<? echo number_format($pfour); ?>]</small></td>
- <td style="border: 1px solid darkred; background-color: black;width:14.5%;"><img src="items/masterball.png" border="0"><br><input type="radio" name="pokeball" value="63"<?echo$locksixtythree;?>> <small>[x<? echo number_format($psixtythree); ?>]</small></td>
- <td style="border: 1px solid darkred; background-color: black;width:14.5%;"><img src="items/legendball.png" border="0"><br><input type="radio" name="pokeball" value="102"<?echo$locklegend;?>> <small>[x<? echo number_format($plegend); ?>]</small></td>
- <td style="border: 1px solid darkred; background-color: black;width:14.5%;"><img src="items/rainbow pokeball.png" border="0"><br><input type="radio" name="pokeball" value="5"<?echo$lockpgl;?>> <small>[x<? echo number_format($pgl); ?>]</small></td>
- <td style="border: 1px solid darkred; background-color: black;width:14.5%;"><img src="items/shadow pokeball.png" border="0"><br><input type="radio" name="pokeball" value="36"<?echo$locks;?>> <small>[x<? echo number_format($ps); ?>]</small></td>
- <?if($form == 1){echo"</form>";}?>
- </tr>
- </table>
- </td>
- </table>
- </div>
- <?
- include 'rightmenu.php';}?>
Add Comment
Please, Sign In to add comment