From a4de6c51a3337ff4f8e1aefab12be6315a777a50 Mon Sep 17 00:00:00 2001 From: "Igor Barkov (iwork)" Date: Wed, 30 Sep 2020 22:12:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BD=D0=B5=D0=B4=D1=80=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=82=D0=BE=D1=80=D0=B0.=20=D0=A0=D0=B5=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=81=D0=B0=D0=BC=D1=8B=D1=85=20=D0=B8?= =?UTF-8?q?=D0=B4=D0=B8=D0=BE=D1=82=D1=81=D0=BA=D0=B8=D1=85=20=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=B1=D0=BE=D0=BA=20=D0=B2=D1=91=D1=80=D1=81=D1=82=D0=BA?= =?UTF-8?q?=D0=B8.=20=D0=9A=D0=BE=D0=B5-=D0=B3=D0=B4=D0=B5=20=D0=B8=D1=81?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=B1=D0=BA=D0=B8=20=D1=81=D0=B8=D0=BD=D1=82=D0=B0=D0=BA?= =?UTF-8?q?=D1=81=D0=B8=D1=81=D0=B0=20php.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/admin.php | 1 - classes/Template.php | 1 + classes/quests_class.php | 2 +- functions.php | 2 - gotzamok.php | 56 +- group_arena.php | 495 ++++++----- hell.php | 58 +- hostel.php | 491 ++++++----- hostel_checkpoint.php | 17 +- hostel_room.php | 334 +++---- index.php | 13 +- lab.php | 923 ++++++++++---------- lab2.php | 924 ++++++++++---------- lab_enter.php | 885 ++++++++++--------- labirint.php | 1791 +++++++++++++++++++------------------- library.php | 732 ++++++++-------- logs.php | 257 +++--- main.php | 75 +- module_quest.php | 75 +- navig.php | 2 +- podzem_dialog.php | 243 ++---- post.php | 10 +- presents.php | 55 +- quest_room.php | 17 +- register.php | 13 +- rememberpassword.php | 19 +- repair.php | 13 +- shop.php | 35 +- stat_battle.php | 366 -------- top_menu.php | 5 +- tournament.php | 40 +- tower.php | 15 +- towerin.php | 899 ++++++++++--------- towerlog.php | 14 +- towerstamp.php | 15 +- ul_clans.php | 43 +- user_abilities.php | 548 ++++++------ user_anketa.php | 25 +- vxod.php | 542 ++++++------ zayavka.php | 17 +- znahar.php | 335 ------- 41 files changed, 4688 insertions(+), 5715 deletions(-) delete mode 100644 stat_battle.php delete mode 100644 znahar.php diff --git a/admin/admin.php b/admin/admin.php index 8c368ba..3e65d53 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -11,7 +11,6 @@ if (empty($user['admin'])) { header("HTTP/1.0 404 Not Found"); exit; } -header("Cache-Control: no-cache"); $al = db::c()->query('SELECT * FROM `aligns` WHERE `align` = "?s" LIMIT 1', $user['align'])->fetch_assoc(); diff --git a/classes/Template.php b/classes/Template.php index dfdf066..2c0801a 100644 --- a/classes/Template.php +++ b/classes/Template.php @@ -23,6 +23,7 @@ class Template + $title HTML_HEADER; if (!$return) { diff --git a/classes/quests_class.php b/classes/quests_class.php index b39be32..0bb830f 100644 --- a/classes/quests_class.php +++ b/classes/quests_class.php @@ -391,7 +391,7 @@ TASK; return $r; } - public function endq($id, $tp, $user) + public function endq($id, $tp, $user):void { $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1')); $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1')); diff --git a/functions.php b/functions.php index 832119f..de44dd6 100644 --- a/functions.php +++ b/functions.php @@ -145,8 +145,6 @@ function takeshopitem($item, $table = "shop", $present = '', $onlyonetrip = '', define('_BOTSEPARATOR_', 10000000); -header("Cache-Control: no-cache"); - function level_up($uid) { $us = db::c()->query('SELECT `id`, `login`, `level`, `money`, `exp`, `nextup`, `stats`, `master`, `ip`, `in_tower` FROM `users` WHERE `id` =?i', $uid)->fetch_assoc(); diff --git a/gotzamok.php b/gotzamok.php index eae8d3e..b209deb 100644 --- a/gotzamok.php +++ b/gotzamok.php @@ -10,7 +10,7 @@ if (empty($_SESSION['uid'])) { require_once 'functions.php'; -if (!($user->room >= 37 AND $user->room <= 41)) { +if (!($user->room >= 37 && $user->room <= 41)) { header("Location: main.php"); exit; } @@ -19,15 +19,27 @@ $castleOwners = db::c()->query('SELECT * FROM `clans` WHERE `short` = (SELECT * if ($castleOwners['id'] == $user['klan']) { // если мой клан - if ($_GET['goto'] == 'arsenal') $user->room = 38; - if ($_GET['goto'] == 'home') $user->room = 37; - if ($_GET['goto'] == 'dvor') $user->room = 39; - if ($_GET['goto'] == 'master') $user->room = 40; - if ($_GET['goto'] == 'rest') $user->room = 41; + if ($_GET['goto'] == 'arsenal') { + $user->room = 38; + } + if ($_GET['goto'] == 'home') { + $user->room = 37; + } + if ($_GET['goto'] == 'dvor') { + $user->room = 39; + } + if ($_GET['goto'] == 'master') { + $user->room = 40; + } + if ($_GET['goto'] == 'rest') { + $user->room = 41; + } if (in_array($_GET['goto'], ['arsenal', 'home', 'dvor', 'master', 'rest'])) { db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $user->room, $user->room, $_SESSION['uid']); header('location: gotzamok.php'); - } else $status = 'В этом замке нет такого места!'; + } else { + $status = 'В этом замке нет такого места!'; + } } switch ($user->room) { @@ -45,7 +57,7 @@ if ($user->room == 38) { if ($_GET['back']) { $item = db::c()->query('SELECT * FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back'])->fetch_assoc(); - if ($_SESSION['uid'] == $item['owner'] OR $_SESSION['uid'] == $glava['glava']) { + if ($_SESSION['uid'] == $item['owner'] or $_SESSION['uid'] == $glava['glava']) { $status = 'Вы забрали вещь из арсенала.'; db::c()->query('UPDATE `inventory` SET `owner` = ?i WHERE `id` = ?i', $_SESSION['uid'], $item['id_it']); db::c()->query('DELETE FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back']); @@ -84,24 +96,20 @@ if ($user->room == 40) { } else $status = 'Не хватает денег!'; } } +Template::header('Клановый замок'); ?> - - - - - - -

Приветствую тебя в замке .gif'> , воин!

-
- -
-
+

Приветствую тебя в замке .gif'> , + воин!

+
+ +
+
@@ -153,12 +161,12 @@ if ($castleOwners['id'] == $user['klan']) { ?>
Положил: full(1) ?>
+ if ($_SESSION['uid'] == $item['owner'] or $_SESSION['uid'] == $glava['glava']): ?> забрать
- Тут был showitem($row); + Тут был showitem($row); @@ -172,7 +180,7 @@ if ($castleOwners['id'] == $user['klan']) { ?>
сдать в арсенал - Тут был showitem($row); + Тут был showitem($row); @@ -205,6 +213,4 @@ if ($castleOwners['id'] == $user['klan']) { ?> - - - \ No newline at end of file + \ No newline at end of file diff --git a/group_arena.php b/group_arena.php index 44fd76b..6ae989e 100644 --- a/group_arena.php +++ b/group_arena.php @@ -1,271 +1,310 @@ '; - if($user['klan'] != '') { - $clan = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `clans` WHERE `id` = "'.$user['klan'].'" LIMIT 1')); - $clan_img = ' '; - } else { - $clan_img = ''; - } - $r = $align_img.$clan_img.' '.$user['login'].' ['.$user['level'].']'; - } else { - $r = 'Место свободно'; - } - return $r; -} - - -function form_start($uid) { - $r = ''; $go = ''; - if($uid > 0) { - $user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan`, `zayrist` FROM `users` WHERE `id` = "'.$uid.'" LIMIT 1')); - if(isset($user['id'])) { - if($user['zayrist']) { - $zv = mysql_fetch_array(mysql_query('SELECT `id`, `name`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1')); - if(isset($zv['id'])) { - $r .= '
'; - if($zv['uid1'] == $user['id']) { - $go = ' / '; - } - for($i = 1; $i <= 3; $i++) { - $nick .= login($zv['uid'.$i]).', '; - } - $nc = rtrim($nick, ', '); - $r .= '
Ваша группа («'.$zv['name'].'»): '.$nc.' '.$go.'
'; - $r .= '
'; +function login($uid) +{ + $user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan` FROM `users` WHERE `id` = "' . mysql_real_escape_string($uid) . '" LIMIT 1')); + if (isset($user['id'])) { + $align_img = ' '; + if ($user['klan'] != '') { + $clan = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `clans` WHERE `id` = "' . $user['klan'] . '" LIMIT 1')); + $clan_img = ' '; } else { - $user['zayrist'] = 0; - mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); + $clan_img = ''; } - } + $r = $align_img . $clan_img . ' ' . $user['login'] . ' [' . $user['level'] . ']'; + } else { + $r = 'Место свободно'; } - } - return $r; + return $r; } -function forms($level) { - $r = '

'; - $sp = mysql_query('SELECT `id`, `name`, `pass`, `comment`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `level` = "'.(int)$level.'" ORDER BY `id` DESC'); - if(mysql_num_rows($sp) > 0) { - while($pl = mysql_fetch_array($sp)) { - $i = 1; - while($i <= 3) { - $nick .= login($pl['uid'.$i]).', '; - $i++; - } - $nc = rtrim($nick, ', '); - $r .= '
Группа («'.$pl['name'].'»): '.$nc.'
'; + +function form_start($uid) +{ + $r = ''; + $go = ''; + if ($uid > 0) { + $user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan`, `zayrist` FROM `users` WHERE `id` = "' . $uid . '" LIMIT 1')); + if (isset($user['id']) ?? $user['zayrist']) { + $zv = mysql_fetch_array(mysql_query('SELECT `id`, `name`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1')); + if (isset($zv['id'])) { + $r .= '
'; + if ($zv['uid1'] == $user['id']) { + $go = ' / '; + } + for ($i = 1; $i <= 3; $i++) { + $nick .= login($zv['uid' . $i]) . ', '; + } + $nc = rtrim($nick, ', '); + $r .= '
Ваша группа («' . $zv['name'] . '»): ' . $nc . ' ' . $go . '
'; + $r .= '
'; + } else { + $user['zayrist'] = 0; + mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + } + } } - } else { - $r .= 'Заявок вашего уровня нет'; - } - unset($sp, $pl, $nick, $nc, $i); - return $r; + return $r; } -if(isset($_POST['buyFirst'])) { - if(isset($user['id'])) { - if($user['money'] >= 5) { - $Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "'.$user['id'].'" LIMIT 1')); - if(isset($Firts['id'])) { - $error = 'У Вас уже есть Фамильный Герб'; - } else { - $Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "'.$user['id'].'" LIMIT 1')); - if(isset($Second['id'])) { - $error = 'У Вас уже есть Фамильный Герб'; +function forms($level) +{ + $r = '

'; + $sp = mysql_query('SELECT `id`, `name`, `pass`, `comment`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `level` = "' . (int)$level . '" ORDER BY `id` DESC'); + if (mysql_num_rows($sp) > 0) { + while ($pl = mysql_fetch_array($sp)) { + $i = 1; + while ($i <= 3) { + $nick .= login($pl['uid' . $i]) . ', '; + $i++; + } + $nc = rtrim($nick, ', '); + $r .= '
Группа («' . $pl['name'] . '»): ' . $nc . '
'; + } + } else { + $r .= 'Заявок вашего уровня нет'; + } + unset($sp, $pl, $nick, $nc, $i); + return $r; +} + +if (isset($_POST['buyFirst'])) { + if (isset($user['id'])) { + if ($user['money'] >= 5) { + $Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "' . $user['id'] . '" LIMIT 1')); + if (isset($Firts['id'])) { + $error = 'У Вас уже есть Фамильный Герб'; + } else { + $Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "' . $user['id'] . '" LIMIT 1')); + if (isset($Second['id'])) { + $error = 'У Вас уже есть Фамильный Герб'; + } else { + $user['money'] -= 5; + mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + takeshopitem(1930, 'shop', '', '', 0, 0, $user['id'], 1, '', 0); + mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил Фамильный Герб за 5кр.', '1', '" . time() . "')"); + $error = 'Вы купили Фамильный Герб'; + } + } } else { - $user['money'] -= 5; - mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - takeshopitem(1930, 'shop', '', '', 0, 0, $user['id'], 1, '', 0); - mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"".$user['login']."\" купил Фамильный Герб за 5кр.', '1', '".time()."')"); - $error = 'Вы купили Фамильный Герб'; + $error = 'Недостаточно средств'; } - } } else { - $error = 'Недостаточно средств'; + $error = 'Вы не авторизированы'; } - } else { - $error = 'Вы не авторизированы'; - } } -if(isset($_POST['buySecond'])) { - if(isset($user['id'])) { - if($user['money'] >= 15) { - $Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "'.$user['id'].'" LIMIT 1')); - if(isset($Firts['id'])) { - $error = 'У Вас уже есть Фамильный Герб'; - } else { - $Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "'.$user['id'].'" LIMIT 1')); - if(isset($Second['id'])) { - $error = 'У Вас уже есть Фамильный Герб'; +if (isset($_POST['buySecond'])) { + if (isset($user['id'])) { + if ($user['money'] >= 15) { + $Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "' . $user['id'] . '" LIMIT 1')); + if (isset($Firts['id'])) { + $error = 'У Вас уже есть Фамильный Герб'; + } else { + $Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "' . $user['id'] . '" LIMIT 1')); + if (isset($Second['id'])) { + $error = 'У Вас уже есть Фамильный Герб'; + } else { + $user['money'] -= 15; + mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + takeshopitem(1931, 'shop', '', '', 0, 0, $user['id'], 1, '', 0); + mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил Фамильный Герб (x2) за 15кр.', '1', '" . time() . "')"); + $error = 'Вы купили Фамильный Герб (x2)'; + } + } } else { - $user['money'] -= 15; - mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - takeshopitem(1931, 'shop', '', '', 0, 0, $user['id'], 1, '', 0); - mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"".$user['login']."\" купил Фамильный Герб (x2) за 15кр.', '1', '".time()."')"); - $error = 'Вы купили Фамильный Герб (x2)'; + $error = 'Недостаточно средств'; } - } } else { - $error = 'Недостаточно средств'; + $error = 'Вы не авторизированы'; } - } else { - $error = 'Вы не авторизированы'; - } } -if($_POST['addZayavka']) { - if(isset($user['id'])) { - $name = mysql_real_escape_string($_POST['nameZv']); - $pass = mysql_real_escape_string($_POST['passZv']); - $comment = mysql_real_escape_string($_POST['commentZv']); - $zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1')); - - if($user['zayrist'] > 0 && isset($zv['id'])) { - $error = 'Вы уже состоите в заявке'; - } elseif(strlen($name) > 15) { - $error = 'Название может состоять максимум из 15 символов'; - } elseif(strlen($name) < 3) { - $error = 'Название может состоять минимум из 3 символов'; - } elseif(strlen($pass) > 6) { - $error = 'Пароль может состоять максимум из 6 символов'; - } elseif(strlen($comment) > 20) { - $error = 'Комментарий может состоять максимум из 20 символов'; +if ($_POST['addZayavka']) { + if (isset($user['id'])) { + $name = mysql_real_escape_string($_POST['nameZv']); + $pass = mysql_real_escape_string($_POST['passZv']); + $comment = mysql_real_escape_string($_POST['commentZv']); + $zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1')); + + if ($user['zayrist'] > 0 && isset($zv['id'])) { + $error = 'Вы уже состоите в заявке'; + } elseif (strlen($name) > 15) { + $error = 'Название может состоять максимум из 15 символов'; + } elseif (strlen($name) < 3) { + $error = 'Название может состоять минимум из 3 символов'; + } elseif (strlen($pass) > 6) { + $error = 'Пароль может состоять максимум из 6 символов'; + } elseif (strlen($comment) > 20) { + $error = 'Комментарий может состоять максимум из 20 символов'; + } else { + mysql_query('INSERT INTO `group_ristal` (`name`, `pass`, `comment`, `time`, `uid1`) VALUES ("' . $name . '", "' . $pass . '", "' . $comment . '", "' . time() . '", "' . $user['id'] . '")'); + $user['zayrist'] = mysql_insert_id(); + mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + $error = 'Заявка создана'; + } } else { - mysql_query('INSERT INTO `group_ristal` (`name`, `pass`, `comment`, `time`, `uid1`) VALUES ("'.$name.'", "'.$pass.'", "'.$comment.'", "'.time().'", "'.$user['id'].'")'); - $user['zayrist'] = mysql_insert_id(); - mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - $error = 'Заявка создана'; + $error = 'Вы не авторизированы'; } - } else { - $error = 'Вы не авторизированы'; - } } -if(isset($_POST['leaveZv'])) { - if($user['zayrist'] > 0) { - $zv = mysql_fetch_array(mysql_query('SELECT `id`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1')); - if(isset($zv['id'])) { - $i = 1; $j = 3; $k = 0; $h = 0; - while($i <= 3) { - if($k == 0 && $zv['uid'.$i] != $user['id']) { - $k = $zv['uid'.$i]; - $h = $i; - } - $i++; - } - $i = 1; - while($i <= 3) { - if($zv['uid'.$i] == $user['id']) { - if($i > 1) { - $zv['uid'.$i] = 0; - } else { - $zv['uid'.$i] = $k; - $zv['uid'.$h] = 0; - } - } - if($zv['uid'.$i] == 0) { - $j--; - } - $i++; - } - if($j < 1) { - mysql_query('DELETE FROM `group_ristal` WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - $error = 'Заявка была удалена
'; - $user['zayrist'] = 0; - mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - } else { - mysql_query('UPDATE `group_ristal` SET `uid1` = "'.$zv['uid1'].'", `uid2` = "'.$zv['uid2'].'", `uid3` = "'.$zv['uid3'].'" WHERE `id` = "'.$zv['id'].'" lIMIT 1'); - $user['zayrist'] = 0; - mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - $error = 'Вы покинули заявку
'; - } - unset($zv); +if (isset($_POST['leaveZv']) ?? $user['zayrist']) { + $zv = mysql_fetch_array(mysql_query('SELECT `id`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1')); + if (isset($zv['id'])) { + $i = 1; + $j = 3; + $k = 0; + $h = 0; + while ($i <= 3) { + if ($k == 0 && $zv['uid' . $i] != $user['id']) { + $k = $zv['uid' . $i]; + $h = $i; + } + $i++; + } + $i = 1; + while ($i <= 3) { + if ($zv['uid' . $i] == $user['id']) { + if ($i > 1) { + $zv['uid' . $i] = 0; + } else { + $zv['uid' . $i] = $k; + $zv['uid' . $h] = 0; + } + } + if ($zv['uid' . $i] == 0) { + $j--; + } + $i++; + } + if ($j < 1) { + mysql_query('DELETE FROM `group_ristal` WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + $error = 'Заявка была удалена
'; + $user['zayrist'] = 0; + mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + } else { + mysql_query('UPDATE `group_ristal` SET `uid1` = "' . $zv['uid1'] . '", `uid2` = "' . $zv['uid2'] . '", `uid3` = "' . $zv['uid3'] . '" WHERE `id` = "' . $zv['id'] . '" lIMIT 1'); + $user['zayrist'] = 0; + mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + $error = 'Вы покинули заявку
'; + } + unset($zv); } - } } - if($_GET['exit'] == 1) { +if ($_GET['exit'] == 1) { - mysql_query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"'); + mysql_query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"'); header('Location: city.php'); -} +} +Template::header('group_arena'); ?> - - - - - - - - - + + + - - -
-
-

Турниры: Групповые сражения.

- Внимание! В боях этой локации разрешается использовать свитки "Восстановления энергии" номиналом не более 180НР!

- Внимание! При старте группового турнира руны автоматически будут сняты с персонажа.
Проверьте, что ваши вещи после снятия рун не упадут, и не забудьте надеть руны после выхода из локации!
-
-

Принять участие в турнире:

Создать группу
- -

 

Победители 10-ти предыдущих турниров: -е уровни

-
+
+
+

Турниры: Групповые сражения.

+ Внимание! В боях этой локации разрешается использовать свитки "Восстановления энергии" номиналом не + более 180НР!

+ Внимание! При старте группового турнира руны автоматически будут сняты с персонажа.
Проверьте, что ваши вещи после снятия рун не упадут, и не забудьте надеть руны после выхода из локации!
+
+ +

Принять участие в турнире:

Создать группу +
+ +

 

Победители 10-ти предыдущих турниров: -е уровни

+


-
- - -
+
+ +

+
+ + +
-
- - growl('Внимание', 'Red', '$error');"; } ?> - - \ No newline at end of file + +growl('Внимание', 'Red', '$error');"; +} \ No newline at end of file diff --git a/hell.php b/hell.php index cb88922..c05d7da 100644 --- a/hell.php +++ b/hell.php @@ -42,34 +42,21 @@ $hr = new hellround; $mytrip = $hr->is_in_trip($user['id']); $tr = $hr->get_par($mytrip); - +Template::header('hell'); if ($mytrip > 0) { + ?> - - - - - - - - + body { + background-image: url('i/hell.jpg'); + background-repeat: no-repeat; + background-position: top right; + } + + Приближается " . ($tr['volna'] + 1) . " волна нашествия..."; // диалоговый бот - ?> - - -
- - - 0) { $f = mysql_fetch_array(mysql_query("SELECT `date_out` FROM `hellround_pohod` WHERE `owner`= " . $user['id'] . " ORDER by `id` DESC LIMIT 1;")); if ((time() - strtotime($f['date_out'])) < 3600 * 24) { @@ -82,20 +69,14 @@ if ($mytrip > 0) { } ?> - - - - - - - + body { + background-image: url('i/hell.jpg'); + background-repeat: no-repeat; + background-position: top right; + } +
@@ -139,8 +120,5 @@ if ($mytrip > 0) { - - \ No newline at end of file +} \ No newline at end of file diff --git a/hostel.php b/hostel.php index 283c0ca..a34ae99 100644 --- a/hostel.php +++ b/hostel.php @@ -1,14 +1,18 @@ - array('type' => 'Сумка'), 2 => array('type' => 'Сундук'), 3 => array('type' => 'Комната'), 4 => array('type' => 'Амбар')); -$times = array(1 => 7, 2 => 14, 3 => 21, 4 => 28); -$cost = array(1 => array(8, 16, 24, 32), 2 => array(15, 30, 45, 60), 3 => array(25, 50, 75, 100), 4 => array(40, 80, 120, 160)); +$error = ''; +$rs = ''; +$base = [1 => ['type' => 'Сумка'], 2 => ['type' => 'Сундук'], 3 => ['type' => 'Комната'], 4 => ['type' => 'Амбар']]; +$times = [1 => 7, 2 => 14, 3 => 21, 4 => 28]; +$cost = [1 => [8, 16, 24, 32], 2 => [15, 30, 45, 60], 3 => [25, 50, 75, 100], 4 => [40, 80, 120, 160]]; function remove_hostel_items($u) { @@ -21,7 +25,7 @@ function remove_hostel_items($u) function select_arenda($u, $type, $redirect = false) { $hostel = mysql_fetch_array(mysql_query('SELECT `id` FROM `hostel` WHERE `uid` = "' . $u['id'] . '" LIMIT 1')); - $price = array(1 => 8, 2 => 15, 3 => 25, 4 => 40); + $price = [1 => 8, 2 => 15, 3 => 25, 4 => 40]; if (!isset($u['id'])) { $r = 'Персонаж не найден ...'; } else { @@ -42,252 +46,281 @@ function select_arenda($u, $type, $redirect = false) $r = 'Неверный тип аренды ...'; } } - if ($redirect == true) { + if ($redirect) { header('Location: main.php'); } return $r; } - -if($_GET['exit'] == 1) { - if($user['sleep'] == 0) { - mysql_query('UPDATE `users`,`online` SET `users`.`room` = 26, `online`.`room` = 26 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"'); - header('Location: city.php'); - } else { - $error = 'Вы спите ...'; - } -} - -if($_GET['to_room'] == 1) { - if(isset($hostel['id'])) { - if($hostel['time'] > time()) { - mysql_query('UPDATE `users`,`online` SET `users`.`room` = 661, `online`.`room` = 661 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"'); - header('Location: hostel_room.php'); +if ($_GET['exit'] == 1) { + if ($user['sleep'] == 0) { + mysql_query('UPDATE `users`,`online` SET `users`.`room` = 26, `online`.`room` = 26 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"'); + header('Location: city.php'); } else { - $error = 'У Вас просрочена аренда. Оплатите что-бы продолжить пользоваться нашими услугами ...'; + $error = 'Вы спите ...'; } - } else { - $error = 'У Вас, нету комнаты ...'; - } } -if($_GET['pays']) { - if((int)$_GET['pays'] >= 1 && (int)$_GET['pays'] <= 4) { - if(isset($hostel['id'])) { - if($user['money'] >= $cost[$hostel['type']][(int)$_GET['pays']]) { - $time = $hostel['time']+60*60*24*$times[(int)$_GET['pays']]; - $user['money'] -= $cost[$hostel['type']][(int)$_GET['pays']]; - $hostel['time'] = $time; - mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - mysql_query('UPDATE `hostel` SET `time` = "'.$time.'" WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1'); - $error = 'Всё прошло успешно ...'; - } else { - $error = 'Недостаточно денег ...'; - } +if ($_GET['to_room'] == 1) { + if (isset($hostel['id'])) { + if ($hostel['time'] > time()) { + mysql_query('UPDATE `users`,`online` SET `users`.`room` = 661, `online`.`room` = 661 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"'); + header('Location: hostel_room.php'); + } else { + $error = 'У Вас просрочена аренда. Оплатите что-бы продолжить пользоваться нашими услугами ...'; + } } else { - $error = 'Ошибка #1'; + $error = 'У Вас, нету комнаты ...'; } - } } -if(isset($_POST['select']) && isset($_POST['tariff'])) { - if($_POST['tariff'] == 0) { - $error = 'Выберите тариф ...'; - } else { - $error = select_arenda($user, (int)$_POST['tariff']); - } +if ($_GET['pays'] && (int)$_GET['pays'] >= 1 && (int)$_GET['pays'] <= 4) { + if (isset($hostel['id'])) { + if ($user['money'] >= $cost[$hostel['type']][(int)$_GET['pays']]) { + $time = $hostel['time'] + 60 * 60 * 24 * $times[(int)$_GET['pays']]; + $user['money'] -= $cost[$hostel['type']][(int)$_GET['pays']]; + $hostel['time'] = $time; + mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + mysql_query('UPDATE `hostel` SET `time` = "' . $time . '" WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1'); + $error = 'Всё прошло успешно ...'; + } else { + $error = 'Недостаточно денег ...'; + } + } else { + $error = 'Ошибка #1'; + } } -if($_GET['del'] == 1) { - if(isset($hostel['id']) && $hostel['time'] > time()) { - mysql_query('DELETE FROM `hostel` WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1'); - remove_hostel_items($user['id']); - $error = 'Вы успешно отказались от аренды ...'; - unset($hostel); - } elseif(isset($hostel['id']) && $hostel['time'] < time()) { - $error = 'Нельзя отказаться от услуг если имеется задолежнность ...'; - } +if (isset($_POST['select']) && isset($_POST['tariff'])) { + if ($_POST['tariff'] == 0) { + $error = 'Выберите тариф ...'; + } else { + $error = select_arenda($user, (int)$_POST['tariff']); + } } -if(isset($_POST['deselect']) && isset($_POST['retariff'])) { - if(isset($hostel['id']) && $hostel['time'] > time()) { - mysql_query('DELETE FROM `hostel` WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1'); - remove_hostel_items($user['id']); - select_arenda($user, (int)$_POST['retariff'], true); - } elseif(isset($hostel['id']) && $hostel['time'] < time()) { - $error = 'Нельзя сменить услугу если имеется задолежнность ...'; - } +if ($_GET['del'] == 1) { + if (isset($hostel['id']) && $hostel['time'] > time()) { + mysql_query('DELETE FROM `hostel` WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1'); + remove_hostel_items($user['id']); + $error = 'Вы успешно отказались от аренды ...'; + unset($hostel); + } elseif (isset($hostel['id']) && $hostel['time'] < time()) { + $error = 'Нельзя отказаться от услуг если имеется задолежнность ...'; + } } -if($_GET['sleep'] && $user['sleep'] == 0) { - if($user['sleep_time'] <= time()) { - if($user['vip'] == 1) { $sl = 8; } elseif($user['vip'] == 2) { $sl = 12; } elseif($user['vip'] == 3) { $sl = 18; } else { $sl = 2; } - mysql_query('UPDATE `users` SET `sleep` = "'.(time()+60*60*$sl).'", `sleep_time` = "'.(time()+60*60*8).'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - mysql_query('INSERT INTO `effects` (`type`, `name`, `time`, `owner`) VALUES ("8", "Сон", "'.(time()+60*60*$sl).'", "'.$user['id'].'")'); - $ef = mysql_query('SELECT `id`, `time`, `type` FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `type` != 11 AND `type` != 12 AND `type` != 13 AND `type` != 14 AND `type` != 5 AND `type` != 4 AND `type` != 2 AND `type` != 3 AND `type` != 8'); - while($pl = mysql_fetch_array($ef)) { - $tm = $pl['time']-time(); - mysql_query('UPDATE `effects` SET `sleep` = "'.$tm.'" WHERE `id` = "'.$pl['id'].'" AND `owner` = "'.$user['id'].'"'); +if (isset($_POST['deselect']) && isset($_POST['retariff'])) { + if (isset($hostel['id']) && $hostel['time'] > time()) { + mysql_query('DELETE FROM `hostel` WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1'); + remove_hostel_items($user['id']); + select_arenda($user, (int)$_POST['retariff'], true); + } elseif (isset($hostel['id']) && $hostel['time'] < time()) { + $error = 'Нельзя сменить услугу если имеется задолежнность ...'; + } +} + +if ($_GET['sleep'] && $user['sleep'] == 0) { + if ($user['sleep_time'] <= time()) { + if ($user['vip'] == 1) { + $sl = 8; + } elseif ($user['vip'] == 2) { + $sl = 12; + } elseif ($user['vip'] == 3) { + $sl = 18; + } else { + $sl = 2; + } + mysql_query('UPDATE `users` SET `sleep` = "' . (time() + 60 * 60 * $sl) . '", `sleep_time` = "' . (time() + 60 * 60 * 8) . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + mysql_query('INSERT INTO `effects` (`type`, `name`, `time`, `owner`) VALUES ("8", "Сон", "' . (time() + 60 * 60 * $sl) . '", "' . $user['id'] . '")'); + $ef = mysql_query('SELECT `id`, `time`, `type` FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `type` != 11 AND `type` != 12 AND `type` != 13 AND `type` != 14 AND `type` != 5 AND `type` != 4 AND `type` != 2 AND `type` != 3 AND `type` != 8'); + while ($pl = mysql_fetch_array($ef)) { + $tm = $pl['time'] - time(); + mysql_query('UPDATE `effects` SET `sleep` = "' . $tm . '" WHERE `id` = "' . $pl['id'] . '" AND `owner` = "' . $user['id'] . '"'); + } + header('Location: hostel.php'); + } else { + $error = 'Нельзя спать ... Приходите через : ' . timeOut($user['sleep_time'] - time()); + } +} + +if ($_GET['unsleep'] && $user['sleep'] > 0) { + mysql_query('UPDATE `users` SET `sleep` = "0" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `type` = "8" LIMIT 1'); + $ef = mysql_query('SELECT `id`, `time`, `sleep` FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `sleep` != 0'); + while ($pl = mysql_fetch_array($ef)) { + $tm = time() + $pl['sleep']; + mysql_query('UPDATE `effects` SET `time` = "' . $tm . '", `sleep` = "0" WHERE `id` = "' . $pl['id'] . '" AND `owner` = "' . $user['id'] . '"'); } header('Location: hostel.php'); - } else { - $error = 'Нельзя спать ... Приходите через : '.timeOut($user['sleep_time']-time()); - } } - -if($_GET['unsleep'] && $user['sleep'] > 0) { - mysql_query('UPDATE `users` SET `sleep` = "0" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `type` = "8" LIMIT 1'); - $ef = mysql_query('SELECT `id`, `time`, `sleep` FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `sleep` != 0'); - while($pl = mysql_fetch_array($ef)) { - $tm = time()+$pl['sleep']; - mysql_query('UPDATE `effects` SET `time` = "'.$tm.'", `sleep` = "0" WHERE `id` = "'.$pl['id'].'" AND `owner` = "'.$user['id'].'"'); - } - header('Location: hostel.php'); -} - +Template::header('Хостел'); ?> - - - - 404 - - - - - - - - - + + + + +
-
Гостиница, Холл
-
- - - - - - - - -
- -
-
- -
- Станьте нашим клиентом -
- -

Выберите подходящий для Вас вариант обслуживания:

-
- - - '.$error.'
'; } ?> -
-
-
- -
- Добро пожаловать! -
-

Вы выбрали вариант предоставления жилья :

-

Аренда оплачена по: ()

-
- Сменить вариант аренды - -
-
- Расторгнуть договор Внести предоплату -
'.$error.'

'; } ?> -
- +
Гостиница, Холл
+
+ + + + + + + +
-
- Правила проживания -
-
-

И что я получу за свои кровные?

- У нас ты можешь: -
- хранить свое барахло и прочий хлам. -

Охрана у вас есть? Не воруют?

- Самые любопытные могут получить в сурло прямо здесь - в холле. -
- Устраивать беспорядки в комнатах не позволено. -
- Прислуга у нас проверенная - пожитки твои не тронут. -

И сколько стоит всё это удовольствие?

- - Комнаты есть разные, для людей разного достатка. Смотри справа расценки. -
- Платить нужно каждый день. Пока не заплатишь - на лестницу не ногой. -
- Вместимость - это сколько твоих вещей влезет в комнату, имеется ввиду общая масса инвентаря. -

Как всем этим пользоваться?

- Всё просто. Плати и живи. -
Приходишь, платишь по долгам, проходишь в аппартаменты. В сундуке есть секции для каждого вида вещей, фильтр поможет разобраться. -

Что ещё мне нужно знать?

- - При смене размера комнаты, ты теряешь оставшееся оплаченное время. -
- При просрочке платы более 60 суток, мы оставляем за собой право сдать вещи на аукцион для погашения задолжености. -
- Если долг будет разумный, то подарки забирать с полки не будем. -
- Быстро сориентироваться с шмотом поможет фильтр предметов. -
- Если что потеряешь - твои проблемы. +
+
+ +
+ Станьте нашим клиентом +
+ +

Выберите подходящий для Вас вариант обслуживания:

+
+ + + ' . $error . '
'; + } ?> +
+
+
+ +
+ Добро пожаловать! +
+

Вы выбрали вариант предоставления жилья :

+

Аренда оплачена по: + ()

+
+ Сменить вариант аренды + +
+
+ Расторгнуть договор Внести предоплату +
' . $error . '

'; + } ?> +
+
-
-
-
+
+ Правила проживания +
+
+

И что я получу за свои кровные?

+ У нас ты можешь: +
- хранить свое барахло и прочий хлам. +

Охрана у вас есть? Не воруют?

+ Самые любопытные могут получить в сурло прямо здесь - в холле. +
- Устраивать беспорядки в комнатах не позволено. +
- Прислуга у нас проверенная - пожитки твои не тронут. +

И сколько стоит всё это удовольствие?

+ - Комнаты есть разные, для людей разного достатка. Смотри справа расценки. +
- Платить нужно каждый день. Пока не заплатишь - на лестницу не ногой. +
- Вместимость - это сколько твоих вещей влезет в комнату, имеется ввиду общая масса инвентаря. -
-
- Тарифы и услуги -
- - - - - - -
Сумка
Вместимость15 ед.
Стоимость (7 сут.)8.00 кр.
-
- - - - - - -
Сундук
Вместимость30 ед.
Стоимость (7 сут.)15.00 кр.
-
- - - - - - -
Комната
Вместимость50 ед.
Стоимость (7 сут.)25.00 кр.
-
- - - - - - -
Амбар
Вместимость100 ед.
Стоимость (7 сут.)40.00 кр.
-
-
-
+

Как всем этим пользоваться?

+ Всё просто. Плати и живи. +
Приходишь, платишь по долгам, проходишь в аппартаменты. В сундуке есть секции для каждого вида + вещей, фильтр поможет разобраться. +

Что ещё мне нужно знать?

+ - При смене размера комнаты, ты теряешь оставшееся оплаченное время. +
- При просрочке платы более 60 суток, мы оставляем за собой право сдать вещи на аукцион для + погашения задолжености. +
- Если долг будет разумный, то подарки забирать с полки не будем. +
- Быстро сориентироваться с шмотом поможет фильтр предметов. +
- Если что потеряешь - твои проблемы. +
+
+ +
- - \ No newline at end of file +
+
+ Тарифы и услуги +
+ + + + + + + + + + + + +
Сумка
Вместимость15 ед.
Стоимость (7 сут.)8.00 кр.
+
+ + + + + + + + + + + + +
Сундук
Вместимость30 ед.
Стоимость (7 сут.)15.00 кр.
+
+ + + + + + + + + + + + +
Комната
Вместимость50 ед.
Стоимость (7 сут.)25.00 кр.
+
+ + + + + + + + + + + + +
Амбар
Вместимость100 ед.
Стоимость (7 сут.)40.00 кр.
+
+
+ \ No newline at end of file diff --git a/hostel_checkpoint.php b/hostel_checkpoint.php index 502440e..59aa371 100644 --- a/hostel_checkpoint.php +++ b/hostel_checkpoint.php @@ -1,23 +1,24 @@ array(8, 16, 24, 32), 2 => array(15, 30, 45, 60), 3 => array(25, 50, 75, 100), 4 => array(40, 80, 120, 160)); +$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1')); +$base = [1 => [8, 16, 24, 32], 2 => [15, 30, 45, 60], 3 => [25, 50, 75, 100], 4 => [40, 80, 120, 160]]; -if(isset($_POST['act']) && $_POST['act'] == 'pay') { - if(isset($user['id']) && isset($hostel['id'])) { +if (isset($_POST['act']) && $_POST['act'] == 'pay' && isset($user['id']) && isset($hostel['id'])) { echo '
'; echo 'Предварительная оплата'; echo '

'; - echo 'Аренда оплачена по: '.date('h:i d.m.y', $hostel['time']).' ('.timeOut($hostel['time']-time()).')

'; + echo 'Аренда оплачена по: ' . date('h:i d.m.y', $hostel['time']) . ' (' . timeOut($hostel['time'] - time()) . ')

'; echo ' - +
Выберите срок предоплаты.
Сутки7142128
Сумма'.$base[$hostel['type']][0].''.$base[$hostel['type']][1].''.$base[$hostel['type']][2].''.$base[$hostel['type']][3].'
Сумма' . $base[$hostel['type']][0] . '' . $base[$hostel['type']][1] . '' . $base[$hostel['type']][2] . '' . $base[$hostel['type']][3] . '
Внимание! При расторжении договора или смене тарифа, внесенная плата не возвращается
'; - } } \ No newline at end of file diff --git a/hostel_room.php b/hostel_room.php index 7f08d23..14cbea6 100644 --- a/hostel_room.php +++ b/hostel_room.php @@ -1,22 +1,29 @@ 15, 2 => 30, 3 => 50, 4 => 100); -$vips = array(1 => 0.15, 2 => 0.30, 3 => 0.45); +$base = [1 => 15, 2 => 30, 3 => 50, 4 => 100]; +$vips = [1 => 0.15, 2 => 0.30, 3 => 0.45]; function show_item($row, $txt, $place) { - if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) destructitem($row['id']); + if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) { + destructitem($row['id']); + } $r = ''; $ntxt = "В инвентаре"; - if ($txt == "В сундук") $ntxt = "В сундуке"; + if ($txt == "В сундук") { + $ntxt = "В сундуке"; + } $magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $$row['magic'])->fetch_assoc(); $incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = \'' . $row['includemagic'] . '\' LIMIT 1')); @@ -28,8 +35,8 @@ function show_item($row, $txt, $place) $magic['time'] = $incmagic['time']; $magic['targeted'] = $incmagic['targeted']; } - #href="?search=1&otdel='.$row['otdel'].'&place='.$place.'&itm='.$row['id'].'&set=1" if (isset($row['id'])) { + //todo подтянуть отображение предмета из класса $r .= '
'; $r .= ''; $r .= ''; + $r = ''; } -if($_GET['set'] && $_GET['set'] == 1) { - $it = mysql_fetch_array(mysql_query('SELECT `id`, `owner` FROM `inventory` WHERE `id` = "'.(int)$_GET['itm'].'" LIMIT 1')); - if(isset($it['id'])) { - if($it['owner'] == $user['id']) { - if($in['cnt'] < $count) { - mysql_query('UPDATE `inventory` SET `owner` = "-101'.$user['id'].'" WHERE `id` = "'.$it['id'].'" LIMIT 1'); - $in['cnt']++; - } else { - $error = 'Не хватает места ...'; - } - } elseif($it['owner'] == '-101'.$user['id']) { - mysql_query('UPDATE `inventory` SET `owner` = "'.$user['id'].'" WHERE `id` = "'.$it['id'].'" LIMIT 1'); - $in['cnt']--; +if ($_GET['set'] && $_GET['set'] == 1) { + $it = mysql_fetch_array(mysql_query('SELECT `id`, `owner` FROM `inventory` WHERE `id` = "' . (int)$_GET['itm'] . '" LIMIT 1')); + if (isset($it['id'])) { + if ($it['owner'] == $user['id']) { + if ($in['cnt'] < $count) { + mysql_query('UPDATE `inventory` SET `owner` = "-101' . $user['id'] . '" WHERE `id` = "' . $it['id'] . '" LIMIT 1'); + $in['cnt']++; + } else { + $error = 'Не хватает места ...'; + } + } elseif ($it['owner'] == '-101' . $user['id']) { + mysql_query('UPDATE `inventory` SET `owner` = "' . $user['id'] . '" WHERE `id` = "' . $it['id'] . '" LIMIT 1'); + $in['cnt']--; + } } - } - unset($it); - header('Location: hostel_room.php?search=1&otdel='.$_GET['otdel'].'&place='.$_GET['place']); + unset($it); + header('Location: hostel_room.php?search=1&otdel=' . $_GET['otdel'] . '&place=' . $_GET['place']); } -if($_GET['search']) { - $r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']); +if ($_GET['search']) { + $r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']); } ####### -$w = (270*$d['mass']/get_meshok()); $w_a = 270-$w; -$h = (270*$in['cnt']/$count); $h_a = 270-$h; +$w = (270 * $d['mass'] / get_meshok()); +$w_a = 270 - $w; +$h = (270 * $in['cnt'] / $count); +$h_a = 270 - $h; ####### -if($_GET['go_back'] == 1) { - mysql_query('UPDATE `users`,`online` SET `users`.`room` = 660, `online`.`room` = 660 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"'); - header('Location: hostel.php'); +if ($_GET['go_back'] == 1) { + mysql_query('UPDATE `users`,`online` SET `users`.`room` = 660, `online`.`room` = 660 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"'); + header('Location: hostel.php'); } - +Template::header('hostel_room'); ?> - - - - 404 - - - - - - -
-
- - -

Комнатуха

-
- - -
-
-Фильтр инвентаря -
-
- - + #hstInventory td.item { + width: 85%; + } -
-  - - -
-
-
Состояние -
-
/
/
-
-
+ #hstInventory td.links { + text-align: center; + vertical-align: middle; + width: 117px; + } -
- -
-
'.$error.''; } ?>
- - \ No newline at end of file + #hstInventory td.links span { + display: block; + } + + #hstInventory td.original span.pk-current { + display: none; + } + + #hstInventory td.moved { + font-weight: bold; + } + + #hstInventory td.odd { + background-color: #c7c7c7; + } + + #hstInventory td.even { + background-color: #d5d5d5; + } + + label { + font-weight: bold; + margin-right: 15px; + } + + +
+
+ Фильтр инвентаря +
+
+ + + +
+   + + +
+
+
+ Состояние +
+
/
+
/
+
+
+
+ +
+ +
+ +%s
', $error); +} \ No newline at end of file diff --git a/index.php b/index.php index 659c80a..65aba16 100644 --- a/index.php +++ b/index.php @@ -1,11 +1,4 @@ - - - - - - Вход - - +

Демонстрационная версия

Ребята, давайте сперва сделаем чтобы работало, а потом будем делать красиво. Идёт?

Пол персонажа выбирать нельзя. Это не ошибка. Все ограничения только для мальчиков или только для девочек постепенно будут удалены.
@@ -19,6 +12,4 @@

- - \ No newline at end of file + \ No newline at end of file diff --git a/lab.php b/lab.php index d8cd8e3..11cf772 100644 --- a/lab.php +++ b/lab.php @@ -1,484 +1,525 @@ - - - + -room) { $user->room = rand(1,1000); } - - - $room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '".mysql_real_escape_string($user->room)."';")); +room) . "';")); -if($_GET['healall'] == 1){ - $cost = $_GET['cost']; - $kto = $user['login']; - if($user['money'] >= $cost){ - mysql_query("UPDATE `users` SET `hp`=`maxhp` WHERE `lab`='1' AND `bot`!='1';"); - mysql_query("insert into `lab_heal_log` (`kto`,`cost`) VALUES ('".$kto."','".$cost."')"); - mysql_query("update `users` set `money`=`money`-'".$cost."' where `login`='".$user['login']."'"); - echo"Вы всех излечили за ".$cost." Кр!
"; -}else{echo"Не достаточно денег.
";} +if ($_GET['healall'] == 1) { + $cost = $_GET['cost']; + $kto = $user['login']; + if ($user['money'] >= $cost) { + mysql_query("UPDATE `users` SET `hp`=`maxhp` WHERE `lab`='1' AND `bot`!='1';"); + mysql_query("insert into `lab_heal_log` (`kto`,`cost`) VALUES ('" . $kto . "','" . $cost . "')"); + mysql_query("update `users` set `money`=`money`-'" . $cost . "' where `login`='" . $user['login'] . "'"); + echo "Вы всех излечили за " . $cost . " Кр!
"; + } else { + echo "Не достаточно денег.
"; + } } - -If($_GET['buykill'] == 1){ - if($user['money'] >= 0.15){ - mysql_query("update `users` set `money`=`money`-'0.15' where `id`='".$user['id']."'"); - mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`+'1' where `id_user`='".$user['id']."'"); - echo""; -}echo"Не достаточно денег!
"; +if ($_GET['buykill'] == 1) { + if ($user['money'] >= 0.15) { + mysql_query("update `users` set `money`=`money`-'0.15' where `id`='" . $user['id'] . "'"); + mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`+'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + } + echo "Не достаточно денег!
"; } -if($_GET['svitheal'] == 1){ - If($u_res['svitok_heal'] >= 1){ - if($user['hp'] < $user['maxhp']){ -Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); -Mysql_query("update `lab_user` set `svitok_heal`=`svitok_heal`-'1' where `id_user`='".$user['id']."'"); - echo""; -}else{echo"Ваши жизни итак полны!
";} -}else{echo"У Вас нет свитков оздоровления!
";} +if ($_GET['svitheal'] == 1) { + if ($u_res['svitok_heal'] >= 1) { + if ($user['hp'] < $user['maxhp']) { + Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'"); + Mysql_query("update `lab_user` set `svitok_heal`=`svitok_heal`-'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + } else { + echo "Ваши жизни итак полны!
"; + } + } else { + echo "У Вас нет свитков оздоровления!
"; + } } -if($_GET['eexit'] == 1){ - mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'"); -Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); - $msg .= 'Вышли...
'; - mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - echo""; +if ($_GET['eexit'] == 1) { + mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'"); + Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'"); + $msg .= 'Вышли...
'; + mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + echo ""; } -if($_GET['kwestend'] == 1){ +if ($_GET['kwestend'] == 1) { ///////////*****3ADAHU9I******////////// -if($u_res['zadanie'] == 1){$mkol = 3;} -elseif($u_res['zadanie'] == 2){$mkol = 10;} -elseif($u_res['zadanie'] == 3){$mkol = 50;} -elseif($u_res['zadanie'] == 4){$mkol = 10;} -elseif($u_res['zadanie'] == 5){$mkol = 15;} -elseif($u_res['zadanie'] == 6){$mkol = 25;} -elseif($u_res['zadanie'] == 7){$mkol = 5;} -elseif($u_res['zadanie'] == 8){$mkol = 10;} -if($u_res['zad'.$u_res['zadanie'].'_kol'] >= $mkol){ - mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); -Mysql_query("update `users` set `hp`=`maxhp`,`city_mountain`=`city_mountain`+'".$u_res['nagrada']."',`doblest`=`doblest`+'".$u_res['nagrada']."' where `login`='".$user['login']."'"); -mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'"); -mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';"); - echo""; -}else{echo"Вы еще не собрали все ресурсы
";} + if ($u_res['zadanie'] == 1) { + $mkol = 3; + } elseif ($u_res['zadanie'] == 2) { + $mkol = 10; + } elseif ($u_res['zadanie'] == 3) { + $mkol = 50; + } elseif ($u_res['zadanie'] == 4) { + $mkol = 10; + } elseif ($u_res['zadanie'] == 5) { + $mkol = 15; + } elseif ($u_res['zadanie'] == 6) { + $mkol = 25; + } elseif ($u_res['zadanie'] == 7) { + $mkol = 5; + } elseif ($u_res['zadanie'] == 8) { + $mkol = 10; + } + if ($u_res['zad' . $u_res['zadanie'] . '_kol'] >= $mkol) { + mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'"); + Mysql_query("update `users` set `hp`=`maxhp`,`city_mountain`=`city_mountain`+'" . $u_res['nagrada'] . "',`doblest`=`doblest`+'" . $u_res['nagrada'] . "' where `login`='" . $user['login'] . "'"); + mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';"); + echo ""; + } else { + echo "Вы еще не собрали все ресурсы
"; + } } -if($_GET['mobkill'] == 1){ - If($u_res['svitok_kill'] > 0){ - $coma = array ( -"Бот яростно замахнулся, но вы уклонились от удара!", -"Вы заблокировали подлый удар в спину.", -"Ваша реакция позволила вам отпрыгнуть от врага.", -"Вы громко закричали, в следствии чего бот промахнулся.", -"Бот явно не расчитал свою силы и ударил мимо вас!", -"Вы технично парировали удар."); -$com = $coma[rand(0,count($coma)-1)]; -$id = $_GET['idbot']; -$rand_bot_atack = rand(1,3); -$rand_bot_hpkol2 = rand(1,7); -$rand_bot_hpkol1 = rand(3,20); -$rand_bot_hpkol = ($rand_bot_hpkol1 + $rand_bot_hpkol2) * $user['level']; -if($rand_bot_atack == 1){$user['hp'] = $user['hp'] - $rand_bot_hpkol;echo"*** Бот атаковал вас на -".$rand_bot_hpkol." HP!
";mysql_query("update `users` set `hp`=`hp`-'".$rand_bot_hpkol."' where `id`='".$user['id']."'");} -else{echo"*** Бот промахнулся!
";} - $rand_hp1 = rand(1,10); - $rand_hp = $rand_hp1 * $user['level']; - $bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1")); -$hels = $bot['bot_hp'] - $rand_hp; -if($hels < 0){ - echo"Вы убили моба!
"; +if ($_GET['mobkill'] == 1) { + if ($u_res['svitok_kill'] > 0) { + $coma = [ + "Бот яростно замахнулся, но вы уклонились от удара!", + "Вы заблокировали подлый удар в спину.", + "Ваша реакция позволила вам отпрыгнуть от врага.", + "Вы громко закричали, в следствии чего бот промахнулся.", + "Бот явно не расчитал свою силы и ударил мимо вас!", + "Вы технично парировали удар."]; + $com = $coma[rand(0, count($coma) - 1)]; + $id = $_GET['idbot']; + $rand_bot_atack = rand(1, 3); + $rand_bot_hpkol2 = rand(1, 7); + $rand_bot_hpkol1 = rand(3, 20); + $rand_bot_hpkol = ($rand_bot_hpkol1 + $rand_bot_hpkol2) * $user['level']; + if ($rand_bot_atack == 1) { + $user['hp'] = $user['hp'] - $rand_bot_hpkol; + echo "*** Бот атаковал вас на -" . $rand_bot_hpkol . " HP!
"; + mysql_query("update `users` set `hp`=`hp`-'" . $rand_bot_hpkol . "' where `id`='" . $user['id'] . "'"); + } else { + echo "*** Бот промахнулся!
"; + } + $rand_hp1 = rand(1, 10); + $rand_hp = $rand_hp1 * $user['level']; + $bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1")); + $hels = $bot['bot_hp'] - $rand_hp; + if ($hels < 0) { + echo "Вы убили моба!
"; ///Если нужно выбить записки -if($u_res['zadanie'] == 7){ -$zapis = rand(1,4); -if($zapis == 1){ -echo"Вы получили 1 записку!
"; -Mysql_query("update `lab_user` set `zad".$u_res['zadanie']."_kol`=`zad".$u_res['zadanie']."_kol`+'1' where `id_user`='".$user['id']."'"); -} -mysql_query("delete from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1"); + if ($u_res['zadanie'] == 7) { + $zapis = rand(1, 4); + if ($zapis == 1) { + echo "Вы получили 1 записку!
"; + Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'"); + } + mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1"); //если просто убивалка -}else{ -Mysql_query("update `lab_user` set `zad".$u_res['zadanie']."_kol`=`zad".$u_res['zadanie']."_kol`+'1' where `id_user`='".$user['id']."'"); - mysql_query("delete from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1"); -}} -else{echo"Вы отняли у моба -".$rand_hp." HP!
";mysql_query("update `lab_bots` set `bot_hp`=`bot_hp`-'".$rand_hp."' where `id`='".$bot['id']."'");} -Mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`-'1' where `id_user`='".$user['id']."'"); -}else{echo"У вас нет свитков атаки!
";} + } else { + Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'"); + mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1"); + } + } else { + echo "Вы отняли у моба -" . $rand_hp . " HP!
"; + mysql_query("update `lab_bots` set `bot_hp`=`bot_hp`-'" . $rand_hp . "' where `id`='" . $bot['id'] . "'"); + } + Mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`-'1' where `id_user`='" . $user['id'] . "'"); + } else { + echo "У вас нет свитков атаки!
"; + } } -if($_GET['svitexit'] == 1){ - If($u_res['exit_teleport'] >= 1){ - mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); -Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); -Mysql_query("update `lab_user` set `exit_teleport`=`exit_teleport`-'1' where `id_user`='".$user['id']."'"); -mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';"); - echo""; -}else{echo"У вас нет свитков возрата!
";} +if ($_GET['svitexit'] == 1) { + if ($u_res['exit_teleport'] >= 1) { + mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'"); + Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'"); + Mysql_query("update `lab_user` set `exit_teleport`=`exit_teleport`-'1' where `id_user`='" . $user['id'] . "'"); + mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';"); + echo ""; + } else { + echo "У вас нет свитков возрата!
"; + } } - - if($_GET['exit'] && $room['exit']==1) { - mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'"); -Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); -mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';"); - echo""; - } - if($_GET['get']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($_GET['get'])."' AND `id_user`='".$user['id']."';")); - if($data['id_room'] == $user->room) { +if ($_GET['exit'] && $room['exit'] == 1) { + mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'"); + Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'"); + mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';"); + echo ""; +} - switch($data['type']){ - case 1: - $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."';")); - if($user['sila']*4 > $d[0]) { - mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');"); - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - } - break; - case 2: - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - $user['hp'] = $user['maxhp']; - break; - case 6: - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - Mysql_query("update `lab_user` set `zad3_kol`=`zad3_kol`+'1' where `id_user`='".$user['id']."'"); - echo""; - break; - case 5: - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - Mysql_query("update `lab_user` set `zad2_kol`=`zad2_kol`+'1' where `id_user`='".$user['id']."'"); - echo""; - break; - case 7: - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - Mysql_query("update `lab_user` set `zad8_kol`=`zad8_kol`+'1' where `id_user`='".$user['id']."'"); - echo""; - break; - case 4: - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - Mysql_query("update `lab_user` set `zad1_kol`=`zad1_kol`+'1' where `id_user`='".$user['id']."'"); - echo""; - break; - case 3: - $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';")); - if($user['sila']*4 > $d[0]) { - mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');"); - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - } - break; - case 9: - $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';")); - if($user['sila']*4 > $d[0]) { - mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');"); - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - } - break; - case 8: - $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';")); - if($user['sila']*4 > $d[0]) { - mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');"); - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - } - break; - } - } - unset($data); - } - - if($_GET['drop']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '".mysql_real_escape_string($_GET['drop'])."' AND `id_user`='".$user['id']."';")); - mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('".mysql_real_escape_string($user->room)."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."','".mysql_real_escape_string($user['id'])."');"); - unset($data); - } - - if($_GET['nal1']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal1'])."' AND `id_user`='".$user['id']."';")); - if($data['id_room'] == $user->room) { - $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='1';")); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='1';"); - mysql_query("UPDATE `users` SET `money` = `money`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - err('Вы обналичили у Архивариуса чек на '.round($sum[0],2).' кр!
'); - } - unset($data); - } - +if ($_GET['get']) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($_GET['get']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($data['id_room'] == $user->room) { - if($_GET['nal2']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal2'])."' AND `id_user`='".$user['id']."';")); - if($data['id_room'] == $user->room) { - $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='3';")); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='3';"); - mysql_query("UPDATE `users` SET `doblest` = `doblest`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - err('Вы обналичили у Архивариуса чек на '.round($sum[0],2).' доблести!
'); - } - unset($data); - } - + switch ($data['type']) { + case 1: + $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "';")); + if ($user['sila'] * 4 > $d[0]) { + mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');"); + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + } + break; + case 2: + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + $user['hp'] = $user['maxhp']; + break; + case 6: + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + Mysql_query("update `lab_user` set `zad3_kol`=`zad3_kol`+'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + break; + case 5: + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + Mysql_query("update `lab_user` set `zad2_kol`=`zad2_kol`+'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + break; + case 7: + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + Mysql_query("update `lab_user` set `zad8_kol`=`zad8_kol`+'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + break; + case 4: + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + Mysql_query("update `lab_user` set `zad1_kol`=`zad1_kol`+'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + break; + case 3: + $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($user['sila'] * 4 > $d[0]) { + mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');"); + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + } + break; + case 9: + $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($user['sila'] * 4 > $d[0]) { + mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');"); + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + } + break; + case 8: + $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($user['sila'] * 4 > $d[0]) { + mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');"); + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + } + break; + } + } + unset($data); +} - if($_GET['nal3']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal3'])."' AND `id_user`='".$user['id']."';")); - if($data['id_room'] == $user->room) { - $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='8';")); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='8';"); - mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - err('Вы обналичили у Архивариуса чек на '.round($sum[0],2).' екр!
'); - } - unset($data); - } - +if ($_GET['drop']) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($_GET['drop']) . "' AND `id_user`='" . $user['id'] . "';")); + mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('" . mysql_real_escape_string($user->room) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "','" . mysql_real_escape_string($user['id']) . "');"); + unset($data); +} - if($_GET['nal4']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal4'])."' AND `id_user`='".$user['id']."';")); - if($data['id_room'] == $user->room) { - $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='9';")); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='9';"); - mysql_query("UPDATE `users` SET `exp` = `exp`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - err('Вы обналичили у Архивариуса чек на '.round($sum[0],2).' опыта!
'); - } - unset($data); - } - - if ($_GET['go']) { - if(time()-$_SESSION['time'] <= 3) { - echo "Не так быстро"; - } - else - switch($_GET['go']) { - case "p1": - mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p1'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - $user->room = $room['p1']; - $_SESSION['time'] = time(); - break; - case "p2": - mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p2'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - $user->room = $room['p2']; - $_SESSION['time'] = time(); - break; - case "p3": - mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p3'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - $user->room = $room['p3']; - $_SESSION['time'] = time(); - break; - case "p4": - mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p4'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - $user->room = $room['p4']; - $_SESSION['time'] = time(); - break; - } - } - - $room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '".mysql_real_escape_string($user->room)."';")); - - if($user['hp'] <= 0) { - mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'"); -Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); - $msg .= 'К сожалению, Вы умерли!
'; - mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - echo""; - } - - - - $data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '".mysql_real_escape_string($user->room)."' AND `id_user`='".$user['id']."';"); - $data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."';"); - $data3 = mysql_query("SELECT * FROM `users` WHERE `lab` = 1 AND `room` = '".mysql_real_escape_string($room['id'])."';"); - $data4 = mysql_query("SELECT * FROM `lab_bots` WHERE `id_room` = '".mysql_real_escape_string($room['id'])."' AND `id_user`='".$user['id']."';"); - - $roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '".mysql_real_escape_string($user->room)."' AND `id_user`='".$user['id']."';")); - - if($roow[0]) { - $msg .= 'В комнате была установлена ловушка...
'; - switch($roow[3]) { - case 1: - mysql_query("UPDATE `users` SET `hp` = '1' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - break; - case 2: - mysql_query("UPDATE `users` SET `hp` = `hp`/2+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - break; - case 3: - mysql_query("UPDATE `users` SET `hp` = `hp`/3+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - break; - case 4: - mysql_query("UPDATE `users` SET `hp` = `hp`/4+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - break; - } - $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '".mysql_real_escape_string($_SESSION['uid'])."' LIMIT 1;")); - mysql_query("DELETE FROM `lab_trap` WHERE `id` = '".mysql_real_escape_string($roow['id'])."' AND `id_user`='".$user['id']."';"); - } - - if((time()-$_SESSION['time']) > 3) { - $tt = 3; - } - else { - $tt =(time()-$_SESSION['time']); - } -?> - - - - - - -room) { + $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';")); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';"); + mysql_query("UPDATE `users` SET `money` = `money`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + err('Вы обналичили у Архивариуса чек на ' . round($sum[0], 2) . ' кр!
'); + } + unset($data); +} - echo Nick::id($user)->battle(); - echo" Выйти?"; - echo "
Поиск ...
Поиск ...
"; +echo "
".$msg; echo ""; - if($room['exit']==1) { - echo "В комнате есть выход.ВЫЙТИ!
"; - } - echo" Свиток возрата: ".$u_res['exit_teleport']." | Свиток оздоровления: ".$u_res['svitok_heal']."
"; +if ($_GET['nal2']) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal2']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($data['id_room'] == $user->room) { + $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';")); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';"); + mysql_query("UPDATE `users` SET `doblest` = `doblest`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + err('Вы обналичили у Архивариуса чек на ' . round($sum[0], 2) . ' доблести!
'); + } + unset($data); +} + + +if ($_GET['nal3']) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal3']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($data['id_room'] == $user->room) { + $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';")); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';"); + mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + err('Вы обналичили у Архивариуса чек на ' . round($sum[0], 2) . ' екр!
'); + } + unset($data); +} + + +if ($_GET['nal4']) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal4']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($data['id_room'] == $user->room) { + $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';")); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';"); + mysql_query("UPDATE `users` SET `exp` = `exp`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + err('Вы обналичили у Архивариуса чек на ' . round($sum[0], 2) . ' опыта!
'); + } + unset($data); +} + +if ($_GET['go']) { + if (time() - $_SESSION['time'] <= 3) { + echo "Не так быстро"; + } else + switch ($_GET['go']) { + case "p1": + mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p1']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + $user->room = $room['p1']; + $_SESSION['time'] = time(); + break; + case "p2": + mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p2']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + $user->room = $room['p2']; + $_SESSION['time'] = time(); + break; + case "p3": + mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p3']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + $user->room = $room['p3']; + $_SESSION['time'] = time(); + break; + case "p4": + mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p4']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + $user->room = $room['p4']; + $_SESSION['time'] = time(); + break; + } +} + +$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';")); + +if ($user['hp'] <= 0) { + mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'"); + Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'"); + $msg .= 'К сожалению, Вы умерли!
'; + mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + echo ""; +} + + +$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';"); +$data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "';"); +$data3 = mysql_query("SELECT * FROM `users` WHERE `lab` = 1 AND `room` = '" . mysql_real_escape_string($room['id']) . "';"); +$data4 = mysql_query("SELECT * FROM `lab_bots` WHERE `id_room` = '" . mysql_real_escape_string($room['id']) . "' AND `id_user`='" . $user['id'] . "';"); + +$roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';")); + +if ($roow[0]) { + $msg .= 'В комнате была установлена ловушка...
'; + switch ($roow[3]) { + case 1: + mysql_query("UPDATE `users` SET `hp` = '1' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + break; + case 2: + mysql_query("UPDATE `users` SET `hp` = `hp`/2+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + break; + case 3: + mysql_query("UPDATE `users` SET `hp` = `hp`/3+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + break; + case 4: + mysql_query("UPDATE `users` SET `hp` = `hp`/4+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + break; + } + $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '" . mysql_real_escape_string($_SESSION['uid']) . "' LIMIT 1;")); + mysql_query("DELETE FROM `lab_trap` WHERE `id` = '" . mysql_real_escape_string($roow['id']) . "' AND `id_user`='" . $user['id'] . "';"); +} + +if ((time() - $_SESSION['time']) > 3) { + $tt = 3; +} else { + $tt = (time() - $_SESSION['time']); +} +Template::header('lab'); + +echo Nick::id($user)->battle(); +echo " Выйти?"; +echo ""; - echo ""; +echo ""; - echo "
" . $msg; +echo ""; +if ($room['exit'] == 1) { + echo "В комнате есть выход.ВЫЙТИ!
"; +} + +echo " Свиток возрата: " . $u_res['exit_teleport'] . " | Свиток оздоровления: " . $u_res['svitok_heal'] . "
"; + +echo " + Бот-атаки: " . $u_res['svitok_kill'] . " [купить]"; +echo "

"; - echo" + Бот-атаки: ".$u_res['svitok_kill']." [купить]"; - echo"

"; - $log = mysql_query("select * from `lab_heal_log` order by `id` desc LIMIT 1"); - for($i=0; $i".$u_info['login']." [".$u_info['level']."]Информация о ".$u_info[ излечил всех за ".$log_inf['cost']." кр.
"; +for ($i = 0; $i < mysql_num_rows($log); $i++) { + $log_inf = mysql_fetch_array($log); + $u_info = mysql_fetch_array(mysql_query("select `level`,`login` from `users` where `login`='" . $log_inf['kto'] . "'")); + echo "" . $u_info['login'] . " [" . $u_info['level'] . "]Информация о " . $u_info[ излечил всех за " . $log_inf['cost'] . " кр.
"; } - - echo"".$room['name']." (".$user->room.")

 "; - $u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'"); + +echo "" . $room['name'] . " (" . $user->room . ")
 "; +$u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'"); $u_lab_kol = mysql_num_rows($u_lab); -$heal_all = (($u_lab_kol/2)+1); -echo"Всего в Квестовом Лабиринте: ".$u_lab_kol." чел. [излечить]
"; - echo"В этой комнате:"; - echo"
  • Игроки:"; - while($items = mysql_fetch_array($data3)){ - echo "
    "; echo Nick::id($items['id'])->full(); - } - echo"
  • Мобы:"; - while($items = mysql_fetch_array($data4)){ - echo "
    "; echo"".$items['bot_name']." "; echo" [".$items['bot_hp']."/".$items['bot_hpmax']."]"; - if(($u_res['zadanie_mob_id'] == $items['id_bot'] && $u_res['svitok_kill'] > 0) || ($u_res['zadanie'] == 7 && $u_res['svitok_kill'] > 0)){echo " " . $u_lab_kol . " чел. В этой комнате:"; +echo "
  • Игроки:"; +while ($items = mysql_fetch_array($data3)) { + echo "
    "; + echo Nick::id($items['id'])->full(); +} +echo "
  • Мобы:"; +while ($items = mysql_fetch_array($data4)) { + echo "
    "; + echo "" . $items['bot_name'] . " "; + echo " [" . $items['bot_hp'] . "/" . $items['bot_hpmax'] . "]"; + if (($u_res['zadanie_mob_id'] == $items['id_bot'] && $u_res['svitok_kill'] > 0) || ($u_res['zadanie'] == 7 && $u_res['svitok_kill'] > 0)) { + echo "
    [Обналичить чеки на кр]
    "; - } - elseif($items['id_bot'] == 5) { - echo "
    [Обналичить чеки на добл.]
    "; - } - elseif($items['id_bot'] == 6) { - echo "
    [Обналичить чеки на екры]
    "; - } - elseif($items['id_bot'] == 7) { - echo "
    [Обналичить чеки на опыт]
    "; - } - } - echo"
  • Ресурсы:"; - while($items = mysql_fetch_array($data)){ - switch($items['type']){ - case 1: - echo "
    Чек на ".$items['value']." кр."; - break; - case 2: - echo "
    Колодец жизни"; - break; - case 6: - echo "
    Подарок"; - break; - case 5: - echo "
    Нож"; - break; - case 7: - echo "
    Установить древний символ"; - break; - case 3: - echo "
    Чек на ".$items['value']." добл."; - break; - case 8: - echo "
    Чек на ".$items['value']." екр"; - break; - case 9: - echo "
    Чек на ".$items['value']." опыта"; - break; - case 4: - echo "
    Синий жемчуг"; - break; - } - } - echo "
  • "; + if ($items['id_bot'] == 4) { + echo "
    [Обналичить чеки на кр]
    "; + } elseif ($items['id_bot'] == 5) { + echo "
    [Обналичить чеки на добл.]
    "; + } elseif ($items['id_bot'] == 6) { + echo "
    [Обналичить чеки на екры]
    "; + } elseif ($items['id_bot'] == 7) { + echo "
    [Обналичить чеки на опыт]
    "; + } +} +echo "
  • Ресурсы:"; +while ($items = mysql_fetch_array($data)) { + switch ($items['type']) { + case 1: + echo "
    Чек на " . $items['value'] . " кр."; + break; + case 2: + echo "
    Колодец жизни"; + break; + case 6: + echo "
    Подарок"; + break; + case 5: + echo "
    Нож"; + break; + case 7: + echo "
    Установить древний символ"; + break; + case 3: + echo "
    Чек на " . $items['value'] . " добл."; + break; + case 8: + echo "
    Чек на " . $items['value'] . " екр"; + break; + case 9: + echo "
    Чек на " . $items['value'] . " опыта"; + break; + case 4: + echo "
    Синий жемчуг"; + break; + } +} +echo "
  • "; ///////////*****3ADAHU9I******////////// -if($u_res['zadanie'] == 1){$mkol = 3;} -elseif($u_res['zadanie'] == 2){$mkol = 10;} -elseif($u_res['zadanie'] == 3){$mkol = 50;} -elseif($u_res['zadanie'] == 4){$mkol = 10;} -elseif($u_res['zadanie'] == 5){$mkol = 15;} -elseif($u_res['zadanie'] == 6){$mkol = 25;} -elseif($u_res['zadanie'] == 7){$mkol = 5;} -elseif($u_res['zadanie'] == 8){$mkol = 10;} -echo"Задание: ".$u_res['zadanie_opisanie']." [".$u_res['zad'.$u_res['zadanie'].'_kol']."/".$mkol."]"; -if($u_res['zad'.$u_res['zadanie'].'_kol'] >= $mkol){echo" +if ($u_res['zadanie'] == 1) { + $mkol = 3; +} elseif ($u_res['zadanie'] == 2) { + $mkol = 10; +} elseif ($u_res['zadanie'] == 3) { + $mkol = 50; +} elseif ($u_res['zadanie'] == 4) { + $mkol = 10; +} elseif ($u_res['zadanie'] == 5) { + $mkol = 15; +} elseif ($u_res['zadanie'] == 6) { + $mkol = 25; +} elseif ($u_res['zadanie'] == 7) { + $mkol = 5; +} elseif ($u_res['zadanie'] == 8) { + $mkol = 10; +} +echo "Задание: " . $u_res['zadanie_opisanie'] . " [" . $u_res['zad' . $u_res['zadanie'] . '_kol'] . "/" . $mkol . "]"; +if ($u_res['zad' . $u_res['zadanie'] . '_kol'] >= $mkol) { + echo " ЗАВЕРШИТЬ! - ";} + "; +} ?> - + Найденные ресурсы:"; - while($items = mysql_fetch_array($data2)){ - if($items['type']==1){echo "
    Чек на ".$items['value']." кр.";} - if($items['type']==3){echo "
    Чек на ".$items['value']." добл.";} - if($items['type']==9){echo "
    Чек на ".$items['value']." опыта";} - if($items['type']==8){echo "
    Чек на ".$items['value']." екр";} +echo "
    Найденные ресурсы:"; +while ($items = mysql_fetch_array($data2)) { + if ($items['type'] == 1) { + echo "
    Чек на " . $items['value'] . " кр."; + } + if ($items['type'] == 3) { + echo "
    Чек на " . $items['value'] . " добл."; + } + if ($items['type'] == 9) { + echo "
    Чек на " . $items['value'] . " опыта"; + } + if ($items['type'] == 8) { + echo "
    Чек на " . $items['value'] . " екр"; + } - } - echo "
    Всего: ".mysql_num_rows($data2)."/".($user['sila']*4)." "; - echo "
    "; - -?> - - +} +echo "
    Всего: " . mysql_num_rows($data2) . "/" . ($user['sila'] * 4) . " "; +echo "
    "; \ No newline at end of file diff --git a/lab2.php b/lab2.php index 9530be8..e02534c 100644 --- a/lab2.php +++ b/lab2.php @@ -1,485 +1,523 @@ - - - + +room) . "';")); -if($_GET['healall'] == 1){ - $cost = $_GET['cost']; - $kto = $user['login']; - if($user['money'] >= $cost){ - mysql_query("UPDATE `users` SET `hp`=`maxhp` WHERE `lab`='1' AND `bot`!='1';"); - mysql_query("insert into `lab_heal_log` (`kto`,`cost`) VALUES ('".$kto."','".$cost."')"); - mysql_query("update `users` set `money`=`money`-'".$cost."' where `login`='".$user['login']."'"); - echo"Вы всех излечили за ".$cost." Кр!
    "; -}else{echo"Недостаточно денег.
    ";} +if ($_GET['healall'] == 1) { + $cost = $_GET['cost']; + $kto = $user['login']; + if ($user['money'] >= $cost) { + mysql_query("UPDATE `users` SET `hp`=`maxhp` WHERE `lab`='1' AND `bot`!='1';"); + mysql_query("insert into `lab_heal_log` (`kto`,`cost`) VALUES ('" . $kto . "','" . $cost . "')"); + mysql_query("update `users` set `money`=`money`-'" . $cost . "' where `login`='" . $user['login'] . "'"); + echo "Вы всех излечили за " . $cost . " Кр!
    "; + } else { + echo "Недостаточно денег.
    "; + } } - -If($_GET['buykill'] == 1){ - if($user['money'] >= 0.15){ - mysql_query("update `users` set `money`=`money`-'0.15' where `id`='".$user['id']."'"); - mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`+'1' where `id_user`='".$user['id']."'"); - echo""; -}echo"Недостаточно денег!
    "; +if ($_GET['buykill'] == 1) { + if ($user['money'] >= 0.15) { + mysql_query("update `users` set `money`=`money`-'0.15' where `id`='" . $user['id'] . "'"); + mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`+'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + } + echo "Недостаточно денег!
    "; } -if($_GET['svitheal'] == 1){ - If($u_res['svitok_heal'] >= 1){ - if($user['hp'] < $user['maxhp']){ -Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); -Mysql_query("update `lab_user` set `svitok_heal`=`svitok_heal`-'1' where `id_user`='".$user['id']."'"); - echo""; -}else{echo"Ваши жизни итак полны!
    ";} -}else{echo"У вас нет свитков оздоровления!
    ";} +if ($_GET['svitheal'] == 1) { + if ($u_res['svitok_heal'] >= 1) { + if ($user['hp'] < $user['maxhp']) { + Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'"); + Mysql_query("update `lab_user` set `svitok_heal`=`svitok_heal`-'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + } else { + echo "Ваши жизни итак полны!
    "; + } + } else { + echo "У вас нет свитков оздоровления!
    "; + } } -if($_GET['eexit'] == 1){ - mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'"); -Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); - $msg .= 'Вышли...
    '; - mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - echo""; +if ($_GET['eexit'] == 1) { + mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'"); + Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'"); + $msg .= 'Вышли...
    '; + mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + echo ""; } -if($_GET['kwestend'] == 1){ +if ($_GET['kwestend'] == 1) { ///////////*****3ADAHU9I******////////// -if($u_res['zadanie'] == 1){$mkol = 3;} -elseif($u_res['zadanie'] == 2){$mkol = 10;} -elseif($u_res['zadanie'] == 3){$mkol = 50;} -elseif($u_res['zadanie'] == 4){$mkol = 10;} -elseif($u_res['zadanie'] == 5){$mkol = 15;} -elseif($u_res['zadanie'] == 6){$mkol = 25;} -elseif($u_res['zadanie'] == 7){$mkol = 5;} -elseif($u_res['zadanie'] == 8){$mkol = 10;} -if($u_res['zad'.$u_res['zadanie'].'_kol'] >= $mkol){ - mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); -Mysql_query("update `users` set `hp`=`maxhp`,`city_mountain`=`city_mountain`+'".$u_res['nagrada']."',`nagrada_mountain`=`nagrada_mountain`+'".$u_res['nagrada']."' where `login`='".$user['login']."'"); -mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'"); -mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';"); - echo""; -}else{echo"Вы еще не собрали все ресурсы
    ";} + if ($u_res['zadanie'] == 1) { + $mkol = 3; + } elseif ($u_res['zadanie'] == 2) { + $mkol = 10; + } elseif ($u_res['zadanie'] == 3) { + $mkol = 50; + } elseif ($u_res['zadanie'] == 4) { + $mkol = 10; + } elseif ($u_res['zadanie'] == 5) { + $mkol = 15; + } elseif ($u_res['zadanie'] == 6) { + $mkol = 25; + } elseif ($u_res['zadanie'] == 7) { + $mkol = 5; + } elseif ($u_res['zadanie'] == 8) { + $mkol = 10; + } + if ($u_res['zad' . $u_res['zadanie'] . '_kol'] >= $mkol) { + mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'"); + Mysql_query("update `users` set `hp`=`maxhp`,`city_mountain`=`city_mountain`+'" . $u_res['nagrada'] . "',`nagrada_mountain`=`nagrada_mountain`+'" . $u_res['nagrada'] . "' where `login`='" . $user['login'] . "'"); + mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';"); + echo ""; + } else { + echo "Вы еще не собрали все ресурсы
    "; + } } -if($_GET['mobkill'] == 1){ - If($u_res['svitok_kill'] > 0){ - $coma = array ( -"Бот яростно замахнулся, но вы уклонились от удара!", -"Вы заблокировали подлый удар в спину.", -"Ваша реакция позволила вам отпрыгнуть от врага.", -"Вы громко закричали, в следствии чего бот промахнулся.", -"Бот явно не расчитал свою силы и ударил мимо вас!", -"Вы технично парировали удар."); -$com = $coma[rand(0,count($coma)-1)]; -$id = $_GET['idbot']; -$rand_bot_atack = rand(1,3); -$rand_bot_hpkol2 = rand(1,7); -$rand_bot_hpkol1 = rand(3,20); -$rand_bot_hpkol = ($rand_bot_hpkol1 + $rand_bot_hpkol2) * $user['level']; -if($rand_bot_atack == 1){$user['hp'] = $user['hp'] - $rand_bot_hpkol;echo"*** Бот атаковал вас на -".$rand_bot_hpkol." HP!
    ";mysql_query("update `users` set `hp`=`hp`-'".$rand_bot_hpkol."' where `id`='".$user['id']."'");} -else{echo"*** Бот промахнулся!
    ";} - $rand_hp1 = rand(1,10); - $rand_hp = $rand_hp1 * $user['level']; - $bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1")); -$hels = $bot['bot_hp'] - $rand_hp; -if($hels < 0){ - echo"Вы убили моба!
    "; +if ($_GET['mobkill'] == 1) { + if ($u_res['svitok_kill'] > 0) { + $coma = [ + "Бот яростно замахнулся, но вы уклонились от удара!", + "Вы заблокировали подлый удар в спину.", + "Ваша реакция позволила вам отпрыгнуть от врага.", + "Вы громко закричали, в следствии чего бот промахнулся.", + "Бот явно не расчитал свою силы и ударил мимо вас!", + "Вы технично парировали удар."]; + $com = $coma[rand(0, count($coma) - 1)]; + $id = $_GET['idbot']; + $rand_bot_atack = rand(1, 3); + $rand_bot_hpkol2 = rand(1, 7); + $rand_bot_hpkol1 = rand(3, 20); + $rand_bot_hpkol = ($rand_bot_hpkol1 + $rand_bot_hpkol2) * $user['level']; + if ($rand_bot_atack == 1) { + $user['hp'] = $user['hp'] - $rand_bot_hpkol; + echo "*** Бот атаковал вас на -" . $rand_bot_hpkol . " HP!
    "; + mysql_query("update `users` set `hp`=`hp`-'" . $rand_bot_hpkol . "' where `id`='" . $user['id'] . "'"); + } else { + echo "*** Бот промахнулся!
    "; + } + $rand_hp1 = rand(1, 10); + $rand_hp = $rand_hp1 * $user['level']; + $bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1")); + $hels = $bot['bot_hp'] - $rand_hp; + if ($hels < 0) { + echo "Вы убили моба!
    "; ///Если нужно выбить записки -if($u_res['zadanie'] == 7){ -$zapis = rand(1,4); -if($zapis == 1){ -echo"Вы получили 1 записку!
    "; -Mysql_query("update `lab_user` set `zad".$u_res['zadanie']."_kol`=`zad".$u_res['zadanie']."_kol`+'1' where `id_user`='".$user['id']."'"); -} -mysql_query("delete from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1"); + if ($u_res['zadanie'] == 7) { + $zapis = rand(1, 4); + if ($zapis == 1) { + echo "Вы получили 1 записку!
    "; + Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'"); + } + mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1"); //если просто убивалка -}else{ -Mysql_query("update `lab_user` set `zad".$u_res['zadanie']."_kol`=`zad".$u_res['zadanie']."_kol`+'1' where `id_user`='".$user['id']."'"); - mysql_query("delete from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1"); -}} -else{echo"Вы отняли у моба -".$rand_hp." HP!
    ";mysql_query("update `lab_bots` set `bot_hp`=`bot_hp`-'".$rand_hp."' where `id`='".$bot['id']."'");} -Mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`-'1' where `id_user`='".$user['id']."'"); -}else{echo"У вас нет свитков атаки!
    ";} + } else { + Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'"); + mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1"); + } + } else { + echo "Вы отняли у моба -" . $rand_hp . " HP!
    "; + mysql_query("update `lab_bots` set `bot_hp`=`bot_hp`-'" . $rand_hp . "' where `id`='" . $bot['id'] . "'"); + } + Mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`-'1' where `id_user`='" . $user['id'] . "'"); + } else { + echo "У вас нет свитков атаки!
    "; + } } -if($_GET['svitexit'] == 1){ - If($u_res['exit_teleport'] >= 1){ - mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); -Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); -Mysql_query("update `lab_user` set `exit_teleport`=`exit_teleport`-'1' where `id_user`='".$user['id']."'"); -mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';"); - echo""; -}else{echo"У вас нет свитков возрата!
    ";} +if ($_GET['svitexit'] == 1) { + if ($u_res['exit_teleport'] >= 1) { + mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'"); + Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'"); + Mysql_query("update `lab_user` set `exit_teleport`=`exit_teleport`-'1' where `id_user`='" . $user['id'] . "'"); + mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';"); + echo ""; + } else { + echo "У вас нет свитков возрата!
    "; + } } - - if($_GET['exit'] && $room['exit']==1) { - mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'"); -Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); -mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';"); - echo""; - } - if($_GET['get']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($_GET['get'])."' AND `id_user`='".$user['id']."';")); - if($data['id_room'] == $user->room) { +if ($_GET['exit'] && $room['exit'] == 1) { + mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'"); + Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'"); + mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';"); + echo ""; +} - switch($data['type']){ - case 1: - $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."';")); - if($user['sila']*4 > $d[0]) { - mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');"); - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - } - break; - case 2: - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - $user['hp'] = $user['maxhp']; - break; - case 6: - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - Mysql_query("update `lab_user` set `zad3_kol`=`zad3_kol`+'1' where `id_user`='".$user['id']."'"); - echo""; - break; - case 5: - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - Mysql_query("update `lab_user` set `zad2_kol`=`zad2_kol`+'1' where `id_user`='".$user['id']."'"); - echo""; - break; - case 7: - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - Mysql_query("update `lab_user` set `zad8_kol`=`zad8_kol`+'1' where `id_user`='".$user['id']."'"); - echo""; - break; - case 4: - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - Mysql_query("update `lab_user` set `zad1_kol`=`zad1_kol`+'1' where `id_user`='".$user['id']."'"); - echo""; - break; - case 3: - $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';")); - if($user['sila']*4 > $d[0]) { - mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');"); - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - } - break; - case 9: - $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';")); - if($user['sila']*4 > $d[0]) { - mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');"); - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - } - break; - case 8: - $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';")); - if($user['sila']*4 > $d[0]) { - mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');"); - mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - } - break; - } - } - unset($data); - } - - if($_GET['drop']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '".mysql_real_escape_string($_GET['drop'])."' AND `id_user`='".$user['id']."';")); - mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;"); - mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('".mysql_real_escape_string($user->room)."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."','".mysql_real_escape_string($user['id'])."');"); - unset($data); - } - - if($_GET['nal1']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal1'])."' AND `id_user`='".$user['id']."';")); - if($data['id_room'] == $user->room) { - $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='1';")); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='1';"); - mysql_query("UPDATE `users` SET `money` = `money`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - err('Вы обналичили у Архивариуса '.round($sum[0],2).' КР!
    '); - } - unset($data); - } - +if ($_GET['get']) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($_GET['get']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($data['id_room'] == $user->room) { - if($_GET['nal2']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal2'])."' AND `id_user`='".$user['id']."';")); - if($data['id_room'] == $user->room) { - $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='3';")); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='3';"); - mysql_query("UPDATE `users` SET `patriotizm` = `patriotizm`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - err('Вы обналичили у Архивариуса '.round($sum[0],2).' ПАТРИОТИЗМА!
    '); - } - unset($data); - } - + switch ($data['type']) { + case 1: + $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "';")); + if ($user['sila'] * 4 > $d[0]) { + mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');"); + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + } + break; + case 2: + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + $user['hp'] = $user['maxhp']; + break; + case 6: + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + Mysql_query("update `lab_user` set `zad3_kol`=`zad3_kol`+'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + break; + case 5: + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + Mysql_query("update `lab_user` set `zad2_kol`=`zad2_kol`+'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + break; + case 7: + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + Mysql_query("update `lab_user` set `zad8_kol`=`zad8_kol`+'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + break; + case 4: + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + Mysql_query("update `lab_user` set `zad1_kol`=`zad1_kol`+'1' where `id_user`='" . $user['id'] . "'"); + echo ""; + break; + case 3: + $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($user['sila'] * 4 > $d[0]) { + mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');"); + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + } + break; + case 9: + $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($user['sila'] * 4 > $d[0]) { + mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');"); + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + } + break; + case 8: + $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($user['sila'] * 4 > $d[0]) { + mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');"); + mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + } + break; + } + } + unset($data); +} - if($_GET['nal3']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal3'])."' AND `id_user`='".$user['id']."';")); - if($data['id_room'] == $user->room) { - $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='8';")); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='8';"); - mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - err('Вы обналичили у Архивариуса '.round($sum[0],2).' ЕКР!
    '); - } - unset($data); - } - +if ($_GET['drop']) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($_GET['drop']) . "' AND `id_user`='" . $user['id'] . "';")); + mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); + mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('" . mysql_real_escape_string($user->room) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "','" . mysql_real_escape_string($user['id']) . "');"); + unset($data); +} - if($_GET['nal4']) { - $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal4'])."' AND `id_user`='".$user['id']."';")); - if($data['id_room'] == $user->room) { - $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='9';")); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='9';"); - mysql_query("UPDATE `users` SET `exp` = `exp`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - err('Вы обналичили у Архивариуса '.round($sum[0],2).' ОПЫТА!
    '); - } - unset($data); - } - - if ($_GET['go']) { - if(time()-$_SESSION['time'] <= 3) { - echo "Не так быстро"; - } - else - switch($_GET['go']) { - case "p1": - mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p1'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - $user->room = $room['p1']; - $_SESSION['time'] = time(); - break; - case "p2": - mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p2'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - $user->room = $room['p2']; - $_SESSION['time'] = time(); - break; - case "p3": - mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p3'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - $user->room = $room['p3']; - $_SESSION['time'] = time(); - break; - case "p4": - mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p4'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - $user->room = $room['p4']; - $_SESSION['time'] = time(); - break; - } - } - - $room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '".mysql_real_escape_string($user->room)."';")); - - if($user['hp'] <= 0) { - mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'"); - mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'"); -Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); - $msg .= 'Поздравляем, вы умерли!
    '; - mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - echo""; - } - - - - $data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '".mysql_real_escape_string($user->room)."' AND `id_user`='".$user['id']."';"); - $data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."';"); - $data3 = mysql_query("SELECT * FROM `users` WHERE `lab` = 1 AND `room` = '".mysql_real_escape_string($room['id'])."';"); - $data4 = mysql_query("SELECT * FROM `lab_bots` WHERE `id_room` = '".mysql_real_escape_string($room['id'])."' AND `id_user`='".$user['id']."';"); - - $roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '".mysql_real_escape_string($user->room)."' AND `id_user`='".$user['id']."';")); - - if($roow[0]) { - $msg .= 'В комнате была установлена ловушка...
    '; - switch($roow[3]) { - case 1: - mysql_query("UPDATE `users` SET `hp` = '1' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - break; - case 2: - mysql_query("UPDATE `users` SET `hp` = `hp`/2+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - break; - case 3: - mysql_query("UPDATE `users` SET `hp` = `hp`/3+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - break; - case 4: - mysql_query("UPDATE `users` SET `hp` = `hp`/4+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); - break; - } - $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '".mysql_real_escape_string($_SESSION['uid'])."' LIMIT 1;")); - mysql_query("DELETE FROM `lab_trap` WHERE `id` = '".mysql_real_escape_string($roow['id'])."' AND `id_user`='".$user['id']."';"); - } - - if((time()-$_SESSION['time']) > 3) { - $tt = 3; - } - else { - $tt =(time()-$_SESSION['time']); - } -?> - - - - - - -room) { + $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';")); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';"); + mysql_query("UPDATE `users` SET `money` = `money`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + err('Вы обналичили у Архивариуса ' . round($sum[0], 2) . ' КР!
    '); + } + unset($data); +} - echo Nick::id($user)->battle(); - echo" Выйти?"; - echo "
    ".$msg; echo ""; - if($room['exit']==1) { - echo "В комнате есть выход.ВЫЙТИ!
    "; - } - echo" Св. возрата: ".$u_res['exit_teleport']." | Св. оздоровления: ".$u_res['svitok_heal']."
    "; - echo"Игровые атаки: ".$u_res['svitok_kill_user'].""; - echo" + Бот-атаки: ".$u_res['svitok_kill']." [купить]"; - echo"

    "; - +if ($_GET['nal2']) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal2']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($data['id_room'] == $user->room) { + $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';")); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';"); + mysql_query("UPDATE `users` SET `patriotizm` = `patriotizm`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + err('Вы обналичили у Архивариуса ' . round($sum[0], 2) . ' ПАТРИОТИЗМА!
    '); + } + unset($data); +} + + +if ($_GET['nal3']) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal3']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($data['id_room'] == $user->room) { + $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';")); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';"); + mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + err('Вы обналичили у Архивариуса ' . round($sum[0], 2) . ' ЕКР!
    '); + } + unset($data); +} + + +if ($_GET['nal4']) { + $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal4']) . "' AND `id_user`='" . $user['id'] . "';")); + if ($data['id_room'] == $user->room) { + $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';")); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';"); + mysql_query("UPDATE `users` SET `exp` = `exp`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + err('Вы обналичили у Архивариуса ' . round($sum[0], 2) . ' ОПЫТА!
    '); + } + unset($data); +} + +if ($_GET['go']) { + if (time() - $_SESSION['time'] <= 3) { + echo "Не так быстро"; + } else + switch ($_GET['go']) { + case "p1": + mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p1']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + $user->room = $room['p1']; + $_SESSION['time'] = time(); + break; + case "p2": + mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p2']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + $user->room = $room['p2']; + $_SESSION['time'] = time(); + break; + case "p3": + mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p3']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + $user->room = $room['p3']; + $_SESSION['time'] = time(); + break; + case "p4": + mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p4']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + $user->room = $room['p4']; + $_SESSION['time'] = time(); + break; + } +} + +$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';")); + +if ($user['hp'] <= 0) { + mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'"); + mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'"); + Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'"); + $msg .= 'Поздравляем, вы умерли!
    '; + mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + echo ""; +} + + +$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';"); +$data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "';"); +$data3 = mysql_query("SELECT * FROM `users` WHERE `lab` = 1 AND `room` = '" . mysql_real_escape_string($room['id']) . "';"); +$data4 = mysql_query("SELECT * FROM `lab_bots` WHERE `id_room` = '" . mysql_real_escape_string($room['id']) . "' AND `id_user`='" . $user['id'] . "';"); + +$roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';")); + +if ($roow[0]) { + $msg .= 'В комнате была установлена ловушка...
    '; + switch ($roow[3]) { + case 1: + mysql_query("UPDATE `users` SET `hp` = '1' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + break; + case 2: + mysql_query("UPDATE `users` SET `hp` = `hp`/2+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + break; + case 3: + mysql_query("UPDATE `users` SET `hp` = `hp`/3+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + break; + case 4: + mysql_query("UPDATE `users` SET `hp` = `hp`/4+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); + break; + } + $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '" . mysql_real_escape_string($_SESSION['uid']) . "' LIMIT 1;")); + mysql_query("DELETE FROM `lab_trap` WHERE `id` = '" . mysql_real_escape_string($roow['id']) . "' AND `id_user`='" . $user['id'] . "';"); +} + +if ((time() - $_SESSION['time']) > 3) { + $tt = 3; +} else { + $tt = (time() - $_SESSION['time']); +} +Template::header('lab2'); + +echo Nick::id($user)->battle(); +echo " Выйти?"; +echo ""; - echo ""; +echo ""; +echo "
    " . $msg; +echo ""; +if ($room['exit'] == 1) { + echo "В комнате есть выход.ВЫЙТИ!
    "; +} + +echo " Св. возрата: " . $u_res['exit_teleport'] . " | Св. оздоровления: " . $u_res['svitok_heal'] . "
    "; +echo "Игровые атаки: " . $u_res['svitok_kill_user'] . ""; +echo " + Бот-атаки: " . $u_res['svitok_kill'] . " [купить]"; +echo "

    "; + $log = mysql_query("select * from `lab_heal_log` order by `id` desc LIMIT 1"); - for($i=0; $i".$u_info['login']." [".$u_info['level']."]Информация о ".$u_info[ излечил всех за ".$log_inf['cost']." кр.
    "; +for ($i = 0; $i < mysql_num_rows($log); $i++) { + $log_inf = mysql_fetch_array($log); + $u_info = mysql_fetch_array(mysql_query("select `level`,`login` from `users` where `login`='" . $log_inf['kto'] . "'")); + echo "" . $u_info['login'] . " [" . $u_info['level'] . "]Информация о " . $u_info[ излечил всех за " . $log_inf['cost'] . " кр.
    "; } - - echo"".$room['name']." (".$user->room.")

     "; - $u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'"); + +echo "" . $room['name'] . " (" . $user->room . ")
     "; +$u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'"); $u_lab_kol = mysql_num_rows($u_lab); -$heal_all = (($u_lab_kol/2)+1); -echo"Всего в Лабиринте: ".$u_lab_kol." чел. [излечить]
    "; - echo"В этой комнате:"; - echo"
  • Игроки:"; - while($items = mysql_fetch_array($data3)){ - echo "
    "; echo Nick::id($items['id'])->full(); - } - echo"
  • Мобы:"; - while($items = mysql_fetch_array($data4)){ - echo "
    "; echo"".$items['bot_name']." "; echo" [".$items['bot_hp']."/".$items['bot_hpmax']."]"; - if(($u_res['zadanie_mob_id'] == $items['id_bot'] && $u_res['svitok_kill'] > 0) || ($u_res['zadanie'] == 7 && $u_res['svitok_kill'] > 0)){echo " " . $u_lab_kol . " чел. [излечить]
    "; +echo "В этой комнате:"; +echo "
  • Игроки:"; +while ($items = mysql_fetch_array($data3)) { + echo "
    "; + echo Nick::id($items['id'])->full(); +} +echo "
  • Мобы:"; +while ($items = mysql_fetch_array($data4)) { + echo "
    "; + echo "" . $items['bot_name'] . " "; + echo " [" . $items['bot_hp'] . "/" . $items['bot_hpmax'] . "]"; + if (($u_res['zadanie_mob_id'] == $items['id_bot'] && $u_res['svitok_kill'] > 0) || ($u_res['zadanie'] == 7 && $u_res['svitok_kill'] > 0)) { + echo "
    [Обналичить чеки КР]
    "; - } - elseif($items['id_bot'] == 5) { - echo "
    [Обналичить чеки ПАТР.]
    "; - } - elseif($items['id_bot'] == 6) { - echo "
    [Обналичить чеки ЕКР]
    "; - } - elseif($items['id_bot'] == 7) { - echo "
    [Обналичить чеки ОПЫТА]
    "; - } - } - echo"
  • Ресурсы:"; - while($items = mysql_fetch_array($data)){ - switch($items['type']){ - case 1: - echo "
    Чек на ".$items['value']." кр."; - break; - case 2: - echo "
    Колодец жизни"; - break; - case 6: - echo "
    Подарок"; - break; - case 5: - echo "
    Нож"; - break; - case 7: - echo "
    Установить древний символ"; - break; - case 3: - echo "
    Чек на ".$items['value']." патр."; - break; - case 8: - echo "
    Чек на ".$items['value']." екр"; - break; - case 9: - echo "
    Чек на ".$items['value']." опыта"; - break; - case 4: - echo "
    Синий жемчуг"; - break; - } - } - echo "
  • "; + if ($items['id_bot'] == 4) { + echo "
    [Обналичить чеки КР]
    "; + } elseif ($items['id_bot'] == 5) { + echo "
    [Обналичить чеки ПАТР.]
    "; + } elseif ($items['id_bot'] == 6) { + echo "
    [Обналичить чеки ЕКР]
    "; + } elseif ($items['id_bot'] == 7) { + echo "
    [Обналичить чеки ОПЫТА]
    "; + } +} +echo "
  • Ресурсы:"; +while ($items = mysql_fetch_array($data)) { + switch ($items['type']) { + case 1: + echo "
    Чек на " . $items['value'] . " кр."; + break; + case 2: + echo "
    Колодец жизни"; + break; + case 6: + echo "
    Подарок"; + break; + case 5: + echo "
    Нож"; + break; + case 7: + echo "
    Установить древний символ"; + break; + case 3: + echo "
    Чек на " . $items['value'] . " патр."; + break; + case 8: + echo "
    Чек на " . $items['value'] . " екр"; + break; + case 9: + echo "
    Чек на " . $items['value'] . " опыта"; + break; + case 4: + echo "
    Синий жемчуг"; + break; + } +} +echo "
  • "; ///////////*****3ADAHU9I******////////// -if($u_res['zadanie'] == 1){$mkol = 3;} -elseif($u_res['zadanie'] == 2){$mkol = 10;} -elseif($u_res['zadanie'] == 3){$mkol = 50;} -elseif($u_res['zadanie'] == 4){$mkol = 10;} -elseif($u_res['zadanie'] == 5){$mkol = 15;} -elseif($u_res['zadanie'] == 6){$mkol = 25;} -elseif($u_res['zadanie'] == 7){$mkol = 5;} -elseif($u_res['zadanie'] == 8){$mkol = 10;} -echo"Задание: ".$u_res['zadanie_opisanie']." [".$u_res['zad'.$u_res['zadanie'].'_kol']."/".$mkol."]"; -if($u_res['zad'.$u_res['zadanie'].'_kol'] >= $mkol){echo" +if ($u_res['zadanie'] == 1) { + $mkol = 3; +} elseif ($u_res['zadanie'] == 2) { + $mkol = 10; +} elseif ($u_res['zadanie'] == 3) { + $mkol = 50; +} elseif ($u_res['zadanie'] == 4) { + $mkol = 10; +} elseif ($u_res['zadanie'] == 5) { + $mkol = 15; +} elseif ($u_res['zadanie'] == 6) { + $mkol = 25; +} elseif ($u_res['zadanie'] == 7) { + $mkol = 5; +} elseif ($u_res['zadanie'] == 8) { + $mkol = 10; +} +echo "Задание: " . $u_res['zadanie_opisanie'] . " [" . $u_res['zad' . $u_res['zadanie'] . '_kol'] . "/" . $mkol . "]"; +if ($u_res['zad' . $u_res['zadanie'] . '_kol'] >= $mkol) { + echo " ЗАВЕРШИТЬ! - ";} + "; +} ?> - -Найденные ресурсы:"; - while($items = mysql_fetch_array($data2)){ - if($items['type']==1){echo "
    Чек на ".$items['value']." кр.";} - if($items['type']==3){echo "
    Чек на ".$items['value']." патр.";} - if($items['type']==9){echo "
    Чек на ".$items['value']." опыта";} - if($items['type']==8){echo "
    Чек на ".$items['value']." екр";} + +Найденные ресурсы:"; +while ($items = mysql_fetch_array($data2)) { + if ($items['type'] == 1) { + echo "
    Чек на " . $items['value'] . " кр."; + } + if ($items['type'] == 3) { + echo "
    Чек на " . $items['value'] . " патр."; + } + if ($items['type'] == 9) { + echo "
    Чек на " . $items['value'] . " опыта"; + } + if ($items['type'] == 8) { + echo "
    Чек на " . $items['value'] . " екр"; + } -?> - - +} +echo "
    Всего: " . mysql_num_rows($data2) . "/" . ($user['sila'] * 4) . " "; +echo "
    "; \ No newline at end of file diff --git a/lab_enter.php b/lab_enter.php index 38d237b..ae45275 100644 --- a/lab_enter.php +++ b/lab_enter.php @@ -1,456 +1,453 @@ room == 1051) { + mysql_query('DELETE FROM `laba_zv` WHERE `time` < "' . (time() - 1 * 60 * 60) . '"'); + $var = mysql_fetch_array(mysql_query('SELECT `id`, `vals` FROM `actions` WHERE `vals` > "' . time() . '" AND `uid` = "' . $user['id'] . '" AND `vars` = "go_labirint" LIMIT 1')); + $zv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `uid1` = "' . $user['id'] . '" OR `uid2` = "' . $user['id'] . '" OR `uid3` = "' . $user['id'] . '" OR `uid4` = "' . $user['id'] . '" LIMIT 1')); + $re = ''; + if (isset($_GET['exitlaba'])) { + if (isset($zv['id'])) { + $re = 'Подали заявку и убегаем? Не хорошо!'; + } else { + mysql_query("UPDATE `users`, `online` SET `users`.`room` = '2601', `online`.`room` = '2601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'"); + header('Location: city.php'); + } + } elseif (isset($_GET['pz1'])) { + if (isset($zv['id'])) { + $re = 'Вы уже подали заявку...'; + } else { + if ($user['level'] < 4) { + $re = 'Персонажам до 4-го уровня запрещается посещать лабиринт!'; + } elseif (isset($var['id'])) { + $tm = timeOut($var['vals'] - time()); + $re = 'Следующий поход через: ' . $tm; + } else { + $_POST['type_gors'] = (int)$_POST['type_gors']; + if ($_POST['type_gors'] == 0 && $user['level'] > 6) { + $re = 'Лабиринт для новичков доступен для 4-6 уровней!'; + } elseif ($_POST['type_gors'] == 1 && $user['level'] < 7) { + $re = 'Лабиринт для опытных доступен с 7 уровня!'; + } elseif ($_POST['type_gors'] == 2 && ($user['level'] < 9 || $user['rep_laba'] < 20000)) { + $re = 'Легендарный Лабиринт доступен с 9 уровня!
    Так-же требуется 20000 репутации Лабиринтов! У Вас : ' . $user['rep_laba'] . ' репутации Лабиринтов.'; + } else { + mysql_query('INSERT INTO `laba_zv` (`uid1`, `time`, `com`, `pass`, `type`, `level`) VALUES ("' . $user['id'] . '", "' . time() . '", "' . mysql_real_escape_string(htmlspecialchars($_POST['text'])) . '", "' . mysql_real_escape_string($_POST['text']) . '", "' . mysql_real_escape_string($_POST['type_gors']) . '", "' . $user['level'] . '")'); + header('Location: lab_enter.php'); + } + } + } + } elseif (isset($_GET['cancelzv'])) { + if (!isset($zv['id'])) { + $re = 'Вы не участвуете ни в одной из заявок!
    '; + } else { + $i = 1; + $j = 4; + $k = 0; + $h = 0; + while ($i <= 4) { + if ($k == 0 && $zv['uid' . $i] != $user['id']) { + $k = $zv['uid' . $i]; + $h = $i; + } + $i++; + } + $i = 1; + while ($i <= 4) { + if ($zv['uid' . $i] == $user['id']) { + if ($i > 1) { + $zv['uid' . $i] = 0; + } else { + $zv['uid' . $i] = $k; + $zv['uid' . $h] = 0; + } + } + if ($zv['uid' . $i] == 0) { + $j--; + } + $i++; + } + if ($j < 1) { + mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + } else { + mysql_query('UPDATE `laba_zv` SET `uid1` = "' . $zv['uid1'] . '", `uid2` = "' . $zv['uid2'] . '", `uid3` = "' . $zv['uid3'] . '", `uid4` = "' . $zv['uid4'] . '" WHERE `id` = "' . $zv['id'] . '" lIMIT 1'); + } + $re = 'Заявка успешно отменена!
    '; + unset($zv); + } + } elseif (isset($_GET['priemzv'])) { + if (isset($zv['id'])) { + $re = 'Вы уже состоите в одной из заявок!'; + } else { + $tozv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `id` = "' . mysql_real_escape_string($_GET['priemzv']) . '" LIMIT 1')); + if (!isset($tozv['id'])) { + $re = 'Заявка не найдена!'; + } elseif (isset($var['id'])) { + $tm = timeOut($var['vals'] - time()); + $re = 'Следующий поход через: ' . $tm; + } else { + if ($tozv['uid1'] > 0 && $tozv['uid2'] > 0 && $tozv['uid3'] > 0 && $tozv['uid4'] > 0) { + $re = 'В заявке нет свободных мест!'; + } else { + $i = 1; + $j = 0; + while ($i <= 4) { + if ($tozv['uid' . $i] == 0 && $j == 0) { + $j = $i; + } + $i++; + } + mysql_query('UPDATE `laba_zv` SET `uid' . $j . '` = "' . $user['id'] . '" WHERE `id` = "' . $tozv['id'] . '" LIMIT 1'); + header('Location: lab_enter.php'); + } + } + } + } elseif (isset($_GET['startzv'])) { + if (!isset($zv['id'])) { + $re = 'Вы должны сначала подать заявку!'; + } elseif ($zv['uid1'] != $user['id']) { + $re = 'Вы должны являться лидером группы!'; + } else { + if ($zv['type'] == 0) { + $level = 5; + } elseif ($zv['type'] == 1) { + $level = 8; + } elseif ($zv['type'] == 2) { + $level = 10; + } -if($user->room == 1051) { - $aligns = array(2.99); - mysql_query('DELETE FROM `laba_zv` WHERE `time` < "'.(time()-1*60*60).'"'); - $var = mysql_fetch_array(mysql_query('SELECT `id`, `vals` FROM `actions` WHERE `vals` > "'.time().'" AND `uid` = "'.$user['id'].'" AND `vars` = "go_labirint" LIMIT 1')); - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `uid1` = "'.$user['id'].'" OR `uid2` = "'.$user['id'].'" OR `uid3` = "'.$user['id'].'" OR `uid4` = "'.$user['id'].'" LIMIT 1')); - $re = ''; - if(isset($_GET['exitlaba'])) { - if(isset($zv['id'])) { - $re = 'Подали заявку и убегаем? Не хорошо!'; - } else { - mysql_query("UPDATE `users`, `online` SET `users`.`room` = '2601', `online`.`room` = '2601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'"); - header('Location: city.php'); - } - } elseif(isset($_GET['pz1'])) { - if(isset($zv['id'])) { - $re = 'Вы уже подали заявку...'; - } else { - if($user['level'] < 4) { - $re = 'Персонажам до 4-го уровня запрещается посещать лабиринт!'; - } elseif(isset($var['id'])) { - $tm = timeOut($var['vals']-time()); - $re = 'Следующий поход через: '.$tm; - } else { - $_POST['type_gors'] = (int)$_POST['type_gors']; - if($_POST['type_gors'] == 0 && $user['level'] > 6) { - $re = 'Лабиринт для новичков доступен для 4-6 уровней!'; - } elseif($_POST['type_gors'] == 1 && $user['level'] < 7) { - $re = 'Лабиринт для опытных доступен с 7 уровня!'; - } elseif($_POST['type_gors'] == 2 && ($user['level'] < 9 || $user['rep_laba'] < 20000)) { - $re = 'Легендарный Лабиринт доступен с 9 уровня!
    Так-же требуется 20000 репутации Лабиринтов! У Вас : '.$user['rep_laba'].' репутации Лабиринтов.'; - } else { - mysql_query('INSERT INTO `laba_zv` (`uid1`, `time`, `com`, `pass`, `type`, `level`) VALUES ("'.$user['id'].'", "'.time().'", "'.mysql_real_escape_string(htmlspecialchars($_POST['text'])).'", "'.mysql_real_escape_string($_POST['text']).'", "'.mysql_real_escape_string($_POST['type_gors']).'", "'.$user['level'].'")'); - header('Location: lab_enter.php'); - } - } - } - } elseif(isset($_GET['cancelzv'])) { - if(!isset($zv['id'])) { - $re = 'Вы не участвуете ни в одной из заявок!
    '; - } else { - $i = 1; $j = 4; $k = 0; $h = 0; - while($i <= 4) { - if($k == 0 && $zv['uid'.$i] != $user['id']) { - $k = $zv['uid'.$i]; - $h = $i; - } - $i++; - } - $i = 1; - while($i <= 4) { - if($zv['uid'.$i] == $user['id']) { - if($i > 1) { - $zv['uid'.$i] = 0; - } else { - $zv['uid'.$i] = $k; - $zv['uid'.$h] = 0; - } - } - if($zv['uid'.$i] == 0) { - $j--; - } - $i++; - } - if($j < 1) { - mysql_query('DELETE FROM `laba_zv` WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - } else { - mysql_query('UPDATE `laba_zv` SET `uid1` = "'.$zv['uid1'].'", `uid2` = "'.$zv['uid2'].'", `uid3` = "'.$zv['uid3'].'", `uid4` = "'.$zv['uid4'].'" WHERE `id` = "'.$zv['id'].'" lIMIT 1'); - } - $re = 'Заявка успешно отменена!
    '; - unset($zv); - } - } elseif(isset($_GET['priemzv'])) { - if(isset($zv['id'])) { - $re = 'Вы уже состоите в одной из заявок!'; - } else { - $tozv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `id` = "'.mysql_real_escape_string($_GET['priemzv']).'" LIMIT 1')); - if(!isset($tozv['id'])) { - $re = 'Заявка не найдена!'; - } elseif(isset($var['id'])) { - $tm = timeOut($var['vals']-time()); - $re = 'Следующий поход через: '.$tm; - } else { - if($tozv['uid1'] > 0 && $tozv['uid2'] > 0 && $tozv['uid3'] > 0 && $tozv['uid4'] > 0) { - $re = 'В заявке нет свободных мест!'; - } else { - $i = 1; $j = 0; - while($i <= 4) { - if($tozv['uid'.$i] == 0 && $j == 0) { - $j = $i; - } - $i++; - } - mysql_query('UPDATE `laba_zv` SET `uid'.$j.'` = "'.$user['id'].'" WHERE `id` = "'.$tozv['id'].'" LIMIT 1'); - header('Location: lab_enter.php'); - } - } - } - } elseif(isset($_GET['startzv'])) { - if(!isset($zv['id'])) { - $re = 'Вы должны сначала подать заявку!'; - } elseif($zv['uid1'] != $user['id']) { - $re = 'Вы должны являться лидером группы!'; - } else { - if($zv['type'] == 0) { - $level = 5; - } elseif($zv['type'] == 1) { - $level = 8; - } elseif($zv['type'] == 2) { - $level = 10; - } + $k = floor(2.5 * $level); + $s = $k * 2 + 3; + $r = 10; + $count = 1; + $a = []; + for ($y = 0; $y < $s; $y++) { + for ($x = 0; $x < $s; $x++) { + $a[$y][$x] = 1; + } + } + for ($x = 0; $x < $s; $x++) { + $a[0][$x] = 0; + $a[$s - 1][$x] = 0; + $a[$x][0] = 0; + $a[$x][$s - 1] = 0; + } + $x = $y = ($k - 1) >> 1; + $a[$y * 2 + 2][$x * 2 + 2] = 0; + while (1) { + do { + $d = rand(0, 3); + for ($i = 0; $i < 4; $i++) { + if ($d == 0 && $a[$y * 2 + 2][$x * 2 + 4]) { + $a[$y * 2 + 2][$x++ * 2 + 3] = 0; + $a[$y * 2 + 2][$x * 2 + 2] = 0; + $i = 5; + $count++; + break; + } elseif ($d == 1 && $a[$y * 2][$x * 2 + 2]) { + $a[$y-- * 2 + 1][$x * 2 + 2] = 0; + $a[$y * 2 + 2][$x * 2 + 2] = 0; + $i = 5; + $count++; + break; + } elseif ($d == 2 && $a[$y * 2 + 2][$x * 2]) { + $a[$y * 2 + 2][$x-- * 2 + 1] = 0; + $a[$y * 2 + 2][$x * 2 + 2] = 0; + $i = 5; + $count++; + break; + } elseif ($d == 3 && $a[$y * 2 + 4][$x * 2 + 2]) { + $a[$y++ * 2 + 3][$x * 2 + 2] = 0; + $a[$y * 2 + 2][$x * 2 + 2] = 0; + $i = 5; + $count++; + break; + } + $d = ($d + 1) % 4; + } + } while ($i != 4); + if ($count >= $k * $k) { + break; + } + $x = rand(0, $k - 1); + $y = rand(0, $k - 1); + while ($a[$y * 2 + 2][$x * 2 + 2] || !$a[$y * 2 + 2][$x * 2 + 4] && !$a[$y * 2][$x * 2 + 2] && !$a[$y * 2 + 2][$x * 2] && !$a[$y * 2 + 4][$x * 2 + 2]) { + if (++$x >= $k) { + $x = 0; + if (++$y >= $k) { + $y = 0; + } + } + } + } + $rnds = [rand(1, 3), rand(1, 3)]; + $srg = []; + $objects = []; + if ($rnds[0] == 1) { + $a[2][1] = 0; + $a[2][2] = 0; + $srg = [2, 1]; + $objects[2][1] = '

    '; + } elseif ($rnds[0] == 2) { + $a[$k][1] = 0; + $a[$k][2] = 0; + $srg = [$k, 1]; + $objects[$k][1] = '
    '; + } elseif ($rnds[0] == 3) { + $a[$k * 2][1] = 0; + $a[$k * 2][2] = 0; + $srg = [$k * 2, 1]; + $objects[$k * 2][1] = '
    '; + } - $k = floor(2.5*$level); $s = $k*2+3; $r = 10; $count = 1; - $a = array(); - for($y = 0; $y < $s; $y++) { - for($x = 0; $x < $s; $x++) { - $a[$y][$x] = 1; - } - } - for($x = 0; $x < $s; $x++) { - $a[0][$x] = 0; $a[$s-1][$x] = 0; - $a[$x][0] = 0; $a[$x][$s-1] = 0; - } - $x = $y = ($k-1)>>1; $a[$y*2+2][$x*2+2] = 0; - while(1) { - do { - $d = rand(0, 3); - for($i = 0; $i < 4; $i++) { - if($d == 0 && $a[$y*2+2][$x*2+4]) { - $a[$y*2+2][$x++*2+3] = 0; $a[$y*2+2][$x*2+2] = 0; - $i = 5; $count++; break; - } elseif($d == 1 && $a[$y*2][$x*2+2]) { - $a[$y--*2+1][$x*2+2] = 0; $a[$y*2+2][$x*2+2] = 0; - $i = 5; $count++; break; - } elseif($d == 2 && $a[$y*2+2][$x*2]) { - $a[$y*2+2][$x--*2+1] = 0; $a[$y*2+2][$x*2+2] = 0; - $i = 5; $count++; break; - } elseif($d == 3 && $a[$y*2+4][$x*2+2]) { - $a[$y++*2+3][$x*2+2] = 0; $a[$y*2+2][$x*2+2] = 0; - $i = 5; $count++; break; - } - $d = ($d+1)%4; - } - } while($i != 4); - if($count >= $k*$k) { - break; - } - $x = rand(0, $k-1); $y = rand(0, $k-1); - while($a[$y*2+2][$x*2+2] || !$a[$y*2+2][$x*2+4] && !$a[$y*2][$x*2+2] && !$a[$y*2+2][$x*2] && !$a[$y*2+4][$x*2+2]) { - if(++$x >= $k) { - $x = 0; - if(++$y >= $k) { - $y = 0; - } - } - } - } - $rnds = array(rand(1, 3), rand(1, 3)); - $srg = array(); - $objects = array(); - if($rnds[0] == 1) { - $a[2][1] = 0; $a[2][2] = 0; - $srg = array(2, 1); $objects[2][1] = '
    '; - } elseif($rnds[0] == 2) { - $a[$k][1] = 0; $a[$k][2] = 0; - $srg = array($k, 1); $objects[$k][1] = '
    '; - } elseif($rnds[0] == 3) { - $a[$k*2][1] = 0; $a[$k*2][2] = 0; - $srg = array($k*2, 1); $objects[$k*2][1] = '
    '; - } + if ($rnds[1] == 1) { + $a[2][$k * 2 + 1] = 0; + $a[2][$k * 2] = 0; + $objects[2][$k * 2 + 1] = '
    '; + } elseif ($rnds[1] == 2) { + $a[$k][$k * 2 + 1] = 0; + $a[$k][$k * 2] = 0; + $objects[$k][$k * 2 + 1] = '
    '; + } elseif ($rnds[1] == 3) { + $a[$k * 2][$k * 2 + 1] = 0; + $a[$k * 2][$k * 2] = 0; + $objects[$k * 2][$k * 2 + 1] = '
    '; + } - if($rnds[1] == 1) { - $a[2][$k*2+1] = 0; $a[2][$k*2] = 0; - $objects[2][$k*2+1] = '
    '; - } elseif($rnds[1] == 2) { - $a[$k][$k*2+1] = 0; $a[$k][$k*2] = 0; - $objects[$k][$k*2+1] = '
    '; - } elseif($rnds[1] == 3) { - $a[$k*2][$k*2+1] = 0; $a[$k*2][$k*2] = 0; - $objects[$k*2][$k*2+1] = '
    '; - } + $map = []; + $i = 1; + while ($i < count($a) - 1) { + $j = 1; + while ($j < count($a[$i]) - 1) { + if ($a[$i][$j] == 0 && $i > 1 && $j > 1 && $i <= $k * 2 && $j <= $k * 2) { + $map[] = [$i, $j]; + } + $j++; + } + $i++; + } + $proc1 = round(1.7 * $level); //Сколько % занимают сундуки + $proc2 = round(2.5 * $level); //Сколько % занимают монстры + $proc3 = round(1.35 * $level); //Сколько % занимают хилки + $proc4 = round(0.5 * $level); //Сколько % занимают ловушки + $proc5 = round(0.1 * $level); //Сколько % занимают пандоры + $proc6 = round(0.2 * $level); // Сколько занимает Антидот - $map = array(); - $i = 1; - while($i < count($a) - 1) { - $j = 1; - while($j < count($a[$i]) - 1) { - if($a[$i][$j] == 0 && $i > 1 && $j > 1 && $i <= $k*2 && $j <= $k*2) { - $map[] = array($i, $j); - } - $j++; - } - $i++; - } - $proc1 = round(1.7*$level); //Сколько % занимают сундуки - $proc2 = round(2.5*$level); //Сколько % занимают монстры - $proc3 = round(1.35*$level); //Сколько % занимают хилки - $proc4 = round(0.5*$level); //Сколько % занимают ловушки - $proc5 = round(0.1*$level); //Сколько % занимают пандоры - $proc6 = round(0.2*$level); // Сколько занимает Антидот + $proc1 = round($proc1 / 2); + $proc1 = round(count($map) / 100 * $proc1); + $proc2 = round($proc2 / 2); + $proc2 = round(count($map) / 100 * $proc2); + $proc3 = round($proc3 / 2); + $proc3 = round(count($map) / 100 * $proc3); + $proc4 = round($proc4 / 2); + $proc4 = round(count($map) / 100 * $proc4); + $proc5 = round($proc5 / 2); + $proc5 = round(count($map) / 100 * $proc5); + $proc6 = round($proc6 / 2); + $proc6 = round(count($map) / 100 * $proc6); - $proc1 = round($proc1/2); - $proc1 = round(count($map)/100*$proc1); - $proc2 = round($proc2/2); - $proc2 = round(count($map)/100*$proc2); - $proc3 = round($proc3/2); - $proc3 = round(count($map)/100*$proc3); - $proc4 = round($proc4/2); - $proc4 = round(count($map)/100*$proc4); - $proc5 = round($proc5/2); - $proc5 = round(count($map)/100*$proc5); - $proc6 = round($proc6/2); - $proc6 = round(count($map)/100*$proc6); + $usi = 0; + mysql_query('INSERT INTO `laba_now` (`time`, `uid`, `users`, `map_id`, `end`, `type`) VALUES ("' . time() . '", "' . $user['id'] . '", "-1", "0", "0", "' . $zv['type'] . '")'); + $ding = mysql_insert_id(); + $i = 1; + while ($i <= 4) { + if ($zv['uid' . $i] > 0) { + $plu = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `id` = "' . $zv['uid' . $i] . '" LIMIT 1')); + if (isset($plu['id'])) { + mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1052', `online`.`room` = '1052', `users`.`x` = '" . $srg[0] . "', `users`.`y` = '" . $srg[1] . "', `users`.`xf` = '" . $srg[0] . "', `users`.`yr` = '" . $srg[1] . "', `users`.`laba` = '" . $ding . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $plu['id'] . "'"); + $usi++; + } + } + $i++; + } + mysql_query('UPDATE `laba_now` SET `users` = "' . $usi . '" WHERE `id` = "' . $ding . '" LIMIT 1'); + mysql_query('INSERT INTO `laba_map` (`id`, `data`, `update`) VALUES ("' . $ding . '", "' . json_encode($a) . '", "' . time() . '")'); + mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); - $usi = 0; - mysql_query('INSERT INTO `laba_now` (`time`, `uid`, `users`, `map_id`, `end`, `type`) VALUES ("'.time().'", "'.$user['id'].'", "-1", "0", "0", "'.$zv['type'].'")'); - $ding = mysql_insert_id(); - $i = 1; - while($i <= 4) { - if($zv['uid'.$i] > 0) { - $plu = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `id` = "'.$zv['uid'.$i].'" LIMIT 1')); - if(isset($plu['id'])) { - mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1052', `online`.`room` = '1052', `users`.`x` = '".$srg[0]."', `users`.`y` = '".$srg[1]."', `users`.`xf` = '".$srg[0]."', `users`.`yr` = '".$srg[1]."', `users`.`laba` = '".$ding."' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$plu['id']."'"); - $usi++; - } - } - $i++; - } - mysql_query('UPDATE `laba_now` SET `users` = "'.$usi.'" WHERE `id` = "'.$ding.'" LIMIT 1'); - mysql_query('INSERT INTO `laba_map` (`id`, `data`, `update`) VALUES ("'.$ding.'", "'.json_encode($a).'", "'.time().'")'); - mysql_query('DELETE FROM `laba_zv` WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - - $i = 1; - while($i <= 6) { - if(${'proc'.$i} > 0) { - $j = 0; - while($j < ${'proc'.$i}) { - $cord = $map[rand(0, count($map)-1)]; - $obj = ''; - if($i == 1) { - $obj = 'ddp1s'; - } elseif($i == 2) { - $obj = 'ddp1m'; - } elseif($i == 3) { - $obj = 'ddp1h'; - } elseif($i == 4) { - $obj = 'ddp1l'; - } elseif($i == 5) { - $obj = 'ddp1p'; - } elseif($i == 6) { - $obj = 'ddp1a'; - } - mysql_query('INSERT INTO `laba_obj` (`lib`, `x`, `y`, `type`, `img`, `name`, `time`, `use`) VALUES ("'.$ding.'", "'.$cord[0].'", "'.$cord[1].'", "'.$i.'", "'.$obj.'", "{standart}", "'.time().'", "0")'); - $j++; - } - } - $i++; - } - mysql_query('DELETE FROM `laba_zv` WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - header('Location: labirint.php'); - } - } - -?> - - - - - - - - - - - - -
    -  
    -
    -

    Вход в Лабиринты

    -
    -= 4) { - if(isset($_GET['quest'])) { - $q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "'.$user['id'].'" AND `cancel` = "0" AND `finish` = "0" LIMIT 1')); - if(!isset($q2['id'])) { - $q3 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "'.$user['id'].'" AND (`cancel` > "'.time().'" OR `finish` > "'.time().'") LIMIT 1')); - if(isset($q3['id'])) { - if($q3['cancel'] > time()) { $tm = timeOut($q3['cancel']-time()); } else { $tm = timeOut($q3['finish']-time()); } - $re = 'Нельзя брать задания так часто, разрешенный лимит: Один раз в 12 часов.
    Следующее задание можно взять через : '.$tm; - } else { - $rand = array(); - $sp = mysql_query('SELECT `id`, `name` FROM `qst` WHERE `level` = "'.$user['level'].'"'); - while($pl = mysql_fetch_array($sp)) { - $rand[] = $pl; - } - $rand = $rand[rand(0, count($rand)-1)]; - if($rand['id'] > 0) { - $re = 'Вы успешно взяли задание "'.$rand['name'].'"!
    '; - mysql_query('INSERT INTO `qst_user` (`uid`, `time`, `qid`) VALUES ("'.$user['id'].'", "'.time().'", "'.$rand['id'].'")'); - } else { - $re = 'Неудалось взять задание, нет подходящих заданий у Хранителя Лабиринта
    '; - } - } - } else { - $re = 'У вас уже есть задание.'; - } - } - - $q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "'.$user['id'].'" AND `cancel` = "0" AND `finish` = "0" LIMIT 1')); - $q1 = mysql_fetch_array(mysql_query('SELECT * FROM `qst` WHERE `id` = "'.$q2['qid'].'" LIMIT 1')); - - if(isset($q2['id']) && isset($_GET['cancelqst'])) { - mysql_query('UPDATE `qst_user` SET `cancel` = "'.(time()+6*3600).'" WHERE `id` = "'.$q2['id'].'" LIMIT 1'); - unset($q1, $q2); - $re = 'Вы успешно отказались от задания...
    '; - } - - if(isset($q1['id'])) { - $re .= '
    Задание : '.$q1['name'].' ['.$q2['val'].'/'.$q1['obj_val'].']
    • Отказаться (Следующее можно будет взять через 12 часов)
    '; - if($q2['val'] >= $q1['obj_val']) { - if(isset($_GET['finishqst'])) { - $re = 'Вы успешно завершили задание и получили: '; - if($q1['cr'] > 0) { - $re .= ' '.$q1['cr'].' кр. '; - } - if($q1['rep'] > 0) { - $re .= ' '.$q1['rep'].' репутации. '; - } - $re .= '
    '; - $user['money'] += $q1['cr']; $user['doblest'] += $q1['rep']; $user['rep_laba'] += $q1['rep']; - mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'", `doblest` = "'.$user['doblest'].'", `rep_laba` = "'.$user['rep_laba'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - mysql_query('UPDATE `qst_user` SET `finish` = "'.(time()+60*60*12).'" WHERE `id` = "'.$q2['id'].'" AND `uid` = "'.$user['id'].'" LIMIT 1'); - unset($q1, $q2); - } - $re .= ' • Завершить задание и получить награду!'; - } - } else { -?> - - - 'Для новичков', 1 => 'Для опытных', 2 => 'Для легендарных'); -while($pl = mysql_fetch_array($sp)) { - $userszv = ''; - $i = 1; - while($i <= 4) { - if($pl['uid'.$i] > 0) { - $plu = mysql_fetch_array(mysql_query('SELECT `id`, `align`, `login`, `level` FROM `users` WHERE `id` = "'.$pl['uid'.$i].'" LIMIT 1')); - if(isset($plu['id'])) { - $userszv .= ', '.$plu['login'].' ['.$plu['level'].']'; - } - } - $i++; - } - $userszv = ltrim($userszv, ', '); - if($pl['com'] != '') { - if(in_array($user['align'], $aligns)) { - $del = ' Удалить комментарий'; - } else { - $del = ''; + $i = 1; + while ($i <= 6) { + if (${'proc' . $i} > 0) { + $j = 0; + while ($j < ${'proc' . $i}) { + $cord = $map[rand(0, count($map) - 1)]; + $obj = ''; + if ($i == 1) { + $obj = 'ddp1s'; + } elseif ($i == 2) { + $obj = 'ddp1m'; + } elseif ($i == 3) { + $obj = 'ddp1h'; + } elseif ($i == 4) { + $obj = 'ddp1l'; + } elseif ($i == 5) { + $obj = 'ddp1p'; + } elseif ($i == 6) { + $obj = 'ddp1a'; + } + mysql_query('INSERT INTO `laba_obj` (`lib`, `x`, `y`, `type`, `img`, `name`, `time`, `use`) VALUES ("' . $ding . '", "' . $cord[0] . '", "' . $cord[1] . '", "' . $i . '", "' . $obj . '", "{standart}", "' . time() . '", "0")'); + $j++; + } + } + $i++; + } + mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1'); + header('Location: labirint.php'); + } } - $userszv .= ' (Комментарий: '.$pl['com'].''.$del.')'; - } - if(!isset($zv['id'])) { - $userszv .= ' '; - } - echo '
    '.date('H:i', $pl['time']).' Тип : '.$typez[$pl['type']].' | '.$userszv.'
    '; -} -?> -
    - - - - - -
    -
    -
    - Группа - Тип похода: - -
    - Комментарий - -
    - -  
    -
    -
    -
    - -   - -'.$re.''; } ?> - - - \ No newline at end of file + Template::header('Вход в Лабиринты'); + ?> +
    + + +
    +
    +

    Вход в Лабиринты

    +
    + admin) { + mysql_query('UPDATE `laba_zv` SET `com` = "" WHERE `id` = "' . (int)$_GET['del_com'] . '" LIMIT 1'); + $re = 'Комментарий удалён'; + } else { + $re = 'Вы не можете удалять комментарии.'; + } + } + + if ($user['level'] >= 4) { + if (isset($_GET['quest'])) { + $q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND `cancel` = "0" AND `finish` = "0" LIMIT 1')); + if (!isset($q2['id'])) { + $q3 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND (`cancel` > "' . time() . '" OR `finish` > "' . time() . '") LIMIT 1')); + if (isset($q3['id'])) { + if ($q3['cancel'] > time()) { + $tm = timeOut($q3['cancel'] - time()); + } else { + $tm = timeOut($q3['finish'] - time()); + } + $re = 'Нельзя брать задания так часто, разрешенный лимит: Один раз в 12 часов.
    Следующее задание можно взять через : ' . $tm; + } else { + $rand = []; + $sp = mysql_query('SELECT `id`, `name` FROM `qst` WHERE `level` = "' . $user['level'] . '"'); + while ($pl = mysql_fetch_array($sp)) { + $rand[] = $pl; + } + $rand = $rand[rand(0, count($rand) - 1)]; + if ($rand['id'] > 0) { + $re = 'Вы успешно взяли задание "' . $rand['name'] . '"!
    '; + mysql_query('INSERT INTO `qst_user` (`uid`, `time`, `qid`) VALUES ("' . $user['id'] . '", "' . time() . '", "' . $rand['id'] . '")'); + } else { + $re = 'Неудалось взять задание, нет подходящих заданий у Хранителя Лабиринта
    '; + } + } + } else { + $re = 'У вас уже есть задание.'; + } + } + + $q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND `cancel` = "0" AND `finish` = "0" LIMIT 1')); + $q1 = mysql_fetch_array(mysql_query('SELECT * FROM `qst` WHERE `id` = "' . $q2['qid'] . '" LIMIT 1')); + + if (isset($q2['id']) && isset($_GET['cancelqst'])) { + mysql_query('UPDATE `qst_user` SET `cancel` = "' . (time() + 6 * 3600) . '" WHERE `id` = "' . $q2['id'] . '" LIMIT 1'); + unset($q1, $q2); + $re = 'Вы успешно отказались от задания...
    '; + } + + if (isset($q1['id'])) { + $re .= '
    Задание : ' . $q1['name'] . ' [' . $q2['val'] . '/' . $q1['obj_val'] . ']
    • Отказаться (Следующее можно будет взять через 12 часов)
    '; + if ($q2['val'] >= $q1['obj_val']) { + if (isset($_GET['finishqst'])) { + $re = 'Вы успешно завершили задание и получили: '; + if ($q1['cr'] > 0) { + $re .= ' ' . $q1['cr'] . ' кр. '; + } + if ($q1['rep'] > 0) { + $re .= ' ' . $q1['rep'] . ' репутации. '; + } + $re .= '
    '; + $user['money'] += $q1['cr']; + $user['doblest'] += $q1['rep']; + $user['rep_laba'] += $q1['rep']; + mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '", `doblest` = "' . $user['doblest'] . '", `rep_laba` = "' . $user['rep_laba'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + mysql_query('UPDATE `qst_user` SET `finish` = "' . (time() + 60 * 60 * 12) . '" WHERE `id` = "' . $q2['id'] . '" AND `uid` = "' . $user['id'] . '" LIMIT 1'); + unset($q1, $q2); + } + $re .= ' • Завершить задание и получить награду!'; + } + } else { + ?> + + + 'Для новичков', 1 => 'Для опытных', 2 => 'Для легендарных']; + while ($pl = mysql_fetch_array($sp)) { + $userszv = ''; + $i = 1; + while ($i <= 4) { + if ($pl['uid' . $i] > 0) { + $plu = mysql_fetch_array(mysql_query('SELECT `id`, `align`, `login`, `level` FROM `users` WHERE `id` = "' . $pl['uid' . $i] . '" LIMIT 1')); + if (isset($plu['id'])) { + $userszv .= ', ' . $plu['login'] . ' [' . $plu['level'] . ']'; + } + } + $i++; + } + $userszv = ltrim($userszv, ', '); + if ($pl['com'] != '') { + if ($user->admin) { + $del = ' Удалить комментарий'; + } else { + $del = ''; + } + $userszv .= ' (Комментарий: ' . $pl['com'] . '' . $del . ')'; + } + if (!isset($zv['id'])) { + $userszv .= ' '; + } + echo '
    ' . date('H:i', $pl['time']) . ' Тип : ' . $typez[$pl['type']] . ' | ' . $userszv . '
    '; + } + ?> +
    + + + + + +
    +
    +
    + Группа + Тип похода: + +
    + Комментарий + +
    + +  
    +
    +
    +
    + + + + + + + ' . $re . ''; + } +} \ No newline at end of file diff --git a/labirint.php b/labirint.php index 89fde55..9246abf 100644 --- a/labirint.php +++ b/labirint.php @@ -1,944 +1,903 @@ '0'){ - exit(""); +if ($user->battle) { + header("Location: fbattle.php"); + exit; } -$vipUsers = array( - 'SaulDin', - 'Дед Мазай', - 'Лик Ужаса', - -); +$vipUsers = [ + 'Father', +]; $errkom = ''; +$varsitm = [[270, 1]]; +$varsitm2 = [[87, 1], [88, 1], [48, 1], [49, 1], [29, 1], [66, 1], [97, 1], [67, 1], [98, 1], [115, 1]]; -$varsitm = array(array(270, 1)); - -$varsitm2 = array(array(87, 1), array(88, 1), array(48, 1), array(49, 1), array(29, 1), array(66, 1), array(97, 1), array(67, 1), array(98, 1), array(115, 1)); - -function labaItemAdd($id, $type) { - global $user; - if($type == 1) { - $dress = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "'.(int)$id.'" LIMIT 1')); - } else { - $dress = mysql_fetch_array(mysql_query('SELECT * FROM `ashop` WHERE `id` = "'.(int)$id.'" LIMIT 1')); - } - if(isset($dress['id'])) { - mysql_query("INSERT INTO `inventory` (`laba`, `prototype`,`owner`,`name`,`type`,`massa`,`cost`, `img`,`maxdur`,`isrep`,`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`koll`) VALUES ('$type', '{$dress['id']}','{$user['id']}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}','{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron2']}','{$dress['bron3']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dress[koll]}')"); - } -} - -function money_add($sum) { - global $user; - $user['money'] += $sum; - mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); -} - -if($user->room == 1052) { - if($user['id'] == 10022) { - $lab = mysql_fetch_array(mysql_query('SELECT * FROM `laba_now` WHERE `id` = "'.$user['laba'].'" LIMIT 1')); - $map = mysql_fetch_array(mysql_query('SELECT `id`,`data`,`update` FROM `laba_map` WHERE `id` = "'.$user['laba'].'" LIMIT 1')); - } else { - $lab = mysql_fetch_array(mysql_query('SELECT * FROM `laba_now` WHERE `id` = "'.$user['laba'].'" LIMIT 1')); - $map = mysql_fetch_array(mysql_query('SELECT `id`,`data`,`update` FROM `laba_map` WHERE `id` = "'.$user['laba'].'" LIMIT 1')); - } - - $dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$user['laba'].'" AND `vars` = "dielaba" LIMIT 1')); - $dies = $dies[0]; - $map_d = json_decode($map['data']); - $usersDng = showProgressBar($user['hp'], $user['maxhp']); - $errors = ''; - $effed = ''; - $mapsee = ''; - $varos = array(); - $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1')); - - $real_x = $user['x']; - $real_y = $user['y']; - if($real_y < 6) { $real_y = 6; } - if($real_x < 6) { $real_x = 6; } - - if($real_y > count($map_d) - 7) { - $real_y = count($map_d) - 7; - } - - if($real_x > count($map_d) - 7) { - $real_x = count($map_d) - 7; - } - - $objs = array(); - - $sp = mysql_query('SELECT * FROM `laba_obj` WHERE `lib` = "'.$lab['id'].'" AND `x` > '.($real_x - 7).' AND `x` < '.($real_x + 7).' AND `y` > '.($real_y - 12).' AND `y` < '.($real_y + 12).' LIMIT 144'); - while($pl = mysql_fetch_array($sp)) { - $objs[$pl['x']][$pl['y']] = $pl; - } - - $i = 1; - $goodgoo = array(1 => 0, 2 => 0, 3 => 0, 4 => 0); - while($i <= 4) { - $goto = array('x' => $user['y'], 'y' => $user['x']); - if($i == 1) { - $goto['x']--; - } elseif($i == 2) { - $goto['y']--; - } elseif($i == 3) { - $goto['x']++; - } elseif($i == 4) { - $goto['y']++; - } - if($map_d[$goto['y']][$goto['x']] == 0 && $goto['x'] > 0 && $goto['x'] < count($map_d)-1 && $user['timeGo'] <= time()) { - $goodgoo[$i] = 1; - } - $i++; - } - - if(isset($_GET['goto'])) { - $goto = array('x' => $user['y'], 'y' => $user['x']); - if($_GET['goto'] == 1 ) { - $goto['x']--; - } elseif($_GET['goto'] == 2) { - $goto['y']--; - } elseif($_GET['goto'] == 3) { - $goto['x']++; - } elseif($_GET['goto'] == 4) { - $goto['y']++; - } - - if($goodgoo[$_GET['goto']] == 1 && $user['timeGo'] <= time()) { - $user['y'] = $goto['x']; - $user['x'] = $goto['y']; - $real_x = $user['x']; - $real_y = $user['y']; - $varos['timego'] = 0; #5 - if(isset($varos['trap1']['id'])) { - $varos['timego'] += 3; - } - if($user['align'] == 2.99) { $varos['timego'] = 0; } - $user['timeGo'] = (time()+$varos['timego']); - $user['timeGoL'] = time(); - if(!mysql_query('UPDATE `users` SET `x` = "'.$user['x'].'", `y` = "'.$user['y'].'", `timeGoL` = "'.$user['timeGoL'].'", `timeGo` = "'.$user['timeGo'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1')) { - $errors = 'Ошибка перемещения!'; - } - } - } - - if($real_y < 6) { $real_y = 6; } - if($real_x < 6) { $real_x = 6; } - - if($real_y > count($map_d) - 7) { - $real_y = count($map_d) - 7; - } - if($real_x > count($map_d) - 7) { - $real_x = count($map_d) - 7; - } - - $tmdg = ($user['timeGo']-time()); - $tmdgl = ($user['timeGo']-$user['timeGoL']); - $tmdgp = floor(100-$tmdg/$tmdgl*100); - if($tmdgp < 1) { $tmdgp = 1; } elseif($tmdgp > 100) { $tmdgp = 100; } - $tmdgm = 25*$tmdgl; - $tmdg = floor(40/100*$tmdgp); - - if($tmdg < 1) { - $tmdg = 1; - } elseif($tmdg > 40) { - $tmdg = 40; - } - - if(isset($_POST['exit'])) { - if($lab['users'] < 2) { - mysql_query('DELETE FROM `laba_now` WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `laba_map` WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "'.$lab['id'].'"'); - mysql_query('DELETE FROM `laba_act` WHERE `lib` = "'.$lab['id'].'"'); - mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "'.$lab['id'].'"'); - } else { - $lab['users']--; - mysql_query('UPDATE `laba_now` SET `users` = "'.$lab['users'].'" WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - } - $dresed = mysql_query('SELECT `id`, `type` FROM `inventory` WHERE `dressed` = 1 AND `laba` = 2 AND `owner` = "'.$user['id'].'"'); - while($pl = mysql_fetch_array($dresed)) { - dropitemid($pl['type'], $user['id']); +function labaItemAdd($id, $type) +{ + global $user; + if ($type == 1) { + $dress = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "' . (int)$id . '" LIMIT 1')); + } else { + $dress = mysql_fetch_array(mysql_query('SELECT * FROM `ashop` WHERE `id` = "' . (int)$id . '" LIMIT 1')); } - mysql_query('DELETE FROM `inventory` WHERE `laba` > 0 AND `owner` = "'.$user['id'].'"'); - mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1051', `online`.`room` = '1051', `users`.`x` = '0', `users`.`y` = '0', `users`.`laba` = '0' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$user['id']."'"); - mysql_query('UPDATE `qst_user` SET `val` = "0" WHERE `uid` = "'.$user['id'].'" AND `cancel` = "0" AND `finish` = "0"'); - addActions(time(), 'go_labirint', (time()+60*60*6), $user['id']); - header('Location: lab_enter.php'); - } - - $itms = ''; - - if(isset($objs[$user['x']][$user['y']]['id'])) { - $var = array(); - $mitm = $objs[$user['x']][$user['y']]; - if($mitm['type'] == 2) { - if($mitm['use'] == 0) { - $btl_pix = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `battle` > 0 AND `laba` = "'.$lab['id'].'" AND `x` = "'.$user['x'].'" AND `y` = "'.$user['y'].'" LIMIT 1')); - if(!isset($btl_pix['id']) ) { - $bots = array( - 0 => array(10025, 10026, 10027, 10028, 10031, 10032, 10033, 10034), - 1 => array(10111, 10112, 10113, 10114, 10115, 10116), - 2 => array(10111, 10112, 10113) - ); - $bot_pix2 = $bots[$lab['type']]; - - $teams = array(); - $where = ''; $bot_ids = ''; - $i = 0; - $j = (1+rand(0, floor($user['level']/rand(3, 4)))); - while($i < $j) { - $bot_pix = $bot_pix2[rand(0, count($bot_pix2)-1)]; - $bot_pix = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$bot_pix.'" LIMIT 1')); - mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) VALUES ('".$bot_pix['login']." (Бот #$i)', '".$bot_pix['id']."', '', '".$bot_pix['maxhp']."')"); - $bot = mysql_insert_id(); - $bot_ids .= $bot.';'; - $teams[$user['id']][$bot] = array(0, 0, time()); - $teams[$bot][$user['id']] = array(0, 0, time()); - $where = ' `id` = '.$bot.' OR'; - $i++; - } - $bot_ids = rtrim($bot_ids, ';'); - $where = rtrim($where, ' OR'); - - if(!mysql_query("INSERT INTO `battle` (`teams`, `timeout`, `type`, `status`, `t1`, `t2`, `to1`, `to2`, `x`, `y`) VALUES ('".serialize($teams)."', '3', '1', '0', '".$user['id']."', '".$bot_ids."', '".time()."', '".time()."', '".$user['x']."', '".$user['y']."')")) { exit('Error #2'); } - - $id = mysql_insert_id(); - $bts = explode(';', $bot_ids); - $is = 0; - while($is <= count($bts)) { - $nicks .= Nick::id($bts[$is])->full(1).', '; - $i_d .= $bts[$is].', '; - $is++; - } - $nicks = rtrim($nicks, ', '); - $who = '`id` IN ('.rtrim($i_d, ', ').')'; - - if($user1['invis'] == 1) { - $rr = "невидимка и ".$nicks.""; - } else { - $rr = "".Nick::id($user['id'])->full(1)." и ".$nicks.""; - } - - if(!mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE ".$who."")) { exit('Error #1'.$who); } - mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE `id`= {$user['id']} LIMIT 1"); - addlog($id, "Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
    "); - } else { - $bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$btl_pix['battle'].'" LIMIT 1')); - $botd = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `battle` = "'.$bd['id'].'" LIMIT 1')); - $battle = unserialize($bd['teams']); - $ak = array_keys($battle[$botd['id']]); - $battle[$user['id']] = $battle[$ak[0]]; - foreach($battle[$user['id']] as $k => $v) { - $battle[$user['id']][$k] = array(0, 0, time()); - $battle[$k][$user['id']] = array(0, 0, time()); - } - $t1 = explode(";", $bd['t1']); - $ttt = 1; - addlog($jert['battle'], ''.date("H:i").' '.Nick::id($user['id'])->short().' вмешался в поединок!
    '); - mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\') WHERE `id` = "'.$btl_pix['battle'].'" LIMIT 1'); - mysql_query("UPDATE `users` SET `battle` = '".$bd['id']."', `zayavka` = 0 WHERE `id` = '".$user['id']."' LIMIT 1"); - header("Location: fbattle.php"); - } - exit(""); - } - } elseif($mitm['type'] == 1) { - if($mitm['use'] == 0) { - $itms .= '
    '; - } else { - $itms .= '
    '; - } - } elseif($mitm['type'] == 3) { - if($mitm['use'] == 0) { - $itms .= '
    '; - } else { - $itms .= '
    '; - } - } elseif($mitm['type'] == 4) { - if($mitm['use'] == 0) { - $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1')); - $var['time'] = rand(1, 60); - if(isset($var['trap1']['id'])) { - mysql_query('UPDATE `laba_act` SET `vals` = "'.($var['trap1']['vals'] + $var['time']).'", `time` = "'.($var['trap1']['time'] + $var['time']*60).'" WHERE `id` = "'.$var['trap1']['id'].'" LIMIT 1'); - } else { - mysql_query('INSERT INTO `laba_act` (`uid`, `time`, `lib`, `vars`, `vals`) VALUES ("'.$user['id'].'", "'.(time()+$var['time']*60).'", "'.$lab['id'].'", "trap1", "'.$var['time'].'")'); - } - $mitm['use'] = $user['id']; - mysql_query('UPDATE `laba_obj` SET `use` = "'.$mitm['use'].'" WHERE `id` = "'.$mitm['id'].'" LIMIT 1'); - $var['sex'] = ''; - if($user['sex'] == 0) { $var['sex'] = 'а'; } - $var['text'] = ' '.$user['login'].' угодил'.$var['sex'].' в ловушку...'; - $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1')); - $errors .= ' '.$user['login'].' угодил'.$var['sex'].' в ловушку... Время перехода +3 секунды (Длительность: +'.$var['time'].' мин.)'; - } - } elseif($mitm['type'] == 5) { - if($mitm['use'] == 0) { - $itms .= '
    '; - } else { - $itms .= '
    '; - } - } elseif($mitm['type'] == 6) { - if($mitm['use'] == 0) { - $itms .= '
    '; - } else { - $itms .= '
    '; - } - } - unset($var); - } - - if($user['y'] >= count($map_d)-2) { - if($lab['users'] < 2) { - mysql_query('DELETE FROM `laba_now` WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `laba_map` WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "'.$lab['id'].'"'); - mysql_query('DELETE FROM `laba_act` WHERE `lib` = "'.$lab['id'].'"'); - mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "'.$lab['id'].'"'); - } else { - $lab['users']--; - mysql_query('UPDATE `laba_now` SET `users` = "'.$lab['users'].'" WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - } - $dresed = mysql_query('SELECT `id`, `type` FROM `inventory` WHERE `dressed` = 1 AND `laba` = 2 AND `owner` = "'.$user['id'].'"'); - while($pl = mysql_fetch_array($dresed)) { - dropitemid($pl['type'], $user['id']); + if (isset($dress['id'])) { + mysql_query("INSERT INTO `inventory` (`laba`, `prototype`,`owner`,`name`,`type`,`massa`,`cost`, `img`,`maxdur`,`isrep`,`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`koll`) VALUES ('$type', '{$dress['id']}','{$user['id']}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}','{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron2']}','{$dress['bron3']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dress[koll]}')"); } - mysql_query('UPDATE `inventory` SET `laba` = 0 WHERE `laba` = 1 AND `owner` = "'.$user['id'].'"'); - mysql_query('DELETE FROM `inventory` WHERE `laba` = 2 AND `owner` = "'.$user['id'].'"'); - mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1051', `online`.`room` = '1051', `users`.`x` = '0', `users`.`y` = '0', `users`.`laba` = '0' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$user['id']."'"); - addActions(time(), 'go_labirint', (time()+60*60*6), $user['id']); - header('Location: lab_enter.php'); - } - - if(isset($_GET['takeitm'])) { - $errors = 'Предмет не найден...'; - } elseif(isset($_GET['useobj'])) { - $var = array('obj' => mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `id` = "'.mysql_real_escape_string($_GET['useobj']).'" AND `lib` = "'.$lab['id'].'" AND `x` = "'.$user['x'].'" AND `y` = "'.$user['y'].'" LIMIT 1'))); - if(isset($var['obj']['id'])) { - if($var['obj']['use'] == 0) { - if($var['obj']['type'] == 1) { - $var['sex'] = ''; - if($user['sex'] == 0) { $var['sex'] = 'а'; } - $var['itm'] = $varsitm[rand(0, count($varsitm)-1)]; - $var['itm'] = $var['itm'][0]; - $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `shop` WHERE `id` = "'.$var['itm'].'" LIMIT 1')); - if(isset($var['itm']['id'])) { - if($var['itm']['id'] == 270) { - $arr = array(0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2); - $kr = $arr[rand(0, count($arr)-1)]; - $var['itm']['name'] = $kr.' кр'; - money_add($kr); - unset($kr); - } else { - labaItemAdd($var['itm']['id'], 1); - } - } else { - $var['itm']['name'] = 'Предмет рассыпался на глазах...'; - } - $errors .= ' '.$user['login'].' открыл'.$var['sex'].' сундук...и забрал "'.$var['itm']['name'].'"'; - $var['obj']['use'] = $user['id']; - } elseif($var['obj']['type'] == 5) { - $var['sex'] = ''; - if($user['sex'] == 0) { $var['sex'] = 'а'; } - $var['itm'] = $varsitm2[rand(0, count($varsitm2)-1)]; - $var['itm'] = $var['itm'][0]; - $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `ashop` WHERE `id` = "'.$var['itm'].'" LIMIT 1')); - if(isset($var['itm']['id'])) { - labaItemAdd($var['itm']['id'], 2); - } else { - $var['itm']['name'] = 'Предмет рассыпался на глазах...'; - } - $errors .= ' '.$user['login'].' открыл'.$var['sex'].' Ящик Пандоры...и забрал "'.$var['itm']['name'].'"'; - $var['obj']['use'] = $user['id']; - } elseif($var['obj']['type'] == 3) { - $var['sex'] = ''; - if($user['sex'] == 0) { $var['sex'] = 'а'; } - $var['hpp'] = rand(2, 5)*10; - $var['hp'] = round($user['maxhp']/100*$var['hpp']); - $user['hp'] += $var['hp']; - if($user['hp'] > $user['maxhp']) { - $user['hp'] = $user['maxhp']; - } - mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - $errors .= ' '.$user['login'].' пополнил'.$var['sex'].' здоровье, Уровень Жизни +'.$var['hpp'].'% (+'.$var['hp'].'HP)'; - $var['obj']['use'] = $user['id']; - } elseif($var['obj']['type'] == 6) { - $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1')); - if(isset($var['trap1']['id'])) { - $var['time'] = rand(1, 50); - if($var['trap1']['time'] <= (time()+60*$var['time'])) { - mysql_query('DELETE FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1'); - $errors .= '
    Действие ловушки закончилось.'; - unset($var['trap1'], $var['time']); - } else { - $var['trap1']['time'] -= 60*$var['time']; - mysql_query('UPDATE `laba_act` SET `time` = "'.$var['trap1']['time'].'" WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1'); - $errors = '
    Действие ловушки снижено на '.$var['time'].' мин...'; - } - $var['obj']['use'] = $user['id']; - } else { - $errors .= '
    Вам нечего очищать ...'; - } - } - if($var['obj']['use'] > 0) { - mysql_query('UPDATE `laba_obj` SET `use` = "'.$var['obj']['use'].'" WHERE `id` = "'.$var['obj']['id'].'" LIMIT 1'); - #$var['obj']['use'] = $var['obj']['use']; ?!?!?!?!?! - } - } else { - $errors = 'Кто-то уже использовал это до Вас...'; - } - } else { - $errors = 'Обьект не найден...'; - } - unset($var); - } - - $sp = mysql_query('SELECT `x`, `y`, `level`, `login` FROM `users` WHERE `laba` = "'.$lab['id'].'" AND `id` != "'.$user['id'].'" LIMIT 3'); - $pi = 1; - while($pl = mysql_fetch_array($sp)) { - $objs[$pl['x']][$pl['y']] = array(2 => '
    '); - $pi++; - } - - $objs[$user['x']][$user['y']] = array(2 => '
    '); - $i = 0; - while($i <= count($map_d)) { - $j = 0; - while($j < count($map_d[$i])) { - if($i > $real_x - 6 && $i < $real_x + 6 && $j > $real_y - 6 && $j < $real_y + 6) { - if($map_d[$i][$j] == 1) { - $mapsee .= '
    '.$objs[$i][$j][2].'
    '; - } else { - if(!isset($objs[$i][$j]['id'])) { - if(isset($objs[$i][$j][2])) { - - } elseif($j == 1) { - $objs[$i][$j][2] = '
    '; - } elseif($j == count($map_d)-2) { - $objs[$i][$j][2] = '
    '; - } - } else { - if($objs[$i][$j]['use'] == 0) { - $objs[$i][$j][2] = '
    '; - } else { - $objs[$i][$j][2] = ''; - } - } - $mapsee .= '
    '.$objs[$i][$j][2].'
    '; - } - } - $j++; - } - if($i > $real_x - 6 && $i < $real_x + 6) { - $mapsee .= '
    '; - } - $i++; - } - $mapsee = '
    '.$mapsee.'
    '; - - if($user['align'] == 2.99) { - unset($objs); - $objs[$user['x']][$user['y']] = array(2 => '
    '); - $i = 0; - while($i <= count($map_d)) { - $j = 0; - while($j < count($map_d[$i])) { - if($map_d[$i][$j] == 1) { - $mapsee2 .= '
    '.$objs[$i][$j][2].'
    '; - } else { - if(!isset($objs[$i][$j]['id'])) { - if(isset($objs[$i][$j][2])) { - - } elseif($j == 1 && $i > 0 && $i < count($map_d)-2) { - $objs[$i][$j][2] = '
    '; - } elseif($j == count($map_d)-2 && $i > 0 && $i < count($map_d)-2) { - $objs[$i][$j][2] = '
    '; - } - } else { - if($objs[$i][$j]['use'] == 0) { - $objs[$i][$j][2] = '
    '; - } else { - $objs[$i][$j][2] = ''; - } - } - $mapsee2 .= '
    '.$objs[$i][$j][2].'
    '; - } - $j++; - } - $mapsee2 .= '
    '; - $i++; - } - $mapsee2 = '
    '.$mapsee2.'
    '; - } - - if(isset($varos['trap1']['vals']) && $varos['trap1']['vals'] > 0) { - $effed .= '
    - Время перехода +3 секунды (Осталось : '.timeOut($varos['trap1']['time']-time()).')
    '; - } - unset($varos); -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
      - - -
    -
    -
    -
    -
    - -
    -
    - -
    - 0 ) { - echo 'Кол-во смертей : '.$dies.'/3
    '; - } - ?> - Карта : #. Координаты : {X = | Y = } -
     
      - Задание: '.$q1['name'].'
    • '; - if( $q1['type'] == 1 ) { - echo 'Собрать ресурсы: '; - $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1')); - - $qobj_f = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `inventory` WHERE `owner` = "'.$user['id'].'" AND "name" = "'.$qobj['obj_id'].'" LIMIT 1')); - if( $q2['val'] != $qobj[0] ) { - mysql_query('UPDATE `qst_user` SET `val` = "'.$qobj[0].'" WHERE `id` = "'.$q2['id'].'" LIMIT 1'); - $q2['val'] = $qobj[0]; - } - echo ''.$qobj['name'].'  '; - }elseif( $q1['type'] == 2 ) { - echo 'Собрать трофеи: '; - $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1')); - $qobj_f = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `inventory` WHERE `owner` = "'.$user['id'].'" AND "name" = "'.$qobj['obj_id'].'" LIMIT 1')); - - echo ''.$qobj['name'].''; - $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1')); - if( $q2['val'] != $qobj[0] ) { - mysql_query('UPDATE `qst_user` SET `val` = "'.$qobj[0].'" WHERE `id` = "'.$q2['id'].'" LIMIT 1'); - $q2['val'] = $qobj[0]; - } - echo ' c монстров '.$qobj['name'].'  '; - }elseif( $q1['type'] == 3 ) { - echo 'Убить монстров: '; - $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1')); - echo ''.$qobj['login'].' ['.$qobj['level'].']  '; - } - echo '['.$q2['val'].'/'.$q1['obj_val'].']
    '; - echo '(Задание не засчитается, если Вы не найдёте выход.)'; - } - ?> -
     
     '; } ?> - - '.$mapsee2; - } - ?> -  
      - - - - - - - - - + + + -
    - - - - - - - -
         
                                                                                                                           
      
    - "); } - - function progress_none() { - for (let i = 1; i <= 40; i++) document.getElementById('progress'+i).style.backgroundColor = progressColor; + } elseif ($mitm['type'] == 1) { + if ($mitm['use'] == 0) { + $itms .= '
    '; + } else { + $itms .= '
    '; } - - function progress_clear() { - for (let i = ; i <= progressEnd; i++) document.getElementById('progress'+i).style.backgroundColor = 'transparent'; - progressAt = ; + } elseif ($mitm['type'] == 3) { + if ($mitm['use'] == 0) { + $itms .= '
    '; + } else { + $itms .= '
    '; } - function progress_update() { - document.getElementById('showbar').style.visibility = 'visible'; - progressAt++; - if (progressAt > progressEnd) - { - clearTimeout(progressTimer); - return; + } elseif ($mitm['type'] == 4) { + if ($mitm['use'] == 0) { + $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "' . $user['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" ORDER BY `time` DESC LIMIT 1')); + $var['time'] = rand(1, 60); + if (isset($var['trap1']['id'])) { + mysql_query('UPDATE `laba_act` SET `vals` = "' . ($var['trap1']['vals'] + $var['time']) . '", `time` = "' . ($var['trap1']['time'] + $var['time'] * 60) . '" WHERE `id` = "' . $var['trap1']['id'] . '" LIMIT 1'); + } else { + mysql_query('INSERT INTO `laba_act` (`uid`, `time`, `lib`, `vars`, `vals`) VALUES ("' . $user['id'] . '", "' . (time() + $var['time'] * 60) . '", "' . $lab['id'] . '", "trap1", "' . $var['time'] . '")'); + } + $mitm['use'] = $user['id']; + mysql_query('UPDATE `laba_obj` SET `use` = "' . $mitm['use'] . '" WHERE `id` = "' . $mitm['id'] . '" LIMIT 1'); + $var['sex'] = ''; + if ($user['sex'] == 0) { + $var['sex'] = 'а'; + } + $var['text'] = ' ' . $user['login'] . ' угодил' . $var['sex'] . ' в ловушку...'; + $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`, `time` FROM `laba_act` WHERE `uid` = "' . $user['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" ORDER BY `time` DESC LIMIT 1')); + $errors .= ' ' . $user['login'] . ' угодил' . $var['sex'] . ' в ловушку... Время перехода +3 секунды (Длительность: +' . $var['time'] . ' мин.)'; + } + } elseif ($mitm['type'] == 5) { + if ($mitm['use'] == 0) { + $itms .= '
    '; + } else { + $itms .= '
    '; + } + } elseif ($mitm['type'] == 6) { + if ($mitm['use'] == 0) { + $itms .= '
    '; + } else { + $itms .= '
    '; + } + } + unset($var); + } + + if ($user['y'] >= count($map_d) - 2) { + if ($lab['users'] < 2) { + mysql_query('DELETE FROM `laba_now` WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `laba_map` WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "' . $lab['id'] . '"'); + mysql_query('DELETE FROM `laba_act` WHERE `lib` = "' . $lab['id'] . '"'); + mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "' . $lab['id'] . '"'); + } else { + $lab['users']--; + mysql_query('UPDATE `laba_now` SET `users` = "' . $lab['users'] . '" WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); + } + $dresed = mysql_query('SELECT `id`, `type` FROM `inventory` WHERE `dressed` = 1 AND `laba` = 2 AND `owner` = "' . $user['id'] . '"'); + while ($pl = mysql_fetch_array($dresed)) { + dropitemid($pl['type'], $user['id']); + } + mysql_query('UPDATE `inventory` SET `laba` = 0 WHERE `laba` = 1 AND `owner` = "' . $user['id'] . '"'); + mysql_query('DELETE FROM `inventory` WHERE `laba` = 2 AND `owner` = "' . $user['id'] . '"'); + mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1051', `online`.`room` = '1051', `users`.`x` = '0', `users`.`y` = '0', `users`.`laba` = '0' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $user['id'] . "'"); + addActions(time(), 'go_labirint', (time() + 60 * 60 * 6), $user['id']); + header('Location: lab_enter.php'); + } + + if (isset($_GET['takeitm'])) { + $errors = 'Предмет не найден...'; + } elseif (isset($_GET['useobj'])) { + $var = ['obj' => mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `id` = "' . mysql_real_escape_string($_GET['useobj']) . '" AND `lib` = "' . $lab['id'] . '" AND `x` = "' . $user['x'] . '" AND `y` = "' . $user['y'] . '" LIMIT 1'))]; + if (isset($var['obj']['id'])) { + if ($var['obj']['use'] == 0) { + if ($var['obj']['type'] == 1) { + $var['sex'] = ''; + if ($user['sex'] == 0) { + $var['sex'] = 'а'; + } + $var['itm'] = $varsitm[rand(0, count($varsitm) - 1)]; + $var['itm'] = $var['itm'][0]; + $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `shop` WHERE `id` = "' . $var['itm'] . '" LIMIT 1')); + if (isset($var['itm']['id'])) { + if ($var['itm']['id'] == 270) { + $arr = [0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2]; + $kr = $arr[rand(0, count($arr) - 1)]; + $var['itm']['name'] = $kr . ' кр'; + money_add($kr); + unset($kr); + } else { + labaItemAdd($var['itm']['id'], 1); } - else document.getElementById('progress'+progressAt).style.backgroundColor = progressColor; - progressTimer = setTimeout('progress_update()',progressInterval); + } else { + $var['itm']['name'] = 'Предмет рассыпался на глазах...'; + } + $errors .= ' ' . $user['login'] . ' открыл' . $var['sex'] . ' сундук...и забрал "' . $var['itm']['name'] . '"'; + $var['obj']['use'] = $user['id']; + } elseif ($var['obj']['type'] == 5) { + $var['sex'] = ''; + if ($user['sex'] == 0) { + $var['sex'] = 'а'; + } + $var['itm'] = $varsitm2[rand(0, count($varsitm2) - 1)]; + $var['itm'] = $var['itm'][0]; + $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `ashop` WHERE `id` = "' . $var['itm'] . '" LIMIT 1')); + if (isset($var['itm']['id'])) { + labaItemAdd($var['itm']['id'], 2); + } else { + $var['itm']['name'] = 'Предмет рассыпался на глазах...'; + } + $errors .= ' ' . $user['login'] . ' открыл' . $var['sex'] . ' Ящик Пандоры...и забрал "' . $var['itm']['name'] . '"'; + $var['obj']['use'] = $user['id']; + } elseif ($var['obj']['type'] == 3) { + $var['sex'] = ''; + if ($user['sex'] == 0) { + $var['sex'] = 'а'; + } + $var['hpp'] = rand(2, 5) * 10; + $var['hp'] = round($user['maxhp'] / 100 * $var['hpp']); + $user['hp'] += $var['hp']; + if ($user['hp'] > $user['maxhp']) { + $user['hp'] = $user['maxhp']; + } + mysql_query('UPDATE `users` SET `hp` = "' . $user['hp'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + $errors .= ' ' . $user['login'] . ' пополнил' . $var['sex'] . ' здоровье, Уровень Жизни +' . $var['hpp'] . '% (+' . $var['hp'] . 'HP)'; + $var['obj']['use'] = $user['id']; + } elseif ($var['obj']['type'] == 6) { + $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "' . $user['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" ORDER BY `time` DESC LIMIT 1')); + if (isset($var['trap1']['id'])) { + $var['time'] = rand(1, 50); + if ($var['trap1']['time'] <= (time() + 60 * $var['time'])) { + mysql_query('DELETE FROM `laba_act` WHERE `uid` = "' . $user['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" ORDER BY `time` DESC LIMIT 1'); + $errors .= '
    Действие ловушки закончилось.'; + unset($var['trap1'], $var['time']); + } else { + $var['trap1']['time'] -= 60 * $var['time']; + mysql_query('UPDATE `laba_act` SET `time` = "' . $var['trap1']['time'] . '" WHERE `uid` = "' . $user['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" ORDER BY `time` DESC LIMIT 1'); + $errors = '
    Действие ловушки снижено на ' . $var['time'] . ' мин...'; + } + $var['obj']['use'] = $user['id']; + } else { + $errors .= '
    Вам нечего очищать ...'; + } + } + if ($var['obj']['use'] > 0) { + mysql_query('UPDATE `laba_obj` SET `use` = "' . $var['obj']['use'] . '" WHERE `id` = "' . $var['obj']['id'] . '" LIMIT 1'); + #$var['obj']['use'] = $var['obj']['use']; ?!?!?!?!?! + } + } else { + $errors = 'Кто-то уже использовал это до Вас...'; } - - - progress_clear(); - progress_set(); - progress_update(); - -
     
    - - - - - - - - - - - - - - - - - +
    + } else { + $errors = 'Обьект не найден...'; + } + unset($var); + } + + $sp = mysql_query('SELECT `x`, `y`, `level`, `login` FROM `users` WHERE `laba` = "' . $lab['id'] . '" AND `id` != "' . $user['id'] . '" LIMIT 3'); + $pi = 1; + while ($pl = mysql_fetch_array($sp)) { + $objs[$pl['x']][$pl['y']] = [2 => '
    ']; + $pi++; + } + + $objs[$user['x']][$user['y']] = [2 => '
    ']; + $i = 0; + while ($i <= count($map_d)) { + $j = 0; + while ($j < count($map_d[$i])) { + if ($i > $real_x - 6 && $i < $real_x + 6 && $j > $real_y - 6 && $j < $real_y + 6) { + if ($map_d[$i][$j] == 1) { + $mapsee .= '
    ' . $objs[$i][$j][2] . '
    '; + } else { + if (!isset($objs[$i][$j]['id'])) { + if ($j == 1) { + $objs[$i][$j][2] = '
    '; + } elseif ($j == count($map_d) - 2) { + $objs[$i][$j][2] = '
    '; + } + } else { + if ($objs[$i][$j]['use'] == 0) { + $objs[$i][$j][2] = '
    '; + } else { + $objs[$i][$j][2] = ''; + } + } + $mapsee .= '
    ' . $objs[$i][$j][2] . '
    '; + } + } + $j++; + } + if ($i > $real_x - 6 && $i < $real_x + 6) { + $mapsee .= '
    '; + } + $i++; + } + $mapsee = '
    ' . $mapsee . '
    '; + + if ($user['align'] == 2.99) { + unset($objs); + $objs[$user['x']][$user['y']] = [2 => '
    ']; + $i = 0; + while ($i <= count($map_d)) { + $j = 0; + while ($j < count($map_d[$i])) { + if ($map_d[$i][$j] == 1) { + $mapsee2 .= '
    ' . $objs[$i][$j][2] . '
    '; + } else { + if (!isset($objs[$i][$j]['id'])) { + if ($j == 1 && $i > 0 && $i < count($map_d) - 2) { + $objs[$i][$j][2] = '
    '; + } elseif ($j == count($map_d) - 2 && $i > 0 && $i < count($map_d) - 2) { + $objs[$i][$j][2] = '
    '; + } + } else { + if ($objs[$i][$j]['use'] == 0) { + $objs[$i][$j][2] = '
    '; + } else { + $objs[$i][$j][2] = ''; + } + } + $mapsee2 .= '
    ' . $objs[$i][$j][2] . '
    '; + } + $j++; + } + $mapsee2 .= '
    '; + $i++; + } + $mapsee2 = '
    ' . $mapsee2 . '
    '; + } + + if (isset($varos['trap1']['vals']) && $varos['trap1']['vals'] > 0) { + $effed .= '
    - Время перехода +3 секунды (Осталось : ' . timeOut($varos['trap1']['time'] - time()) . ')
    '; + } + unset($varos); + Template::header('labirint'); + ?> + + +
    + + + + + + + + - - - -
    + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + -
    Вверх
    ВлевоОбновитьВправо
    Вниз
      + + +
    +
    +
    + +
    +
    + +
    +
    + +
    + 0) { + echo 'Кол-во смертей : ' . $dies . '/3
    '; + } + ?> + Карта : #. Координаты : {X = | Y = } +
     
      + Задание: ' . $q1['name'] . '
    • '; + if ($q1['type'] == 1) { + echo 'Собрать ресурсы: '; + $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "' . $q1['obj_id'] . '" LIMIT 1')); + + $qobj_f = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `inventory` WHERE `owner` = "' . $user['id'] . '" AND "name" = "' . $qobj['obj_id'] . '" LIMIT 1')); + if ($q2['val'] != $qobj[0]) { + mysql_query('UPDATE `qst_user` SET `val` = "' . $qobj[0] . '" WHERE `id` = "' . $q2['id'] . '" LIMIT 1'); + $q2['val'] = $qobj[0]; + } + echo '' . $qobj['name'] . '  '; + } elseif ($q1['type'] == 2) { + echo 'Собрать трофеи: '; + $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "' . $q1['obj_id'] . '" LIMIT 1')); + $qobj_f = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `inventory` WHERE `owner` = "' . $user['id'] . '" AND "name" = "' . $qobj['obj_id'] . '" LIMIT 1')); + + echo '' . $qobj['name'] . ''; + $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $q1['obj_id'] . '" LIMIT 1')); + if ($q2['val'] != $qobj[0]) { + mysql_query('UPDATE `qst_user` SET `val` = "' . $qobj[0] . '" WHERE `id` = "' . $q2['id'] . '" LIMIT 1'); + $q2['val'] = $qobj[0]; + } + echo ' c монстров ' . $qobj['name'] . '  '; + } elseif ($q1['type'] == 3) { + echo 'Убить монстров: '; + $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $q1['obj_id'] . '" LIMIT 1')); + echo '' . $qobj['login'] . ' [' . $qobj['level'] . ']  '; + } + echo '[' . $q2['val'] . '/' . $q1['obj_val'] . ']
    '; + echo '(Задание не засчитается, если Вы не найдёте выход.)'; + } + ?> +
     
     '; + } ?> + + ' . $mapsee2; + } + ?> +  
    - - - - - - - -
    - -
    +
      + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + +
          +
    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +
    +
      
    + +
     
    +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Вверх
    ВлевоОбновитьВправо
    Вниз
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    - - - \ No newline at end of file +
    + +room != 53) { header("Location: main.php"); exit; } - if ($user->battle) { header('location: fbattle.php'); exit; } +include "functions.php"; + +if ($user->room != 53) { + header("Location: main.php"); + exit; +} +if ($user->battle) { + header('location: fbattle.php'); + exit; +} +Template::header('Библиотека Просвещения'); ?> - - - - - - - - - - - + + + '); - echo(''); - echo(''); - + +if ($_GET['lib_room'] == 'hall' || !$_GET['lib_room']) { + echo ''; + echo ''; + echo ''; echo ''; - echo ''; - echo(''); - //echo ''; - //echo ''; - } -elseif($_GET['lib_room']=='archive') -{ + echo ''; +} elseif ($_GET['lib_room'] == 'archive') { //код опознавания страниц - if($_POST['ident_pages']) - { + if ($_POST['ident_pages']) { //выбираем неопределенные страницы - $pages=array(); - $pages_res=mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='867' AND `dressed`='0'; "); - while($page_res=mysql_fetch_array($pages_res)) - $pages[]=$page_res['id']; - $names=array(); - $cred=0; - foreach($pages as $p) - { - if(mt_rand(1,2)==1) - { - $page_num=868+mt_rand(0,14); + $pages = []; + $pages_res = mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='867' AND `dressed`='0'; "); + while ($page_res = mysql_fetch_array($pages_res)) { + $pages[] = $page_res['id']; + } + $names = []; + $cred = 0; + foreach ($pages as $p) { + if (mt_rand(1, 2) == 1) { + $page_num = 868 + mt_rand(0, 14); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$page_num}' LIMIT 1;")); mysql_query("INSERT INTO `inventory` (`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`, @@ -74,354 +63,359 @@ elseif($_GET['lib_room']=='archive') ) VALUES ('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}', - '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' - ) ;"); - $names[]=$dress['name']; + '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' + ) ;"); + $names[] = $dress['name']; + } else { + $cred += 1; } - else - $cred+=1; mysql_query("DELETE FROM `inventory` WHERE `id` = '{$p}' LIMIT 1;"); } - + } //текст - echo(''); - if($_POST['ident_pages']) echo(''); - else echo(' - '); + echo ''; + if ($_POST['ident_pages']) { + echo ''; + } else { + echo ' + '; + } //выбираем неопределенные страницы - $pages=array(); - $pages_res=mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='867' AND `dressed`='0'; "); - while($page_res=mysql_fetch_array($pages_res)) - $pages[]=$page_res['id']; + $pages = []; + $pages_res = mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='867' AND `dressed`='0'; "); + while ($page_res = mysql_fetch_array($pages_res)) { + $pages[] = $page_res['id']; + } //обмен страниц - if($pages) - echo(''); - else echo(''); - //money - if($cred) - { - mysql_query("UPDATE `users` SET `money`=money+{$cred} where `id`='{$user['id']}';"); - echo(''); - } - //ident - if($names) foreach($names as $n) - { - echo(''); - mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) - VALUES ('','0','{$user['id']}','\"".$user['login']."\" получил в Библиотеке ".$n." кр. ',1,'".time()."');"); - - } - //меняем страницы на книгу - if($_POST['get_book']) - { - $pages=array(); - $got_all_1=1; - for($pn=868;$pn<=882;$pn++) - { - $pc_r=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; ")); - if($pc_r) $pages[]=$pc_r['id']; - else $got_all_1=0; + if ($pages) { + echo ''; + else { + echo ''; } - if($got_all_1) { - foreach($pages as $p) - mysql_query("DELETE FROM `inventory` WHERE `id` = '{$p}' LIMIT 1;"); - $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '866' LIMIT 1;")); - mysql_query("INSERT INTO `inventory` + //money + if ($cred) { + mysql_query("UPDATE `users` SET `money`=money+{$cred} where `id`='{$user['id']}';"); + echo ''; + } + //ident + if ($names) { + foreach ($names as $n) { + echo(''); + mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) + VALUES ('','0','{$user['id']}','\"" . $user['login'] . "\" получил в Библиотеке " . $n . " кр. ',1,'" . time() . "');"); + } + } + //меняем страницы на книгу + if ($_POST['get_book']) { + $pages = []; + $got_all_1 = 1; + for ($pn = 868; $pn <= 882; $pn++) { + $pc_r = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; ")); + if ($pc_r) { + $pages[] = $pc_r['id']; + } else { + $got_all_1 = 0; + } + } + if ($got_all_1) { + foreach ($pages as $p) { + mysql_query("DELETE FROM `inventory` WHERE `id` = '{$p}' LIMIT 1;"); + } + $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '866' LIMIT 1;")); + mysql_query("INSERT INTO `inventory` (`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`, `gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`, `mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`duration` ) VALUES ('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}', - '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' - ) ;"); - addchp ('У Вас есть все необходимые страницы. Сложив их в нужном порядке, Вы получаете Книгу Комментатора [1]','{[]}'.Nick::id($user['id'])->short().'{[]}'); - } - - } - //есть страницы - $pagesn=array(); - for($pn=868;$pn<=882;$pn++)//книга 1 - { - $pc_r=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; ")); - if($pc_r) $pagesn[$pn]=1; - else $pagesn[$pn]=0; - } - echo(''); - echo(''); - echo(''); - else - echo(""); - - echo(''); -} -elseif($_GET['lib_room']='magic_craft') -{ - /*books=array(); - $pages_res=mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='867' AND `dressed`='0'; "); - while($page_res=mysql_fetch_array($pages_res))*/ - $res=array(); - $del=array(); - $book_1=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='866' LIMIT 1; ")); - //делаем крафт - if($_POST['craft_1']) { - - $craft_err=0; - //считаем книжку - if(!$book_1) $craft_err=1; - //считаем ингридиенты - $ing=mysql_fetch_array(mysql_query("SELECT `ingred` FROM `recipes` WHERE `id`='{$_POST['magic_id']}' LIMIT 1;")); - $need_1=unserialize($ing['ingred']); - //считаем кол-во ингридиентов - foreach($need_1 as $k=>$n) { - $res_r=mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; "); - $i=0; - while($res_id=mysql_fetch_array($res_r)) - if($i<$n) - { - if($res_id['id']) $del[]=$res_id['id']; - else - $craft_err=1; - $i++; + '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' + ) ;"); + addchp('У Вас есть все необходимые страницы. Сложив их в нужном порядке, Вы получаете Книгу Комментатора [1]', '{[]}' . Nick::id($user['id'])->short() . '{[]}'); } - } - //ингридиентов хватает - if(!$craft_err) { - foreach($del as $d) - mysql_query("DELETE FROM `inventory` WHERE `id`='{$d}';"); - $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$_POST['magic_id']}' LIMIT 1;")); - mysql_query("INSERT INTO `inventory` + + } + //есть страницы + $pagesn = []; + for ($pn = 868; $pn <= 882; $pn++)//книга 1 + { + $pc_r = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; ")); + if ($pc_r) { + $pagesn[$pn] = 1; + } else { + $pagesn[$pn] = 0; + } + } + echo ''; + echo ''; + echo ''; + } else { + echo ""; + } + echo ''; + } elseif ($_GET['lib_room'] = 'magic_craft') { + $res = []; + $del = []; + $book_1 = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='866' LIMIT 1; ")); + //делаем крафт + if ($_POST['craft_1']) { + $craft_err = 0; + //считаем книжку + if (!$book_1) { + $craft_err = 1; + } + //считаем ингридиенты + $ing = mysql_fetch_array(mysql_query("SELECT `ingred` FROM `recipes` WHERE `id`='{$_POST['magic_id']}' LIMIT 1;")); + $need_1 = unserialize($ing['ingred']); + //считаем кол-во ингридиентов + foreach ($need_1 as $k => $n) { + $res_r = mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; "); + $i = 0; + while ($res_id = mysql_fetch_array($res_r)) { + if ($i < $n) { + if ($res_id['id']) $del[] = $res_id['id']; + else + $craft_err = 1; + $i++; + } + } + } + //ингридиентов хватает + if (!$craft_err) { + foreach ($del as $d) { + mysql_query("DELETE FROM `inventory` WHERE `id`='{$d}';"); + } + $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$_POST['magic_id']}' LIMIT 1;")); + mysql_query("INSERT INTO `inventory` (`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`, `gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`, `mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`duration` ) VALUES ('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}', - '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' - ) ;"); - mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) - VALUES ('','0','{$user['id']}','\"".$user['login']."\" создал свиток ".$dress['name']." ',1,'".time()."');"); - addchp ('Вы успешно создали свиток '.$dress['name'].'!','{[]}'.Nick::id($user['id'])->short().'{[]}'); + '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' + ) ;"); + mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) + VALUES ('','0','{$user['id']}','\"" . $user['login'] . "\" создал свиток " . $dress['name'] . " ',1,'" . time() . "');"); + addchp('Вы успешно создали свиток ' . $dress['name'] . '!', '{[]}' . Nick::id($user['id'])->short() . '{[]}'); + } } - } - - //$book1=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='--book 2--'; ")); - //$book1=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='--book 3--'; ")); - echo(''); - if($craft_err) echo(""); - if($book_1) { - echo(''); - //ОГОНЬ - echo(''); - //выбираем всю магию стихии - $all_fire_raw=mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='F';"); - while($all_fire=mysql_fetch_array($all_fire_raw)) - { - $spell_info=mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_fire['id']}' LIMIT 1;")); - //необходимые ингридиенты - $ing=unserialize($all_fire['ingred']); - foreach($ing as $k=>$n) { - $txt_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;")); - $count_k=mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; ")); - if($count_k<$n) - { - $ingred.=$txt_k['name']." (".$count_k."/".$n.")
    "; - $ing_error=1; - } - - else - $ingred.=$txt_k['name']." (".$count_k."/".$n.")
    "; - - - } - - echo('
    '); - } - //ЗЕМЛЯ - echo(''); - //выбираем всю магию стихии - $all_earth_raw=mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='E';"); - while($all_earth=mysql_fetch_array($all_earth_raw)) - { - $spell_info=mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_earth['id']}' LIMIT 1;")); - //необходимые ингридиенты - $ing=unserialize($all_earth['ingred']); - foreach($ing as $k=>$n) { - $txt_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;")); - $count_k=mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; ")); - if($count_k<$n) - { - $ingred.=$txt_k['name']." (".$count_k."/".$n.")
    "; - $ing_error=1; - } - - else - $ingred.=$txt_k['name']." (".$count_k."/".$n.")
    "; - - - } - echo('
    '); - } - //ВОЗДУХ - echo(''); - //выбираем всю магию стихии - $all_air_raw=mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='A';"); - while($all_air=mysql_fetch_array($all_air_raw)) - { - $spell_info=mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_air['id']}' LIMIT 1;")); - //необходимые ингридиенты - $ing=unserialize($all_air['ingred']); - foreach($ing as $k=>$n) { - $txt_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;")); - $count_k=mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; ")); - if($count_k<$n) - { - $ingred.=$txt_k['name']." (".$count_k."/".$n.")
    "; - $ing_error=1; - } - - else - $ingred.=$txt_k['name']." (".$count_k."/".$n.")
    "; - - - } - echo('
    '); - } - //ВОДА - echo(''); - //выбираем всю магию стихии - $all_fire_raw=mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='W';"); - while($all_fire=mysql_fetch_array($all_fire_raw)) - { - $spell_info=mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_fire['id']}' LIMIT 1;")); - //необходимые ингридиенты - $ing=unserialize($all_fire['ingred']); - foreach($ing as $k=>$n) { - $txt_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;")); - $count_k=mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; ")); - if($count_k<$n) - { - $ingred.=$txt_k['name']." (".$count_k."/".$n.")
    "; - $ing_error=1; - } - - else - $ingred.=$txt_k['name']." (".$count_k."/".$n.")
    "; - - - } - echo('
    '); - } - + echo 'Ваша стихия:'; + $el = element(star_sign(substr($user['borndate'], 3, 2), substr($user['borndate'], 0, 2))); + switch ($el) { + case 'a': + echo "Воздух"; + break; + case 'w': + echo "Вода"; + break; + case 'f': + echo "Огонь"; + break; + case 'e': + echo "Земля"; + break; } -// if($book2) -// { -// -// } -// if($book3) -// { -// -// } + echo "
    Эффективность магии:"; + foreach (Config::$elem_align as $k => $ea) { + switch ($k) { + case 'a': + echo "
    Воздух"; + break; + case 'w': + echo "
    Вода"; + break; + case 'f': + echo "
    Огонь"; + break; + case 'e': + echo "
    Земля"; + break; + } + switch ($ea[$el]) { + case '0': + echo " : " . ($ea[$el] * 100) . "%"; + break; + case '0.5': + echo " : " . ($ea[$el] * 100) . "%"; + break; + case '1': + echo " : " . ($ea[$el] * 100) . "%"; + break; + } + } + echo ''; + if ($craft_err) { + echo "
    "; + } + if ($book_1) { + echo ''; + //ОГОНЬ + echo ''; + //выбираем всю магию стихии + $all_fire_raw = mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='F';"); + while ($all_fire = mysql_fetch_array($all_fire_raw)) { + $spell_info = mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_fire['id']}' LIMIT 1;")); + //необходимые ингридиенты + $ing = unserialize($all_fire['ingred']); + foreach ($ing as $k => $n) { + $txt_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;")); + $count_k = mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; ")); + if ($count_k < $n) { + $ingred .= $txt_k['name'] . " (" . $count_k . "/" . $n . ")
    "; + $ing_error = 1; + } else { + $ingred .= $txt_k['name'] . " (" . $count_k . "/" . $n . ")
    "; + } + } - - - echo('
    '); - -} + echo ''; + } -?> + //ЗЕМЛЯ + echo ''; + //выбираем всю магию стихии + $all_earth_raw = mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='E';"); + while ($all_earth = mysql_fetch_array($all_earth_raw)) { + $spell_info = mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_earth['id']}' LIMIT 1;")); + //необходимые ингридиенты + $ing = unserialize($all_earth['ingred']); + foreach ($ing as $k => $n) { + $txt_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;")); + $count_k = mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; ")); + if ($count_k < $n) { + $ingred .= $txt_k['name'] . " (" . $count_k . "/" . $n . ")
    "; + $ing_error = 1; + } else { + $ingred .= $txt_k['name'] . " (" . $count_k . "/" . $n . ")
    "; + } + } + echo '
    '; + } + //ВОЗДУХ + echo ''; + //выбираем всю магию стихии + $all_air_raw = mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='A';"); + while ($all_air = mysql_fetch_array($all_air_raw)) { + $spell_info = mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_air['id']}' LIMIT 1;")); + //необходимые ингридиенты + $ing = unserialize($all_air['ingred']); + foreach ($ing as $k => $n) { + $txt_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;")); + $count_k = mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; ")); + if ($count_k < $n) { + $ingred .= $txt_k['name'] . " (" . $count_k . "/" . $n . ")
    "; + $ing_error = 1; + } else { + $ingred .= $txt_k['name'] . " (" . $count_k . "/" . $n . ")
    "; + } + } + echo '
    '; + } + //ВОДА + echo ''; + //выбираем всю магию стихии + $all_fire_raw = mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='W';"); + while ($all_fire = mysql_fetch_array($all_fire_raw)) { + $spell_info = mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_fire['id']}' LIMIT 1;")); + //необходимые ингридиенты + $ing = unserialize($all_fire['ingred']); + foreach ($ing as $k => $n) { + $txt_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;")); + $count_k = mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; ")); + if ($count_k < $n) { + $ingred .= $txt_k['name'] . " (" . $count_k . "/" . $n . ")
    "; + $ing_error = 1; + } else { + $ingred .= $txt_k['name'] . " (" . $count_k . "/" . $n . ")
    "; + } + } + echo '
    '; + } + + } + echo ''; + } + ?> -

    Библиотека Просвещения

    Библиотека Просвещения

    Вы стоите в холле Библиотеки. В застоявшемся воздухе висит многовековая пыль, плавно витающая между полками и сундуками с книгами. - Потолки залов теряются в темноте, которую разгоняют лишь факелы на стенах.

    К Вам подходит один из Смотрителей. Он определенно стар, лицо скрыто под плащем, но его движения - быстрые и точные.

    Смотритель: "Какие услуги тебе понадобились?"
    Вы стоите в холле Библиотеки. В застоявшемся воздухе висит многовековая пыль, плавно витающая между полками и сундуками с книгами. + Потолки залов теряются в темноте, которую разгоняют лишь факелы на стенах.

    К Вам подходит один из Смотрителей. Он определенно стар, лицо скрыто под плащем, но его движения - быстрые и точные.

    Смотритель: "Какие услуги тебе понадобились?"


    Здесь ученые мужи трудятся над рашифровкой древних книг и свитков. Если Вам нужна информация про какие-либо книги или свитки, здесь Вам обязательно помогут.


    Оснащенная по последнему слову магии и техники лаборатория для опытов. Тут Вы можете создавать магические предметы.
    Перед Вами длинный зал, заполненный людьми в серых робах. Некоторые внимательно изучают всевозможные вещи и книги, другие - в небольших группах что-то оживленно обсуждают. В углу помещения стоит каменная плита с неизвестными Вам символами.

    За столом слева от входа сгорбился Архивариус. Он не обращает на Вас никакого внимания.

    За столом слева от входа сгорбился Архивариус. Он медленно поднимает голову и смотрим Вам прямо в глаза.

    Архивариус: "Предметы не определяем. Чеки не принимаем. С вопросами - к помощникам."
    Перед Вами длинный зал, заполненный людьми в серых робах. Некоторые внимательно изучают всевозможные вещи и книги, другие + в небольших группах что-то оживленно обсуждают. В углу помещения стоит каменная плита с неизвестными Вам символами.

    За столом слева от входа сгорбился Архивариус. Он не обращает на Вас никакого внимания.

    За столом слева от входа сгорбился Архивариус. Он медленно поднимает голову и смотрим Вам прямо в глаза.

    Архивариус: "Предметы не определяем. Чеки не принимаем. С вопросами - к помощникам."
    Здесь Вам помогут опознать найденные Вами страницы -
    ('.count($pages).') шт. - -
    У Вас нету страниц, нуждающихся в идентификации.

    Вы отдали ненужные страницы в Архив (+'.$cred.')кр.

    Вы получили '.$n.'
    Здесь Вам помогут опознать найденные Вами страницы} +
    (' . count($pages) . ') шт. - +
    У Вас нету страниц, нуждающихся в идентификации.

    Вы отдали ненужные страницы в Архив (+' . $cred . ')кр.

    Вы получили ' . $n . '

    Найденные страницы:
    Книга Комментатора [1]:
    '); - foreach($pagesn as $p) - { - $c++; - if($p>0) echo ("".$c." "); - else echo("".$c." "); - } - $got_all_1=1; - for($pn=868;$pn<=882;$pn++) - { - $pc_r=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; ")); - if($pc_r) $pages[]=$pc_r; - else $got_all_1=0; - } - if($got_all_1) - echo('
    -
    Не хватает страниц

    Найденные страницы:
    Книга Комментатора [1]:
    '; + foreach ($pagesn as $p) { + $c++; + if ($p > 0) { + echo "" . $c . " "; + } else { + echo "" . $c . " "; + } + } + $got_all_1 = 1; + for ($pn = 868; $pn <= 882; $pn++) { + $pc_r = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; ")); + if ($pc_r) { + $pages[] = $pc_r; + } else { + $got_all_1 = 0; + } + } + if ($got_all_1) { + echo '
    +
    Не хватает страниц
    Вы стоите в небольшой комнате, от пола до потолка забтиой банками, пробирками, ингредиентами и прочими полезными вещами. - Здесь Вы можете собрать предметы по имеющимся у Вас рецептам.

    Знак зодиака'); + echo star_sign(substr($user['borndate'], 3, 2), substr($user['borndate'], 0, 2)); + echo '.gif" width=100>'; //выводим инфо по стихиям -echo('Ваша стихия:'); -$el=element(star_sign(substr($user['borndate'],3,2), substr($user['borndate'],0,2))); -switch($el) -{ -case 'a': echo("Воздух"); break; -case 'w': echo("Вода"); break; -case 'f': echo("Огонь"); break; -case 'e': echo("Земля"); break; -} -echo("
    Эффективность магии:"); -foreach(Config::$elem_align as $k=>$ea) -{ - switch($k) - { - case 'a': echo("
    Воздух"); break; - case 'w': echo("
    Вода"); break; - case 'f': echo("
    Огонь"); break; - case 'e': echo("
    Земля"); break; - } - switch($ea[$el]) - { - case '0': echo(" : ".($ea[$el]*100)."%"); break; - case '0.5': echo(" : ".($ea[$el]*100)."%"); break; - case '1': echo(" : ".($ea[$el]*100)."%"); break; - } -} - - - echo('
    Недостаточно ингредиентов!

    Рецепты: Книга Комментатора [1]

    Магия Огня

    '. - $spell_info['name'].'
    Ингредиенты:
    '. - $ingred); - unset ($ing); - unset($ingred); - if(!$ing_error) echo(''); else echo("Недостаточно ингридиентов"); - echo('

    Магия Земли

    '. - $spell_info['name'].'
    Ингредиенты:
    '. - $ingred); - unset ($ing); - unset($ingred); - if(!$ing_error) echo(''); else echo("Недостаточно ингридиентов"); - echo('

    Магия Воздуха

    '. - $spell_info['name'].'
    Ингредиенты:
    '. - $ingred); - unset ($ing); - unset($ingred); - if(!$ing_error) echo(''); else echo("Недостаточно ингридиентов"); - echo('

    Магия Воды

    '. - $spell_info['name'].'
    Ингредиенты:
    '. - $ingred); - unset ($ing); - unset($ingred); - if(!$ing_error) echo(''); else echo("Недостаточно ингридиентов"); - echo('
    Недостаточно ингредиентов!

    Рецепты: Книга Комментатора [1]

    Магия Огня


    ' . + $spell_info['name'] . '
    Ингредиенты:
    ' . + $ingred; + unset ($ing); + unset($ingred); + if (empty($ing_error)) { + echo ''; + } else { + echo "Недостаточно ингридиентов"; + } + echo '

    Магия Земли

    ' . + $spell_info['name'] . '
    Ингредиенты:
    ' . + $ingred; + unset ($ing); + unset($ingred); + if (!$ing_error) { + echo ''; + } else { + echo "Недостаточно ингридиентов"; + } + echo '

    Магия Воздуха

    ' . + $spell_info['name'] . '
    Ингредиенты:
    ' . + $ingred; + unset ($ing); + unset($ingred); + if (empty($ing_error)) { + echo ''; + } else { + echo "Недостаточно ингридиентов"; + } + echo '

    Магия Воды

    ' . + $spell_info['name'] . '
    Ингредиенты:
    ' . + $ingred; + unset ($ing); + unset($ingred); + if (empty($ing_error)) { + echo ''; + } else { + echo "Недостаточно ингридиентов"; + } + echo '

    - +
    '); - -?> - - - + echo('
    '); \ No newline at end of file diff --git a/logs.php b/logs.php index 938714b..acb32d7 100644 --- a/logs.php +++ b/logs.php @@ -1,140 +1,125 @@ - - - - - - - - -Бойцовский Клуб Возрождение : Лог боя #<?=$_REQUEST['log'];?> - - -

    Лог поединка

    -
    - - -
    "; - - if ($data['type'] == 10) { - $rr = "\"Кровавый (поединок в башне смерти)"; - } elseif($data['blood'] && ($data['type'] == 5 || $data['type'] == 4)) { - $rr = "\"кулачный\"Кровавый (кровавый кулачный поединок)"; - } elseif($data['blood'] && ($data['type'] == 2 || $data['type'] == 3 || $data['type'] == 6)) { - $rr = "\"Кровавый (кровавый поединок)"; - } elseif($data['type'] == 5 || $data['type'] == 4) { - $rr = "\"кулачный (кулачный поединок)"; - } elseif($data['type'] == 3 || $data['type'] == 2) { - $rr = "\"групповой (групповой поединок)"; - } elseif($data['type'] == 1) { - $rr = "\"физический (физический поединок)"; - } - - $t1 = explode(";", $data['t1']); - $t2 = explode(";", $data['t2']); - - if($data['win'] == 3) { - $battle = unserialize($data['teams']); - - foreach($t1 as $k => $v) { - if(in_array($v, array_keys($battle))) { - ++$i; - if($i > 1) { $cc = ', '; } else { $cc = ''; } - $ffs .= $cc.Nick::id($v)->battleShort('B1'); - } - } - - $i = 0; - - $ffs .= ' против '; - foreach ($t2 as $k => $v) { - if(in_array($v, array_keys($battle))) { - ++$i; - if($i > 1) { $cc = ', '; } else { $cc = ''; } - $ffs .= $cc.Nick::id($v)->battleShort('B1'); - } - } - $i = 0; - } - - $countall = count($t1)+count($t2); - if($countall > 70) { - echo "

    Эпическая битва!

    "; - } elseif($countall > 50) { - echo "

    Эпохальная битва!

    "; - } elseif($countall > 30) { - echo "

    Великая битва!

    "; - } - - echo "
    Тип боя: "; - echo $rr; +$data = mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `id` = '" . $_REQUEST['log'] . "'")); +$log = file("backup/logs/battle" . $_REQUEST['log'] . ".txt"); +Template::header('Лог поединка'); ?> -  -Страницы: -", $log[0]); - $all = count($log)-1; - $pgs = $all/50; - for ($i=0;$i<=$pgs;++$i) { - if ($_GET['page']==$i) { - echo ' ',($i+1),' '; - } - else { - echo ' ',($i+1),' '; - } - } -//print_r($log); -?>
    "; - } -?> -
    -".$ffs."
    "; -?> -
    - - +

    Лог поединка

    + + + +
    "; - - -  -Страницы: -',($i+1),' '; - } - else { - echo ' ',($i+1),' '; - } - } -echo "

    "; -} -else { echo "
    "; -echo "Статистика временно недоступна ...
    "; -#include('stat_battle.php'); -echo "
    "; -} -?> + if ($data['type'] == 10) { + $rr = "\"Кровавый (поединок в башне смерти)"; + } elseif ($data['blood'] && ($data['type'] == 5 || $data['type'] == 4)) { + $rr = "\"кулачный\"Кровавый (кровавый кулачный поединок)"; + } elseif ($data['blood'] && ($data['type'] == 2 || $data['type'] == 3 || $data['type'] == 6)) { + $rr = "\"Кровавый (кровавый поединок)"; + } elseif ($data['type'] == 5 || $data['type'] == 4) { + $rr = "\"кулачный (кулачный поединок)"; + } elseif ($data['type'] == 3 || $data['type'] == 2) { + $rr = "\"групповой (групповой поединок)"; + } elseif ($data['type'] == 1) { + $rr = "\"физический (физический поединок)"; + } - - - \ No newline at end of file + $t1 = explode(";", $data['t1']); + $t2 = explode(";", $data['t2']); + + if ($data['win'] == 3) { + $battle = unserialize($data['teams']); + + foreach ($t1 as $k => $v) { + if (in_array($v, array_keys($battle))) { + ++$i; + if ($i > 1) { + $cc = ', '; + } else { + $cc = ''; + } + $ffs .= $cc . Nick::id($v)->battleShort('B1'); + } + } + + $i = 0; + + $ffs .= ' против '; + foreach ($t2 as $k => $v) { + if (in_array($v, array_keys($battle))) { + ++$i; + if ($i > 1) { + $cc = ', '; + } else { + $cc = ''; + } + $ffs .= $cc . Nick::id($v)->battleShort('B1'); + } + } + $i = 0; + } + + $countall = count($t1) + count($t2); + if ($countall > 70) { + echo "

    Эпическая битва!

    "; + } elseif ($countall > 50) { + echo "

    Эпохальная битва!

    "; + } elseif ($countall > 30) { + echo "

    Великая битва!

    "; + } + + echo "
    Тип боя: "; + echo $rr; + echo 'Страницы:'; + + $log = explode("
    ", $log[0]); + $all = count($log) - 1; + $pgs = $all / 50; + for ($i = 0; $i <= $pgs; ++$i) { + if ($_GET['page'] == $i) { + echo ' ', ($i + 1), ' '; + } else { + echo ' ', ($i + 1), ' '; + } + } + echo '
    '; + + $start = 50 * $_GET['page']; + if (50 * $_GET['page'] + 50 <= $all) { + $stop = 50 * $_GET['page'] + 50; + } else { + $stop = 50 * $_GET['page'] + ($all - 50 * $_GET['page']) - 1; + } + for ($i = $start; $i <= $stop; $i++) { + echo $log[$i] . "
    "; + } + echo '
    '; + echo "
    " . $ffs . "

    "; + ?> +
    + + + +
    +   + Страницы: + ', ($i + 1), ' '; + } else { + echo ' ', ($i + 1), ' '; + } + } + echo "

    "; + } else { + echo "
    "; + echo "Статистика временно недоступна ...
    "; + echo "
    "; + } + ?> + \ No newline at end of file diff --git a/main.php b/main.php index 647886f..4977b7c 100644 --- a/main.php +++ b/main.php @@ -365,16 +365,8 @@ if ($mfs && $ids) { } } if ($setShadow) { + Template::header('Образ персонажа'); ?> - - - - - - - - -
    @@ -403,8 +395,6 @@ if ($setShadow) {
    f09 f10
    - - - - - - - - - - - - + + - Окно игры - - + document.getElementById("hint3").innerHTML = '
    ' + title + 'x
    ' + + '
    ' + + errkom + 'введите название предмета
    '; + document.getElementById("hint3").style.visibility = "visible"; + document.getElementById("hint3").style.left = '100'; + document.getElementById("hint3").style.top = '100'; + document.getElementById(name).focus(); + Hint3Name = name; + } +
    @@ -568,7 +550,8 @@ if ($edit) { room === 20): ?> - @@ -601,6 +584,4 @@ if ($edit) { - - - \ No newline at end of file + \ No newline at end of file diff --git a/module_quest.php b/module_quest.php index 2d8c815..1b21b04 100644 --- a/module_quest.php +++ b/module_quest.php @@ -6,7 +6,7 @@ if (empty($_SESSION['uid'])) { } require_once 'functions.php'; -include('classes/quests_class.php'); +require_once 'classes/quests_class.php'; $qEndNow = $_GET['end_qst_now'] ?? null; $qEnd = $_GET['end_qst'] ?? null; @@ -23,70 +23,9 @@ $qsee = ''; $qx = 0; $error = ''; +Template::header('module_quest'); ?> - - - - - - - - - + query('SELECT `vars` FROM `actions` WHERE `vars` LIKE "?S" AND `vals` = "?s" AND `uid` = ?i LIMIT 100', "%start_quest%", "go", $user->id); while ($pl = $sp->fetch_assoc()) { @@ -111,10 +50,10 @@ if ($q->error) { - +
    - - - \ No newline at end of file + \ No newline at end of file diff --git a/navig.php b/navig.php index 8960299..dd891af 100644 --- a/navig.php +++ b/navig.php @@ -33,7 +33,7 @@ -'; print' diff --git a/podzem_dialog.php b/podzem_dialog.php index e69ddde..112ce6d 100644 --- a/podzem_dialog.php +++ b/podzem_dialog.php @@ -5,9 +5,8 @@ if (empty($_SESSION['uid'])) { exit; } -include "config.php"; -include "functions.php"; -include "startpodzemel.php"; +require_once "functions.php"; +require_once "startpodzemel.php"; if ($user->battle) { header('location: fbattle.php'); exit; @@ -17,87 +16,22 @@ $fd = mysql_fetch_array($df); $cd = mysql_query("select `n18` from `podzem3` where `glava`='" . $fd['glava'] . "' and `name`='Канализация 1 этаж'"); $vb = mysql_fetch_array($cd); if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 этаж' and $vb['n18'] == '8') { + Template::header('Подземелье Луки'); ?> - - - - - - Подземка - Лука - - -
    - - - - - -
    -
    - showUserDoll(); - ?> -
    -
    - +
    + showUserDoll(); + ?> +
    - Вы получили 'Гайку силы'.

    -Лука говарит спасибо..."; + if ($ok_qwest == '1' && $_GET['d'] == '1.3') { + $sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','15','8','10','10','','3','','','','60','50','30','','','g_sila.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')"; + $res = mysql_query($sql); + mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'"); + mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'"); + if (!$res) { + echo mysql_error(); } + print"Вы получили 'Гайку силы'.

    Лука говарит спасибо..."; } - if ($ok_qwest == '1') { - if ($_GET['d'] == '1.4') { - $sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','5','4','4','10','15','','','','3','80','','50','50','','g_mudr.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')"; - $res = mysql_query($sql); - mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'"); - mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'"); - if (!$res) { - echo mysql_error(); - } - print"Вы получили 'Гайку мудрости'.

    -Лука говарит спасибо..."; + if ($ok_qwest == '1' && $_GET['d'] == '1.4') { + $sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','5','4','4','10','15','','','','3','80','','50','50','','g_mudr.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')"; + $res = mysql_query($sql); + mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'"); + mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'"); + if (!$res) { + echo mysql_error(); } + print"Вы получили 'Гайку мудрости'.

    Лука говарит спасибо..."; } } - if (($_GET['d'] == '2') && ($user['level'] >= 4) && ($user['level'] < 7)) { print"Цена-аа? У Луки много жетонов. Лука не жаадный. Лука берет 3 Гайки и отдает жетон. Лука дает жетон за целый болт. Лука дает ТРИ жетона за найденный вентиль.
    Лука дает жетоны серебрянные, если Гайки и Вентили Чистые, а Болт Длинный! Лука дает золотые жетоны, если Гайки с Резьбой, Вентиль Рабочий, а Болт Нужный!"; } @@ -365,8 +289,6 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта } else { $ze_m = $ostalos * 0.1; mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos', `massa`='$ze_m' WHERE `id`='$alls_id'"); - // mysql_query("DELETE FROM `inventory` WHERE `name`='Гайка' and owner='".$user["id"]."'"); - // mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$alls_id'");// x_mis ставим 0 } if (($user['level'] >= 4) && ($user['level'] < 7)) { if ($total_mass_v <= 0) { @@ -546,8 +468,6 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта } else { $ze_v = $ostalos_v * 0.2; mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos_v',`massa`='$ze_v' WHERE `id`='$vls_id'"); - // mysql_query("DELETE FROM `inventory` WHERE `name`='Вентиль' and `x_mis`='0' and owner='".$user["id"]."'"); - // mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$vls_id'");// x_mis ставим 0 } if (($user['level'] >= 4) && ($user['level'] < 7)) { if ($total_mass_b <= 0) { @@ -726,11 +646,9 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта } else { $ze_b = $ostalos_b * 0.1; mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos_b',`massa`='$ze_b' WHERE `id`='$bls_id'"); - // mysql_query("DELETE FROM `inventory` WHERE `name`='Болт' and owner='".$user["id"]."'"); - // mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$bls_id'");// x_mis ставим 0 } - if ($ziton != '0') {//1 + if (!empty($ziton) { $g = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'")); $koll = $g["maxdur"]; $mas = $ziton * 0.1; @@ -738,12 +656,11 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта mysql_query("UPDATE `inventory` SET maxdur=maxdur+$ziton, massa=massa+$mas,`present`='Лука' WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Жетон'"); } else { $mas = $ziton * 0.1; - $fo = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa,present) VALUES('Жетон','0','$ziton','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')"); } - }//1 + } - if ($ziton_v != '0') {//1 + if (!empty($ziton_v)) { $gv = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'")); $kollv = $gv["maxdur"]; $mas = $ziton_v * 0.1; @@ -753,9 +670,9 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта $mas = $ziton_v * 0.1; $fov = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa, present) VALUES('Жетон','0','$ziton_v','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')"); } - }//1 + } - if ($ziton_b != '0') {//1 + if (!empty($ziton_b)) { $gb = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'")); $kollb = $gb["maxdur"]; $mas = $ziton_b * 0.1; @@ -765,9 +682,9 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта $mas = $ziton_b * 0.1; $fob = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa, present) VALUES('Жетон','0','$ziton_b','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')"); } - }//1 + } - if ($ziton <= 0 and $ziton_v <= 0 and $ziton_b <= 0) { + if (empty($ziton) && empty($ziton_v) && empty($ziton_b)) { print" ИХ больше у тебя нету... Неси еще, Луке нужно больше ИХ! "; } if ($ziton > 0) { @@ -794,75 +711,40 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта if ($_GET['d'] == '7') { if ($qwest != '1') { $T1 = mysql_query("INSERT INTO qwest (user_id,login,name_qwest,name_items,id_items,dlja,zadanie,kw,status) VALUES('" . $user['id'] . "','" . $user['login'] . "','kluchiik','Ключиик','','Лука','Найти ключиик','0','no')"); - print"Вы приняли задание.(Найти 'ключиик').

    + print"Вы приняли задание.(Найти 'ключиик').

    Хорошо... Лука будет ждать..."; } else { - print"Вы уже приняли задание.(Найти 'ключиик').

    + print"Вы уже приняли задание.(Найти 'ключиик').

    Ну что? Лука ждёт..."; } } } ?> -
    - - -

    - -

    + Запах?? Ты вообще о чем?
    "; - } - if (!isset($_GET['d'])) { print"• Я тут гайки-вентили нашел, тебе они случайно не нужны?
    "; - } - if ($qwest_status != 'ok') { - if ($ok_qwest == '1') { - if (!isset($_GET['d'])) { - print"• Вот твой ключиик!
    "; - } + if ($qwest_status != 'ok' && $ok_qwest == '1') { + print"• Вот твой ключиик!
    "; } - } - if (!isset($_GET['d'])) { print"• Я, пожалуй, пойду.
    "; } - if ($_GET['d'] == '1') { print"• Понятно. Но я хотел поговорить о другом.
    "; - } - if ($_GET['d'] == '1') { print"• Я, пожалуй, пойду.
    "; } - if ($_GET['d'] == '1.1') { print"• Я хочу знать, сколько жетонов ты мне дашь.
    "; - } - if ($_GET['d'] == '1.1') { print"• Я хочу поменять ИХ на жетоны.
    "; - } - if ($_GET['d'] == '1.1') { print"• С гайками все ясно. Вернемся назад.
    "; - } - if ($_GET['d'] == '1.1') { print"• Я, пожалуй, пойду.
    "; } - - if ($ok_qwest == '1') { - if ($_GET['d'] == '1.2') { - print"• Выбераю Гайку силы.
    "; - } - } - if ($ok_qwest == '1') { - if ($_GET['d'] == '1.2') { - print"• Выбераю Гайку мудрости.
    "; - } - } - if ($ok_qwest == '1') { - if ($_GET['d'] == '1.2') { - print"• Я, пожалуй, пойду..
    "; - } + if ($ok_qwest == '1' && $_GET['d'] == '1.2') { + print"• Выбераю Гайку силы.
    "; + print"• Выбераю Гайку мудрости.
    "; + print"• Я, пожалуй, пойду..
    "; } if ($_GET['d'] == '1.3') { print"• Я, пожалуй, пойду.
    "; @@ -870,61 +752,39 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта if ($_GET['d'] == '1.4') { print"• Я, пожалуй, пойду.
    "; } - if ($_GET['d'] == '2') { print"• Я хочу поменять ИХ на жетоны.
    "; - } - if ($_GET['d'] == '2') { print"• Спасибо, за прайс-лист.
    "; - } - if ($_GET['d'] == '2') { print"• Я, пожалуй, пойду.
    "; } - - if ($_GET['d'] == '3') { print"• Я хотел еще спросить...
    "; - } - if ($_GET['d'] == '3') { print"• Хорошо, пойду еще принесу.
    "; } - if ($_GET['d'] == '4') { print"• Что ты там говорил про гайки-вентили?
    "; - } - if ($_GET['d'] == '4') { print"• Расскажи мне о себе.
    "; - } - if ($_GET['d'] == '4') { print"• Я, пожалуй, пойду.
    "; } - if ($_GET['d'] == '5') { print"• Что ты там говорил про гайки-вентили?
    "; } - if ($qwest != '1') { - if ($_GET['d'] == '5') { - print"• Может помочь чем?
    "; - } + if ($qwest != '1' && $_GET['d'] == '5') { + print"• Может помочь чем?
    "; } if ($_GET['d'] == '5') { print"• Я, пожалуй, пойду.
    "; } - if ($_GET['d'] == '6') { print"• Я помогу тебе... принесу я ключиик... жди!
    "; - } - if ($_GET['d'] == '6') { print"• Да ну тя сам разберайся.
    "; } - if ($_GET['d'] == '7') { print"• Я, пойду.(конец диалога).
    "; } - - - print"

    "; + print""; ?> +

    - - \ No newline at end of file +} \ No newline at end of file diff --git a/post.php b/post.php index c5bd1fb..524fc67 100644 --- a/post.php +++ b/post.php @@ -77,15 +77,9 @@ if ($_SESSION['receiverName']) { } } } +Template::header('Почта'); ?> - - - - - - -
    @@ -143,5 +137,3 @@ if ($_SESSION['receiverName']) { - - diff --git a/presents.php b/presents.php index 336b491..e16a5fe 100644 --- a/presents.php +++ b/presents.php @@ -18,7 +18,7 @@ if ($_SESSION['uid'] != 2) header("Location: index.php"); require_once 'config.php'; $user = new User($_SESSION['uid']); - +$status = ''; $dirname = "i/presents/"; $images = glob($dirname . "*.png"); @@ -48,11 +48,9 @@ if (!empty($_POST['sendAction'])) { if ($_POST['sender'] == 1) { $sender = "Анонимный подарок"; - } - elseif ($_POST['sender'] == 2 && $user->clan) { + } elseif ($_POST['sender'] == 2 && $user->clan) { $sender = "Подарок от клана {$user->clan}"; - } - else { + } else { $sender = "Подарок от {$user->login}"; } @@ -64,34 +62,27 @@ if (!empty($_POST['sendAction'])) { db::c()->query('INSERT INTO `telegraph` (receiver, text) VALUES (?i,"?s")', $receiver['id'], $telegraphText); $status = "Подарок удачно доставлен к {$_POST['receiver']}! Вы потратили {$cost} кр."; } +Template::header('Дарильня'); ?> - - - - - - - - - - -

    Магазин подарков

    -
    + label.present > input:checked + img { /* (RADIO CHECKED) IMAGE STYLES */ + border: 1px solid darkred; + background: lightcoral; + } + +

    Дарильня

    +
    Вы можете сделать подарок любому персонажу. Ваш подарок будет отображаться в информации о персонаже.

    @@ -119,6 +110,4 @@ if (!empty($_POST['sendAction'])) {
    -
    - - \ No newline at end of file + \ No newline at end of file diff --git a/quest_room.php b/quest_room.php index 9ca5c0d..c6ce1cb 100644 --- a/quest_room.php +++ b/quest_room.php @@ -5,7 +5,7 @@ if (empty($_SESSION['uid'])) { } require_once 'functions.php'; include('classes/quests_class.php'); - +$status = ''; $get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING')); if ($get == 'exit') { @@ -54,22 +54,17 @@ function info_quest($id) if (!empty($q->error)) { $status = $q->error; } +Template::header('Памятник'); ?> - - - - - -
    - + level < 5 || $user->admin) && $user->health < $user->maxHealth): ?>

    Памятник

    -
    +
    На памятнике выгравированы опасные задания, за выполнение которых можно получить достойную награду! Для каждого задания отводится определенный промежуток времени, если задание не сдано вовремя, то @@ -77,6 +72,4 @@ if (!empty($q->error)) {
    -
    - - \ No newline at end of file + \ No newline at end of file diff --git a/register.php b/register.php index f01fb84..e0907f7 100644 --- a/register.php +++ b/register.php @@ -32,15 +32,8 @@ if ($hreject) { } } } +Template::header('Регистрация персонажа'); ?> - - - - - - Регистрация персонажа - - ← на главную

    @@ -56,6 +49,4 @@ if ($hreject) {
    - - - \ No newline at end of file + \ No newline at end of file diff --git a/rememberpassword.php b/rememberpassword.php index 598a9fe..ec0ca42 100644 --- a/rememberpassword.php +++ b/rememberpassword.php @@ -25,6 +25,7 @@ function mail_send($to, $from_user, $from_email, $subject = '(No subject)', $mes return mail($to, $subject, $message, $headers); } + if ($login) { $loginCheck = db::c()->query('SELECT email FROM users WHERE login = "?s"', $login)->fetch_assoc(); if ($loginCheck) { @@ -55,8 +56,7 @@ if ($login) { if ($changePassword) { if (db::c()->query('SELECT 1 FROM users_recovery WHERE `hash` = "?s" AND `date` < "?s"', $changePassword, date('Y-m-d'))->getNumRows()) { $allowChange = true; - } - else { + } else { $statusMessage = ERROR_OLD_HASH; } } @@ -72,16 +72,9 @@ if ($newPassword && $hashCheck) { $statusMessage = ERROR_WRONG_HASH; } } +Template::header('Восстановление пароля'); ?> - - - - - - Восстановление пароля - - - ← на главную + ← на главную

    @@ -101,6 +94,4 @@ if ($newPassword && $hashCheck) {
    - - - \ No newline at end of file +query('SELECT `id`,`name`,`img`,`text` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 3 AND `name` NOT LIKE "?S" AND `setsale` = 0 OR `text` <> "?s" AND `owner` = ?i AND `dressed` = 0 AND `setsale` = 0 ORDER by `update` DESC', $_SESSION['uid'], '%Букет%', '', $_SESSION['uid']); } +Template::header('Кузня'); ?> - - - - - - - -

    Ремонтная мастерская

    ← выйти из мастерской
    @@ -205,6 +198,4 @@ if ($goto == 'podgon') { } } ?> -
    - - \ No newline at end of file + \ No newline at end of file diff --git a/shop.php b/shop.php index 4c8c290..58ef91a 100644 --- a/shop.php +++ b/shop.php @@ -91,7 +91,7 @@ switch ($shopCategoryTypeNumber) { break; } -if (false == $saleItems) { +if (!$saleItems) { $shopItems = db::c()->query('SELECT `shop`.*, `magic`.`name` AS `magic_name`, `magic`.`chanse` AS `magic_chanse`, @@ -130,7 +130,7 @@ ORDER BY `update` DESC', null, $_SESSION['uid']); } -$sellItemId = filter_input(INPUT_GET, 'sell'); +$sellItemId = $_GET['sell'] ?? 0; if ($sellItemId) { $dress = db::c()->query('SELECT `id`, `name`, `cost`, `koll` FROM `inventory` WHERE `dressed` = 0 AND `artefact` = 0 AND `id` = ?i AND `owner` = ?i', $sellItemId, $user['id'])->fetch_assoc(); @@ -142,9 +142,14 @@ if ($sellItemId) { $allcost = mt_rand(0, $dress['cost'] / 2); db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $dress['id']); + //todo подключить банковский класс db::c()->query('UPDATE `users` SET `money` = `money` + ?i WHERE `id` = ?i', $allcost, $_SESSION['uid']); - if ($allcost == 0) $status = "После длительных и изнурительных торгов вы плюнули на всё и просто подарили ваш «{$dress['name']}» торговцу."; - else $status = "Вы продали «{$dress['name']}» $kols за " . $allcost . " кр."; + if ($allcost == 0) { + $status = "После длительных и изнурительных торгов вы плюнули на всё и просто подарили ваш «{$dress['name']}» торговцу."; + } else { + $status = "Вы продали «{$dress['name']}» $kols за " . $allcost . " кр."; + } + $deloText = "{$user['login']} продал товар «{$dress['name']}» {$kols}id:({$dress['id']}) в магазине за {$allcost} кр."; addToDelo($deloText); // Для обновления данных о деньгах на странице @@ -155,8 +160,10 @@ if (!empty($_GET['buy'])) { $dress = db::c()->query('SELECT * FROM `shop` WHERE `id`=?i', $_GET['buy'])->fetch_assoc(); $itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $_SESSION['uid'])->fetch_assoc(); - if (($dress['massa'] + $itemWeight['m']) > (get_meshok())) $status = 'Недостаточно места в рюкзаке.'; - elseif ($user['money'] >= $dress['cost'] AND ($dress['count'] > 0 OR $dress['count'] == -1)) { + if (($dress['massa'] + $itemWeight['m']) > (get_meshok())) { + $status = 'Недостаточно места в рюкзаке.'; + } + elseif ($user['money'] >= $dress['cost'] && ($dress['count'] > 0 || $dress['count'] == -1)) { $newItem = [ 'prototype' => $dress['id'], 'owner' => $user['id'], @@ -227,7 +234,9 @@ if (!empty($_GET['buy'])) { db::c()->query('INSERT INTO `inventory` SET ?A[?i,?i,"?s",?i,?i,?i,"?s",?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i]', $newItem); $inventoryItemId = db::c()->getLastInsertId(); - if ($dress['count'] != -1) db::c()->query('UPDATE `shop` SET `count` = `count` - 1 WHERE `id` = ?i', $_GET['buy']); + if ($dress['count'] != -1) { + db::c()->query('UPDATE `shop` SET `count` = `count` - 1 WHERE `id` = ?i', $_GET['buy']); + } $status = "Вы купили «{$dress['name']}» за {$dress['cost']} кр."; db::c()->query('UPDATE `users` set `money` = `money` - ?i WHERE `id` = ?i', $dress['cost'], $_SESSION['uid']); $deloText = "{$user['login']} купил товар «{$dress['name']}» id:({$inventoryItemId}) в магазине за {$dress['cost']} кр."; @@ -239,15 +248,9 @@ if (!empty($_GET['buy'])) { $status = "Недостаточно денег или нет вещей в наличии."; } } +Template::header('Магазин'); ?> - - - - - - -

    Государственный магазин

    ← выйти на Центральную площадь
    @@ -317,6 +320,4 @@ if (!empty($_GET['buy'])) {
    - - - \ No newline at end of file + \ No newline at end of file diff --git a/stat_battle.php b/stat_battle.php deleted file mode 100644 index a1ea730..0000000 --- a/stat_battle.php +++ /dev/null @@ -1,366 +0,0 @@ - - - - - - - - -

    Статистика боя

    - -Тип боя: -Продолжительность боя: мин. -
    - - -
    - -

    Последовательность ударов

    - - - - - - - - "; - $an2 = ""; - asort($unique); - foreach ($unique as $u) { - echo " - - - - - - "; - } - ?> - - -
    ЛогинУдар вПоследовательность ударов
    " . $u . "голову
    грудь
    живот
    пояс
    ноги
    "; - $c = count($hits); - $excl = [2, 3, 4, 5]; - for ($i = 0; $i <= $c; $i++) { - if (!$hits[$i][$u]['hits']) { - $i++; - } - if ($hits[$i][$u]['hits'] == 1) { - echo "X"; - } elseif ($hits[$i][$u]['hits'] == 665) { - echo "X"; - } elseif (in_array($hits[$i][$u]['hits'], $excl)) { - echo "$anX$an2"; - } - } - echo "
    "; - $excl = [1, 3, 4, 5, 665]; - for ($i = 0; $i < $c; $i++) { - if (!$hits[$i][$u]['hits']) { - $i++; - } - if ($hits[$i][$u]['hits'] == 2) { - echo "X"; - } elseif (in_array($hits[$i][$u]['hits'], $excl)) { - echo "$anX$an2"; - } - } - echo "
    "; - $excl = [1, 2, 4, 5, 665]; - for ($i = 0; $i < $c; $i++) { - if (!$hits[$i][$u]['hits']) { - $i++; - } - if ($hits[$i][$u]['hits'] == 3) { - echo "X"; - } elseif (in_array($hits[$i][$u]['hits'], $excl)) { - echo "$anX$an2"; - } - } - echo "
    "; - $excl = [1, 3, 2, 5, 665]; - for ($i = 0; $i < $c; $i++) { - if (!$hits[$i][$u]['hits']) { - $i++; - } - if ($hits[$i][$u]['hits'] == 4) { - echo "X"; - } elseif (in_array($hits[$i][$u]['hits'], $excl)) { - echo "$anX$an2"; - } - } - echo "
    "; - $excl = [1, 3, 4, 2, 665]; - for ($i = 0; $i < $c; $i++) { - if (!$hits[$i][$u]['hits']) { - $i++; - } - if ($hits[$i][$u]['hits'] == 5) { - echo "X"; - } elseif (in_array($hits[$i][$u]['hits'], $excl)) { - echo "$anX$an2"; - } - } - echo "
    "; - echo " -
    -(X - удачный удар, X - критический удар, Ξ - крит + инвалидность, X - доп. магический удар,
    - -  - противник блокировал удар,  - увернулся, - - парировал,  - отбил -удар щитом) - -

    Последовательность блоков

    - - - - - - - $dd) { - $hits[][$r[0]]['defs'][$k] = $dd; - } - if (!in_array($r[0], $unique)) { - $unique[] = $r[0]; - } - } - - $an = ""; - $an2 = ""; - asort($unique); - foreach ($unique as $u) { - echo ""; - } - ?> - - -
    ЛогинБлокПоследовательность блоков
    " . $u . "голова
    грудь
    живот
    пояс
    ноги
    "; - $c = count($hits) - 1; - $excl = ["00", "01", "10", "11"]; - for ($i = 0; $i <= $c; $i++) { - if (!in_array($hits[$i][$u]['defs'][0], $excl)) { - $i++; - } - if ($hits[$i][$u]['defs'][0] == "11") { - echo "X"; - } elseif ($hits[$i][$u]['defs'][0] == "10") { - echo ""; - } else { - echo "$anX$an2"; - }//} - } - echo "
    "; - for ($i = 0; $i <= $c; $i++) { - if (!in_array($hits[$i][$u]['defs'][1], $excl)) { - $i++; - } - if ($hits[$i][$u]['defs'][1] == "11") { - echo "X"; - } elseif ($hits[$i][$u]['defs'][1] == "10") { - echo ""; - } else { - echo "$anX$an2"; - }//} - } - echo "
    "; - for ($i = 0; $i <= $c; $i++) { - if (!in_array($hits[$i][$u]['defs'][2], $excl)) { - $i++; - } - if ($hits[$i][$u]['defs'][2] == "11") { - echo "X"; - } elseif ($hits[$i][$u]['defs'][2] == "10") { - echo ""; - } else { - echo "$anX$an2"; - }//} - } - echo "
    "; - for ($i = 0; $i <= $c; $i++) { - if (!in_array($hits[$i][$u]['defs'][3], $excl)) { - $i++; - } - if ($hits[$i][$u]['defs'][3] == "11") { - echo "X"; - } elseif ($hits[$i][$u]['defs'][3] == "10") { - echo ""; - } else { - echo "$anX$an2"; - }//} - } - echo "
    "; - for ($i = 0; $i <= $c; $i++) { - if (!in_array($hits[$i][$u]['defs'][4], $excl)) { - $i++; - } - if ($hits[$i][$u]['defs'][4] == "11") { - echo "X"; - } elseif ($hits[$i][$u]['defs'][4] == "10") { - echo ""; - } else { - echo "$anX$an2"; - }//} - } - echo "
    -(X - удачный блок, X - пробили блок критом,  - пропустил -удар, - - увернулся - - парировал - - отбил щитом) - -

    "; -foreach ($summary as $k) { - //echo $k.'
    '; - $r = explode("|", $k); - - if ($r[5] == 'udar') { - $hit[$r[0]] += $r[6]; - } - if ($r[0] == 'user_team1') { - $team1_users[$r[1]] = $r[2]; - } - if ($r[0] == 'user_team2') { - $team2_users[$r[1]] = $r[2]; - } - if ($r[1] == 'B1' or $r[1] == 'B2') { - $where_hit[$r[0]][$r[4]] += 1; - } -} - -?> - - -

    Суммарно

    - - - - - - - - - - - - - "; - } - echo ""; - - if (strpos($data['t2'], ';')) { - $team2 = explode(";", $data['t2']); - } else { - $team2[0] = $data['t2']; - } - for ($i = 0; $i < count($team2); $i++) { - - $sData = substr($team2_users[$team2[$i]], -12); - preg_match('/\[(.*?)\//', $sData, $rgMatches1); - $sum_hp2[1] += substr($rgMatches1[0], 1, strlen($rgMatches1[0]) - 1); - preg_match('/\/(.*?)\]/', $sData, $rgMatches2); - $sum_hp2[2] += substr($rgMatches2[0], 1, strlen($rgMatches2[0]) - 1); - - echo ""; - } - echo ""; - ?> - -
    ЛогинУдарыБлокиПопаданияЗащитаУронПотериВылечено
    " . $team1_users[$team1[$i]] . "" . (!empty($where_hit[$team1[$i]][1]) ? $where_hit[$team1[$i]][1] : 0) . "/" . (!empty($where_hit[$team1[$i]][2]) ? $where_hit[$team1[$i]][2] : 0) . "/" . (!empty($where_hit[$team1[$i]][3]) ? $where_hit[$team1[$i]][3] : 0) . "/" . (!empty($where_hit[$team1[$i]][4]) ? $where_hit[$team1[$i]][4] : 0) . "/" . (!empty($where_hit[$team1[$i]][5]) ? $where_hit[$team1[$i]][5] : 0) . "0/0/0/0/00(0)00/0/00/000
    Всего[" . $sum_hp1[1] . "/" . $sum_hp1[2] . "]00000
    " . $team2_users[$team2[$i]] . "" . (!empty($where_hit[$team2[$i]][1]) ? $where_hit[$team2[$i]][1] : 0) . "/" . (!empty($where_hit[$team2[$i]][2]) ? $where_hit[$team2[$i]][2] : 0) . "/" . (!empty($where_hit[$team2[$i]][3]) ? $where_hit[$team2[$i]][3] : 0) . "/" . (!empty($where_hit[$team2[$i]][4]) ? $where_hit[$team2[$i]][4] : 0) . "/" . (!empty($where_hit[$team2[$i]][5]) ? $where_hit[$team2[$i]][5] : 0) . "0/0/0/0/00(0)00/0/00/000
    Всего[" . $sum_hp2[1] . "/" . $sum_hp2[2] . "]00000
    - -Логин - имя персонажа и уровень жизни: [сейчас/всего]
    -Удары - статистика ударов по областям: голова/грудь/живот/пояс/ноги
    - -Блоки - статистика блоков по областям: голова/грудь/живот/пояс/ноги
    -Попадания - удачных попаданий (из них критов) / всего ударов
    -Защита - ударов заблокировано / уворотов / пропущено ударов
    -Урон - выбито HP из противников / из них критами
    -Потери - получено повреждений
    -Вылечено - восстановлено HP
    - - - \ No newline at end of file diff --git a/top_menu.php b/top_menu.php index 3a1cf3b..f64337e 100644 --- a/top_menu.php +++ b/top_menu.php @@ -1,7 +1,4 @@ - - - - + - - - -
    + function closehint3() { + document.all("hint3").style.visibility = "hidden"; + Hint3Name = ''; + } + +
    @@ -337,453 +319,454 @@ if ($user['hp'] <= 0) { onclick="findlogin('Напасть на','towerin.php','attack')"> - -
    - + + - room . "';"); - if (mysql_num_rows($its) > 0) { - echo '

    В комнате разбросаны вещи:

    '; - } - while ($it = mysql_fetch_array($its)) { - echo ' Подобрать предмет \'', $it['name'], '\''; - } - - ?> -
    - - + - function Down() { - top.CtrlPress = window.event.ctrlKey; - } - - document.onmousedown = Down; - - - - - - -
    - - - - - - - - - - -
    -
    - -
    -
    -
    - - - - -
    - -
    -
    -
    - -
    - - - - -
    - - - - - - - + if (mtime > 0) { + progress_clear(); + progress_update(); + } else { + for (var i = 1; i <= progressEnd; i++) { + document.getElementById('progress' + i).style.backgroundColor = progressColor; + } + } + + +
    - +
    + + + + +
    + + + + + + - - - - - - - + + + +
    +
    +
    +
    +
    + - - - - -
    - - - - -
    -
    - -
    -
    -
    - - - - - - - - - - - - - - - - -
    - room][4]]) { - echo 'id="m7"'; - } ?> href="?rnd=0.817371946556865&path=4">room][4]]) { - echo 'i'; - } ?>nmousemove="fastshow2('room][4]] ?>');" - onmouseout="hideshow();"/>
    -
    - - - - - - - - -
    - room][1]]) { - echo 'id="m1"'; - } ?> href="?rnd=0.817371946556865&path=1">room][1]]) { - echo 'i'; - } ?>onmousemove="fastshow2('room][1]] ?>');" - onmouseout="hideshow();"/>
    - room][3]]) { - echo 'id="m5"'; - } ?> href="?rnd=0.817371946556865&path=3">room][3]]) { - echo 'i'; - } ?>onmousemove="fastshow2('room][3]] ?>');" - onmouseout="hideshow();"/>
    -
    - - - - - - - - - - - - - - - - -
    room][2]]) { - echo 'id="m3"'; - } ?> href="?rnd=0.817371946556865&path=2">room][2]]) { - echo 'i'; - } ?>onmousemove="fastshow2('room][2]] ?>');" - onmouseout="hideshow();"/>
    -
    +
    + + + + +
    + + + + + + + + + + + + +
    + + + + + + +
    + + + + +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + +
    + room][4]]) { + echo 'id="m7"'; + } ?> href="?rnd=0.817371946556865&path=4">room][4]]) { + echo 'i'; + } ?>nmousemove="fastshow2('room][4]] ?>');" + onmouseout="hideshow();"/>
    +
    + + + + + + + + + + +
    + room][1]]) { + echo 'id="m1"'; + } ?> href="?rnd=0.817371946556865&path=1">room][1]]) { + echo 'i'; + } ?>onmousemove="fastshow2('room][1]] ?>');" + onmouseout="hideshow();"/>
    +
    + room][3]]) { + echo 'id="m5"'; + } ?> href="?rnd=0.817371946556865&path=3">room][3]]) { + echo 'i'; + } ?>onmousemove="fastshow2('room][3]] ?>');" + onmouseout="hideshow();"/>
    +
    + + + + + + + + + + + + + + + + +
    room][2]]) { + echo 'id="m3"'; + } ?> href="?rnd=0.817371946556865&path=2">room][2]]) { + echo 'i'; + } ?>onmousemove="fastshow2('room][2]] ?>');" + onmouseout="hideshow();"/>
    +
    +
    +
    + + -
    -
    -Всего живых участников на данный момент : ".$kol_pl." + ".$ls.""; ?>...
    +
    +Всего живых участников на данный момент : " . $kol_pl . " + " . $ls . ""; ?>...
    - - - \ No newline at end of file + \ No newline at end of file diff --git a/towerlog.php b/towerlog.php index 2ebe230..d6372ef 100644 --- a/towerlog.php +++ b/towerlog.php @@ -1,15 +1,5 @@ - - - - - Башня смерти. Отчет о турнире #<? echo $tr['id']; ?> - - -

    Башня смерти. Отчет о турнире.

    -Призовой фонд : кр.

    - - \ No newline at end of file +Template::header('Башня смерти. Отчет о турнире #'. $tr['id']); +echo sprintf('

    Башня смерти. Отчет о турнире.

    %s кр.
    %s', $tr['coin'], $tr['log']); \ No newline at end of file diff --git a/towerstamp.php b/towerstamp.php index ccded6f..3ad4108 100644 --- a/towerstamp.php +++ b/towerstamp.php @@ -40,16 +40,9 @@ if($_GET['setdef']){ mysql_query("UPDATE `deztow_charstams` SET `def` = 0 WHERE `owner` = '{$user['id']}' AND `id` != ".(int)$_GET['setdef'].""); echo "Сохранено.".mysql_error(); } + +Template::header('towerstamp'); ?> - - - - - - - - -

    Профили характеристик

    Статы не позволяют сходить в БС? Раскиньте ваши статы так, как вы хотите, и участвуйте в турнире! Выбранный по умолчанию профиль, загрузится сам. Вы можете создавать неограниченное число профилей, и менять их за секунды до турнира!

    @@ -111,6 +104,4 @@ if($_GET['setdef']){
    - - - \ No newline at end of file + \ No newline at end of file diff --git a/ul_clans.php b/ul_clans.php index 560f808..b286342 100644 --- a/ul_clans.php +++ b/ul_clans.php @@ -5,7 +5,6 @@ if (empty($_SESSION['uid'])) { exit; } - require_once "config.php"; $user = new User($_SESSION['uid']); @@ -19,38 +18,22 @@ if ($user->battle) { exit; } -if ($_GET['id']) { +if ($_GET['id'] && $user->admin) { echo "Пробуем перейти на выбранную замковую улицу..."; $_SESSION["klan"] = $_GET['klan']; $a = $_GET['klan']; - db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 651, `online`.`room` = 651 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i',$_SESSION['uid']); + db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 651, `online`.`room` = 651 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']); header("location: city.php"); -} else { -?> - - - - - - - -← назад -

    Переход к клановым улицам

    -На данный момент свои замки имеют такие кланы: - -query('SELECT `id`,`short`,`align`,`name` FROM `clans` WHERE `zamok` = 2'); - while ($row = $query->fetch_assoc()) { - // $id = $row['id']; - // $s = $row['short']; - // echo " $s"; - // echo '
    '; - // echo ""; - // echo '

    '; - $frm = " %s
    "; - echo sprintf($frm,$row['align'],$row['short'],$row['name'],$row['id']); - } + exit; } +Template::header('Клановый перекрёсток'); ?> - - \ No newline at end of file + ← назад +

    Переход к клановым улицам

    + На данный момент свои замки имеют такие кланы: +query('SELECT `id`,`short`,`align`,`name` FROM `clans` WHERE `zamok` = 2'); +while ($row = $query->fetch_assoc()) { + $frm = " %s
    "; + echo sprintf($frm, $row['align'], $row['short'], $row['name'], $row['id']); +} diff --git a/user_abilities.php b/user_abilities.php index 86d28c6..a4578c6 100644 --- a/user_abilities.php +++ b/user_abilities.php @@ -17,26 +17,6 @@ if (!empty($_GET['teleport']) && $user->admin == 1) { db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']); } - -?> - - - - - - - - -
    - admin == 1): ?> - - - -
    -

    Особые умения

    -
    -query('SELECT `accses`,`name` FROM `aligns` WHERE `align` = ?i', $user->align)->fetch_assoc(); $moj = expa($al['accses']); @@ -252,246 +232,6 @@ if (in_array($_POST['use'], array_keys($moj))) { } } - -echo "


    "; -foreach ($moj as $k => $v) { - switch ($k) { - case "sleep": - $script_name = "runmagic0"; - $magic_name = "Наложить заклятие молчания"; - break; - case "sleepf": - $script_name = "runmagicf"; - $magic_name = "Наложить заклятие форумного молчания"; - break; - case "healing": - $script_name = "runmagic1"; - $magic_name = "Лечение"; - break; - case "al_neut_power": - $script_name = "RunMagicSelf"; - $magic_name = "Сила нейтралитета"; - break; - case "ct1": - $script_name = "runmagic1"; - $magic_name = "Исцелить легкую травму"; - break; - case "ct2": - $script_name = "runmagic1"; - $magic_name = "Исцелить среднюю травму"; - break; - case "ct3": - $script_name = "runmagic1"; - $magic_name = "Исцелить тяжелую травму"; - break; - case "sleep_off": - $script_name = "runmagic1"; - $magic_name = "Снять заклятие молчания"; - break; - case "sleepf_off": - $script_name = "runmagic1"; - $magic_name = "Снять заклятие форумного молчания"; - break; - case "haos": - $script_name = "runmagic2"; - $magic_name = "Наложить заклятие хаоса"; - break; - case "haos_off": - $script_name = "runmagic1"; - $magic_name = "Снять заклятие хаоса"; - break; - case "death": - $script_name = "runmagic1"; - $magic_name = "Наложить заклятие смерти"; - break; - case "death_off": - $script_name = "runmagic1"; - $magic_name = "Снять заклятие смерти"; - break; - case "obezl": - $script_name = "runmagic2"; - $magic_name = "Наложить заклятие обезличивания"; - break; - case "obezl_off": - $script_name = "runmagic1"; - $magic_name = "Снять заклятие обезличивания"; - break; - case "pal_off": - $script_name = "runmagic1"; - $magic_name = "Лишить звания Паладин"; - break; - case "attack": - $script_name = "runmagic1"; - $magic_name = "Нападение"; - break; - case "attack_t": - $script_name = "runmagic1"; - $magic_name = "Нападение на Темного"; - break; - case "battack": - $script_name = "runmagic1"; - $magic_name = "Кровавое нападение"; - break; - case "attackk_close": - $script_name = "runmagic1"; - $magic_name = "Кулачное закрытое кровавое нападение"; - break; - case "attackk_open": - $script_name = "runmagic1"; - $magic_name = "Кулачное закрытое нападение"; - break; - case "marry": - $script_name = "runmagic4"; - $magic_name = "Зарегистрировать брак"; - break; - case "unmarry": - $script_name = "runmagic4"; - $magic_name = "Расторгнуть брак"; - break; - case "hidden": - $script_name = "runmagic1"; - $magic_name = "Заклятие невидимости"; - break; - case "teleport": - $script_name = "runmagic"; - $magic_name = "Телепортация"; - break; - case "check": - $script_name = "runmagic1"; - $magic_name = "Поставить проверку"; - break; - case "ct_all": - $script_name = "runmagic1"; - $magic_name = "Вылечить от травм"; - break; - case "pal_buttons": - $script_name = "runmagic1"; - $magic_name = "Отметить о прохождении проверки"; - break; - case "vampir": - $script_name = "runmagic1"; - $magic_name = "Вампиризм (выпить энергию другого игрока)"; - break; - case "brat": - $script_name = "runmagic1"; - $magic_name = "Помочь темному собрату (вмешаться в поединок)"; - break; - case "dneit": - $script_name = "runmagic1"; - $magic_name = "Присвоить склонность (Нейтральное Братство)"; - break; - case "dpal": - $script_name = "runmagic"; - $magic_name = "Присвоить склонность (Паладин)"; - break; - case "ddark": - $script_name = "runmagic1"; - $magic_name = "Присвоить склонность (Темное Братство)"; - break; - case "dlight": - $script_name = "runmagic1"; - $magic_name = "Присвоить склонность (Светлое Братство)"; - break; - case "un_align": - $script_name = "runmagic1"; - $magic_name = "Лишить склонности"; - break; - case "note": - $script_name = "runmagic"; - $magic_name = "Редактировать личное дело"; - break; - case "sys": - $script_name = "runmagic"; - $magic_name = "Отправить в чат системное сообщение"; - break; - case "scanner": - $script_name = "runmagic"; - $magic_name = "Показать лог действий модератора"; - break; - case "rep": - $script_name = "runmagic"; - $magic_name = "Отчет о переводах"; - break; - case "rost": - $script_name = "runmagic"; - $magic_name = "Присвоить статус"; - break; - case "ldadd": - $script_name = ""; - $magic_name = "Записать причину отправки в Хаос"; - break; - case "crush": - $script_name = "runmagic1"; - $magic_name = "Сокрушение"; - break; - case "def": - $script_name = "runmagic1"; - $magic_name = "Защита от оружия"; - break; - case "bexit": - $script_name = "runmagic1"; - $magic_name = "Выйти из боя"; - break; - } - - if ($script_name) { - $action_ok = 1; - $abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc(); - $abil = unserialize($abil['abil']); - - if ($user->align == 2) { - if ($k == 'al_neut_power' && $abil[0] < 1) { - $action_ok = 0; - } - if ($k == 'attackk_close' && $abil[1] < 1) { - $action_ok = 0; - } - if ($k == 'attackk_open' && $abil[2] < 1) { - $action_ok = 0; - } - } - if ($user->align == 6) { - if ($k == 'ct1' && $abil[0] < 1) { - $action_ok = 0; - } - if ($k == 'ct2' && $abil[1] < 1) { - $action_ok = 0; - } - if ($k == 'ct3' && $abil[2] < 1) { - $action_ok = 0; - } - } - } - if ($action_ok > 0) { - print " "; - } -} -if ($user->align == 2) // Нейтралы -{ - - $abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc(); - $abil = unserialize($abil['abil']); - for ($i = 0; $i < 3; $i++) if (!$abil[$i]) $abil[$i] = 0; - echo("
    Осталось использований:
    "); - echo(" Сила нейтралитета - " . $abil[0] . "
    "); - echo(" Кулачное закрытое кровавое нападение - " . $abil[1] . "
    "); - echo(" Кулачное закрытое нападение - " . $abil[2] . "
    "); -} - -if ($user->align == 6) // Свет -{ - - $abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc(); - $abil = unserialize($abil['abil']); - for ($i = 0; $i < 3; $i++) if (!$abil[$i]) $abil[$i] = 0; - echo("
    Осталось использований:
    "); - echo(" Исцелить легкую травму - " . $abil[0] . "
    "); - echo(" Исцелить среднюю травму - " . $abil[1] . "
    "); - echo(" Исцелить тяжелую травму - " . $abil[2] . "
    "); -} - -echo "
    "; - #RELIKT PHP function klan_relicts() { @@ -802,8 +542,264 @@ if (empty($user->clan)) { $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['uid'])->fetch_assoc(); -?> +Template::header('user_abilities'); +?> +
    + admin == 1): ?> + + + +
    +

    Особые умения

    +
    +
    + $v) { + switch ($k) { + case "sleep": + $script_name = "runmagic0"; + $magic_name = "Наложить заклятие молчания"; + break; + case "sleepf": + $script_name = "runmagicf"; + $magic_name = "Наложить заклятие форумного молчания"; + break; + case "healing": + $script_name = "runmagic1"; + $magic_name = "Лечение"; + break; + case "al_neut_power": + $script_name = "RunMagicSelf"; + $magic_name = "Сила нейтралитета"; + break; + case "ct1": + $script_name = "runmagic1"; + $magic_name = "Исцелить легкую травму"; + break; + case "ct2": + $script_name = "runmagic1"; + $magic_name = "Исцелить среднюю травму"; + break; + case "ct3": + $script_name = "runmagic1"; + $magic_name = "Исцелить тяжелую травму"; + break; + case "sleep_off": + $script_name = "runmagic1"; + $magic_name = "Снять заклятие молчания"; + break; + case "sleepf_off": + $script_name = "runmagic1"; + $magic_name = "Снять заклятие форумного молчания"; + break; + case "haos": + $script_name = "runmagic2"; + $magic_name = "Наложить заклятие хаоса"; + break; + case "haos_off": + $script_name = "runmagic1"; + $magic_name = "Снять заклятие хаоса"; + break; + case "death": + $script_name = "runmagic1"; + $magic_name = "Наложить заклятие смерти"; + break; + case "death_off": + $script_name = "runmagic1"; + $magic_name = "Снять заклятие смерти"; + break; + case "obezl": + $script_name = "runmagic2"; + $magic_name = "Наложить заклятие обезличивания"; + break; + case "obezl_off": + $script_name = "runmagic1"; + $magic_name = "Снять заклятие обезличивания"; + break; + case "pal_off": + $script_name = "runmagic1"; + $magic_name = "Лишить звания Паладин"; + break; + case "attack": + $script_name = "runmagic1"; + $magic_name = "Нападение"; + break; + case "attack_t": + $script_name = "runmagic1"; + $magic_name = "Нападение на Темного"; + break; + case "battack": + $script_name = "runmagic1"; + $magic_name = "Кровавое нападение"; + break; + case "attackk_close": + $script_name = "runmagic1"; + $magic_name = "Кулачное закрытое кровавое нападение"; + break; + case "attackk_open": + $script_name = "runmagic1"; + $magic_name = "Кулачное закрытое нападение"; + break; + case "marry": + $script_name = "runmagic4"; + $magic_name = "Зарегистрировать брак"; + break; + case "unmarry": + $script_name = "runmagic4"; + $magic_name = "Расторгнуть брак"; + break; + case "hidden": + $script_name = "runmagic1"; + $magic_name = "Заклятие невидимости"; + break; + case "teleport": + $script_name = "runmagic"; + $magic_name = "Телепортация"; + break; + case "check": + $script_name = "runmagic1"; + $magic_name = "Поставить проверку"; + break; + case "ct_all": + $script_name = "runmagic1"; + $magic_name = "Вылечить от травм"; + break; + case "pal_buttons": + $script_name = "runmagic1"; + $magic_name = "Отметить о прохождении проверки"; + break; + case "vampir": + $script_name = "runmagic1"; + $magic_name = "Вампиризм (выпить энергию другого игрока)"; + break; + case "brat": + $script_name = "runmagic1"; + $magic_name = "Помочь темному собрату (вмешаться в поединок)"; + break; + case "dneit": + $script_name = "runmagic1"; + $magic_name = "Присвоить склонность (Нейтральное Братство)"; + break; + case "dpal": + $script_name = "runmagic"; + $magic_name = "Присвоить склонность (Паладин)"; + break; + case "ddark": + $script_name = "runmagic1"; + $magic_name = "Присвоить склонность (Темное Братство)"; + break; + case "dlight": + $script_name = "runmagic1"; + $magic_name = "Присвоить склонность (Светлое Братство)"; + break; + case "un_align": + $script_name = "runmagic1"; + $magic_name = "Лишить склонности"; + break; + case "note": + $script_name = "runmagic"; + $magic_name = "Редактировать личное дело"; + break; + case "sys": + $script_name = "runmagic"; + $magic_name = "Отправить в чат системное сообщение"; + break; + case "scanner": + $script_name = "runmagic"; + $magic_name = "Показать лог действий модератора"; + break; + case "rep": + $script_name = "runmagic"; + $magic_name = "Отчет о переводах"; + break; + case "rost": + $script_name = "runmagic"; + $magic_name = "Присвоить статус"; + break; + case "ldadd": + $script_name = ""; + $magic_name = "Записать причину отправки в Хаос"; + break; + case "crush": + $script_name = "runmagic1"; + $magic_name = "Сокрушение"; + break; + case "def": + $script_name = "runmagic1"; + $magic_name = "Защита от оружия"; + break; + case "bexit": + $script_name = "runmagic1"; + $magic_name = "Выйти из боя"; + break; + } + + if ($script_name) { + $action_ok = 1; + $abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc(); + $abil = unserialize($abil['abil']); + + if ($user->align == 2) { + if ($k == 'al_neut_power' && $abil[0] < 1) { + $action_ok = 0; + } + if ($k == 'attackk_close' && $abil[1] < 1) { + $action_ok = 0; + } + if ($k == 'attackk_open' && $abil[2] < 1) { + $action_ok = 0; + } + } + if ($user->align == 6) { + if ($k == 'ct1' && $abil[0] < 1) { + $action_ok = 0; + } + if ($k == 'ct2' && $abil[1] < 1) { + $action_ok = 0; + } + if ($k == 'ct3' && $abil[2] < 1) { + $action_ok = 0; + } + } + } + if ($action_ok > 0) { + print " "; + } + } + if ($user->align == 2) // Нейтралы + { + + $abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc(); + $abil = unserialize($abil['abil']); + for ($i = 0; $i < 3; $i++) { + if (!$abil[$i]) { + $abil[$i] = 0; + } + } + echo("
    Осталось использований:
    "); + echo(" Сила нейтралитета - " . $abil[0] . "
    "); + echo(" Кулачное закрытое кровавое нападение - " . $abil[1] . "
    "); + echo(" Кулачное закрытое нападение - " . $abil[2] . "
    "); + } + + if ($user->align == 6) // Свет + { + + $abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc(); + $abil = unserialize($abil['abil']); + for ($i = 0; $i < 3; $i++) { + if (!$abil[$i]) { + $abil[$i] = 0; + } + } + echo("
    Осталось использований:
    "); + echo(" Исцелить легкую травму - " . $abil[0] . "
    "); + echo(" Исцелить среднюю травму - " . $abil[1] . "
    "); + echo(" Исцелить тяжелую травму - " . $abil[2] . "
    "); + } + ?> +

    Реликты

    @@ -960,21 +956,21 @@ $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['u
    - - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
    "; + exit(); + } + } else { + + $login = $user['login']; + $ya = mysql_query("SELECT `login` FROM `vxodd` WHERE `login` = '$login' LIMIT 1"); + $wawe = 0; + if ($daw = mysql_fetch_array($ya)) { + $wawe = 1; } - body { - background-image: url('i/canal.jpg'); - background-repeat: no-repeat; - background-position: top right; + $naw = mysql_query("SELECT `login` FROM `vxod` WHERE `login` = '$login' LIMIT 1"); + $nawe = 0; + if ($ser = mysql_fetch_array($naw)) { + $nawe = 1; } - - - -
    - - - - -
    -

    Вход в водосток

    - '0'"); - if ($el = mysql_fetch_array($select)) { - $wait_sec = $el["time"]; - $new_t = time(); - $left_time = $wait_sec - $new_t; - $left_hour = floor(($left_time / 60) / 60); - $left_min = floor($left_time / 60); - $left_sec = $left_time - $left_min * 60; - $left_min = ($left_min - $left_hour * 60); - if ($wait_sec > $new_t) { - print" До следующего входа осталось -: $left_hour - ч. $left_min - мин. -$left_sec сек. -
    "; - } else { - mysql_query("DELETE FROM visit_podzem WHERE login='" . $user['login'] . "'"); - print ""; - exit(); - } - }else{ - - $login = $user['login']; - $ya = mysql_query("SELECT `login` FROM `vxodd` WHERE `login` = '$login' LIMIT 1"); - $wawe = 0; - if ($daw = mysql_fetch_array($ya)) { - $wawe = 1; - } - - $naw = mysql_query("SELECT `login` FROM `vxod` WHERE `login` = '$login' LIMIT 1"); - $nawe = 0; - if ($ser = mysql_fetch_array($naw)) { - $nawe = 1; - } - - $rt = mysql_query("select id,level from users where login='$login'"); - $est = mysql_fetch_array($rt); - $user_id = $est["id"]; - $user_lvl = $est["level"]; + $rt = mysql_query("select id,level from users where login='$login'"); + $est = mysql_fetch_array($rt); + $user_id = $est["id"]; + $user_lvl = $est["level"]; - if ($wawe == 0) { - echo "
    + if ($wawe == 0) { + echo "
    Группа Комментарий
    @@ -101,235 +95,217 @@ if ($user->room == 402) {
    "; - } else { + } else { - print"
    + print"
    Группа "; - if ($nawe == 1) { - echo "  "; - } - echo " + if ($nawe == 1) { + echo "  "; + } + echo "
    "; - } - - if ($_GET['warning'] == 1) { - print" Вы покинули группу"; - } - if ($_GET['warning'] == 2) { - print" Увы! Не угадали пароль!"; - } - if ($_GET['warning'] == 3) { - print" Вы подали заявку! Отзавите!"; - } - if ($_GET['warning'] == 4) { - print" Вы уже в группе!"; - } - if ($_GET['warning'] == 5) { - print" Группа уже собранна!"; - } - print""; - - $i = 0; - $Q = mysql_query("SELECT * FROM vxod"); - while ($DATA = mysql_fetch_array($Q)) { - $cr = $DATA["glav_id"]; - $z_login[$i] = $DATA["login"]; - $date[$i] = $DATA["date"]; - $comment[$i] = $DATA["comment"]; - $password[$i] = $DATA["pass"]; - - $mine_z[$i] = 0; - - $Q2 = mysql_query("SELECT glav_id FROM vxodd WHERE glav_id='$cr'"); - $t1_all[$i] = 0; - while ($DATAS = mysql_fetch_array($Q2)) { - $t1_all[$i]++; - } - $creator[$i] = $DATA["glav_id"]; - $i++; - } - - for ($n = 0; $n < $i; $n++) { - echo ""; - - }/////////закрытие - ?> - - - - - - - -
    $date[$n] "; - - $QUER = mysql_query("SELECT login,lvl FROM vxodd WHERE glav_id='$creator[$n]' ORDER BY id ASC"); - while ($DATAS = mysql_fetch_array($QUER)) { - $p1 = $DATAS["login"]; - $p_login = $DATAS["login"]; - $p_lvl = $DATAS["lvl"]; - if ($p1 != "") { - $p1 = "$p1 [$p_lvl] "; - if ($t1_all[$n] == 1) { - echo " $p1"; - } else { - echo " $p1,"; - } - - } - } - if (!empty($comment[$n])) { - print"| $comment[$n] "; - } - - if ($wawe == '0') { - - if (!empty($password[$n])) { - echo " "; - } - echo " -"; - } - echo "
    - - -
    - - location.href='?warning=4'"; - exit; - } - $time = date("H:i"); - $SQL2 = mysql_query("INSERT INTO vxod(date,login,glav_id,comment,pass) VALUES('$time','$login','$user_id','" . $_GET['cmt'] . "','" . $_GET['pass'] . "')"); - $SQL2 = mysql_query("INSERT INTO vxodd(login,glav_id,lvl) VALUES('$login','$user_id','$user_lvl')"); - if ($SQL2) { - print ""; - exit; - } else { - print"Ошибка!!! Сообщите администратору!"; - } - } - //////////////Удаление заявки////////////////////// - if ($_GET['del']) { - $e = mysql_query("DELETE FROM vxod WHERE login='$login'"); - $es = mysql_query("DELETE FROM vxodd WHERE glav_id='$user_id'"); - $ed = mysql_query("DELETE FROM vxodd WHERE login='$login'"); - if ($e) { - print ""; - exit; - } else { - print"Ошибка!!! Сообщите администратору!"; - } - } - /////////////Присоединится/////////////// - if ($_GET['add']) { - $der = mysql_query("SELECT glav_id,id FROM vxodd WHERE login='" . $user['login'] . "'"); - if ($deras = mysql_fetch_array($der)) { - print ""; - exit; - } - $den = mysql_query("SELECT id FROM vxodd WHERE glav_id='" . $_GET['naw_id'] . "'"); - if (mysql_num_rows($den) >= 4) { - print ""; - exit; - } - - if ($_GET['pass'] == $_GET['naw_pass']) { - $rt = mysql_query("select level from users where login='$login'"); - $est = mysql_fetch_array($rt); - $s = mysql_query("INSERT INTO vxodd(login,glav_id,lvl) VALUES('$login','" . $_GET['naw_id'] . "','" . $est["level"] . "')"); - if ($s) { - print ""; - exit; - } else { - print"Ошибка!!! Сообщите администратору!"; } - } else { - print ""; - exit; - } - } - //////////////////Начинаем//////////////////// - if ($_GET['start']) { - $zax = mysql_query("select login from vxodd where glav_id='" . $user['id'] . "'"); - while ($nana = mysql_fetch_array($zax)) { - $n_login = $nana["login"]; - $rty = mysql_query("select id,level,login from users where login='$n_login'"); - $esth = mysql_fetch_array($rty); - $est_id = $esth["id"]; - $est_login = $esth["login"]; -//Время до следующего визита - $vremya = 3600 * 6 + time(); - mysql_query('insert into visit_podzem (login,time) values("' . $n_login . '","' . $vremya . '")'); - $vrem = 120 * 60 + time(); - mysql_query('insert into labirint(user_id, login, location, vector, glav_id, glava, t, l,key1,key2,key3,el,name,visit_time) values("' . $est_id . '", "' . $est_login . '", "16", "0", "' . $user['id'] . '", "' . $user['login'] . '","226","453","99","96","92","47","Канализация 1 этаж","' . $vrem . '")'); - mysql_query("UPDATE `users`,`online` SET `users`.`room` = '403',`online`.`room` = '403' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth["id"] . "' ;"); - } - $ferrr = mysql_query("SELECT * FROM podzem3 WHERE glava='default' and name='Канализация 1 этаж'"); - $retr = mysql_fetch_array($ferrr); - mysql_query('insert into podzem3(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,sunduk1,sunduk2,sunduk3,sunduk4,sunduk5,sunduk6,sunduk7) -values("' . $login . '","Канализация 1 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["sunduk1"] . '","' . $retr["sunduk2"] . '","' . $retr["sunduk3"] . '","' . $retr["sunduk4"] . '","' . $retr["sunduk5"] . '","' . $retr["sunduk6"] . '","' . $retr["sunduk7"] . '")'); + if ($_GET['warning'] == 1) { + print" Вы покинули группу"; + } + if ($_GET['warning'] == 2) { + print" Увы! Не угадали пароль!"; + } + if ($_GET['warning'] == 3) { + print" Вы подали заявку! Отзавите!"; + } + if ($_GET['warning'] == 4) { + print" Вы уже в группе!"; + } + if ($_GET['warning'] == 5) { + print" Группа уже собранна!"; + } + print""; - $ferrr = mysql_query("SELECT * FROM podzem3 WHERE glava='default' and name='Канализация 2 этаж'"); - $retr = mysql_fetch_array($ferrr); - mysql_query('insert into podzem3(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,sunduk1,sunduk2,sunduk3,sunduk4,sunduk5,sunduk6,sunduk7) -values("' . $login . '","Канализация 2 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["sunduk1"] . '","' . $retr["sunduk2"] . '","' . $retr["sunduk3"] . '","' . $retr["sunduk4"] . '","' . $retr["sunduk5"] . '","' . $retr["sunduk6"] . '","' . $retr["sunduk7"] . '")'); + $i = 0; + $Q = mysql_query("SELECT * FROM vxod"); + while ($DATA = mysql_fetch_array($Q)) { + $cr = $DATA["glav_id"]; + $z_login[$i] = $DATA["login"]; + $date[$i] = $DATA["date"]; + $comment[$i] = $DATA["comment"]; + $password[$i] = $DATA["pass"]; - $ferrr = mysql_query("SELECT * FROM podzem4 WHERE glava='default' and name='Канализация 1 этаж'"); - $retr = mysql_fetch_array($ferrr); - mysql_query('insert into podzem4(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,v1,v2,v3,v4,v5,v6,v7,v8,v9,v11,v12,v13,v14,v15,v16,v17,v18,v19,v21,v22,v23,v24,v25,v26,v27,v28,v29,v31,v32,v33,v34,v35,v36,v37,v38,v39,v41,v42,v43,v44,v45,v46,v47,v48,v49,v51,v52,v53,v54,v55,v56,v57,v58,v59,v61,v62,v63,v64,v65,v66,v67,v68,v69,v71,v72,v73,v74,v75,v76,v77,v78,v79,v81,v82,v83,v84,v85,v86,v87,v88,v89,v91,v92,v93,v94,v95,v96,v97,v98,v99) -values("' . $login . '","Канализация 1 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["v1"] . '","' . $retr["v2"] . '","' . $retr["v3"] . '","' . $retr["v4"] . '","' . $retr["v5"] . '","' . $retr["v6"] . '","' . $retr["v7"] . '","' . $retr["v8"] . '","' . $retr["v9"] . '","' . $retr["v11"] . '","' . $retr["v12"] . '","' . $retr["v13"] . '","' . $retr["v14"] . '","' . $retr["v15"] . '","' . $retr["v16"] . '","' . $retr["v17"] . '","' . $retr["v18"] . '","' . $retr["v19"] . '","' . $retr["v21"] . '","' . $retr["v22"] . '","' . $retr["v23"] . '","' . $retr["v24"] . '","' . $retr["v25"] . '","' . $retr["v26"] . '","' . $retr["v27"] . '","' . $retr["v28"] . '","' . $retr["v29"] . '","' . $retr["v31"] . '","' . $retr["v32"] . '","' . $retr["v33"] . '","' . $retr["v34"] . '","' . $retr["v35"] . '","' . $retr["v36"] . '","' . $retr["v37"] . '","' . $retr["v38"] . '","' . $retr["v39"] . '","' . $retr["v41"] . '","' . $retr["v42"] . '","' . $retr["v43"] . '","' . $retr["v44"] . '","' . $retr["v45"] . '","' . $retr["v46"] . '","' . $retr["v47"] . '","' . $retr["v48"] . '","' . $retr["v49"] . '","' . $retr["v51"] . '","' . $retr["v52"] . '","' . $retr["v53"] . '","' . $retr["v54"] . '","' . $retr["v55"] . '","' . $retr["v56"] . '","' . $retr["v57"] . '","' . $retr["v58"] . '","' . $retr["v59"] . '","' . $retr["v61"] . '","' . $retr["v62"] . '","' . $retr["v63"] . '","' . $retr["v64"] . '","' . $retr["v65"] . '","' . $retr["v66"] . '","' . $retr["v67"] . '","' . $retr["v68"] . '","' . $retr["v69"] . '","' . $retr["v71"] . '","' . $retr["v72"] . '","' . $retr["v73"] . '","' . $retr["v74"] . '","' . $retr["v75"] . '","' . $retr["v76"] . '","' . $retr["v77"] . '","' . $retr["v78"] . '","' . $retr["v79"] . '","' . $retr["v81"] . '","' . $retr["v82"] . '","' . $retr["v83"] . '","' . $retr["v84"] . '","' . $retr["v85"] . '","' . $retr["v86"] . '","' . $retr["v87"] . '","' . $retr["v88"] . '","' . $retr["v89"] . '","' . $retr["v91"] . '","' . $retr["v92"] . '","' . $retr["v93"] . '","' . $retr["v94"] . '","' . $retr["v95"] . '","' . $retr["v96"] . '","' . $retr["v97"] . '","' . $retr["v98"] . '","' . $retr["v99"] . '")'); + $mine_z[$i] = 0; - $ferrr = mysql_query("SELECT * FROM podzem4 WHERE glava='default' and name='Канализация 2 этаж'"); - $retr = mysql_fetch_array($ferrr); - mysql_query('insert into podzem4(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,v1,v2,v3,v4,v5,v6,v7,v8,v9,v11,v12,v13,v14,v15,v16,v17,v18,v19,v21,v22,v23,v24,v25,v26,v27,v28,v29,v31,v32,v33,v34,v35,v36,v37,v38,v39,v41,v42,v43,v44,v45,v46,v47,v48,v49,v51,v52,v53,v54,v55,v56,v57,v58,v59,v61,v62,v63,v64,v65,v66,v67,v68,v69,v71,v72,v73,v74,v75,v76,v77,v78,v79,v81,v82,v83,v84,v85,v86,v87,v88,v89,v91,v92,v93,v94,v95,v96,v97,v98,v99) -values("' . $login . '","Канализация 2 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["v1"] . '","' . $retr["v2"] . '","' . $retr["v3"] . '","' . $retr["v4"] . '","' . $retr["v5"] . '","' . $retr["v6"] . '","' . $retr["v7"] . '","' . $retr["v8"] . '","' . $retr["v9"] . '","' . $retr["v11"] . '","' . $retr["v12"] . '","' . $retr["v13"] . '","' . $retr["v14"] . '","' . $retr["v15"] . '","' . $retr["v16"] . '","' . $retr["v17"] . '","' . $retr["v18"] . '","' . $retr["v19"] . '","' . $retr["v21"] . '","' . $retr["v22"] . '","' . $retr["v23"] . '","' . $retr["v24"] . '","' . $retr["v25"] . '","' . $retr["v26"] . '","' . $retr["v27"] . '","' . $retr["v28"] . '","' . $retr["v29"] . '","' . $retr["v31"] . '","' . $retr["v32"] . '","' . $retr["v33"] . '","' . $retr["v34"] . '","' . $retr["v35"] . '","' . $retr["v36"] . '","' . $retr["v37"] . '","' . $retr["v38"] . '","' . $retr["v39"] . '","' . $retr["v41"] . '","' . $retr["v42"] . '","' . $retr["v43"] . '","' . $retr["v44"] . '","' . $retr["v45"] . '","' . $retr["v46"] . '","' . $retr["v47"] . '","' . $retr["v48"] . '","' . $retr["v49"] . '","' . $retr["v51"] . '","' . $retr["v52"] . '","' . $retr["v53"] . '","' . $retr["v54"] . '","' . $retr["v55"] . '","' . $retr["v56"] . '","' . $retr["v57"] . '","' . $retr["v58"] . '","' . $retr["v59"] . '","' . $retr["v61"] . '","' . $retr["v62"] . '","' . $retr["v63"] . '","' . $retr["v64"] . '","' . $retr["v65"] . '","' . $retr["v66"] . '","' . $retr["v67"] . '","' . $retr["v68"] . '","' . $retr["v69"] . '","' . $retr["v71"] . '","' . $retr["v72"] . '","' . $retr["v73"] . '","' . $retr["v74"] . '","' . $retr["v75"] . '","' . $retr["v76"] . '","' . $retr["v77"] . '","' . $retr["v78"] . '","' . $retr["v79"] . '","' . $retr["v81"] . '","' . $retr["v82"] . '","' . $retr["v83"] . '","' . $retr["v84"] . '","' . $retr["v85"] . '","' . $retr["v86"] . '","' . $retr["v87"] . '","' . $retr["v88"] . '","' . $retr["v89"] . '","' . $retr["v91"] . '","' . $retr["v92"] . '","' . $retr["v93"] . '","' . $retr["v94"] . '","' . $retr["v95"] . '","' . $retr["v96"] . '","' . $retr["v97"] . '","' . $retr["v98"] . '","' . $retr["v99"] . '")'); + $Q2 = mysql_query("SELECT glav_id FROM vxodd WHERE glav_id='$cr'"); + $t1_all[$i] = 0; + while ($DATAS = mysql_fetch_array($Q2)) { + $t1_all[$i]++; + } + $creator[$i] = $DATA["glav_id"]; + $i++; + } - ?> - - location.href='canalizaciya.php'"; + for ($n = 0; $n < $i; $n++) { + echo ""; + + }/////////закрытие + ?> + + + + + + +
    $date[$n] "; + + $QUER = mysql_query("SELECT login,lvl FROM vxodd WHERE glav_id='$creator[$n]' ORDER BY id ASC"); + while ($DATAS = mysql_fetch_array($QUER)) { + $p1 = $DATAS["login"]; + $p_login = $DATAS["login"]; + $p_lvl = $DATAS["lvl"]; + if ($p1 != "") { + $p1 = "$p1 [$p_lvl] "; + if ($t1_all[$n] == 1) { + echo " $p1"; + } else { + echo " $p1,"; + } + + } + } + if (!empty($comment[$n])) { + print"| $comment[$n]"; + } + + if ($wawe == '0') { + + if (!empty($password[$n])) { + echo " "; + } + echo " +"; + } + echo "
    + +location.href='?warning=4'"; exit; } + $time = date("H:i"); + $SQL2 = mysql_query("INSERT INTO vxod(date,login,glav_id,comment,pass) VALUES('$time','$login','$user_id','" . $_GET['cmt'] . "','" . $_GET['pass'] . "')"); + $SQL2 = mysql_query("INSERT INTO vxodd(login,glav_id,lvl) VALUES('$login','$user_id','$user_lvl')"); + if ($SQL2) { + print ""; + exit; + } else { + print"Ошибка!!! Сообщите администратору!"; } - ?> - -
    - - - - - - -
    -
    -
    - - - -
    -
    -
    - - - \ No newline at end of file +//////////////Удаление заявки////////////////////// +if ($_GET['del']) { + $e = mysql_query("DELETE FROM vxod WHERE login='$login'"); + $es = mysql_query("DELETE FROM vxodd WHERE glav_id='$user_id'"); + $ed = mysql_query("DELETE FROM vxodd WHERE login='$login'"); + if ($e) { + print ""; + exit; + } else { + print"Ошибка!!! Сообщите администратору!"; + } +} +/////////////Присоединится/////////////// +if ($_GET['add']) { + $der = mysql_query("SELECT glav_id,id FROM vxodd WHERE login='" . $user['login'] . "'"); + if ($deras = mysql_fetch_array($der)) { + print ""; + exit; + } + $den = mysql_query("SELECT id FROM vxodd WHERE glav_id='" . $_GET['naw_id'] . "'"); + if (mysql_num_rows($den) >= 4) { + print ""; + exit; + } + + if ($_GET['pass'] == $_GET['naw_pass']) { + $rt = mysql_query("select level from users where login='$login'"); + $est = mysql_fetch_array($rt); + $s = mysql_query("INSERT INTO vxodd(login,glav_id,lvl) VALUES('$login','" . $_GET['naw_id'] . "','" . $est["level"] . "')"); + if ($s) { + print ""; + exit; + } else { + print"Ошибка!!! Сообщите администратору!"; + } + } else { + print ""; + exit; + } +} +//////////////////Начинаем//////////////////// +if ($_GET['start']) { + $zax = mysql_query("select login from vxodd where glav_id='" . $user['id'] . "'"); + while ($nana = mysql_fetch_array($zax)) { + $n_login = $nana["login"]; + $rty = mysql_query("select id,level,login from users where login='$n_login'"); + $esth = mysql_fetch_array($rty); + $est_id = $esth["id"]; + $est_login = $esth["login"]; +//Время до следующего визита + $vremya = 3600 * 6 + time(); + mysql_query('insert into visit_podzem (login,time) values("' . $n_login . '","' . $vremya . '")'); + $vrem = 120 * 60 + time(); + mysql_query('insert into labirint(user_id, login, location, vector, glav_id, glava, t, l,key1,key2,key3,el,name,visit_time) values("' . $est_id . '", "' . $est_login . '", "16", "0", "' . $user['id'] . '", "' . $user['login'] . '","226","453","99","96","92","47","Канализация 1 этаж","' . $vrem . '")'); + mysql_query("UPDATE `users`,`online` SET `users`.`room` = '403',`online`.`room` = '403' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth["id"] . "' ;"); + } + + $ferrr = mysql_query("SELECT * FROM podzem3 WHERE glava='default' and name='Канализация 1 этаж'"); + $retr = mysql_fetch_array($ferrr); + mysql_query('insert into podzem3(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,sunduk1,sunduk2,sunduk3,sunduk4,sunduk5,sunduk6,sunduk7) +values("' . $login . '","Канализация 1 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["sunduk1"] . '","' . $retr["sunduk2"] . '","' . $retr["sunduk3"] . '","' . $retr["sunduk4"] . '","' . $retr["sunduk5"] . '","' . $retr["sunduk6"] . '","' . $retr["sunduk7"] . '")'); + + $ferrr = mysql_query("SELECT * FROM podzem3 WHERE glava='default' and name='Канализация 2 этаж'"); + $retr = mysql_fetch_array($ferrr); + mysql_query('insert into podzem3(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,sunduk1,sunduk2,sunduk3,sunduk4,sunduk5,sunduk6,sunduk7) +values("' . $login . '","Канализация 2 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["sunduk1"] . '","' . $retr["sunduk2"] . '","' . $retr["sunduk3"] . '","' . $retr["sunduk4"] . '","' . $retr["sunduk5"] . '","' . $retr["sunduk6"] . '","' . $retr["sunduk7"] . '")'); + + $ferrr = mysql_query("SELECT * FROM podzem4 WHERE glava='default' and name='Канализация 1 этаж'"); + $retr = mysql_fetch_array($ferrr); + mysql_query('insert into podzem4(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,v1,v2,v3,v4,v5,v6,v7,v8,v9,v11,v12,v13,v14,v15,v16,v17,v18,v19,v21,v22,v23,v24,v25,v26,v27,v28,v29,v31,v32,v33,v34,v35,v36,v37,v38,v39,v41,v42,v43,v44,v45,v46,v47,v48,v49,v51,v52,v53,v54,v55,v56,v57,v58,v59,v61,v62,v63,v64,v65,v66,v67,v68,v69,v71,v72,v73,v74,v75,v76,v77,v78,v79,v81,v82,v83,v84,v85,v86,v87,v88,v89,v91,v92,v93,v94,v95,v96,v97,v98,v99) +values("' . $login . '","Канализация 1 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["v1"] . '","' . $retr["v2"] . '","' . $retr["v3"] . '","' . $retr["v4"] . '","' . $retr["v5"] . '","' . $retr["v6"] . '","' . $retr["v7"] . '","' . $retr["v8"] . '","' . $retr["v9"] . '","' . $retr["v11"] . '","' . $retr["v12"] . '","' . $retr["v13"] . '","' . $retr["v14"] . '","' . $retr["v15"] . '","' . $retr["v16"] . '","' . $retr["v17"] . '","' . $retr["v18"] . '","' . $retr["v19"] . '","' . $retr["v21"] . '","' . $retr["v22"] . '","' . $retr["v23"] . '","' . $retr["v24"] . '","' . $retr["v25"] . '","' . $retr["v26"] . '","' . $retr["v27"] . '","' . $retr["v28"] . '","' . $retr["v29"] . '","' . $retr["v31"] . '","' . $retr["v32"] . '","' . $retr["v33"] . '","' . $retr["v34"] . '","' . $retr["v35"] . '","' . $retr["v36"] . '","' . $retr["v37"] . '","' . $retr["v38"] . '","' . $retr["v39"] . '","' . $retr["v41"] . '","' . $retr["v42"] . '","' . $retr["v43"] . '","' . $retr["v44"] . '","' . $retr["v45"] . '","' . $retr["v46"] . '","' . $retr["v47"] . '","' . $retr["v48"] . '","' . $retr["v49"] . '","' . $retr["v51"] . '","' . $retr["v52"] . '","' . $retr["v53"] . '","' . $retr["v54"] . '","' . $retr["v55"] . '","' . $retr["v56"] . '","' . $retr["v57"] . '","' . $retr["v58"] . '","' . $retr["v59"] . '","' . $retr["v61"] . '","' . $retr["v62"] . '","' . $retr["v63"] . '","' . $retr["v64"] . '","' . $retr["v65"] . '","' . $retr["v66"] . '","' . $retr["v67"] . '","' . $retr["v68"] . '","' . $retr["v69"] . '","' . $retr["v71"] . '","' . $retr["v72"] . '","' . $retr["v73"] . '","' . $retr["v74"] . '","' . $retr["v75"] . '","' . $retr["v76"] . '","' . $retr["v77"] . '","' . $retr["v78"] . '","' . $retr["v79"] . '","' . $retr["v81"] . '","' . $retr["v82"] . '","' . $retr["v83"] . '","' . $retr["v84"] . '","' . $retr["v85"] . '","' . $retr["v86"] . '","' . $retr["v87"] . '","' . $retr["v88"] . '","' . $retr["v89"] . '","' . $retr["v91"] . '","' . $retr["v92"] . '","' . $retr["v93"] . '","' . $retr["v94"] . '","' . $retr["v95"] . '","' . $retr["v96"] . '","' . $retr["v97"] . '","' . $retr["v98"] . '","' . $retr["v99"] . '")'); + + $ferrr = mysql_query("SELECT * FROM podzem4 WHERE glava='default' and name='Канализация 2 этаж'"); + $retr = mysql_fetch_array($ferrr); + mysql_query('insert into podzem4(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,v1,v2,v3,v4,v5,v6,v7,v8,v9,v11,v12,v13,v14,v15,v16,v17,v18,v19,v21,v22,v23,v24,v25,v26,v27,v28,v29,v31,v32,v33,v34,v35,v36,v37,v38,v39,v41,v42,v43,v44,v45,v46,v47,v48,v49,v51,v52,v53,v54,v55,v56,v57,v58,v59,v61,v62,v63,v64,v65,v66,v67,v68,v69,v71,v72,v73,v74,v75,v76,v77,v78,v79,v81,v82,v83,v84,v85,v86,v87,v88,v89,v91,v92,v93,v94,v95,v96,v97,v98,v99) +values("' . $login . '","Канализация 2 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["v1"] . '","' . $retr["v2"] . '","' . $retr["v3"] . '","' . $retr["v4"] . '","' . $retr["v5"] . '","' . $retr["v6"] . '","' . $retr["v7"] . '","' . $retr["v8"] . '","' . $retr["v9"] . '","' . $retr["v11"] . '","' . $retr["v12"] . '","' . $retr["v13"] . '","' . $retr["v14"] . '","' . $retr["v15"] . '","' . $retr["v16"] . '","' . $retr["v17"] . '","' . $retr["v18"] . '","' . $retr["v19"] . '","' . $retr["v21"] . '","' . $retr["v22"] . '","' . $retr["v23"] . '","' . $retr["v24"] . '","' . $retr["v25"] . '","' . $retr["v26"] . '","' . $retr["v27"] . '","' . $retr["v28"] . '","' . $retr["v29"] . '","' . $retr["v31"] . '","' . $retr["v32"] . '","' . $retr["v33"] . '","' . $retr["v34"] . '","' . $retr["v35"] . '","' . $retr["v36"] . '","' . $retr["v37"] . '","' . $retr["v38"] . '","' . $retr["v39"] . '","' . $retr["v41"] . '","' . $retr["v42"] . '","' . $retr["v43"] . '","' . $retr["v44"] . '","' . $retr["v45"] . '","' . $retr["v46"] . '","' . $retr["v47"] . '","' . $retr["v48"] . '","' . $retr["v49"] . '","' . $retr["v51"] . '","' . $retr["v52"] . '","' . $retr["v53"] . '","' . $retr["v54"] . '","' . $retr["v55"] . '","' . $retr["v56"] . '","' . $retr["v57"] . '","' . $retr["v58"] . '","' . $retr["v59"] . '","' . $retr["v61"] . '","' . $retr["v62"] . '","' . $retr["v63"] . '","' . $retr["v64"] . '","' . $retr["v65"] . '","' . $retr["v66"] . '","' . $retr["v67"] . '","' . $retr["v68"] . '","' . $retr["v69"] . '","' . $retr["v71"] . '","' . $retr["v72"] . '","' . $retr["v73"] . '","' . $retr["v74"] . '","' . $retr["v75"] . '","' . $retr["v76"] . '","' . $retr["v77"] . '","' . $retr["v78"] . '","' . $retr["v79"] . '","' . $retr["v81"] . '","' . $retr["v82"] . '","' . $retr["v83"] . '","' . $retr["v84"] . '","' . $retr["v85"] . '","' . $retr["v86"] . '","' . $retr["v87"] . '","' . $retr["v88"] . '","' . $retr["v89"] . '","' . $retr["v91"] . '","' . $retr["v92"] . '","' . $retr["v93"] . '","' . $retr["v94"] . '","' . $retr["v95"] . '","' . $retr["v96"] . '","' . $retr["v97"] . '","' . $retr["v98"] . '","' . $retr["v99"] . '")'); + + ?> + + location.href='canalizaciya.php'"; + exit; +} +} +?> +
    + +
    +
    + + + +
    +
    +
    \ No newline at end of file diff --git a/zayavka.php b/zayavka.php index 34e3916..08918cc 100644 --- a/zayavka.php +++ b/zayavka.php @@ -596,17 +596,13 @@ VALUES ("?s","?s",?i,?i,?i,"?s","?s",?i,?i,?i,?i)', } $zay = new Zayavka; -header("Cache-Control: no-cache"); if (!empty($_POST['open'])) { $f = fopen("/tmp/zayavka/" . $user->id . ".txt", "w+"); fputs($f, time()); fclose($f); } +Template::header('zayavka'); ?> - - - - - - -
    @@ -1087,10 +1080,4 @@ if ($get == 'current') { } } } - -db::c()->query('UNLOCK TABLES'); - -?> - - - \ No newline at end of file +db::c()->query('UNLOCK TABLES'); \ No newline at end of file diff --git a/znahar.php b/znahar.php deleted file mode 100644 index db30f4b..0000000 --- a/znahar.php +++ /dev/null @@ -1,335 +0,0 @@ - "Сила", "2" => "Ловкость", "3" => "Интуиция", "4" => "Выносливость", "5" => "Интеллект", "6" => "Мудрость"]; -$stat_nmdb = ["1" => "sila", "2" => "lovk", "3" => "inta", "4" => "vinos", "5" => "intel", "6" => "mudra"]; -$stat_nmto = ["1" => "в силу", "2" => "в ловкость", "3" => "в интуицию", "4" => "в выносливость", "5" => "в интеллект", "6" => "в мудрость"]; -$trv = ""; -if (empty($_SESSION['uid'])) { - header("Location: index.php"); - exit; -} - -require_once "functions.php"; -if ($user->battle) { - header('location: fbattle.php'); - exit; -} -?> - - - - - Комната знахаря - - - -
    Комната Знахаря
    -
    -
    -
    - get_meshok()) { - echo "У вас переполнен рюкзак, вы не можете передвигаться...
    "; -} ?> -Запахи трав наполняют помещение, непонятные и пугающие предметы скрываются в пляшущих тенях...
    - Говорят, здесь можно изменить свою судьбу. Стать кем-то иным... кем раньше был лишь в мечтах...


    - -Все имеет цену. Но не все можно купить. Помните - некоторые шансы даются лишь раз в жизни...
    -Вы не можете воспользоваться услугами Знахаря имея травму!"; - exit; -} elseif ($owntravma['type'] == 188 or $owntravma['type'] == 21 or $owntravma['type'] == 201 or $owntravma['type'] == 202) { - echo "
    Вы не можете воспользоваться услугами Знахаря находясь под действием эликсиров и эффектов!"; - exit; -} - - -if ($_POST['undr'] == '1') undressall((int)$_SESSION['uid']); -$s = mysql_fetch_row(mysql_query("SELECT count(id) FROM inventory WHERE dressed!=0 AND owner=" . (int)$_SESSION['uid'])); -if ((int)$s[0] > 0) { - echo "
    Перед входом в комнату Знахарь требует полного очищения!
    "; - exit; -} - -if (@(int)$_POST['move_ab'] > 0 && $user['money'] >= 32) { - if (($stat_nmdb[(int)$_POST['move_ab']] == 'sila' && $user['sila'] < 4) || ($stat_nmdb[(int)$_POST['move_ab']] == 'lovk' && $user['lovk'] < 4) || ($stat_nmdb[(int)$_POST['move_ab']] == 'inta' && $user['inta'] < 4) || ($stat_nmdb[(int)$_POST['move_ab']] == 'vinos' && $user['vinos'] < (4 + $user['level']))) echo "Невозможно перераспределить статы ниже минимального уровня."; - else { - if (@(int)$_POST['move_ab_top'] > 0) { - $money_need = $user[$stat_nmdb[(int)$_POST['move_ab_top']]] <= 10 ? "10" : $user[$stat_nmdb[(int)$_POST['move_ab_top']]]; - #$money_need = 0; - if (@(int)$_POST['move_ab'] == @(int)$_POST['move_ab_top']) echo "Переносить умение можно только в другое!"; - elseif (!$user[$stat_nmdb[(int)$_POST['move_ab']]] > 0) { - echo "Недостаточно умений для перераспределения!"; - } elseif (($user['money'] - $money_need) < 0) { - echo "Недостаточно кредитов для совершения операции!"; - } else { - mysql_query("UPDATE `users` SET `" . $stat_nmdb[(int)$_POST['move_ab']] . "`=(`" . $stat_nmdb[(int)$_POST['move_ab']] . "`-1), `" . $stat_nmdb[(int)$_POST['move_ab_top']] . "`=(`" . $stat_nmdb[(int)$_POST['move_ab_top']] . "`+1), money=(money-" . $money_need . ") WHERE id=" . (int)$_SESSION['uid'] . " "); - echo "Перераспределение статов \"" . $stat_nm[(int)$_POST['move_ab']] . " " . $stat_nmto[(int)$_POST['move_ab_top']] . "\" произведено успешно. Цена операции " . $money_need . ""; - $user[$stat_nmdb[(int)$_POST['move_ab_top']]]++; - $user[$stat_nmdb[(int)$_POST['move_ab']]]--; - $user['money'] -= $money_need; - #$trv=settravma((int)$_SESSION['uid'],20,rand(300,600),1); - } - } - } - -} elseif ((int)$_POST['sbr_nav'] > 0 && $user['money'] >= 32) { - if (($user['noj'] + $user['mec'] + $user['topor'] + $user['dubina'] + $user['mfire'] + $user['mwater'] + $user['mair'] + $user['mearth'] + $user['mlight'] + $user['mgray'] + $user['mdark']) == 0) echo "У Вас нет нераспределённых умений!"; - elseif (!file_exists('/tmp/memcache/uml' . $_SESSION['uid'])) { - if (mysql_query("UPDATE `users` SET `master` = noj+mec+topor+dubina+mfire+mwater+mair+mearth+mlight+mgray+mdark+master,noj=0,mec=0,topor=0,dubina=0,mfire=0,mwater=0,mair=0,mearth=0,mlight=0,mgray=0,mdark=0,money=(money-32) WHERE `id`= " . (int)$_SESSION['uid'] . " LIMIT 1;")) { - mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" перераспределил умения, заплатив 32 кр в Комнате Знахаря. ',1,'" . time() . "');"); - echo "Все прошло удачно.Цена операции 32 кр. Вы можете перераспределить умения."; - $flum = fopen('/tmp/memcache/uml' . $_SESSION['uid'], 'w'); - fwrite($flum, date('Y-m-d H:i:s')); - fclose($flum); - $user['money'] -= 32; - $trv = settravma((int)$_SESSION['uid'], 20, rand(300, 600), 1); - } else echo "Произошла ошибка!"; - } else { - if ($user['money'] < 32) { - echo "Недостаточно кредитов для совершения операции!"; - } else { - if (mysql_query("UPDATE `users` SET `master` = noj+mec+topor+dubina+mfire+mwater+mair+mearth+mlight+mgray+mdark+master,noj=0,mec=0,topor=0,dubina=0,mfire=0,mwater=0,mair=0,mearth=0,mlight=0,mgray=0,mdark=0,money=(money-32) WHERE `id`= " . (int)$_SESSION['uid'] . " LIMIT 1;")) { - mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" перераспределил умения, заплатив 32 кр. в Комнате Знахаря. ',1,'" . time() . "');"); - echo "Все прошло удачно.Цена операции 32 кр. Вы можете перераспределить умения."; - $user['money'] -= 32; - $trv = settravma((int)$_SESSION['uid'], 20, rand(300, 60), 1); - } else echo "Произошла ошибка!"; - } - } -} elseif ((int)$_POST['sbr_par'] > 0) { - $expstats = [ - /* nextup,summstats*/ - "20" => 3, //exp 0-19 - "45" => 4, //exp 20-44 - "75" => 5, //exp 45-74 - "110" => 6, //exp 75-109 - "160" => 9, //1лвл, exp 110-159 - "215" => 10, //exp 160-214 - "280" => 11, //exp 215-279 - "350" => 12, //exp 280-349 - "410" => 13, //exp 350-409 - "530" => 16,//2лвл exp 410-529 - "670" => 17, - "830" => 18, - "950" => 19, - "1100" => 20, - "1300" => 21, - "1450" => 24, //3лвл - "1650" => 25, - "1850" => 26, - "2050" => 27, - "2200" => 28, - "2500" => 29, - "2900" => 34, //4лвл - "3350" => 35, - "3800" => 36, - "4200" => 37, - "4600" => 38, - "5000" => 39, - "6000" => 42, //5лвл - "7000" => 43, - "8000" => 44, - "9000" => 45, - "10000" => 46, - "11000" => 47, - "12000" => 48, - "12500" => 49, - "14000" => 52, //6лвл - "15500" => 53, - "17000" => 54, - "19000" => 55, - "21000" => 56, - "23000" => 57, - "27000" => 58, - "30000" => 59, - "60000" => 64, //7лвл - "75000" => 65, - "150000" => 66, - "175000" => 67, - "200000" => 68, - "225000" => 69, - "250000" => 70, - "260000" => 71, - "280000" => 72, - "300000" => 73, - "1500000" => 78,//8лвл - "1750000" => 79, - "2000000" => 80, - "2175000" => 81, - "2300000" => 82, - "2400000" => 83, - "2500000" => 84, - "2600000" => 85, - "2800000" => 86, - "3000000" => 87, - "6000000" => 94,//9лвл - "6500000" => 95, - "7500000" => 96, - "8500000" => 97, - "9000000" => 98, - "9250000" => 99, - "9500000" => 100, - "9750000" => 101, - "9900000" => 102, - "10000000" => 103, - "13000000" => 112,//10лвл - "14000000" => 114, - "15000000" => 116, - "16000000" => 118, - "17000000" => 120, - "17500000" => 122, - "18000000" => 124, - "19000000" => 126, - "19500000" => 128, - "20000000" => 130, - "30000000" => 132, - "32000000" => 134, - "34000000" => 136, - "35000000" => 138, - "36000000" => 140, - "38000000" => 142, - "40000000" => 144, - "42000000" => 146, - "44000000" => 148, - "45000000" => 150, - "46000000" => 152, - "48000000" => 154, - "50000000" => 156, - "52000000" => 158, - "55000000" => 168,//11лвл - "60000000" => 169, - "65000000" => 170, - "70000000" => 171, - "75000000" => 172, - "80000000" => 173, - "85000000" => 174, - "90000000" => 175, - "95000000" => 176, - "100000000" => 177, - "120000000" => 178, - "150000000" => 188,//12лвл - "180000000" => 190, - "210000000" => 192, - "240000000" => 194, - "270000000" => 196, - "310000000" => 198, - "340000000" => 200, - "370000000" => 202, - "400000000" => 204, - "430000000" => 206, - "470000000" => 208, - "500000000" => 210, - "600000000" => 220 //13лвл - ]; - $vinoslvl = [ - /* level,summvinos*/ - "0" => 3, - "1" => 4, - "2" => 5, - "3" => 6, - "4" => 7, - "5" => 8, - "6" => 9, - "7" => 10, - "8" => 11, - "9" => 13, - "10" => 16, - "11" => 21, - "12" => 26, - "13" => 31]; - - if (!file_exists('/tmp/memcache/par' . $_SESSION['uid']) && $user['money'] >= 10) { - if (mysql_query("UPDATE `users` SET `stats` = " . $expstats[$user['nextup']] . ", `sila`=3,`lovk`=3,`inta`=3,`mudra`=0,`intel`=0,`duh`=0,`vinos`= " . $vinoslvl[$user['level']] . ",`maxhp`= " . $vinoslvl[$user['level']] . "*6,`maxmana`= 0,`mana`= '0',`hp`=" . $vinoslvl[$user['level']] . "*6, `money`=(`money`-10) WHERE `id`= " . (int)$_SESSION['uid'] . " LIMIT 1;")) { - mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" сбросил параметры, заплатив 10 кр. в Комнате Знахаря. ',1,'" . time() . "');"); - echo "Все прошло удачно.Цена операции 10 кр. Вы можете перераспределить параметры."; - $flum = fopen('/tmp/memcache/par' . $_SESSION['uid'], 'w'); - fwrite($flum, date('Y-m-d H:i:s')); - fclose($flum); - $trv = settravma((int)$_SESSION['uid'], 20, rand(300, 600), 1); - $user['money'] -= 10; - } else echo "Произошла ошибка!"; - } else { - if ($user['money'] < 10) echo "Недостаточно кредитов для совершения операции!"; - else { - if (mysql_query("UPDATE `users` SET `stats` = " . $expstats[$user['nextup']] . ", `sila`=3,`lovk`=3,`inta`=3,`mudra`=0,`intel`=0,`duh`=0,`vinos`= " . $vinoslvl[$user['level']] . ",`maxhp`= " . $vinoslvl[$user['level']] . "*6,`maxmana`= 0,`mana`= 0,`money`=(`money`-10) WHERE `id`= " . (int)$_SESSION['uid'] . " LIMIT 1;")) { - mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" сбросил параметры, заплатив 10 кр. в Комнате Знахаря. ',1,'" . time() . "');"); - echo "Все прошло удачно.Цена операции 10 кр. Вы можете перераспределить параметры."; - $trv = settravma((int)$_SESSION['uid'], 20, rand(300, 600), 1); - $user['money'] -= 10; - } else echo "Произошла ошибка!"; - } - } -} - -if ($trv != "") echo "
    Вы чувствуете слабость.. " . $trv . ""; -?> -
    Деньги: кр. -

    - -
    - Навыки владения оружием и магией -
    ' name='sbr_nav'> У Вас есть шанс забыть старое - ради нового: '> -
    -
    -

    - -
    - Параметры -
    ' name='sbr_par'> У Вас есть шанс забыть старое - ради нового: '> -
    -
    -

    - -
    - Параметры - Вы можете стать иным - более ловким, сильным или мудрым... но лишь за счет других параметров
    -
    -
    -
    -
    -
    -
    - -
    - Перенести в - -
    - - - Роспись:
    -
    - - -