battles/canalizaciya.php

1016 lines
44 KiB
PHP
Raw Permalink Normal View History

2018-01-28 16:40:49 +00:00
<?php
use Battles\Template, Battles\User;
require_once "functions.php";
if (User::getInstance()->getRoom() == 403) {
include "startpodzemel.php";
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']) {
$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)) {
2020-09-30 14:06:12 +00:00
$r++;
$log = $raf["login"];
$id_us = $raf["user_id"];
}
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'] . "'");
2020-09-30 14:06:12 +00:00
} 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'] . "'");
2020-09-30 14:06:12 +00:00
$items_to_delete = [
'Подземное зелье жизни',
'Ключик №1',
'Ключик №2',
'Ключик №3',
'Ключик №4',
'Ключик №5',
'Ключик №6',
'Ключик №7',
'Ключик №8',
'Ключик №9',
'Ключик №10'
];
db::c()->query('DELETE FROM inventory WHERE name IN ("?s") AND owner_id = ?i', implode(",", $items_to_delete), User::getInstance()->getId());
2020-09-30 14:06:12 +00:00
}
}
$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 "<script>location.href='vxod.php'</script>";
exit();
2020-09-30 14:06:12 +00:00
}
2018-01-28 16:40:49 +00:00
function podzem_brat()
{
$frt = mysql_query("select user_id from `labirint` where glava='" . $glava . "'");
while ($rbb = mysql_fetch_array($frt)) {
addchp('<b>' . User::getInstance()->getLogin() . '</b> поднял предмет "' . $mis . '". ', '{[]}' . Nick::id($rbb["user_id"])->short() . '{[]}');
2020-09-30 14:06:12 +00:00
}
}
}
Template::header('canalizaciya');
2018-01-28 16:40:49 +00:00
$ros = mysql_query("SELECT * FROM `labirint` WHERE `user_id`='{$_SESSION['uid']}'");
$mir = mysql_fetch_array($ros);
2018-01-28 16:40:49 +00:00
$mesto = $mir['location'];
$vektor = $mir['vector'];
$glava = $mir['glava'];
if ($_GET['act'] == "luka" and $mesto == '28') {
print "<script>location.href='podzem_dialog.php'</script>";
exit();
}
2018-01-28 16:40:49 +00:00
// 3 smerti == vqlet
if ($mir['dead'] >= 3) {
print "<script>location.href='?act=cexit'</script>";
exit();
}
2018-01-28 16:40:49 +00:00
//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']) . "'");
2018-01-28 16:40:49 +00:00
//mysql_query("DELETE FROM `inventory` WHERE name='Бутерброд' and owner='".$varsa['id']."' and podzem='1'");
print "<script>location.href='canalizaciya.php'</script>";
exit();
} else {
print"<span class='error'>Себя нельзя выгнать.</span>";
}
} else {
print"<span class='error'>Такого логина не существует или он не в вашей группе.</span>";
}
}
}
2018-01-28 16:40:49 +00:00
//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 "<script>location.href='canalizaciya.php'</script>";
exit();
} else {
print"<span class='error'>Вы и так Лидер.</span>";
}
} else {
print"<span class='error'>Персонаж не существует или он не в вашей группе.</span>";
}
}
}
$wait_sec = $mir["visit_time"];
$new_t = time();
if ($wait_sec < $new_t) {
print "<script>location.href='?act=cexit'</script>";
exit();
}
if ($mir['dead'] >= 3) {
print "<script>location.href='?act=cexit'</script>";
exit();
}
2018-01-28 16:40:49 +00:00
//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ой ярус...";
2018-01-28 16:40:49 +00:00
$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'];
2018-01-28 16:40:49 +00:00
}
//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 "Поднимаемся на верхний ярус...";
2018-01-28 16:40:49 +00:00
$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'];
2018-01-28 16:40:49 +00:00
}
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 || $mesto == $d2 || $mesto == $d3 || $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"&nbsp;<span class='success'>Вы получили 'Подземное зелье жизни'</span>" . PHP_EOL;
} else {
if ($mir['el'] == '1') {
print"&nbsp;<span class='error'>Вы уже брали зелье!</span>" . PHP_EOL;
} else {
print"&nbsp;<span class='error'>Невозможно! Вы далеко!</span>" . PHP_EOL;
}
}
2018-01-28 16:40:49 +00:00
}
///////////////Сбор чистых гаек/////////////
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 = "Чистая гайка";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Чистая гайка'</span>";
} else {
if ($stloc == '') {
print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";
}
}
2018-01-28 16:40:49 +00:00
}
///////////////Сбор гаек/////////////
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 = "Гайка";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Гайка'</span>";
} else {
if ($stloc == '') {
print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";
}
}
2018-01-28 16:40:49 +00:00
}
/////////////////////////////////////
///////////////Сбор вентилей/////////////
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 = "Вентиль";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Вентиль'</span>";
} else {
if ($stloc == '') {
print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";
}
}
2018-01-28 16:40:49 +00:00
}
///////////////Сбор Чистых вентилей/////////////
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 = "Чистый вентиль";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Чистый вентиль'</span>";
} else {
if ($stloc == '') {
print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";
}
}
2018-01-28 16:40:49 +00:00
}
/////////////////////////////////////
///////////////Сбор Болтов/////////////
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 = "Болт";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Болт'</span>";
} else {
if ($stloc == '') {
print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";
}
}
2018-01-28 16:40:49 +00:00
}
///////////////Сбор Длинных Болтов/////////////
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 = "Длинный болт";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Длинный болт'</span>";
} else {
if ($stloc == '') {
print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";
}
}
2018-01-28 16:40:49 +00:00
}
/////////////////////////////////////
///////////////Сбор ключиик/////////////
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 = "Ключиик";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Ключиик'</span>";
} else {
if ($stloc == '') {
print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";
}
}
2018-01-28 16:40:49 +00:00
}
/////////////////////////////////////
///////////////Сбор сундуков/////////////
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 = "Гайка";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Гайка'</span>";
}
} else {
if ($stloc == '13.0') {
print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";
}
}
2018-01-28 16:40:49 +00:00
}
/////////////////////////////////////
///////////////Сбор сундуков (БОЛТ)/////////////
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 = "Болт";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Болт'</span>";
}
} else {
if ($stloc == '14.0') {
print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";
}
}
2018-01-28 16:40:49 +00:00
}
/////////////////////////////////////
///////////////Сбор ключей/////////////
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','Подземка')");
2018-01-28 16:40:49 +00:00
//Удаляем ключик с локи
//mysql_query("UPDATE `podzem4` SET n".$_GET['n']." = '' WHERE glava='".$glava."' and name='".$mir['name']."'");
print"&nbsp;<span class='success'>Вы получили 'Ключик №" . $_GET['b'] . "'</span>";
}
} else {
if ($g) {
print"&nbsp;<span class='error'>У вас уже есть Ключик №" . $_GET['b'] . "!</span>";
}
}
2018-01-28 16:40:49 +00:00
}
/////////////////////////////////////
///////////////Сбор гаек из стоков/////////////
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 = "Гайка";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Гайка'</span>";
}
} else {
if ($stloc == '11.0') {
print"&nbsp;<span class='error'>Попахивает...</span>";
}
}
2018-01-28 16:40:49 +00:00
}
///////////////Сбор гаек из стоков/////////////
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 = "Гайка";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Гайка'</span>";
}
} else {
if ($stloc == '12.0') {
print"&nbsp;<span class='error'>Попахивает...</span>";
}
}
2018-01-28 16:40:49 +00:00
}
/////////////////////////////////////
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';
}
2018-01-28 16:40:49 +00:00
// переходы
if (isset($_GET['left'])) {
mysql_query("UPDATE `labirint` SET `vector` = '" . mysql_escape_string($_GET['left']) . "' WHERE `user_id` = '{$_SESSION['uid']}' ;");
//header('Location:canalizaciya.php');
exit("<script>location.href='canalizaciya.php';</script>");
}
if (isset($_GET['right'])) {
mysql_query("UPDATE `labirint` SET `vector` = '" . mysql_escape_string($_GET['right']) . "' WHERE `user_id` = '{$_SESSION['uid']}' ;");
//header('Location:canalizaciya.php');
exit("<script>location.href='canalizaciya.php';</script>");
}
2018-01-28 16:40:49 +00:00
$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']] . ""];
}
2018-01-28 16:40:49 +00:00
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"&nbsp;<span class='error'>Нужен ключ №" . $rets["n$loc2"] . "" . $rets["n$mesto"] . "</span>";
} 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');
exit;
2018-01-28 16:40:49 +00:00
}
2018-01-28 16:40:49 +00:00
}
//Вывести хп и ману
echo sprintf('<div style="font-size: 12px">%s</div>', Nick::id($user)->battle());
2018-01-28 16:40:49 +00:00
?>
<div style="display: flex; justify-content: space-between;">
<div style="width: 100%">
<div style="text-align: center;">
<table width="450" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="center">Персонаж</td>
<td align="center">Hp</td>
<td align="center">Звание</td>
<td align="center">Подземелье</td>
</tr>
<?
$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'] . "'"));
?>
<tr>
<td align="center">
<a href=inf.php?<?= $big['id'] ?> target=_blank
title="Информация о <?= $more['login'] ?>"><?= $more['login'] ?></a></td>
<td align="center"><?= $big['hp'] ?>/<?= $big['maxhp'] ?> </td>
<td align="center"><? if ($more['login'] == $more['glava']) {
print"Лидер";
} else {
print"Рядовой";
} ?></td>
<td align="center"><?= $more['name'] ?></td>
<?php if ($user['login'] == $more['glava'] and $more['login'] == $more['glava']) { ?>
<td align="center">
<A href="#"
onClick="findlogin( 'Выберите персонажа которого хотите выгнать','canalizaciya.php', 'kill')">
<IMG alt="Выгнать из группы" src="i/labirint3/ico_kill_member1.gif">
</A>&nbsp;
<A href="#"
onClick="findlogin( 'Выберите персонажа которому хотите передать лидерство','canalizaciya.php', 'change')">
<IMG alt="Передать лидерство" src="i/labirint3/ico_change_leader1.gif">
</A>
</td>
<?php
}
print"</tr>";
}
?>
</table>
</div>
<br>
<?php
if ($mir['dead'] > '0') {
print"<br><span class='error'>&nbsp;&nbsp;Кол-во смертей:</span> <b>" . $mir['dead'] . "</b><br><br>";
}
include "podzem_res.php";
?>
</div>
<div style="width: 530px; height: 285px;">
<?php
include "navig.php";
echo build_move_image($mesto, $vektor, 1);
?>
</div>
</div>
2018-01-28 16:40:49 +00:00
<div id=hint3 class=ahint></div>
<style>
BODY {
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
margin: 0;
2018-01-28 16:40:49 +00:00
scrollbar-face-color: #e3ac67;
scrollbar-highlight-color: #e0c3a0;
scrollbar-shadow-color: #b78d58;
scrollbar-3dlight-color: #b78d58;
scrollbar-arrow-color: #b78d58;
scrollbar-track-color: #e0c3a0;
scrollbar-darkshadow-color: #b78d58;
}
2018-01-28 16:40:49 +00:00
.menu {
z-index: 100;
background-color: #E4F2DF;
border-style: solid;
border-width: 2px;
border-color: #77c3fc
position: absolute;
left: 0;
top: 0;
visibility: hidden;
cursor: hand;
}
2018-01-28 16:40:49 +00:00
a.menuItem {
border: 0 solid #000000;
background-color: #484848;
color: #000000;
display: block;
font-family: Verdana, Arial, serif;
font-size: 8pt;
font-weight: bold;
padding: 2px 12px 2px 8px;
text-decoration: none;
}
2018-01-28 16:40:49 +00:00
a.menuItem:hover {
background-color: #d4cbaa;
color: #000000;
}
2018-01-28 16:40:49 +00:00
body {
margin: 0;
padding: 0;
width: 100%;
font-family: Arial . serif;
font-size: 9px;
}
2018-01-28 16:40:49 +00:00
table {
border-collapse: collapse;
}
2018-01-28 16:40:49 +00:00
td {
margin: 0;
padding: 0;
}
2018-01-28 16:40:49 +00:00
img {
border: 0;
}
2018-01-28 16:40:49 +00:00
A:link {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #fddd00;
text-decoration: none;
}
A:visited {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #fddd00;
text-decoration: none;
}
A:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #fddd00;
text-decoration: none;
}
.form {
background-color: #5B0200;
border: 1px solid #6F4B3F;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #DAA43A;
font-size: 11px;
width: 89px;
height: 18px;
text-align: left;
position: inherit;
padding-bottom: 0;
}
hr {
background: #fddd00;
border-top: 1px solid #fddd00;
color: #fddd00;
height: 2px
}
</style>
<script>
let Hint3Name = '';
// Заголовок, название скрипта, имя поля с логином
function findlogin(title, script, name) {
document.getElementById("hint3").innerHTML = '<form action="' + script + '" method=GET style="margin:0;"><table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B style="font-size:11px">' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' +
'<table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="<? echo @$user['id']; ?>"><td colspan=2>' +
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></FORM></TABLE></td></tr></table>';
document.getElementById("hint3").style.visibility = "visible";
document.getElementById("hint3").style.left = '100px';
document.getElementById("hint3").style.top = '100px';
document.getElementById(name).focus();
Hint3Name = name;
}
function returned2(s) {
if (top.oldlocation !== '') {
top.frames['main'].navigate(top.oldlocation + '?' + s + 'tmp=' + Math.random());
top.oldlocation = '';
} else {
top.frames['main'].navigate('main.php?' + s + 'tmp=' + Math.random())
}
}
function closehint3() {
document.getElementById("hint3").style.visibility = "hidden";
Hint3Name = '';
}
const progressEnd = 32; // set to number of progress <span>'s.
let progressColor = '#00CC00'; // set to progress bar color
let mtime = parseInt('<?=($_SESSION["time"] - time())?>');
if (!mtime || mtime <= 0) {
mtime = 0;
}
const progressInterval = Math.round(mtime * 1000 / progressEnd); // set to time between updates (milli-seconds)
let is_accessible = true;
let progressAt = progressEnd;
let progressTimer;
function progress_clear() {
for (let i = 1; i <= progressEnd; i++) document.getElementById('progress' + i).style.backgroundColor = 'transparent';
progressAt = 0;
for (let t = 1; t <= 8; t++) {
if (document.getElementById('m' + t)) {
const tempname = document.getElementById('m' + t).children[0].src;
if (tempname.match(/b\.gif$/)) {
document.getElementById('m' + t).children[0].id = 'backend';
}
let newname;
newname = tempname.replace(/(b)?\.gif$/, 'i.gif');
document.getElementById('m' + t).children[0].src = newname;
}
}
is_accessible = false;
set_moveto(true);
}
function progress_update() {
progressAt++;
//if (progressAt > progressEnd) progress_clear();
if (progressAt > progressEnd) {
for (let t = 1; t <= 8; t++) {
if (document.getElementById('m' + t)) {
let tempname = document.getElementById('m' + t).children[0].src;
let newname;
newname = tempname.replace(/i\.gif$/, '.gif');
if (document.getElementById('m' + t).children[0].id == 'backend') {
tempname = newname.replace(/\.gif$/, 'b.gif');
newname = tempname;
}
document.getElementById('m' + t).children[0].src = newname;
}
}
is_accessible = true;
if (window.solo_store && solo_store) {
solo(solo_store);
} // go to stored
set_moveto(false);
} else {
document.getElementById('progress' + progressAt).style.backgroundColor = progressColor;
progressTimer = setTimeout('progress_update()', progressInterval);
}
}
function set_moveto(val) {
document.getElementById('moveto').disabled = val;
if (document.getElementById('bmoveto')) {
document.getElementById('bmoveto').disabled = val;
}
}
function progress_stop() {
clearTimeout(progressTimer);
progress_clear();
}
function check(it) {
return is_accessible;
}
function check_access() {
return is_accessible;
}
function ch_counter_color(color) {
progressColor = color;
for (let i = 1; i <= progressAt; i++) {
document.getElementById('progress' + i).style.backgroundColor = progressColor;
}
}
// brrr
if (mtime > 0) {
progress_clear();
progress_update();
} else {
for (var i = 1; i <= progressEnd; i++) {
document.getElementById('progress' + i).style.backgroundColor = progressColor;
}
}
top.onlineReload(true)
2018-01-28 16:40:49 +00:00
2019-01-16 17:45:30 +00:00
const rnd = Math.random();
function sunduk(n) {
document.location.href = "?act=sunduk&n=" + n + "&rnd=" + Math.random();
}
function sunduk2(n) {
document.location.href = "?act=sunduk2&n=" + n + "&rnd=" + Math.random();
}
function key(n, b) {
document.location.href = "?act=key&n=" + n + "&b=" + b + "&rnd=" + Math.random();
}
function stok2(n) {
document.location.href = "?act=stok2&n=" + n + "&rnd=" + Math.random();
}
function stok(n) {
document.location.href = "?act=stok&n=" + n + "&rnd=" + Math.random();
}
function attack(n) {
document.location.href = "?act=atk&n=" + n + "&rnd=" + Math.random();
}
function dialog() {
document.location.href = "?act=luka&rnd=" + Math.random();
}
function OpenMenu(n, e) {
let el, x, y;
el = document.getElementById("oMenu");
const event = (window.event) ? window.event : e;
x = event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft - 5;
y = event.clientY + document.documentElement.scrollTop + document.body.scrollTop - 5;
if (event.clientY + 72 > document.body.clientHeight) {
y -= 62
} else {
y -= 2
}
el.innerHTML = '<div style="color:#000; cursor: pointer; height: 11px; margin: 2px; width: 45px;" class=menuItem onmouseout="this.className=\'menuItem\';" onmouseover="this.className=\'menuItem2\';" onclick="this.disabled = true;attack(' + n + ');closeMenu(event);">Напасть </div>';
el.style.left = x + "px";
el.style.top = y + "px";
el.style.visibility = "visible";
}
function Opendialog(n, e) {
let el, x, y;
el = document.all("oMenu");
const event = (window.event) ? window.event : e;
x = event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft - 5;
y = event.clientY + document.documentElement.scrollTop + document.body.scrollTop - 5;
if (event.clientY + 72 > document.body.clientHeight) {
y -= 62
} else {
y -= 2
}
el.innerHTML = '<div style="color:#000; cursor: pointer;" class=menuItem onmouseout="this.className=\'menuItem\';" onmouseover="this.className=\'menuItem2\';" onclick="this.disabled = true;attack(' + n + ');"> &nbsp;Напасть </div><div style="color:#000; cursor: pointer;" class=menuItem onmouseout="this.className=\'menuItem\';" onmouseover="this.className=\'menuItem2\';" onclick="this.disabled = true;dialog();"> Говорить </div>';
el.style.left = x + "px";
el.style.top = y + "px";
el.style.visibility = "visible";
}
//Закрыть меню нападения
function closeMenu() {
if (window.event && window.event.toElement) {
const cls = window.event.toElement.className;
if (cls == 'menuItem' || cls == 'menu') return;
}
document.all("oMenu").style.visibility = "hidden";
document.all("oMenu").style.top = "0px";
document.all("oMenu").style.left = "0px";
return false;
}
2018-01-28 16:40:49 +00:00
</script>
<div style="position:absolute; left:130px; top:50px;" ID=oMenu CLASS="menu"></DIV>
<script>load_page();</script>