[20, 0, 502, 505, 0], "502" => [15, 0, 0, 0, 501], "503" => [15, 0, 0, 507, 0], "504" => [15, 0, 0, 508, 0], "505" => [20, 501, 0, 510, 0], "506" => [15, 0, 507, 511, 0], "507" => [15, 503, 508, 0, 506], "508" => [25, 504, 0, 513, 507], "509" => [20, 0, 0, 515, 0], "510" => [20, 505, 511, 0, 0], "511" => [20, 506, 0, 0, 510], "512" => [30, 0, 513, 519, 0], "513" => [25, 508, 514, 0, 512], "514" => [20, 0, 0, 0, 513], "515" => [20, 509, 0, 522, 0], "516" => [25, 0, 517, 523, 0], "517" => [25, 0, 518, 0, 516], "518" => [35, 0, 519, 525, 517], "519" => [35, 512, 520, 526, 518], "520" => [35, 0, 521, 0, 519], "521" => [15, 0, 0, 528, 0], "522" => [20, 515, 0, 529, 0], "523" => [15, 516, 0, 530, 0], "524" => [20, 0, 525, 531, 0], "525" => [35, 518, 526, 532, 524], "526" => [40, 519, 527, 533, 525], "527" => [35, 0, 0, 0, 526], "528" => [15, 521, 529, 535, 0], "529" => [20, 522, 0, 0, 528], "530" => [20, 523, 531, 537, 0], "531" => [35, 524, 0, 538, 530], "532" => [20, 525, 533, 539, 0], "533" => [20, 526, 534, 540, 532], "534" => [15, 0, 0, 0, 533], "535" => [20, 528, 0, 541, 0], "536" => [20, 0, 537, 0, 535], "537" => [35, 530, 0, 543, 536], "538" => [20, 531, 0, 544, 0], "539" => [20, 532, 0, 545, 0], "540" => [15, 533, 0, 546, 0], "541" => [20, 535, 542, 547, 0], "542" => [15, 0, 543, 0, 541], "543" => [40, 537, 0, 549, 542], "544" => [40, 538, 545, 550, 543], "545" => [40, 539, 0, 551, 544], "546" => [15, 540, 0, 552, 0], "547" => [20, 541, 548, 553, 0], "548" => [20, 0, 549, 0, 547], "549" => [35, 543, 550, 0, 548], "550" => [40, 544, 551, 554, 549], "551" => [40, 545, 0, 555, 550], "552" => [15, 546, 0, 556, 0], "553" => [20, 547, 0, 557, 0], "554" => [20, 550, 555, 0, 0], "555" => [35, 551, 0, 0, 554], "556" => [15, 552, 0, 559, 0], "557" => [15, 553, 0, 0, 0], "558" => [20, 0, 559, 0, 0], "559" => [20, 556, 560, 0, 558], "560" => [20, 0, 0, 0, 559], ]; mysql_query("LOCK TABLES `bots` WRITE, `deztow_stavka` WRITE, `users` WRITE, `deztow_items` WRITE, `inventory` WRITE, `battle` WRITE, `logs` WRITE, `deztow_turnir` WRITE, `effects` WRITE,`shop` WRITE, `online` WRITE, `deztow_gamers_inv` WRITE, `deztow_realchars` WRITE, `deztow_eff` WRITE, `variables` WRITE"); $ls = mysql_num_rows(mysql_query("SELECT `id` FROM `users` WHERE `bot` = 1 and `in_tower` = 1")); $kol_pl = mysql_num_rows(mysql_query("SELECT `id` FROM `users` WHERE `bot` = 0 and `in_tower` = 1")); $tur_data = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_turnir` WHERE `active` = TRUE")); if ($_GET['give']) { $obj = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_items` WHERE `id` = '" . mysql_real_escape_string($_GET['give']) . "' and `room` = '" . $user->getRoom() . "' LIMIT 1")); if ($obj) { if ($_SESSION['timei'] - time() <= 0) { $_SESSION['timei'] = (time() + 3); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '" . $obj['iteam_id'] . "' LIMIT 1")); if (isset($dress['id'])) { mysql_query("INSERT INTO `inventory` (`bs`, `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`, `koll`) VALUES ('1', '{$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['koll']}')"); mysql_query("DELETE FROM `deztow_items` WHERE `id` = '" . mysql_real_escape_string($_GET['give']) . "' and `room` = '" . $user->getRoom() . "' LIMIT 1"); } else { echo 'Предмет не найден. Сообщите Администрации данный код #' . $obj['iteam_id'] . '#'; } } else { echo "Вы сможете поднять вещь через " . ($_SESSION['timei'] - time()) . " секунд..."; } } else { echo "Кто-то был быстрее..."; } } if ($_POST['attack']) { $jert = mysql_fetch_array(mysql_query("SELECT `id`, `login`, `room`, `battle`, `hp` FROM `users` WHERE `login` = '" . mysql_real_escape_string($_POST['attack']) . "' LIMIT 1")); if ($jert['room'] == $user->getRoom() && $jert['id'] != $user['id']) { if ($jert['id'] == 233 || $jert['id'] == 234 || $jert['id'] == 235) { $arha = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `prototype` = "' . $jert['id'] . '" LIMIT 1')); if (isset($arha['id'])) { $jert['battle'] = $arha['battle']; $jert['id'] = $arha['id']; } else { $jert['battle'] = 0; #$jert['id'] = $jert['id']; ?!?!?!?!?!?! } $bot = 1; } if ($jert['battle'] > 0) { $bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $jert['battle'] . '" LIMIT 1')); $battle = unserialize($bd['teams']); $ak = array_keys($battle[$jert['id']]); $battle[$user['id']] = $battle[$ak[0]]; foreach ($battle[$user['id']] as $k => $v) { $battle[$k][$user['id']] = [0, 0, time()]; $battle[$user['id']][$k] = [0, 0, time()]; } $t1 = explode(";", $bd['t1']); if (in_array($jert['id'], $t1)) { $ttt = 2; $ttt2 = 1; } else { $ttt = 1; $ttt2 = 2; } addch("" . Nick::id($user['id'])->short() . " вмешался в поединок »».", $user->getRoom()); 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'] . '\'), `to' . $ttt . '` = \'' . time() . '\', `to' . $ttt2 . '` = \'' . (time() - 1) . '\' WHERE `id` = "' . $jert['battle'] . '" LIMIT 1'); mysql_query("UPDATE `users` SET `battle` = '" . $jert['battle'] . "', `zayavka` = 0 WHERE `id` = '" . $user['id'] . "' LIMIT 1"); mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,\'' . "" . date("d.m.y H:i") . " " . Nick::id($user['id'])->full(1) . " вмешался в поединок против " . Nick::id($jert['id'])->full(1) . " »»" . '\') WHERE `active` = TRUE LIMIT 1'); header("Location: fbattle.php"); } else { if ($bot) { mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('" . $jert['login'] . "', '" . $jert['id'] . "', '', '" . $jert['hp'] . "')"); $jert['id'] = mysql_insert_id(); } $teams = []; $teams[$user['id']][$jert['id']] = [0, 0, time()]; $teams[$jert['id']][$user['id']] = [0, 0, time()]; $sv = [1, 2, 3, 4, 5]; mysql_query("INSERT INTO `battle` (`coment`, `teams`, `timeout`, `type`, `status`, `t1`, `t2`, `to1`, `to2`, `blood`) VALUES ('', '" . serialize($teams) . "', '" . $sv[rand(0, 3)] . "', '10', '0', '" . $user['id'] . "', '" . $jert['id'] . "', '" . time() . "', '" . time() . "', '1')"); $id = mysql_insert_id(); if ($bot) { mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$jert['id']} LIMIT 1"); } else { mysql_query("UPDATE `users` SET `battle` = {$id} WHERE `id` = {$jert['id']} LIMIT 1"); } $rr = "" . Nick::id($user['id'])->full(1) . " и " . Nick::id($jert['id'])->full(1) . ""; addch("" . Nick::id($user['id'])->short() . " , применив магию нападения, внезапно напал на " . Nick::id($jert['id'])->short() . ".", $user->getRoom()); addlog($id, "Часы показывали " . date("Y.m.d H.i") . ", когда " . $rr . " бросили вызов друг другу. "); mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE (`id` = {$user['id']} OR `id` = {$jert['id']})"); mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,\'' . "" . date("d.m.y H:i") . " " . Nick::id($user['id'])->full(1) . " напал на " . Nick::id($jert['id'])->full(1) . " завязался бой »»" . '\') WHERE `active` = TRUE LIMIT 1'); header("Location: fbattle.php"); } } else { echo 'Жертва ускользнула из комнаты...'; } } $_GET['path'] = (int)$_GET['path']; if ($rhar[$user->getRoom()][$_GET['path']] > 0 && $_GET['path'] < 5 && $_GET['path'] > 0 && ($_SESSION['time'] <= time())) { $rr = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `type` = 10 AND `owner` = {$user['id']} LIMIT 1")); if (!isset($rr['id'])) { $list = mysql_query("SELECT `id`, `room`, `login` FROM `users` WHERE `room` = '" . $user->getRoom() . "' AND `in_tower` = 1"); while ($u = mysql_fetch_array($list)) { if ($u['id'] != $user['id']) { addchp('Внимание! ' . $user['login'] . ' отправился в ' . $rooms[$rhar[$user->getRoom()][$_GET['path']]] . '.', '{[]}' . $u['login'] . '{[]}'); } } $list = mysql_query("SELECT `id`, `room`, `login` FROM `users` WHERE `room` = '" . $rhar[$user->getRoom()][$_GET['path']] . "' AND `in_tower` = 1"); while ($u = mysql_fetch_array($list)) { addchp('Внимание! ' . $user['login'] . ' вошел в комнату.', '{[]}' . $u['login'] . '{[]}'); } mysql_query("UPDATE `users`, `online` SET `users`.`room` = '" . $rhar[$user->getRoom()][$_GET['path']] . "', `online`.`room` = '" . $rhar[$user->getRoom()][$_GET['path']] . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'"); $_SESSION['time'] = (time() + $rhar[$rhar[$user->getRoom()][$_GET['path']]][0]); header('Location: towerin.php'); } else { err('Вы парализованы и не можете двигаться...'); } } $list = mysql_query("SELECT * FROM `users` WHERE `in_tower` = 1 AND `battle` = 0"); while ($u = mysql_fetch_array($list)) { if ($u['hp'] <= 0) { undressall($u['id']); $rep = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '" . $u['id'] . "' AND `bs` = 1"); while ($r = mysql_fetch_array($rep)) { mysql_query("INSERT `deztow_items` (`iteam_id`, `name`, `img`, `room`) VALUES ('" . $r['prototype'] . "', '" . $r['name'] . "', '" . $r['img'] . "', '" . $u['room'] . "')"); } mysql_query("DELETE FROM `inventory` WHERE `owner` = '" . $u['id'] . "' AND `bs` = 1"); $tec = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_realchars` WHERE `owner` = '{$u['id']}' LIMIT 1")); if (isset($tec['id'])) { mysql_query("DELETE FROM `deztow_realchars` WHERE `owner` = '{$u['id']}'"); $u = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$u['id']}' LIMIT 1")); mysql_query("UPDATE `users` SET `sila` = '" . $tec['sila'] . "', `lovk` = '" . $tec['lovk'] . "', `inta` = '" . $tec['inta'] . "', `vinos` = '" . $tec['vinos'] . "', `intel` = '" . $tec['intel'] . "', `stats` = '" . $tec['stats'] . "', `nextup` = '" . $tec['nextup'] . "', `level` = '" . $tec['level'] . "', `hp` = '" . ($tec['vinos'] * 6) . "', `maxhp` = '" . ($tec['vinos'] * 6) . "', `align` = '" . $tec['align'] . "', `noj` = '" . $tec['noj'] . "', `mec` = '" . $tec['mec'] . "', `topor` = '" . $tec['topor'] . "', `dubina` = '" . $tec['dubina'] . "', `mlight` = '" . $tec['mlight'] . "', `mgray` = '" . $tec['mgray'] . "', `mdark` = '" . $tec['mdark'] . "', `master` = '" . $tec['master'] . "' WHERE `id` = '" . $u['id'] . "' LIMIT 1"); } $eff = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = '" . $u['id'] . "' AND (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14 OR `type` = 2 OR `type` = 3)")); mysql_query("DELETE FROM `effects` WHERE `owner` = '" . $u['id'] . "' AND `type` != 11 AND `type` != 12 AND `type` != 13 AND `type` != 14 AND `type` != 2 AND `type` != 3"); if ($tec[0]) { mysql_query("UPDATE `users` SET `sila` = `sila`-'" . $eff['sila'] . "', `lovk` = `lovk`-'" . $eff['lovk'] . "', `inta` = `inta`-'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1"); } get_out($u['id']); mysql_query("UPDATE `users` SET `in_tower` = 0, `room` = '31' WHERE `id` = '" . $u['id'] . "'"); mysql_query("UPDATE `online` SET `room` = '31' WHERE `id` = '" . $u['id'] . "'"); mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,\'' . "" . date("d.m.y H:i") . " " . Nick::id($u['id'])->full(1) . " повержен и выбывает из турнира" . '\') WHERE `active` = TRUE LIMIT 1'); addchp('Внимание! Вы выбыли из турнира Башни Смерти.', '{[]}' . $u['login'] . '{[]}'); header('Location: tower.php'); } } if (($kol_pl + $ls) < 2 && ($tur_data['start_time'] + 60) <= time()) { $tur = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_turnir` WHERE `active` = TRUE LIMIT 1")); undressall($user['id']); $rep = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `bs` = 1"); while ($r = mysql_fetch_array($rep)) { mysql_query("INSERT `deztow_items` (`iteam_id`, `name`, `img`, `room`) VALUES ('" . $r['prototype'] . "', '" . $r['name'] . "', '" . $r['img'] . "', '" . $user->getRoom() . "');"); } mysql_query("DELETE FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `bs` = 1"); $tec = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_realchars` WHERE `owner` = '{$user['id']}'")); if (isset($tec['id'])) { mysql_query("DELETE FROM `deztow_realchars` WHERE `owner` = '{$user['id']}'"); $u = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$user['id']}' LIMIT 1")); mysql_query("UPDATE `users` SET `sila` = '" . $tec['sila'] . "', `lovk` = '" . $tec['lovk'] . "', `inta` = '" . $tec['inta'] . "', `vinos` = '" . $tec['vinos'] . "', `intel` = '" . $tec['intel'] . "', `stats` = '" . $tec['stats'] . "', `nextup` = '" . $tec['nextup'] . "', `level` = '" . $tec['level'] . "', `align` = '" . $tec['align'] . "', `hp` = '" . ($tec['vinos'] * 6) . "', `maxhp` = '" . ($tec['vinos'] * 6) . "', `noj` = '" . $tec['noj'] . "', `mec` = '" . $tec['mec'] . "', `topor` = '" . $tec['topor'] . "', `dubina` = '" . $tec['dubina'] . "', `mlight` = '" . $tec['mlight'] . "', `mgray` = '" . $tec['mgray'] . "', `mdark` = '" . $tec['mdark'] . "', `master` = '" . $tec['master'] . "' WHERE `id` = '" . $user['id'] . "' LIMIT 1"); } mysql_query("DELETE FROM `effects` WHERE `owner` = '" . $user['id'] . "' AND `type` != 11 AND `type` != 12 AND `type` != 13 AND `type` != 14 AND `type` != 2 AND `type` != 3"); get_out($user['id']); mysql_query("UPDATE `users` SET `money` = (`money`+'" . $tur['coin'] . "'), `in_tower` = 0, `room` = 31 WHERE `id` = '" . $user['id'] . "' LIMIT 1"); mysql_query("UPDATE `online` SET `room` = 31 WHERE `id` = '" . $user['id'] . "' LIMIT 1"); mysql_query('UPDATE `deztow_turnir` SET `winner` = \'' . $user['id'] . '\', `winnerlog` = \'' . Nick::id($user['id'])->full(1) . '\', `endtime` = \'' . time() . '\', `active` = FALSE, `log` = CONCAT(`log`,\'' . "" . date("d.m.y H:i") . " Турнир завершен. Победитель : " . Nick::id($user['id'])->full(1) . " Приз : " . $tur['coin'] . " кр. " . '\') WHERE `active` = TRUE LIMIT 1'); addchp('Внимание! Поздравляем! Вы победитель турнира Башни смерти! Получаете ' . $tur['coin'] . ' кр.', '{[]}' . $user['login'] . '{[]}'); AddChatSystem('Внимание! Битва в Башне Смерти завершена. Победитель : ' . $user['login'] . ' [' . $user['level'] . ']'); if ($tur['art'] == 1) { $bs_art = 0; } else { $bs_art = 0; } #1 mysql_query('UPDATE `variables` SET `value` = "' . (time() + 60 * 60 * 1) . '", `bs_art` = "' . $bs_art . '" WHERE `var` = "startbs" LIMIT 1'); mysql_query("TRUNCATE TABLE `deztow_stavka`"); mysql_query("TRUNCATE TABLE `deztow_gamers_inv`"); mysql_query("TRUNCATE TABLE `deztow_items`"); mysql_query("TRUNCATE TABLE `deztow_trap`"); header('Location: tower.php'); } mysql_query("UNLOCK TABLES"); if ($user['hp'] <= 0) { header('Location: tower.php'); exit; } \Battles\Template::header('towerin'); ?> = Nick::id($user)->battle() ?> = $rooms[$user->getRoom()]; ?> $its = mysql_query("SELECT * FROM `deztow_items` WHERE `room` = '" . $user->getRoom() . "';"); if (mysql_num_rows($its) > 0) { echo 'В комнате разбросаны вещи:'; } while ($it = mysql_fetch_array($its)) { echo ' '; } ?> getRoom()][4]]) { echo 'id="m7"'; } ?> href="?rnd=0.817371946556865&path=4">getRoom()][4]]) { echo 'i'; } ?>nmousemove="fastshow2('= $rooms[$rhar[$user->getRoom()][4]] ?>');" onmouseout="hideshow();"/> getRoom()][1]]) { echo 'id="m1"'; } ?> href="?rnd=0.817371946556865&path=1">getRoom()][1]]) { echo 'i'; } ?>onmousemove="fastshow2('= $rooms[$rhar[$user->getRoom()][1]] ?>');" onmouseout="hideshow();"/> getRoom()][3]]) { echo 'id="m5"'; } ?> href="?rnd=0.817371946556865&path=3">getRoom()][3]]) { echo 'i'; } ?>onmousemove="fastshow2('= $rooms[$rhar[$user->getRoom()][3]] ?>');" onmouseout="hideshow();"/> getRoom()][2]]) { echo 'id="m3"'; } ?> href="?rnd=0.817371946556865&path=2">getRoom()][2]]) { echo 'i'; } ?>onmousemove="fastshow2('= $rooms[$rhar[$user->getRoom()][2]] ?>');" onmouseout="hideshow();"/> Всего живых участников на данный момент : echo "" . $kol_pl . " + " . $ls . ""; ?>...