0)) header("Location: index.php");
include "config.php";
include "functions.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
if ($user['room'] == 403) {
include "startpodzemel.php";
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); }
if($_GET['act']=="cexit")
{
$das=mysql_query("select glava,glav_id from `labirint` where user_id='".$user['id']."'");
$rf=mysql_fetch_array($das);
$glav_id=$rf["glav_id"];
$glava=$rf["glava"];
if($glava==$user['login']){//1
$des=mysql_query("select login,user_id from `labirint` where `glav_id`='$glav_id' and `login`!='$glava'");
$r=0;
while($raf=mysql_fetch_array($des)){//2
$r++;
$log = $raf["login"];
$id_us = $raf["user_id"];
}//2
if($r>=1){
mysql_query("UPDATE labirint SET glav_id='$id_us',glava='$log' WHERE glav_id='".$user['id']."'");
mysql_query("UPDATE podzem3 SET glava='$log' WHERE glava='".$user['login']."'");
}else{
mysql_query("DELETE FROM labirint WHERE glav_id='".$user['id']."'");
mysql_query("DELETE FROM podzem3 WHERE glava='".$user['login']."'");
mysql_query("DELETE FROM podzem4 WHERE glava='".$user['login']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Подземное зелье жизни' and owner='".$user['id']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Ключик №1' and owner='".$user['id']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Ключик №2' and owner='".$user['id']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Ключик №3' and owner='".$user['id']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Ключик №4' and owner='".$user['id']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Ключик №5' and owner='".$user['id']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Ключик №6' and owner='".$user['id']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Ключик №7' and owner='".$user['id']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Ключик №8' and owner='".$user['id']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Ключик №9' and owner='".$user['id']."'");
mysql_query("DELETE FROM `inventory` WHERE name='Ключик №10' and owner='".$user['id']."'");
}
}//1
$e = mysql_query("DELETE FROM labirint WHERE user_id='".$user['id']."'");
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '402',`online`.`room` = '402' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$user['id']."' ;");
print ""; exit();
}
?>
);">
$ros=mysql_query("SELECT * FROM `labirint` WHERE `user_id`='{$_SESSION['uid']}'");
$mir=mysql_fetch_array($ros);
$mesto = $mir['location'];
$vektor = $mir['vector'];
$glava = $mir['glava'];
if($_GET['act'] == "luka" and $mesto == '28'){print ""; exit();}
// 3 smerti == vqlet
if($mir['dead']>=3){print ""; exit();}
//vignat
if($_GET['kill']){
if($user['login']==$glava){
$rost=mysql_fetch_array(mysql_query("SELECT `user_id` FROM `labirint` WHERE `glava`='{$glava}' and `login`='".mysql_escape_string($_GET['kill'])."'"));
$varsa = mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '".mysql_escape_string($_GET['kill'])."' LIMIT 1;"));
if($varsa and $rost){
if($_GET['kill']!=$glava){
mysql_query("DELETE FROM labirint WHERE login='".mysql_escape_string($_GET['kill'])."'");
//mysql_query("DELETE FROM `inventory` WHERE name='Бутерброд' and owner='".$varsa['id']."' and podzem='1'");
print ""; exit();
}else{print"Себя нельзя выгнать.";}
}else{print"Такого логина не существует или он не в вашей группе.";}
}}
//smena lider
if($_GET['change']){
if($user['login']==$glava){
$rost=mysql_fetch_array(mysql_query("SELECT `user_id` FROM `labirint` WHERE `glava`='$glava' and `login`='".mysql_escape_string($_GET['change'])."'"));
$varsa = mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '".mysql_escape_string($_GET['change'])."' LIMIT 1;"));
if($varsa and $rost){
if($_GET['change']!=$glava){
mysql_query("UPDATE labirint SET glav_id='".$varsa['id']."',glava='".$_GET['change']."' WHERE glava='".$user['login']."'");
mysql_query("UPDATE podzem3 SET glava='".$_GET['change']."' WHERE glava='".$user['login']."'");
print ""; exit();
}else{print"Вы и так Лидер.";}
}else{print"Персонаж не существует или он не в вашей группе.";}
}}
$wait_sec=$mir["visit_time"];
$new_t=time();
if($wait_sec<$new_t)
{
print ""; exit();
}
if($mir['dead']>=3){print ""; exit();}
//2ой Ярус
if($_GET['act'] == "et2" and $mesto == '47' and $mir['name'] == "Канализация 1 этаж"){
mysql_query("UPDATE labirint SET location='16', vector='180', name='Канализация 2 этаж', l='453', t='226' WHERE glava='".$user['login']."'");
print "Спускаемся на 2ой ярус...";
$ros=mysql_query("SELECT * FROM `labirint` WHERE `user_id`='{$_SESSION['uid']}'");
$mir=mysql_fetch_array($ros);
$mesto = $mir['location'];
$vektor = $mir['vector'];
$glava = $mir['glava'];
}
//1ый Ярус
if($_GET['act'] == "et1" and $mesto == '6' and $mir['name'] == "Канализация 2 этаж"){
mysql_query("UPDATE labirint SET location='48', vector='270', name='Канализация 1 этаж', l='477', t='190' WHERE glava='".$user['login']."'");
print "Поднимаемся на верхний ярус...";
$ros=mysql_query("SELECT * FROM `labirint` WHERE `user_id`='{$_SESSION['uid']}'");
$mir=mysql_fetch_array($ros);
$mesto = $mir['location'];
$vektor = $mir['vector'];
$glava = $mir['glava'];
}
include "canalization_mod.php";
////////////нападение////////////////
if($_GET['act'] == "atk"){
$d = $_GET['n']+10;
$d2 = $_GET['n']-10;
$d3 = $_GET['n']+1;
$d4 = $_GET['n']-1;
$red = mysql_query("SELECT n".mysql_escape_string($_GET['n'])." FROM podzem3 WHERE glava='".$mir['glava']."' and name='".$mir['name']."'");
if($gef = mysql_fetch_array($red)){
$dop = $gef["n".$_GET['n'].""];
}
if($mesto == $d or $mesto == $d1 or $mesto == $d2 or $mesto == $d3 or $mesto == $d4){
if($dop!=''){
include"podzem/atk.php";
}
}
}
if($_GET['act']=='el') {
if($mir['el']!='1' and $mesto==$mir['el']){
mysql_query("INSERT INTO `inventory` (`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`present`,`magic`,`otdel`,`isrep`)
VALUES('".$user['id']."','Подземное зелье жизни','50','1','0','food_l9.gif','5','Подземка','8','6','0') ;");
mysql_query("UPDATE `labirint` SET el='1' WHERE `glava`='".$glava."' and `login`='".$user['login']."'");
print" Вы получили 'Подземное зелье жизни' ";
}else{
if($mir['el']=='1'){print" Вы уже брали зелье! ";}
else{print" Невозможно! Вы далеко! ";}}
}
///////////////Сбор чистых гаек/////////////
if($_GET['sun']=='se_gaika_c'){
$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n$mesto"];
if($stloc=='508' or $stloc=='507' or $stloc=='506'){
if($stloc=='508'){mysql_query("UPDATE `podzem3` SET n$mesto='507' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='507'){mysql_query("UPDATE `podzem3` SET n$mesto='506' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='506'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Чистая гайка'");
if($g = mysql_fetch_array($f)){
$koll = $g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Чистая гайка'");
}else{
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Чистая гайка','1','g_c.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Чистая гайка";
include "podzem_brat.php";
print" Вы получили 'Чистая гайка'";
}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
}
///////////////Сбор гаек/////////////
if($_GET['sun']=='gaika'){
$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n$mesto"];
if($stloc=='503' or $stloc=='502' or $stloc=='501'){
if($stloc=='503'){mysql_query("UPDATE `podzem3` SET n$mesto='502' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='502'){mysql_query("UPDATE `podzem3` SET n$mesto='501' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='501'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
if($g = mysql_fetch_array($f)){
$koll = $g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1, massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
}else{
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Гайка";
include "podzem_brat.php";
print" Вы получили 'Гайка'";
}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
}
/////////////////////////////////////
///////////////Сбор вентилей/////////////
if($_GET['sun']=='ventil'){
$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n$mesto"];
if($stloc=='504' or $stloc=='505' or $stloc=='506'){
if($stloc=='506'){mysql_query("UPDATE `podzem3` SET n$mesto='505' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='505'){mysql_query("UPDATE `podzem3` SET n$mesto='504' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='504'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Вентиль'");
if($g = mysql_fetch_array($f)){
$koll = $g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.2 WHERE owner='".$user['id']."' and `type`='200' and `name`='Вентиль'");
}else{
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Вентиль','1','v.gif','".$user['id']."','200','0.2','0','Лука')");
}
$mis = "Вентиль";
include "podzem_brat.php";
print" Вы получили 'Вентиль'";
}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
}
///////////////Сбор Чистых вентилей/////////////
if($_GET['sun']=='se_ventil'){
$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n$mesto"];
if($stloc=='512' or $stloc=='513' or $stloc=='514'){
if($stloc=='514'){mysql_query("UPDATE `podzem3` SET n$mesto='513' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='513'){mysql_query("UPDATE `podzem3` SET n$mesto='512' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='512'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Чистый вентиль'");
if($g = mysql_fetch_array($f)){
$koll = $g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.4 WHERE owner='".$user['id']."' and `type`='200' and `name`='Чистый вентиль'");
}else{
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Чистый вентиль','1','v2.gif','".$user['id']."','200','0.4','0','Лука')");
}
$mis = "Чистый вентиль";
include "podzem_brat.php";
print" Вы получили 'Чистый вентиль'";
}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
}
/////////////////////////////////////
///////////////Сбор Болтов/////////////
if($_GET['sun']=='bolt'){
$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n$mesto"];
if($stloc=='507' or $stloc=='508' or $stloc=='509'){
if($stloc=='509'){mysql_query("UPDATE `podzem3` SET n$mesto='508' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='508'){mysql_query("UPDATE `podzem3` SET n$mesto='507' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='507'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Болт'");
if($g = mysql_fetch_array($f)){
$koll = $g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Болт'");
}else{
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Болт','1','bolt.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Болт";
include "podzem_brat.php";
print" Вы получили 'Болт'";
}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
}
///////////////Сбор Длинных Болтов/////////////
if($_GET['sun']=='se_gaika_bd'){
$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n$mesto"];
if($stloc=='511' or $stloc=='510' or $stloc=='509'){
if($stloc=='511'){mysql_query("UPDATE `podzem3` SET n$mesto='510' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='510'){mysql_query("UPDATE `podzem3` SET n$mesto='509' WHERE glava='$glava' and name='".$mir['name']."'");}
if($stloc=='509'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Длинный болт'");
if($g = mysql_fetch_array($f)){
$koll = $g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.2 WHERE owner='".$user['id']."' and `type`='200' and `name`='Длинный болт'");
}else{
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Длинный болт','1','dbolt.gif','".$user['id']."','200','0.2','0','Лука')");
}
$mis = "Длинный болт";
include "podzem_brat.php";
print" Вы получили 'Длинный болт'";
}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
}
/////////////////////////////////////
///////////////Сбор ключиик/////////////
if($_GET['sun']=='kluchiik'){
$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n$mesto"];
if($stloc=='510'){
if($stloc=='510'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Ключиик','1','kluchik.gif','".$user['id']."','200','0.5','0','Лука')");
$mis = "Ключиик";
include "podzem_brat.php";
print" Вы получили 'Ключиик'";
}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
}
/////////////////////////////////////
///////////////Сбор сундуков/////////////
if($_GET['act']=='sunduk'){
$ferrr = mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n".$_GET['n'].""];
if($stloc=='13.1'){
$d = $_GET['n']+10;
$d2 = $_GET['n']-10;
$d3 = $_GET['n']+1;
$d4 = $_GET['n']-1;
if($mesto==$d or $mesto==$d2 or $mesto==$d3 or $mesto==$d4){
if($stloc=='13.1'){mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='13.0' WHERE glava='$glava' and name='".$mir['name']."'");}
$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
if($g = mysql_fetch_array($f)){
$koll = $g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
}else{
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Гайка";
include "podzem_brat.php";
print" Вы получили 'Гайка'";
}
}else{if($stloc=='13.0'){print" Кто-то оказался быстрее!";}}
}
/////////////////////////////////////
///////////////Сбор сундуков (БОЛТ)/////////////
if($_GET['act']=='sunduk2'){
$ferrr = mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n".$_GET['n'].""];
if($stloc=='14.1'){
$d = $_GET['n']+10;
$d2 = $_GET['n']-10;
$d3 = $_GET['n']+1;
$d4 = $_GET['n']-1;
if($mesto==$d or $mesto==$d2 or $mesto==$d3 or $mesto==$d4){
if($stloc=='14.1'){mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='14.0' WHERE glava='$glava' and name='".$mir['name']."'");}
$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Болт'");
if($g = mysql_fetch_array($f)){
$koll = $g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Болт'");
}else{
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Болт','1','bolt.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Болт";
include "podzem_brat.php";
print" Вы получили 'Болт'";
}
}else{if($stloc=='14.0'){print" Кто-то оказался быстрее!";}}
}
/////////////////////////////////////
///////////////Сбор ключей/////////////
if($_GET['act']=='key'){
$ferrr = mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n".$_GET['n'].""];
$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Ключик №".mysql_escape_string($_GET['b'])."'");
$g = mysql_fetch_array($f);
if(($stloc=='key1' or $stloc=='key2' or $stloc=='key3' or $stloc=='key4' or $stloc=='key5' or $stloc=='key6' or $stloc=='key7' or $stloc=='key8' or $stloc=='key9' or $stloc=='key10') and !$g){
if($mesto==$_GET['n']){
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Ключик №".mysql_escape_string($_GET['b'])."','1','$stloc.gif','".$user['id']."','200','0.1','0','Подземка')");
//Удаляем ключик с локи
//mysql_query("UPDATE `podzem4` SET n".$_GET['n']." = '' WHERE glava='".$glava."' and name='".$mir['name']."'");
print" Вы получили 'Ключик №".$_GET['b']."'";
}
}else{if($g){print" У вас уже есть Ключик №".$_GET['b']."!";}}
}
/////////////////////////////////////
///////////////Сбор гаек из стоков/////////////
if($_GET['act']=='stok'){
$ferrr = mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n".$_GET['n'].""];
$shans = rand(0,100);
if($shans<51){
mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='11.0' WHERE glava='$glava' and name='".$mir['name']."'");
$stloc='11.0';
}
if($stloc=='11.1'){
if($mesto==$_GET['n']){
if($stloc=='11.1'){mysql_query("UPDATE `podzem4` SET n".mysql_escape_string($_GET['n'])."='11.0' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
if($g = mysql_fetch_array($f)){
$koll = $g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
}else{
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Гайка";
include "podzem_brat.php";
print" Вы получили 'Гайка'";
}
}else{if($stloc=='11.0'){print" Попахивает...";}}
}
///////////////Сбор гаек из стоков/////////////
if($_GET['act']=='stok2'){
$ferrr = mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
$retr = mysql_fetch_array($ferrr);
$stloc = $retr["n".$_GET['n'].""];
$shans = rand(0,100);
if($shans<51){
mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='12.0' WHERE glava='$glava' and name='".$mir['name']."'");
$stloc='12.0';
}
if($stloc=='12.1'){
$d = $_GET['n']+10;
$d2 = $_GET['n']-10;
$d3 = $_GET['n']+1;
$d4 = $_GET['n']-1;
if($mesto==$d or $mesto==$d2 or $mesto==$d3 or $mesto==$d4){
if($stloc=='12.1'){mysql_query("UPDATE `podzem4` SET n".mysql_escape_string($_GET['n'])."='12.0' WHERE glava='$glava' and name='".$mir['name']."'");}
$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
if($g = mysql_fetch_array($f)){
$koll = $g["maxdur"];
mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
}else{
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Гайка";
include "podzem_brat.php";
print" Вы получили 'Гайка'";
}
}else{if($stloc=='12.0'){print" Попахивает...";}}
}
/////////////////////////////////////
if($mesto == '1'){$mesto = '01';}
if($mesto == '2'){$mesto = '02';}
if($mesto == '3'){$mesto = '03';}
if($mesto == '4'){$mesto = '04';}
if($mesto == '5'){$mesto = '05';}
if($mesto == '6'){$mesto = '06';}
if($mesto == '7'){$mesto = '07';}
if($mesto == '8'){$mesto = '08';}
if($mesto == '9'){$mesto = '09';}
// переходы
if(isset($_GET['left'])){
mysql_query("UPDATE `labirint` SET `vector` = '".mysql_escape_string($_GET['left'])."' WHERE `user_id` = '{$_SESSION['uid']}' ;");
//header('Location:canalizaciya.php');
die("");
}
if(isset($_GET['right'])){
mysql_query("UPDATE `labirint` SET `vector` = '".mysql_escape_string($_GET['right'])."' WHERE `user_id` = '{$_SESSION['uid']}' ;");
//header('Location:canalizaciya.php');
die("");
}
$fer = mysql_query("SELECT n".mysql_escape_string($rhar[$mesto][$_GET['path']])." FROM podzem3 WHERE glava='".$mir['glava']."' and name='".$mir['name']."'");
if($ret = @mysql_fetch_array($fer)){
$stoi = $ret["n".$rhar[$mesto][$_GET['path']].""];
}
if($rhar[$mesto][$_GET['path']] > 0 and $_GET['path'] < 4 and $_GET['path'] >= 0 and ($_SESSION['time'] <= time()) and ($stoi=='' or $stoi>'500')) {
if($_GET['path']==0) {$loc2=$mesto+10;}
if($_GET['path']==1) {$loc2=$mesto+1;}
if($_GET['path']==2) {$loc2=$mesto-10;}
if($_GET['path']==3) {$loc2=$mesto-1;}
$fers = mysql_query("SELECT n$loc2,v$loc2 FROM podzem4 WHERE glava='$glava' and name='".$mir['name']."'");
$rets = mysql_fetch_array($fers);
$ins = mysql_query("SELECT id FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Ключик №".$rets["n$loc2"]."'");
$setr = mysql_fetch_array($ins);
if($rets["n$loc2"]>=1 and $rets["n$loc2"]<=10 and !$setr){
print" Нужен ключ №".$rets["n$loc2"]."".$rets["n$mesto"]."";}else{
$vrem=30*60+time();
if($_GET['path']==0) {$nav='t=t-12';}
if($_GET['path']==1) {$nav='l=l+12';}
if($_GET['path']==2) {$nav='t=t+12';}
if($_GET['path']==3) {$nav='l=l-12';}
mysql_query("UPDATE `labirint` SET `location` = '".mysql_escape_string($rhar[$mesto][$_GET['path']])."',`visit_time`='$vrem',$nav WHERE `user_id` = '{$_SESSION['uid']}' ;");
$_SESSION['time'] = time()+1;
//header('Location:canalizaciya.php');
die("");
}
}
?>
". echo nick($user)."";
?>
Персонаж
Hp
Звание
Подземелье
$rog=mysql_query("SELECT login,name,glava FROM `labirint` WHERE `glava`='$glava'");
while($more=mysql_fetch_array($rog)){
$big = mysql_fetch_array(mysql_query("SELECT hp,maxhp,id FROM `users` WHERE `login` = '".$more['login']."'"));
?>