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
+
@@ -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
-
-
-
- if(isset($hostel['id'])) { ?>
-
- } ?>
-
-
-
+
+ if (isset($hostel['id'])) { ?>
+
+ } ?>
+
-
Гостиница, Холл
-
- if($user['sleep'] == 0) { ?>
-
- } else { ?>
-
- } ?>
-
-
-
-
-
-
-
- if(!isset($hostel['id'])) { ?>
-
- Станьте нашим клиентом
-
-
- } else { ?>
-
- Добро пожаловать!
-
- Расторгнуть договор Внести предоплату
- if($error != '') { echo ''.$error.' '; } ?>
-
- } ?>
+
Гостиница, Холл
+
+ if ($user['sleep'] == 0) { ?>
+
+ } else { ?>
+
+ } ?>
+
+
+
-
- Правила проживания
-
-
-
И что я получу за свои кровные?
- У нас ты можешь:
-
- хранить свое барахло и прочий хлам.
-
Охрана у вас есть? Не воруют?
- Самые любопытные могут получить в сурло прямо здесь - в холле.
-
- Устраивать беспорядки в комнатах не позволено.
-
- Прислуга у нас проверенная - пожитки твои не тронут.
-
И сколько стоит всё это удовольствие?
- - Комнаты есть разные, для людей разного достатка. Смотри справа расценки.
-
- Платить нужно каждый день. Пока не заплатишь - на лестницу не ногой.
-
- Вместимость - это сколько твоих вещей влезет в комнату, имеется ввиду общая масса инвентаря.
-
Как всем этим пользоваться?
- Всё просто. Плати и живи.
-
Приходишь, платишь по долгам, проходишь в аппартаменты. В сундуке есть секции для каждого вида вещей, фильтр поможет разобраться.
-
Что ещё мне нужно знать?
- - При смене размера комнаты, ты теряешь оставшееся оплаченное время.
-
- При просрочке платы более 60 суток, мы оставляем за собой право сдать вещи на аукцион для погашения задолжености.
-
- Если долг будет разумный, то подарки забирать с полки не будем.
-
- Быстро сориентироваться с шмотом поможет фильтр предметов.
-
- Если что потеряешь - твои проблемы.
+
+
+ if (!isset($hostel['id'])) { ?>
+
+ Станьте нашим клиентом
+
+
+ } else { ?>
+
+ Добро пожаловать!
+
+ Расторгнуть договор Внести предоплату
+ if ($error != '') {
+ echo '' . $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 @@
session_start();
-if(empty($_SESSION['uid'])) { header('Location: index.php'); exit; }
+if (empty($_SESSION['uid'])) {
+ header('Location: index.php');
+ exit;
+}
require_once "functions.php";
-$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
-$base = 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));
+$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 '
Внимание! При расторжении договора или смене тарифа, внесенная плата не возвращается
';
- }
}
\ 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 .= '
@@ -56,7 +63,9 @@ function show_item($row, $txt, $place)
if (!$row['needident']) {
if ($magic['chanse']) {
- if ($magic['chanse'] >= 95) $magic['chanse'] = 95;
+ if ($magic['chanse'] >= 95) {
+ $magic['chanse'] = 95;
+ }
$r .= 'Вероятность срабатывания: ' . $magic['chanse'] . '% ';
}
if ($magic['time']) {
@@ -67,7 +76,7 @@ function show_item($row, $txt, $place)
}
$r .= '';
- $user = array();
+ $user = [];
if ($row['nsila']) {
$r .= '• ';
@@ -238,7 +247,7 @@ function show_item($row, $txt, $place)
$r .= '
Свойства предмета не идентифицированы ';
}
- $osob = array(22, 23);
+ $osob = [22, 23];
if (in_array($row['type'], $osob)) {
$r .= 'Особенности:
';
if ($row['type'] == 22) {
@@ -277,164 +286,185 @@ function show_itm_hostel($uid, $otdel, $type = 1)
return $r;
}
-if($user['vip'] > 0 && $user['vip_time'] > time()) {
- $count = $base[$hostel['type']];
- $count += floor($base[$hostel['type']]*$vips[$user['vip']]);
+if ($user['vip'] > 0 && $user['vip_time'] > time()) {
+ $count = $base[$hostel['type']];
+ $count += floor($base[$hostel['type']] * $vips[$user['vip']]);
} else {
- $count = $base[$hostel['type']];
+ $count = $base[$hostel['type']];
}
-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']);
} else {
- $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.links {
+ text-align: center;
+ vertical-align: middle;
+ width: 117px;
+ }
-
- =$r;?>
-
-
if($error != '') { echo ''.$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;
+ }
+
+
+
+
+ Фильтр инвентаря
+
+
+
+ Состояние
+
+
+
+
+
+ = $r; ?>
+
+
+%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 @@
-
-
-
-
-
-
Вход
-
-
+= Template::header('Вход', 1) ?>
Демонстрационная версия
Ребята, давайте сперва сделаем чтобы работало, а потом будем делать красиво. Идёт?
Пол персонажа выбирать нельзя. Это не ошибка. Все ограничения только для мальчиков или только для девочек постепенно будут удалены.
@@ -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 @@
- include("config.php");
- session_start();
-
- if (empty($_SESSION['uid'])) {
+
-
-
+
-
-
- //if(!$user->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']);
- }
-?>
-
-
-
-
-
-
-
+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);
+}
- echo Nick::id($user)->battle();
- echo"
Выйти? ";
- 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 @@
-
-include("config.php");
+
-
-
+
+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']);
- }
-?>
-
-
-
-
-
-
-
+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);
+}
- 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 "
";
\ 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');
- }
- }
-
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Вход в Лабиринты
-
-
-if(isset($_GET['del_com'])) {
- if(in_array($user['align'], $aligns)) {
- 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 = 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 {
-?>
-
- }
-} ?>
-
-$sp = mysql_query('SELECT * FROM `laba_zv` ORDER BY `id` DESC');
-$typez = array(0 => 'Для новичков', 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.'
';
-}
-?>
-
- if(!isset($zv['id'])) { ?>
-
- }else{ ?>
- if( $zv['uid1'] == $user['id'] ) { ?> } ?>
- } ?>
- if( $re != '' ) { echo ''.$re.' '; } ?>
-
-
- } ?>
\ No newline at end of file
+ Template::header('Вход в Лабиринты');
+ ?>
+
+
+
+
+
+
Вход в Лабиринты
+
+
+ if (isset($_GET['del_com'])) {
+ if ($user->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 {
+ ?>
+
+ }
+ } ?>
+
+ $sp = mysql_query('SELECT * FROM `laba_zv` ORDER BY `id` DESC');
+ $typez = [0 => 'Для новичков', 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 . '
';
+ }
+ ?>
+
+ if (!isset($zv['id'])) { ?>
+
+ } else { ?>
+ if ($zv['uid1'] == $user['id']) { ?>
+
+ } ?>
+
+ } ?>
+ if ($re != '') {
+ echo '' . $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);
-?>
-
-
-
-
-
-
-
-
-
-
-
-
- /*if ($user['align'] == 2.7) {*/ ?>
-
- /*}*/ ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if( $effed != '' ) { echo $effed; } ?>
-
-
- if( $dies > 0 ) {
- echo 'Кол-во смертей : '.$dies.'/3 ';
- }
- ?>
- Карта : #=$lab['id']?>. Координаты : {X = =$user['x']?> | Y = =$user['y']?>}
-
-
-
-
-
-
-
- if( isset($q1['id']) ) {
- echo 'Задание: '.$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 '(Задание не засчитается, если Вы не найдёте выход.) ';
- }
- ?>
-
-
-
-
-
- if( $errors != '' ) { echo $errors.' '; } ?>
- =$itms?>
-
- if($user['align'] == 2.99) {
- 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 = =$tmdg?>; i <= progressEnd; i++) document.getElementById('progress'+i).style.backgroundColor = 'transparent';
- progressAt = =$tmdg?>;
+ } 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(=$tmdg?>);
- 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');
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ if ($effed != '') {
+ echo $effed;
+ } ?>
+
+
+ if ($dies > 0) {
+ echo 'Кол-во смертей : ' . $dies . '/3 ';
+ }
+ ?>
+ Карта : #= $lab['id'] ?>. Координаты : {X = = $user['x'] ?> | Y = = $user['y'] ?>}
+
+
+
+
+
+
+
+ if (isset($q1['id'])) {
+ echo 'Задание: ' . $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 '(Задание не засчитается, если Вы не найдёте выход.) ';
+ }
+ ?>
+
+
+
+
+
+ if ($errors != '') {
+ echo $errors . ' ';
+ } ?>
+ = $itms ?>
+
+ if ($user['align'] == 2.99) {
+ echo ' ' . $mapsee2;
+ }
+ ?>
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- echo $mapsee;
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
- } ?>
\ 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(' Вы отдали ненужные страницы в Архив (+'.$cred.')кр. ');
- }
- //ident
- if($names) foreach($names as $n)
- {
- echo(' Вы получили '.$n.' ');
- 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 ' Вы отдали ненужные страницы в Архив (+' . $cred . ')кр. ';
+ }
+ //ident
+ if ($names) {
+ foreach ($names as $n) {
+ echo(' Вы получили ' . $n . ' ');
+ 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('Книга Комментатора [1] : ');
- echo('');
- 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(' ');
- 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 'Книга Комментатора [1] : ';
+ echo '';
+ 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 ' ';
+ } 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('Вы стоите в небольшой комнате, от пола до потолка забтиой банками, пробирками, ингредиентами и прочими полезными вещами.
- Здесь Вы можете собрать предметы по имеющимся у Вас рецептам. ');
+ 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(' ');
- if($craft_err) echo("Недостаточно ингредиентов! ");
- if($book_1) {
- echo(' Рецепты: Книга Комментатора [1] ');
- //ОГОНЬ
- 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 ' Рецепты: Книга Комментатора [1] ';
+ //ОГОНЬ
+ 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 ' ';
+ }
+ ?>
-
-
+ ');
-
-?>
-
-
-
+ 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 @@
-
-$_GET['page'] = (int)$_GET['page'];
-$_REQUEST['log'] = (int)$_REQUEST['log'];
-?>
-
-
-
-
-
-
-
-Бойцовский Клуб Возрождение : Лог боя #=$_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 = 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),' ';
- }
- }
-//print_r($log);
-?>
- $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;
- }
- //echo $stop;
- for($i=$start;$i<=$stop;$i++) {
- echo $log[$i]." ";
- }
-?>
-
-
- echo "".$ffs." ";
-?>
-";
-
-
-
-Страницы:
-
- for ($i=0;$i<=$pgs;++$i) {
- if ($_GET['page']==$i) {
- echo ' ',($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) {
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
Окно игры
-
-
+ document.getElementById("hint3").innerHTML = '
';
+ 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');
?>
-
-
-
-
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;
+ }
+
+Дарильня
+= $status ?>
Вы можете сделать подарок любому персонажу. Ваш подарок будет
отображаться в информации о персонаже.
@@ -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): ?>
Восстановить здоровье
endif ?>
Обновить
Вернуться
Памятник
-
+= $status ?>
На памятнике выгравированы опасные задания, за выполнение которых можно получить достойную
награду! Для каждого задания отводится определенный промежуток времени, если задание не сдано вовремя, то
@@ -77,6 +72,4 @@ if (!empty($q->error)) {
= $questList ?>
-
-
-
\ 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 @@
-
-
-
-