Зачем-то инкапсулирем.

This commit is contained in:
lopar 2021-02-01 21:20:23 +02:00
parent 7dd6368b84
commit 2ccb5ef128
63 changed files with 345 additions and 345 deletions

View File

@ -15,7 +15,7 @@ use Battles\Template;
use Battles\User; use Battles\User;
$user = $user ?? new User($_SESSION['uid']); $user = $user ?? new User($_SESSION['uid']);
if (!$user->admin) { if (!$user->getAdmin()) {
header("HTTP/1.0 404 Not Found"); header("HTTP/1.0 404 Not Found");
exit; exit;
} }

View File

@ -7,8 +7,8 @@
session_start(); session_start();
require_once "../functions.php"; require_once "../functions.php";
$user = $user ?? new User($_SESSION['uid']);
if (!$user->admin) { if (!$user->getAdmin()) {
header("HTTP/1.0 404 Not Found"); header("HTTP/1.0 404 Not Found");
exit; exit;
} }

View File

@ -1,7 +1,7 @@
<?php <?php
session_start(); session_start();
require_once('functions.php'); require_once('functions.php');
if ($user->room == 51) { if ($user->getRoom() == 51) {
header('location: city.php'); header('location: city.php');
exit; exit;
} }

View File

@ -6,7 +6,7 @@ use Battles\User;
session_start(); session_start();
require_once "functions.php"; require_once "functions.php";
$user = $user ?? new User($_SESSION['uid']); $user = $user ?? new User($_SESSION['uid']);
if ($user->room == 403) { if ($user->getRoom() == 403) {
include "startpodzemel.php"; include "startpodzemel.php";
if ($_GET['act'] == "cexit") { if ($_GET['act'] == "cexit") {
$das = mysql_query("select glava,glav_id from `labirint` where user_id='" . $user['id'] . "'"); $das = mysql_query("select glava,glav_id from `labirint` where user_id='" . $user['id'] . "'");

View File

@ -1,5 +1,5 @@
<?php <?php
if ($user->room == 403) { if ($user->getRoom() == 403) {
$s = db::c()->query('SELECT * FROM podzem2 WHERE name= "?s"', $mir['name'])->fetch_assoc(); $s = db::c()->query('SELECT * FROM podzem2 WHERE name= "?s"', $mir['name'])->fetch_assoc();
$rooms[0] = ""; $rooms[0] = "";

View File

@ -287,15 +287,15 @@ function makedeath()
{ {
global $user, $floor, $loses, $x, $y, $dir; global $user, $floor, $loses, $x, $y, $dir;
$cavedata = Config::$cavedata ?? []; $cavedata = Config::$cavedata ?? [];
if (!isset($cavedata[$user->room]['x' . $floor])) { if (!isset($cavedata[$user->getRoom()]['x' . $floor])) {
$floor = 1; $floor = 1;
loadmap(); loadmap();
} }
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->room]['x' . $floor] . "', `y` = '" . $cavedata[$user->room]['y' . $floor] . "', `dir` = '" . $cavedata[$user->room]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$user[id]' LIMIT 1"); mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->getRoom()]['x' . $floor] . "', `y` = '" . $cavedata[$user->getRoom()]['y' . $floor] . "', `dir` = '" . $cavedata[$user->getRoom()]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$user[id]' LIMIT 1");
mysql_query('UPDATE `users` SET `hp` = 1 WHERE `id` = "' . $user['id'] . '" LIMIT 1'); mysql_query('UPDATE `users` SET `hp` = 1 WHERE `id` = "' . $user['id'] . '" LIMIT 1');
$x = $cavedata[$user->room]['x' . $floor]; $x = $cavedata[$user->getRoom()]['x' . $floor];
$y = $cavedata[$user->room]['y' . $floor]; $y = $cavedata[$user->getRoom()]['y' . $floor];
$dir = $cavedata[$user->room]['dir' . $floor]; $dir = $cavedata[$user->getRoom()]['dir' . $floor];
updparties(); updparties();
$loses++; $loses++;
} }
@ -466,7 +466,7 @@ while ($rec = mysql_fetch_assoc($r)) {
$party[] = $rec; $party[] = $rec;
} }
if ($user->room == 621) { if ($user->getRoom() == 621) {
$base = "/underdesigns/alchcave"; $base = "/underdesigns/alchcave";
} }
@ -547,8 +547,8 @@ if ($_GET['useitem']) {
$ty = $y + 1; $ty = $y + 1;
} }
if (@$_GET['useitem']) { if (@$_GET['useitem']) {
if (file_exists("underground/objects/$user->room.php")) { if (file_exists("underground/objects/$user->getRoom().php")) {
include "underground/objects/$user->room.php"; include "underground/objects/$user->getRoom().php";
} }
} }
@ -644,7 +644,7 @@ if ($wander && !isset($_GET['attack'])) {
$ty = $v['y'] + 2; $ty = $v['y'] + 2;
} }
if ($user->room == 74 || $user->room == 76) { if ($user->getRoom() == 74 || $user->getRoom() == 76) {
if (strpos($map[$ty][$tx], 's/') !== false && !@$mapbots[$ty][$tx]) { if (strpos($map[$ty][$tx], 's/') !== false && !@$mapbots[$ty][$tx]) {
break; break;
} }
@ -712,8 +712,8 @@ if ($moved && (substr($map[$y * 2][$x * 2], 0, 1) === "e" || substr($map[$y * 2]
$tx = $x; $tx = $x;
$ty = $y; $ty = $y;
$tmp = explode("/", $map[$y * 2][$x * 2]); $tmp = explode("/", $map[$y * 2][$x * 2]);
if (file_exists("underground/events/$user->room.php")) { if (file_exists("underground/events/$user->getRoom().php")) {
include("underground/events/$user->room.php"); include("underground/events/$user->getRoom().php");
} }
} }
@ -738,7 +738,7 @@ if ($ambushes[$y * 2][$x * 2 - 2] && $map[$y * 2][$x * 2 - 1] == 0) {
if ($ax && $ay && $user['hp'] > 0) { if ($ax && $ay && $user['hp'] > 0) {
$cavedata = Config::$cavedata ?? []; $cavedata = Config::$cavedata ?? [];
if (!($cavedata[$user->room]['x' . $floor] == $x && $cavedata[$user->room]['y' . $floor] == $y)) { if (!($cavedata[$user->getRoom()]['x' . $floor] == $x && $cavedata[$user->getRoom()]['y' . $floor] == $y)) {
if ($ax < $x) { if ($ax < $x) {
$dir1 = 0; $dir1 = 0;
} elseif ($ax > $x) { } elseif ($ax > $x) {
@ -902,7 +902,7 @@ if (@$_GET['exit']) {
} }
} }
mysql_query("DELETE FROM `inventory` WHERE `owner` = '$user[id]' AND `foronetrip` = 1"); mysql_query("DELETE FROM `inventory` WHERE `owner` = '$user[id]' AND `foronetrip` = 1");
gotoroom($user->room - 1); gotoroom($user->getRoom() - 1);
} }
$standingon = $map[$y * 2][$x * 2]; $standingon = $map[$y * 2][$x * 2];
@ -1470,9 +1470,9 @@ function drawmap($map1, $players, $x, $y, $direction)
$ret .= drawobject2($aMap[$yy][$xx], $x, $y); $ret .= drawobject2($aMap[$yy][$xx], $x, $y);
} }
$rrm = $user->room; $rrm = $user->getRoom();
if (isset($dialogs[CaveBots::$bots[$data[1]]]) && (CaveBots::$bots[$data[1]] == 11147 && $user->room == 74)) { if (isset($dialogs[CaveBots::$bots[$data[1]]]) && (CaveBots::$bots[$data[1]] == 11147 && $user->getRoom() == 74)) {
$ret .= "<img title=\"$botname" . ($cnt > 1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? "onclick=\"speakattackmenu(event);\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />"; $ret .= "<img title=\"$botname" . ($cnt > 1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? "onclick=\"speakattackmenu(event);\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />";
} else { } else {
$ret .= "<img title=\"$botname" . ($cnt > 1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? " onclick=\"document.location.href='cave.php?attack=1';\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />"; $ret .= "<img title=\"$botname" . ($cnt > 1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? " onclick=\"document.location.href='cave.php?attack=1';\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />";
@ -1562,7 +1562,7 @@ function drawmap($map1, $players, $x, $y, $direction)
$left = $imgdata[$x][$y]["x"][1]; $left = $imgdata[$x][$y]["x"][1];
$top = $imgdata[$x][$y]["y"] + $ht; $top = $imgdata[$x][$y]["y"] + $ht;
} }
$rrm = $user->room; $rrm = $user->getRoom();
if (!isset($imgmap[$obj])) { if (!isset($imgmap[$obj])) {
$ret .= " $ret .= "
@ -1607,7 +1607,7 @@ function drawmap($map1, $players, $x, $y, $direction)
$left = $imgdata[$x][$y]["x"][1]; $left = $imgdata[$x][$y]["x"][1];
$top = $imgdata[$x][$y]["y"] + $ht; $top = $imgdata[$x][$y]["y"] + $ht;
} }
$rrm = $user->room; $rrm = $user->getRoom();
if (!isset($imgmap[$obj])) { if (!isset($imgmap[$obj])) {
$ret .= " $ret .= "
" . ($y == 1 && $x == 3 ? "<a href=\"cave.php?useitem=1\">" : "") . " " . ($y == 1 && $x == 3 ? "<a href=\"cave.php?useitem=1\">" : "") . "
@ -1768,7 +1768,7 @@ function drawmap($map1, $players, $x, $y, $direction)
} }
$objInWall = explode('/', $map[3][$wall]); $objInWall = explode('/', $map[3][$wall]);
if ($objInWall[1] == "o") { if ($objInWall[1] == "o") {
if ($user->room == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82 if ($user->getRoom() == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82
$ret .= drawobject('//' . $objInWall[2], 3, $i); $ret .= drawobject('//' . $objInWall[2], 3, $i);
} }
} }
@ -1991,10 +1991,10 @@ progress_update();
<td width=540> <td width=540>
<div style="text-align:right;padding-right:30px"> <div style="text-align:right;padding-right:30px">
<font style='font-size:14px; color:#8f0000'><b><? <font style='font-size:14px; color:#8f0000'><b><?
$dMap = unserialize(mysql_result(mysql_query("SELECT `map` FROM `cavemaps` WHERE `floor` = $floor AND `room` = " . ($user->room - 1)), 0, 0)); $dMap = unserialize(mysql_result(mysql_query("SELECT `map` FROM `cavemaps` WHERE `floor` = $floor AND `room` = " . ($user->getRoom() - 1)), 0, 0));
$cPlace = $dMap[$y * 2][$x * 2]; $cPlace = $dMap[$y * 2][$x * 2];
$tmp = explode("/", $cPlace); $tmp = explode("/", $cPlace);
if ($user->room == 621) { if ($user->getRoom() == 621) {
if ($floor == 1) { if ($floor == 1) {
echo 'Проклятый Рудник, 1 этаж'; echo 'Проклятый Рудник, 1 этаж';
} elseif ($floor == 2) { } elseif ($floor == 2) {

20
ch.php
View File

@ -4,12 +4,12 @@ use Battles\Template;
session_start(); session_start();
require_once 'functions.php'; require_once 'functions.php';
$user = $user ?? new User($_SESSION['uid']);
db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `id` = ?i', time(), $u->i()['id']); db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `id` = ?i', time(), $u->i()['id']);
if (isset($_GET['online']) && $_GET['online'] != null) { if (isset($_GET['online']) && $_GET['online'] != null) {
if ($_GET['room'] && (int)$_GET['room'] < 500) { if ($_GET['room'] && (int)$_GET['room'] < 500) {
$user->room = (int)$_GET['room']; $user->setRoom($_GET['room']);
} }
if ($u->i()['caveleader'] > 0) { if ($u->i()['caveleader'] > 0) {
$data = db::c()->query(' $data = db::c()->query('
@ -35,13 +35,13 @@ if (isset($_GET['online']) && $_GET['online'] != null) {
ORDER BY ORDER BY
`u`.`login` `u`.`login`
'); ');
$ttl = "<span style=\"color: #8f0000; font-size: 10pt;\"><b>" . $rooms[$user->room] . " (" . mysql_num_rows($data) . ")</b></span>"; $ttl = "<span style=\"color: #8f0000; font-size: 10pt;\"><b>" . $rooms[$user->getRoom()] . " (" . mysql_num_rows($data) . ")</b></span>";
$ch1 = '_active'; $ch1 = '_active';
$ch2 = '_passive'; $ch2 = '_passive';
$ch3 = '_passive'; $ch3 = '_passive';
$ch4 = '_passive'; $ch4 = '_passive';
$ch5 = '_passive'; $ch5 = '_passive';
} elseif ($user->room == 760) { } elseif ($user->getRoom() == 760) {
$forest = db::c()->query('SELECT `id`, `room`, `time`, `user`, `data` FROM `forest` WHERE `user` = "' . $user['id'] . '" LIMIT 1')->fetch_assoc(); $forest = db::c()->query('SELECT `id`, `room`, `time`, `user`, `data` FROM `forest` WHERE `user` = "' . $user['id'] . '" LIMIT 1')->fetch_assoc();
$sp = db::c()->query('SELECT `id`, `room`, `user` FROM `forest` WHERE `room` = "' . $forest['room'] . '"'); $sp = db::c()->query('SELECT `id`, `room`, `user` FROM `forest` WHERE `room` = "' . $forest['room'] . '"');
while ($pl = $sp->fetch_assoc()) { while ($pl = $sp->fetch_assoc()) {
@ -100,18 +100,18 @@ if (isset($_GET['online']) && $_GET['online'] != null) {
WHERE WHERE
`o`.`id` = `u`.`id` AND `o`.`id` = `u`.`id` AND
(`o`.`date` >= ' . (time() - 90) . ' OR `u`.`in_tower` = 1) AND (`o`.`date` >= ' . (time() - 90) . ' OR `u`.`in_tower` = 1) AND
`o`.`room` = "' . $user->room . '" `o`.`room` = "' . $user->getRoom() . '"
ORDER BY ORDER BY
`u`.`login` `u`.`login`
'); ');
$ttl = "<span style=\"color: #8f0000; font-size: 10pt;\"><b>" . $rooms[$user->room] . " (" . mysql_num_rows($data) . ")</b></span>"; $ttl = "<span style=\"color: #8f0000; font-size: 10pt;\"><b>" . $rooms[$user->getRoom()] . " (" . mysql_num_rows($data) . ")</b></span>";
$ch1 = '_active'; $ch1 = '_active';
$ch2 = '_passive'; $ch2 = '_passive';
$ch3 = '_passive'; $ch3 = '_passive';
$ch4 = '_passive'; $ch4 = '_passive';
$ch5 = '_passive'; $ch5 = '_passive';
} }
Template::header(sprintf('%s (%s)', $rooms[$user->room], mysql_num_rows($data))); Template::header(sprintf('%s (%s)', $rooms[$user->getRoom()], mysql_num_rows($data)));
?> ?>
<script> <script>
function fastshow(content) { function fastshow(content) {
@ -366,7 +366,7 @@ if (isset($_GET['online']) && $_GET['online'] != null) {
$ks++; $ks++;
$lastpost = $math[1]; $lastpost = $math[1];
unset($math[3]); unset($math[3]);
} elseif ((strpos($math[3], "private") === FALSE) /*&& ($user->room == $math[4])*/) { } elseif ((strpos($math[3], "private") === FALSE) /*&& ($user->getRoom() == $math[4])*/) {
$times = ''; $times = '';
$soundON = ''; $soundON = '';
if ((strpos($math[3], "[" . $user['login'] . "]") > 0) || ($math[2] == $user['login'])) { if ((strpos($math[3], "[" . $user['login'] . "]") > 0) || ($math[2] == $user['login'])) {
@ -461,7 +461,7 @@ if (isset($_GET['online']) && $_GET['online'] != null) {
if ($action != 1) { if ($action != 1) {
$file = 'tmp/chat.txt'; $file = 'tmp/chat.txt';
if (filesize("tmp/chat.txt") > 100 * 1024) { if (filesize("tmp/chat.txt") > 100 * 1024) {
$line = "\r\n:[" . time() . "]:[{$user['login']}]:[<font color=\"" . (($user['color']) ? $user['color'] : "#000000") . "\">" . ($_GET['text']) . "</font>]:[" . $user->room . "]\r\n"; $line = "\r\n:[" . time() . "]:[{$user['login']}]:[<font color=\"" . (($user['color']) ? $user['color'] : "#000000") . "\">" . ($_GET['text']) . "</font>]:[" . $user->getRoom() . "]\r\n";
// Пишем содержимое в файл, // Пишем содержимое в файл,
// используя флаг FILE_APPEND flag для дописывания содержимого в конец файла // используя флаг FILE_APPEND flag для дописывания содержимого в конец файла
// и флаг LOCK_EX для предотвращения записи данного файла кем-нибудь другим в данное время // и флаг LOCK_EX для предотвращения записи данного файла кем-нибудь другим в данное время
@ -469,7 +469,7 @@ if (isset($_GET['online']) && $_GET['online'] != null) {
file_put_contents($file, $line, FILE_APPEND | LOCK_EX); file_put_contents($file, $line, FILE_APPEND | LOCK_EX);
echo "1"; echo "1";
} else { } else {
$line = ":[" . time() . "]:[{$user['login']}]:[<font color=\"" . (($user['color']) ? $user['color'] : "#000000") . "\">" . ($_GET['text']) . "</font>]:[" . $user->room . "]\r\n"; $line = ":[" . time() . "]:[{$user['login']}]:[<font color=\"" . (($user['color']) ? $user['color'] : "#000000") . "\">" . ($_GET['text']) . "</font>]:[" . $user->getRoom() . "]\r\n";
file_put_contents($file, $line, FILE_APPEND | LOCK_EX); file_put_contents($file, $line, FILE_APPEND | LOCK_EX);
echo "2"; echo "2";
} }

View File

@ -33,12 +33,12 @@ if($_GET['id'] == 1) {
} elseif($_GET['id'] == 6) { } elseif($_GET['id'] == 6) {
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `room` FROM `users` WHERE `id` = "'.(int)$_GET['user'].'" LIMIT 1')); $user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `room` FROM `users` WHERE `id` = "'.(int)$_GET['user'].'" LIMIT 1'));
if(isset($user['id'])) { if(isset($user['id'])) {
addch('<font color=red>Внимание!</font> Ваш бой не может начаться по причине <b>Группа не набрана</b>', $user['login'], $user->room); addch('<font color=red>Внимание!</font> Ваш бой не может начаться по причине <b>Группа не набрана</b>', $user['login'], $user->getRoom());
} }
} elseif($_GET['id'] == 7) { } elseif($_GET['id'] == 7) {
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `room` FROM `users` WHERE `id` = "'.(int)$_GET['user'].'" LIMIT 1')); $user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `room` FROM `users` WHERE `id` = "'.(int)$_GET['user'].'" LIMIT 1'));
if(isset($user['id'])) { if(isset($user['id'])) {
addch('<font color=red>Внимание!</font> Ваш бой начался.', $user['login'], $user->room); addch('<font color=red>Внимание!</font> Ваш бой начался.', $user['login'], $user->getRoom());
} }
} else { } else {
exit; exit;

108
city.php
View File

@ -17,180 +17,180 @@ switch ($location[0]) {
default: default:
break; break;
case 'cp': case 'cp':
Battles\Travel::toRoom(20,$user->room); Battles\Travel::toRoom(20,$user->getRoom());
break; break;
case 'strah': case 'strah':
Battles\Travel::toRoom(21,$user->room); Battles\Travel::toRoom(21,$user->getRoom());
break; break;
case 'bps': case 'bps':
Battles\Travel::toRoom(26,$user->room); Battles\Travel::toRoom(26,$user->getRoom());
break; break;
case 'ps': case 'ps':
Battles\Travel::toRoom(51,$user->room); Battles\Travel::toRoom(51,$user->getRoom());
break; break;
case 'zaliv': case 'zaliv':
Battles\Travel::toRoom(2111,$user->room); Battles\Travel::toRoom(2111,$user->getRoom());
break; break;
case 'zamk': case 'zamk':
Battles\Travel::toRoom(2601,$user->room); Battles\Travel::toRoom(2601,$user->getRoom());
break; break;
case 'abog': case 'abog':
Battles\Travel::toRoom(2655,$user->room); Battles\Travel::toRoom(2655,$user->getRoom());
break; break;
case 'torg': case 'torg':
Battles\Travel::toRoom(2702,$user->room); Battles\Travel::toRoom(2702,$user->getRoom());
break; break;
case 'got': case 'got':
if ($user->room == 20) { if ($user->getRoom() == 20) {
switch ($location[1]) { switch ($location[1]) {
default: default:
break; break;
case 'level1': case 'level1':
Battles\Travel::toRoom(1,$user->room); Battles\Travel::toRoom(1,$user->getRoom());
break; break;
case 'level7': case 'level7':
Battles\Travel::toRoom(21,$user->room); Battles\Travel::toRoom(21,$user->getRoom());
break; break;
case 'level8': case 'level8':
Battles\Travel::toRoom(26,$user->room); Battles\Travel::toRoom(26,$user->getRoom());
break; break;
case 'level13': case 'level13':
header('location: quest_room.php'); header('location: quest_room.php');
break; break;
case 'level222': case 'level222':
Battles\Travel::toRoom(2702,$user->room); Battles\Travel::toRoom(2702,$user->getRoom());
break; break;
case 'level17': case 'level17':
Battles\Travel::toRoom(50,$user->room); Battles\Travel::toRoom(50,$user->getRoom());
break; break;
case 'level2': case 'level2':
Battles\Travel::toRoom(22,$user->room); Battles\Travel::toRoom(22,$user->getRoom());
break; break;
case 'level4': case 'level4':
Battles\Travel::toRoom(23,$user->room); Battles\Travel::toRoom(23,$user->getRoom());
break; break;
case 'level6': case 'level6':
Battles\Travel::toRoom(27,$user->room); Battles\Travel::toRoom(27,$user->getRoom());
break; break;
case 'level3': case 'level3':
Battles\Travel::toRoom(25,$user->room); Battles\Travel::toRoom(25,$user->getRoom());
break; break;
} }
} elseif ($user->room == 21) { } elseif ($user->getRoom() == 21) {
switch ($location[1]) { switch ($location[1]) {
default: default:
break; break;
case 'level4': case 'level4':
Battles\Travel::toRoom(20,$user->room); Battles\Travel::toRoom(20,$user->getRoom());
break; break;
case 'level3': case 'level3':
Battles\Travel::toRoom(2111,$user->room); Battles\Travel::toRoom(2111,$user->getRoom());
break; break;
case 'level13': case 'level13':
Battles\Travel::toRoom(34,$user->room); Battles\Travel::toRoom(34,$user->getRoom());
break; break;
case 'level5': case 'level5':
Battles\Travel::toRoom(29,$user->room); Battles\Travel::toRoom(29,$user->getRoom());
break; break;
case 'level16': case 'level16':
Battles\Travel::toRoom(31,$user->room); Battles\Travel::toRoom(31,$user->getRoom());
break; break;
case 'level14': case 'level14':
Battles\Travel::toRoom(30,$user->room); Battles\Travel::toRoom(30,$user->getRoom());
break; break;
case 'level650': case 'level650':
Battles\Travel::toRoom(650,$user->room); Battles\Travel::toRoom(650,$user->getRoom());
break; break;
} }
} elseif ($user->room == 2111) { } elseif ($user->getRoom() == 2111) {
switch ($location[1]) { switch ($location[1]) {
default: default:
break; break;
case 'level1': case 'level1':
Battles\Travel::toRoom(21,$user->room); Battles\Travel::toRoom(21,$user->getRoom());
break; break;
case 'level203': case 'level203':
Battles\Travel::toRoom(1055,$user->room); Battles\Travel::toRoom(1055,$user->getRoom());
break; break;
case 'level1000': case 'level1000':
Battles\Travel::toRoom(620,$user->room); Battles\Travel::toRoom(620,$user->getRoom());
break; break;
case 'room666': case 'room666':
//Нет на карте //Нет на карте
//Battles\Travel::toRoom(666,$user->room); //Battles\Travel::toRoom(666,$user->getRoom());
break; break;
} }
} elseif ($user->room == 2601) { } elseif ($user->getRoom() == 2601) {
switch ($location[1]) { switch ($location[1]) {
default: default:
break; break;
case 'level4': case 'level4':
Battles\Travel::toRoom(26,$user->room); Battles\Travel::toRoom(26,$user->getRoom());
break; break;
case 'level55': case 'level55':
Battles\Travel::toRoom(2655,$user->room); Battles\Travel::toRoom(2655,$user->getRoom());
break; break;
case 'level1': case 'level1':
Battles\Travel::toRoom(37,$user->room); Battles\Travel::toRoom(37,$user->getRoom());
break; break;
case 'level1051': case 'level1051':
Battles\Travel::toRoom(1051,$user->room); Battles\Travel::toRoom(1051,$user->getRoom());
break; break;
case 'level5': case 'level5':
Battles\Travel::toRoom(404,$user->room); Battles\Travel::toRoom(404,$user->getRoom());
break; break;
} }
} elseif ($user->room == 2701) { } elseif ($user->getRoom() == 2701) {
switch ($location[1]) { switch ($location[1]) {
default: default:
break; break;
case 'level1': case 'level1':
Battles\Travel::toRoom(2111,$user->room); Battles\Travel::toRoom(2111,$user->getRoom());
break; break;
case 'level2': case 'level2':
Battles\Travel::toRoom(402,$user->room); Battles\Travel::toRoom(402,$user->getRoom());
break; break;
} }
} elseif ($user->room == 2702) { } elseif ($user->getRoom() == 2702) {
switch ($location[1]) { switch ($location[1]) {
default: default:
break; break;
case 'level10': case 'level10':
Battles\Travel::toRoom(20,$user->room); Battles\Travel::toRoom(20,$user->getRoom());
break; break;
case 'level6': case 'level6':
Battles\Travel::toRoom(61,$user->room); Battles\Travel::toRoom(61,$user->getRoom());
break; break;
} }
} elseif ($user->room == 2655) { } elseif ($user->getRoom() == 2655) {
switch ($location[1]) { switch ($location[1]) {
default: default:
break; break;
case 'level10': case 'level10':
Battles\Travel::toRoom(2601,$user->room); Battles\Travel::toRoom(2601,$user->getRoom());
break; break;
case 'level2055': case 'level2055':
Battles\Travel::toRoom(603,$user->room); Battles\Travel::toRoom(603,$user->getRoom());
break; break;
} }
} elseif ($user->room == 26) { } elseif ($user->getRoom() == 26) {
switch ($location[1]) { switch ($location[1]) {
default: default:
break; break;
case 'level4': case 'level4':
Battles\Travel::toRoom(20,$user->room); Battles\Travel::toRoom(20,$user->getRoom());
break; break;
case 'level3': case 'level3':
Battles\Travel::toRoom(2601,$user->room); Battles\Travel::toRoom(2601,$user->getRoom());
break; break;
case 'level660': case 'level660':
Battles\Travel::toRoom(660,$user->room); Battles\Travel::toRoom(660,$user->getRoom());
break; break;
case 'level7': case 'level7':
Battles\Travel::toRoom(777,$user->room); Battles\Travel::toRoom(777,$user->getRoom());
break; break;
case 'level56': case 'level56':
Battles\Travel::toRoom(401,$user->room); Battles\Travel::toRoom(401,$user->getRoom());
break; break;
} }
} }
@ -198,7 +198,7 @@ switch ($location[0]) {
\Battles\Template::header('city'); \Battles\Template::header('city');
echo sprintf('<div style="text-align: right;">Сейчас в игре: %s игроков.></div>', $online->getNumRows()); echo sprintf('<div style="text-align: right;">Сейчас в игре: %s игроков.></div>', $online->getNumRows());
if (in_array($user->room, [20, 21, 26, 2601, 2655, 2111, 2701, 2702])) { if (in_array($user->getRoom(), [20, 21, 26, 2601, 2655, 2111, 2701, 2702])) {
/* Улицы: /* Улицы:
* 20 Центральная * 20 Центральная
* 21 Страшилкина * 21 Страшилкина
@ -209,5 +209,5 @@ if (in_array($user->room, [20, 21, 26, 2601, 2655, 2111, 2701, 2702])) {
* 2701 С ещё одним ристалищем? * 2701 С ещё одним ристалищем?
* 2702 Торговая * 2702 Торговая
*/ */
Battles\City::showStreet($user->room); Battles\City::showStreet($user->getRoom());
} }

View File

@ -62,7 +62,7 @@ if ($_POST['add_zay']) {
echo '<strong>сил Хаоса</strong><br />'; echo '<strong>сил Хаоса</strong><br />';
} }
if ($user->admin) { if ($user->getAdmin()) {
echo '<FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Админ: запустить" name="admin_start"><br></FORM>'; echo '<FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Админ: запустить" name="admin_start"><br></FORM>';
echo '<FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Админ: старт боя" name="admin_start1"><br></FORM>'; echo '<FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Админ: старт боя" name="admin_start1"><br></FORM>';
} }
@ -229,7 +229,7 @@ if ($_POST['add_zay']) {
$rrc .= Nick::id($v)->short(); $rrc .= Nick::id($v)->short();
} }
$rr .= "</b>"; $rr .= "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Поединок</a> между <B>" . $rrc . "</B> начался. ", $user->room); addch("<a href=logs.php?log=" . $id . " target=_blank>Поединок</a> между <B>" . $rrc . "</B> начался. ", $user->getRoom());
mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>');"); mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>');");
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>"); addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>");
@ -287,7 +287,7 @@ if ($_POST['add_zay']) {
addchp('<font color=red>Внимание!</font> Ваш бой начался!<BR>\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ', '{[]}' . Nick::id($v)->short() . '{[]}'); addchp('<font color=red>Внимание!</font> Ваш бой начался!<BR>\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ', '{[]}' . Nick::id($v)->short() . '{[]}');
} }
$rr .= "</b>"; $rr .= "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Поединок</a> между <B>" . $rrc . "</B> начался. ", $user->room); addch("<a href=logs.php?log=" . $id . " target=_blank>Поединок</a> между <B>" . $rrc . "</B> начался. ", $user->getRoom());
mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>');"); mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>');");
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>"); addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>");

View File

@ -36,7 +36,7 @@ if ($clanFullName && $clanShortName && $clanInfo && !$userClan) {
if (!$name_check) { if (!$name_check) {
$errorMessage[4] = 'Клан с такими данными уже существует.<br>'; $errorMessage[4] = 'Клан с такими данными уже существует.<br>';
} }
if (!$errorMessage || $user->admin) { if (!$errorMessage || $user->getAdmin()) {
try { try {
db::c()->query('INSERT INTO clans (owner_id, full_name, short_name, info) VALUES (?i,"?s","?s","?s")', $user->getId(), $clanFullName, $clanShortName, $clanInfo); db::c()->query('INSERT INTO clans (owner_id, full_name, short_name, info) VALUES (?i,"?s","?s","?s")', $user->getId(), $clanFullName, $clanShortName, $clanInfo);
$userBank->setMoney($userBank->getMoney() - Config::$clan_register_cost); $userBank->setMoney($userBank->getMoney() - Config::$clan_register_cost);

View File

@ -18,29 +18,29 @@ class User
protected $align = 0; protected $align = 0;
protected $clan = 0; protected $clan = 0;
protected $money = 0; protected $money = 0;
public $strength = 0; protected $strength = 0;
public $dexterity = 0; protected $dexterity = 0;
public $intuition = 0; protected $intuition = 0;
public $endurance = 0; protected $endurance = 0;
public $intelligence = 0; protected $intelligence = 0;
public $wisdom = 0; protected $wisdom = 0;
public $health; protected $health;
public $mana; protected $mana;
public $ip; protected $ip;
public $session_id; protected $session_id;
public $admin = 0; protected $admin = 0;
public $enter_game; protected $enter_game;
public $room; protected $room;
public $block; protected $block;
public $shadow; protected $shadow;
// Удар кулаком всегда 1-2. // Удар кулаком всегда 1-2.
public $minDamage = 1; protected $minDamage = 1;
public $maxDamage = 2; protected $maxDamage = 2;
//Броня без предметов не существует. //Броня без предметов не существует.
public $headArmor = 0; protected $headArmor = 0;
public $chestArmor = 0; protected $chestArmor = 0;
public $legArmor = 0; protected $legArmor = 0;
public $free_stat_points = 0; protected $free_stat_points = 0;
public const STAT_MAXIMUM_AMOUNT = 40; public const STAT_MAXIMUM_AMOUNT = 40;
private const ERROR_STAT_IS_MAXIMUM = 'Ошибка: Параметр достиг своего лимита!'; private const ERROR_STAT_IS_MAXIMUM = 'Ошибка: Параметр достиг своего лимита!';
private const ERROR_STAT_UNKNOWN = 'Ошибка: Неизвестный параметр!'; private const ERROR_STAT_UNKNOWN = 'Ошибка: Неизвестный параметр!';

View File

@ -1,8 +1,8 @@
<?php <?php
if (in_array($user->room, Config::$caverooms)) { if (in_array($user->getRoom(), Config::$caverooms)) {
$cavedata = Config::$cavedata ?? []; $cavedata = Config::$cavedata ?? [];
$floor = mysql_fetch_row(mysql_query("SELECT `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1")); $floor = mysql_fetch_row(mysql_query("SELECT `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
if (!isset($cavedata[$user->room]['x' . $floor])) { if (!isset($cavedata[$user->getRoom()]['x' . $floor])) {
$floor = 1; $floor = 1;
} }
} }
@ -11,8 +11,8 @@ $lomka1 = $lomka;
foreach ($lomka1 as $k => $v) { foreach ($lomka1 as $k => $v) {
if ($v < _BOTSEPARATOR_) { if ($v < _BOTSEPARATOR_) {
if (in_array($user->room, Config::$caverooms)) { if (in_array($user->getRoom(), Config::$caverooms)) {
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->room]['x' . $floor] . "', `y` = '" . $cavedata[$user->room]['y' . $floor] . "', `dir` = '" . $cavedata[$user->room]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$v' LIMIT 1"); mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->getRoom()]['x' . $floor] . "', `y` = '" . $cavedata[$user->getRoom()]['y' . $floor] . "', `dir` = '" . $cavedata[$user->getRoom()]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$v' LIMIT 1");
} }
if ($user['laba'] > 0) { if ($user['laba'] > 0) {
mysql_query('UPDATE `users` SET `x` = `xf`, `y` = `yr` WHERE `id` = "' . $v . '" LIMIT 1'); mysql_query('UPDATE `users` SET `x` = `xf`, `y` = `yr` WHERE `id` = "' . $v . '" LIMIT 1');

View File

@ -21,7 +21,7 @@ function cavesys($text)
} }
} }
if (in_array($user->room, Config::$caverooms)) { if (in_array($user->getRoom(), Config::$caverooms)) {
include("CaveItems.php"); include("CaveItems.php");
mysql_query('LOCK TABLES `cavebots` WRITE, `caveitems` WRITE, `shop` WRITE, `caveparties` WRITE'); mysql_query('LOCK TABLES `cavebots` WRITE, `caveitems` WRITE, `shop` WRITE, `caveparties` WRITE');
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir`, `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1")); $location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir`, `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
@ -55,7 +55,7 @@ if (in_array($user->room, Config::$caverooms)) {
$bot = $rec['bot']; $bot = $rec['bot'];
$cnt = $rec['cnt']; $cnt = $rec['cnt'];
if (@$caveitems[$bot]) { if (@$caveitems[$bot]) {
if ($user->room == 621) { if ($user->getRoom() == 621) {
$i = mt_rand(0, (count($caveitems[$bot]) - 1)); $i = mt_rand(0, (count($caveitems[$bot]) - 1));
$item = $caveitems[$bot][$i]; $item = $caveitems[$bot][$i];
if (getchance($item['chance'])) { if (getchance($item['chance'])) {

View File

@ -158,7 +158,7 @@ class Tournament
mysql_query("UPDATE `users` SET `battle` = {$id} WHERE `id` = " . $user1 . " OR `id` = " . $user2); mysql_query("UPDATE `users` SET `battle` = {$id} WHERE `id` = " . $user1 . " OR `id` = " . $user2);
// создаем лог // создаем лог
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>"; $rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user->room); addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user->getRoom());
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " решили выяснить кто из них сильнее. <i>(турнир)</i><BR>"); addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " решили выяснить кто из них сильнее. <i>(турнир)</i><BR>");
return $id; return $id;
} }

View File

@ -1700,7 +1700,7 @@ class fbattle
} }
if (in_array($user->room, Config::$caverooms)) { if (in_array($user->getRoom(), Config::$caverooms)) {
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1")); $location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1"));
if ($location['dir'] == 0) { if ($location['dir'] == 0) {
@ -1789,7 +1789,7 @@ class fbattle
// выносим хп-ку и выходим из боя // выносим хп-ку и выходим из боя
mysql_query('UPDATE `battle` SET `t1hist` = \'' . implode(", ", $nks1hist) . '\', `t2hist` = \'' . implode(", ", $nks2hist) . '\' WHERE `id` = ' . $this->battle_data['id'] . ' ;'); mysql_query('UPDATE `battle` SET `t1hist` = \'' . implode(", ", $nks1hist) . '\', `t2hist` = \'' . implode(", ", $nks2hist) . '\' WHERE `id` = ' . $this->battle_data['id'] . ' ;');
addch("<a href=logs.php?log=" . $this->battle_data['id'] . " target=_blank>Поединок</a> между <B>" . $rr . "</B> закончен. ", $user->room); addch("<a href=logs.php?log=" . $this->battle_data['id'] . " target=_blank>Поединок</a> между <B>" . $rr . "</B> закончен. ", $user->getRoom());
mysql_query('UPDATE `battle` SET `exp` = \'' . serialize($this->exp) . '\' WHERE `id` = ' . $this->battle_data['id'] . ' ;'); mysql_query('UPDATE `battle` SET `exp` = \'' . serialize($this->exp) . '\' WHERE `id` = ' . $this->battle_data['id'] . ' ;');
mysql_query("DELETE FROM `bots` WHERE `battle` = {$this->user['battle']};"); mysql_query("DELETE FROM `bots` WHERE `battle` = {$this->user['battle']};");
mysql_query("UPDATE users SET `battle` =0, `fullhptime` = " . time() . " WHERE `battle` = {$this->user['battle']}"); mysql_query("UPDATE users SET `battle` =0, `fullhptime` = " . time() . " WHERE `battle` = {$this->user['battle']}");

View File

@ -569,7 +569,7 @@ TASK;
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '", `exp` = "' . $user['exp'] . '", `doblest` = "' . $user['doblest'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '", `exp` = "' . $user['exp'] . '", `doblest` = "' . $user['doblest'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
$this->error = 'Вы успешно сдали задание!'; $this->error = 'Вы успешно сдали задание!';
$text = '<font style="color: Red;">Внимание!</font> За успешно выполненное задание Вы получили : ' . $c; $text = '<font style="color: Red;">Внимание!</font> За успешно выполненное задание Вы получили : ' . $c;
$this->msg($text, '{[]}' . $user['login'] . '{[]}', $user->room); $this->msg($text, '{[]}' . $user['login'] . '{[]}', $user->getRoom());
} else { } else {
$this->error = 'Не все условия задания были выполнены ...'; $this->error = 'Не все условия задания были выполнены ...';
} }

View File

@ -421,7 +421,7 @@ class fbattle
addActions(time(), 'win_fiz', 0, $this->user['id']); addActions(time(), 'win_fiz', 0, $this->user['id']);
} }
if (in_array($user->room, Config::$caverooms)) { if (in_array($user->getRoom(), Config::$caverooms)) {
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1")); $location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1"));
if ($location['dir'] == 0) { if ($location['dir'] == 0) {
$y = $location['y'] * 2; $y = $location['y'] * 2;
@ -451,7 +451,7 @@ class fbattle
$winers .= implode("</B>, <B>", $this->t2); $winers .= implode("</B>, <B>", $this->t2);
$lomka = $this->t1; $lomka = $this->t1;
} else { } else {
if (in_array($user->room, Config::$caverooms)) { if (in_array($user->getRoom(), Config::$caverooms)) {
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1")); $location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1"));
if ($location['dir'] == 0) { if ($location['dir'] == 0) {
$y = $location['y'] * 2; $y = $location['y'] * 2;

View File

@ -65,8 +65,8 @@ if ($_GET['ext'] == 1) {
} }
if (in_array($user->room, Config::$canalenters)) { if (in_array($user->getRoom(), Config::$canalenters)) {
$podzemroom = $user->room + 1; $podzemroom = $user->getRoom() + 1;
$cavedata = [620 => ['x1' => 3, 'y1' => 2, 'dir1' => 2]]; $cavedata = [620 => ['x1' => 3, 'y1' => 2, 'dir1' => 2]];
$podzemdata = [621 => ['name1' => 'Проклятый Рудник', 'name2' => 'Проклятого Рудника']]; $podzemdata = [621 => ['name1' => 'Проклятый Рудник', 'name2' => 'Проклятого Рудника']];
$warning = $_GET["warning"] ?? ''; $warning = $_GET["warning"] ?? '';
@ -92,7 +92,7 @@ if (in_array($user->room, Config::$canalenters)) {
if (($user['align'] == '2.99') && $wait_sec > $new_t) { if (($user['align'] == '2.99') && $wait_sec > $new_t) {
$wait_sec = 1; $wait_sec = 1;
mysql_query("UPDATE `visit_podzem` SET `time` = 1 WHERE `login` = '$user[login]' AND `time` > 0 AND `room` = '$user->room' LIMIT 1"); mysql_query("UPDATE `visit_podzem` SET `time` = 1 WHERE `login` = '$user[login]' AND `time` > 0 AND `room` = '$user->getRoom()' LIMIT 1");
} }
if ($wait_sec > $new_t && $_GET['donate']) { if ($wait_sec > $new_t && $_GET['donate']) {
@ -202,7 +202,7 @@ if (in_array($user->room, Config::$canalenters)) {
return $i; return $i;
} }
$Q = mysql_query("SELECT * FROM `vxod` WHERE `room` = '$user->room'"); $Q = mysql_query("SELECT * FROM `vxod` WHERE `room` = '$user->getRoom()'");
while ($DATA = mysql_fetch_array($Q)) { while ($DATA = mysql_fetch_array($Q)) {
$cr = $DATA['glav_id']; $cr = $DATA['glav_id'];
$z_login[$i] = $DATA['login']; $z_login[$i] = $DATA['login'];
@ -278,7 +278,7 @@ if (in_array($user->room, Config::$canalenters)) {
exit(); exit();
} }
$time = date("H:i"); $time = date("H:i");
$SQL2 = mysql_query("INSERT INTO `vxod` (`date`, `login`, `glav_id`, `comment`, `pass`, `room`) VALUES('$time', '$login', '$user_id', '" . mysql_real_escape_string($_GET['cmt']) . "', '" . mysql_real_escape_string($_GET['pass']) . "', '$user->room')"); $SQL2 = mysql_query("INSERT INTO `vxod` (`date`, `login`, `glav_id`, `comment`, `pass`, `room`) VALUES('$time', '$login', '$user_id', '" . mysql_real_escape_string($_GET['cmt']) . "', '" . mysql_real_escape_string($_GET['pass']) . "', '$user->getRoom()')");
$SQL2 = mysql_query("INSERT INTO `vxodd` (`login`, `glav_id`, `lvl`) VALUES('$login', '$user_id', '$user_lvl')"); $SQL2 = mysql_query("INSERT INTO `vxodd` (`login`, `glav_id`, `lvl`) VALUES('$login', '$user_id', '$user_lvl')");
if ($SQL2) { if ($SQL2) {
echo "<script>location.href='main.php?act=none'</script>"; echo "<script>location.href='main.php?act=none'</script>";
@ -308,7 +308,7 @@ if (in_array($user->room, Config::$canalenters)) {
} }
$den = mysql_query("SELECT `id` FROM `vxodd` WHERE `glav_id` = '" . $_GET['naw_id'] . "'"); $den = mysql_query("SELECT `id` FROM `vxodd` WHERE `glav_id` = '" . $_GET['naw_id'] . "'");
if (mysql_num_rows($den) >= (in_array($user->room + 1, Config::$caverooms) ? 5 : 4)) { if (mysql_num_rows($den) >= (in_array($user->getRoom() + 1, Config::$caverooms) ? 5 : 4)) {
echo "<script>location.href='?warning=5'</script>"; echo "<script>location.href='?warning=5'</script>";
exit(); exit();
} }
@ -356,7 +356,7 @@ if (in_array($user->room, Config::$canalenters)) {
} }
if ($_GET['start']) { if ($_GET['start']) {
if (in_array($user->room + 1, Config::$caverooms)) { if (in_array($user->getRoom() + 1, Config::$caverooms)) {
$nc = 1; $nc = 1;
$locs = []; $locs = [];
} }
@ -378,8 +378,8 @@ if (in_array($user->room, Config::$canalenters)) {
mysql_query("update `users` SET `money` = (`money-$nana[fee]) WHERE `id` = '$esth[id]' LIMIT 1"); mysql_query("update `users` SET `money` = (`money-$nana[fee]) WHERE `id` = '$esth[id]' LIMIT 1");
$user['money'] += $nana['fee']; $user['money'] += $nana['fee'];
$esth['money'] -= $nana['fee']; $esth['money'] -= $nana['fee'];
adddelo($user['id'], "Персонаж $user[login] получил $nana[fee] кр. за поход по локации \"" . $rooms[$user->room + 1] . "\" от персонажа $esth[login] ($user[money]).", 1); adddelo($user['id'], "Персонаж $user[login] получил $nana[fee] кр. за поход по локации \"" . $rooms[$user->getRoom() + 1] . "\" от персонажа $esth[login] ($user[money]).", 1);
adddelo($esth['id'], "Персонаж $esth[login] заплатил $nana[fee] кр. за поход по локации \"" . $rooms[$user->room + 1] . "\" персонажу $user[login] ($esth[money]).", 1); adddelo($esth['id'], "Персонаж $esth[login] заплатил $nana[fee] кр. за поход по локации \"" . $rooms[$user->getRoom() + 1] . "\" персонажу $user[login] ($esth[money]).", 1);
} }
if ($esth['level'] > $level) { if ($esth['level'] > $level) {
$level = $esth['level']; $level = $esth['level'];
@ -392,12 +392,12 @@ if (in_array($user->room, Config::$canalenters)) {
$vrem = 30 * 60 + time(); $vrem = 30 * 60 + time();
$cavedata = Config::$cavedata ?? []; $cavedata = Config::$cavedata ?? [];
mysql_query("INSERT INTO `caveparties` SET `user` = '$esth[id]', `leader` = '$user[id]', `login` = '$esth[login]', `shadow` = '0.png', `x` = '" . $cavedata[$user->room + 1]['x1'] . "', `y` = '" . $cavedata[$user->room + 1]['y1'] . "', `dir` = '" . $cavedata[$user->room + 1]['dir1'] . "', `floor` = 1"); mysql_query("INSERT INTO `caveparties` SET `user` = '$esth[id]', `leader` = '$user[id]', `login` = '$esth[login]', `shadow` = '0.png', `x` = '" . $cavedata[$user->getRoom() + 1]['x1'] . "', `y` = '" . $cavedata[$user->getRoom() + 1]['y1'] . "', `dir` = '" . $cavedata[$user->getRoom() + 1]['dir1'] . "', `floor` = 1");
mysql_query("UPDATE `users`, `online` SET " . ($nc ? "`users`.`caveleader` = '$user[id]', " : "") . " `users`.`room` = '" . ($user->room + 1) . "', `online`.`room` = '" . ($user->room + 1) . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth['id'] . "'"); mysql_query("UPDATE `users`, `online` SET " . ($nc ? "`users`.`caveleader` = '$user[id]', " : "") . " `users`.`room` = '" . ($user->getRoom() + 1) . "', `online`.`room` = '" . ($user->getRoom() + 1) . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth['id'] . "'");
} }
if ($nc) { if ($nc) {
$r = mysql_query("SELECT * FROM `cavemaps` WHERE `room` = '$user->room'"); $r = mysql_query("SELECT * FROM `cavemaps` WHERE `room` = '$user->getRoom()'");
while ($rec = mysql_fetch_assoc($r)) { while ($rec = mysql_fetch_assoc($r)) {
$map = unserialize($rec['map']); $map = unserialize($rec['map']);
foreach ($map as $k => $v) { foreach ($map as $k => $v) {

View File

@ -7,7 +7,7 @@ if (empty($_SESSION['uid'])) {
exit; exit;
} }
require_once "functions.php"; require_once "functions.php";
if ($user->room == 51) { if ($user->getRoom() == 51) {
header('location: city.php'); header('location: city.php');
exit; exit;
} }

View File

@ -17,7 +17,7 @@ if (empty($_SESSION['uid'])) {
$user = new User($_SESSION['uid']); $user = new User($_SESSION['uid']);
} }
if ($user->getId() && $user->block) { if ($user->getId() && $user->getBlock()) {
exit('user blocked!'); exit('user blocked!');
} }
@ -67,8 +67,8 @@ $roomsCheck = [22, 23, 25, 27, 29, 30, 31, 37, 38, 39, 40, 41, 45, 53, 61, 401,
// Если я в одной из этих комнат, // Если я в одной из этих комнат,
// [И] Имя файла который инклюдит файл с проверкой не совпадает с именем файла локации в которой я нахожусь // [И] Имя файла который инклюдит файл с проверкой не совпадает с именем файла локации в которой я нахожусь
// [И] Номер комнаты который я пытаюсь открыть есть в списке проверяемых // [И] Номер комнаты который я пытаюсь открыть есть в списке проверяемых
if (in_array($user->room, $roomsCheck) if (in_array($user->getRoom(), $roomsCheck)
&& pathinfo(debug_backtrace()[0]['file'])['basename'] != Travel::$roomFileName[$user->room] && pathinfo(debug_backtrace()[0]['file'])['basename'] != Travel::$roomFileName[$user->getRoom()]
&& in_array(array_search(pathinfo(debug_backtrace()[0]['file'])['basename'], Travel::$roomFileName), $roomsCheck)) { && in_array(array_search(pathinfo(debug_backtrace()[0]['file'])['basename'], Travel::$roomFileName), $roomsCheck)) {
header('location: main.php'); header('location: main.php');
exit; exit;
@ -77,7 +77,7 @@ if (in_array($user->room, $roomsCheck)
$ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP); $ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
if (isset($_GET['goto']) && isset($_GET['tStamp']) && isset($_GET['vcode']) && $_GET['vcode'] == md5(sha1($_GET['goto'] . $_GET['tStamp']))) { if (isset($_GET['goto']) && isset($_GET['tStamp']) && isset($_GET['vcode']) && $_GET['vcode'] == md5(sha1($_GET['goto'] . $_GET['tStamp']))) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i, `online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_GET['goto'], $_GET['goto'], $_SESSION['uid']); db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i, `online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_GET['goto'], $_GET['goto'], $_SESSION['uid']);
$user->room = intval($_GET['goto']); $user->setRoom(intval($_GET['goto']));
} }
function createbot($bot, $login = "") function createbot($bot, $login = "")
@ -878,7 +878,7 @@ function addch($text, $room = 0)
{ {
global $user; global $user;
if ($room == 0) { if ($room == 0) {
$room = $user->room; $room = $user->getRoom();
} }
if ($fp = @fopen("tmp/chat.txt", "a")) { //открытие if ($fp = @fopen("tmp/chat.txt", "a")) { //открытие
flock($fp, LOCK_EX); //БЛОКИРОВКА ФАЙЛА flock($fp, LOCK_EX); //БЛОКИРОВКА ФАЙЛА
@ -894,7 +894,7 @@ function addchp($text, $who, $room = 0)
{ {
global $user; global $user;
if ($room == 0) { if ($room == 0) {
$room = $user->room; $room = $user->getRoom();
} }
$fp = fopen("tmp/chat.txt", "a"); //открытие $fp = fopen("tmp/chat.txt", "a"); //открытие
flock($fp, LOCK_EX); //БЛОКИРОВКА ФАЙЛА flock($fp, LOCK_EX); //БЛОКИРОВКА ФАЙЛА
@ -942,7 +942,7 @@ function get_meshok()
{ {
global $user; global $user;
$itemsWeight = db::c()->query('SELECT SUM(weight) AS all_weight FROM `inventory` WHERE owner_id = ?i AND on_sale = 0', $_SESSION['uid'])->fetch_assoc(); $itemsWeight = db::c()->query('SELECT SUM(weight) AS all_weight FROM `inventory` WHERE owner_id = ?i AND on_sale = 0', $_SESSION['uid'])->fetch_assoc();
return ($user->strength * 4 + $itemsWeight['all_weight']); return ($user->getStrength() * 4 + $itemsWeight['all_weight']);
} }
/** /**

View File

@ -8,29 +8,29 @@ $castleOwners = db::c()->query('SELECT * FROM `clans` WHERE `short` = (SELECT *
if ($castleOwners['id'] == $user['klan']) { if ($castleOwners['id'] == $user['klan']) {
// если мой клан // если мой клан
if ($_GET['goto'] == 'arsenal') { if ($_GET['goto'] == 'arsenal') {
$user->room = 38; $user->setRoom(38);
} }
if ($_GET['goto'] == 'home') { if ($_GET['goto'] == 'home') {
$user->room = 37; $user->setRoom(37);
} }
if ($_GET['goto'] == 'dvor') { if ($_GET['goto'] == 'dvor') {
$user->room = 39; $user->setRoom(39);
} }
if ($_GET['goto'] == 'master') { if ($_GET['goto'] == 'master') {
$user->room = 40; $user->setRoom(40);
} }
if ($_GET['goto'] == 'rest') { if ($_GET['goto'] == 'rest') {
$user->room = 41; $user->setRoom(41);
} }
if (in_array($_GET['goto'], ['arsenal', 'home', 'dvor', 'master', 'rest'])) { if (in_array($_GET['goto'], ['arsenal', 'home', 'dvor', 'master', 'rest'])) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $user->room, $user->room, $_SESSION['uid']); db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $user->getRoom(), $user->getRoom(), $user->getId());
header('location: gotzamok.php'); header('location: gotzamok.php');
} else { } else {
$status = 'В этом замке нет такого места!'; $status = 'В этом замке нет такого места!';
} }
} }
switch ($user->room) { switch ($user->getRoom()) {
case '37' : case '37' :
$backgroundImage = '689_small_550.jpg'; $backgroundImage = '689_small_550.jpg';
break; break;
@ -39,8 +39,8 @@ switch ($user->room) {
break; break;
} }
if ($user->room == 38) { if ($user->getRoom() == 38) {
$glava = db::c()->query('SELECT `glava` FROM `clans` WHERE `short` = "?s"', $user['klan'])->fetch_assoc(); $glava = db::c()->query('SELECT owner_id FROM `clans` WHERE `short` = "?s"', $user['klan'])->fetch_assoc();
// возврат шмотки // возврат шмотки
if ($_GET['back']) { if ($_GET['back']) {
$item = db::c()->query('SELECT * FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back'])->fetch_assoc(); $item = db::c()->query('SELECT * FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back'])->fetch_assoc();
@ -63,7 +63,7 @@ if ($user->room == 38) {
} }
} }
if ($user->room == 40) { if ($user->getRoom() == 40) {
$at = db::c()->query('SELECT * FROM `variables` WHERE `var` = "?s"', 'gotzam_att')->fetch_assoc(); $at = db::c()->query('SELECT * FROM `variables` WHERE `var` = "?s"', 'gotzam_att')->fetch_assoc();
$def = db::c()->query('SELECT * FROM `variables` WHERE `var` = "?s"', 'gotzam_def')->fetch_assoc(); $def = db::c()->query('SELECT * FROM `variables` WHERE `var` = "?s"', 'gotzam_def')->fetch_assoc();
@ -107,32 +107,32 @@ if ($castleOwners['id'] == $user['klan']) { ?>
<TD valign=top style="width:250px;"> <TD valign=top style="width:250px;">
<INPUT TYPE=button style="width:200px;" value="Перейти в приемную" <INPUT TYPE=button style="width:200px;" value="Перейти в приемную"
onClick="hrefToFrame('gotzamok.php?goto=home')"> onClick="hrefToFrame('gotzamok.php?goto=home')">
<? if ($user->room == 37): ?> <? if ($user->getRoom() == 37): ?>
<img src='i/flag.gif'> <img src='i/flag.gif'>
<?php endif; ?><BR> <?php endif; ?><BR>
<INPUT TYPE=button style="width:200px;" value="Перейти в арсенал" <INPUT TYPE=button style="width:200px;" value="Перейти в арсенал"
onClick="hrefToFrame('gotzamok.php?goto=arsenal')"> onClick="hrefToFrame('gotzamok.php?goto=arsenal')">
<? if ($user->room == 38): ?> <? if ($user->getRoom() == 38): ?>
<img src='i/flag.gif'> <img src='i/flag.gif'>
<?php endif; ?><BR> <?php endif; ?><BR>
<INPUT TYPE=button style="width:200px;" value="Перейти во внутренний двор" <INPUT TYPE=button style="width:200px;" value="Перейти во внутренний двор"
onClick="hrefToFrame('gotzamok.php?goto=dvor')"> onClick="hrefToFrame('gotzamok.php?goto=dvor')">
<? if ($user->room == 39): ?> <? if ($user->getRoom() == 39): ?>
<img src='i/flag.gif'> <img src='i/flag.gif'>
<?php endif; ?><BR> <?php endif; ?><BR>
<INPUT TYPE=button style="width:200px;" value="Перейти в мастерские" <INPUT TYPE=button style="width:200px;" value="Перейти в мастерские"
onClick="hrefToFrame('gotzamok.php?goto=master')"> onClick="hrefToFrame('gotzamok.php?goto=master')">
<? if ($user->room == 40): ?> <? if ($user->getRoom() == 40): ?>
<img src='i/flag.gif'> <img src='i/flag.gif'>
<?php endif; ?><BR> <?php endif; ?><BR>
<INPUT TYPE=button style="width:200px;" value="Перейти в опочивальни" <INPUT TYPE=button style="width:200px;" value="Перейти в опочивальни"
onClick="hrefToFrame('gotzamok.php?goto=rest')"> onClick="hrefToFrame('gotzamok.php?goto=rest')">
<? if ($user->room == 41): ?> <? if ($user->getRoom() == 41): ?>
<img src='i/flag.gif'> <img src='i/flag.gif'>
<?php endif; ?><BR> <?php endif; ?><BR>
</td> </td>
<td valign=top> <td valign=top>
<?php if ($user->room == 38): ?> <?php if ($user->getRoom() == 38): ?>
<h4>Арсенал</h4> <h4>Арсенал</h4>
<button onClick="hrefToFrame('gotzamok.php?do=zdat')">Сдать в арсенал</button> <button onClick="hrefToFrame('gotzamok.php?do=zdat')">Сдать в арсенал</button>
<div style="background: silver; border: 1px solid dimgray;"> <div style="background: silver; border: 1px solid dimgray;">
@ -175,7 +175,7 @@ if ($castleOwners['id'] == $user['klan']) { ?>
<?php <?php
endif; endif;
endif; endif;
if ($user->room == 40): ?> if ($user->getRoom() == 40): ?>
<h4>Мастерские</h4> <h4>Мастерские</h4>
<div style="background: silver; border: 1px solid dimgray;"> <div style="background: silver; border: 1px solid dimgray;">
Здесь вы можете улучшить оборонные способности вашего замка. Здесь вы можете улучшить оборонные способности вашего замка.
@ -192,7 +192,7 @@ if ($castleOwners['id'] == $user['klan']) { ?>
</div> </div>
</div> </div>
<?php endif; <?php endif;
if ($user->room == 41): ?> if ($user->getRoom() == 41): ?>
<h4>Комнаты отдыха</h4> <h4>Комнаты отдыха</h4>
<div style="background: silver; border: 1px solid dimgray;"> <div style="background: silver; border: 1px solid dimgray;">
Посиди в тишине, внутри стен. Тут нет врагов. Тут спокойно. Посиди в тишине, внутри стен. Тут нет врагов. Тут спокойно.

36
lab.php
View File

@ -18,7 +18,7 @@ $u_res = mysql_fetch_array(mysql_query("select * from `lab_user` where `id_user`
</script> </script>
<?php <?php
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';")); $room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->getRoom()) . "';"));
if ($_GET['healall'] == 1) { if ($_GET['healall'] == 1) {
$cost = $_GET['cost']; $cost = $_GET['cost'];
@ -124,7 +124,7 @@ if ($_GET['mobkill'] == 1) {
} }
$rand_hp1 = rand(1, 10); $rand_hp1 = rand(1, 10);
$rand_hp = $rand_hp1 * $user['level']; $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")); $bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1"));
$hels = $bot['bot_hp'] - $rand_hp; $hels = $bot['bot_hp'] - $rand_hp;
if ($hels < 0) { if ($hels < 0) {
echo "<b>Вы убили моба!</b><br>"; echo "<b>Вы убили моба!</b><br>";
@ -135,11 +135,11 @@ if ($_GET['mobkill'] == 1) {
echo "Вы получили 1 записку!<br>"; echo "Вы получили 1 записку!<br>";
Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'"); 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"); mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1");
//если просто убивалка //если просто убивалка
} else { } 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("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"); mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1");
} }
} else { } else {
echo "Вы отняли у моба -<b>" . $rand_hp . "</b> HP!<br>"; echo "Вы отняли у моба -<b>" . $rand_hp . "</b> HP!<br>";
@ -177,7 +177,7 @@ if ($_GET['exit'] && $room['exit'] == 1) {
if ($_GET['get']) { 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'] . "';")); $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 ($data['id_room'] == $user->getRoom()) {
switch ($data['type']) { switch ($data['type']) {
case 1: case 1:
@ -241,13 +241,13 @@ if ($_GET['get']) {
if ($_GET['drop']) { 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'] . "';")); $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("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']) . "');"); mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('" . mysql_real_escape_string($user->getRoom()) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "','" . mysql_real_escape_string($user['id']) . "');");
unset($data); unset($data);
} }
if ($_GET['nal1']) { 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'] . "';")); $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) { if ($data['id_room'] == $user->getRoom()) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';")); $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("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']) . "';"); mysql_query("UPDATE `users` SET `money` = `money`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
@ -259,7 +259,7 @@ if ($_GET['nal1']) {
if ($_GET['nal2']) { 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'] . "';")); $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) { if ($data['id_room'] == $user->getRoom()) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';")); $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("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']) . "';"); mysql_query("UPDATE `users` SET `doblest` = `doblest`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
@ -271,7 +271,7 @@ if ($_GET['nal2']) {
if ($_GET['nal3']) { 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'] . "';")); $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) { if ($data['id_room'] == $user->getRoom()) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';")); $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("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']) . "';"); mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
@ -283,7 +283,7 @@ if ($_GET['nal3']) {
if ($_GET['nal4']) { 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'] . "';")); $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) { if ($data['id_room'] == $user->getRoom()) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';")); $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("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']) . "';"); mysql_query("UPDATE `users` SET `exp` = `exp`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
@ -299,28 +299,28 @@ if ($_GET['go']) {
switch ($_GET['go']) { switch ($_GET['go']) {
case "p1": case "p1":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p1']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); 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']; $user->setRoom($room['p1']);
$_SESSION['time'] = time(); $_SESSION['time'] = time();
break; break;
case "p2": case "p2":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p2']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); 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']; $user->setRoom($room['p2']);
$_SESSION['time'] = time(); $_SESSION['time'] = time();
break; break;
case "p3": case "p3":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p3']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); 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']; $user->setRoom($room['p3']);
$_SESSION['time'] = time(); $_SESSION['time'] = time();
break; break;
case "p4": case "p4":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p4']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); 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']; $user->setRoom($room['p4']);
$_SESSION['time'] = time(); $_SESSION['time'] = time();
break; break;
} }
} }
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';")); $room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->getRoom()) . "';"));
if ($user['hp'] <= 0) { if ($user['hp'] <= 0) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
@ -335,12 +335,12 @@ if ($user['hp'] <= 0) {
} }
$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';"); $data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->getRoom()) . "' AND `id_user`='" . $user['id'] . "';");
$data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($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']) . "';"); $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'] . "';"); $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'] . "';")); $roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '" . mysql_real_escape_string($user->getRoom()) . "' AND `id_user`='" . $user['id'] . "';"));
if ($roow[0]) { if ($roow[0]) {
$msg .= 'В комнате была установлена ловушка...<br>'; $msg .= 'В комнате была установлена ловушка...<br>';
@ -390,7 +390,7 @@ for ($i = 0; $i < mysql_num_rows($log); $i++) {
} }
echo "" . $room['name'] . " (" . $user->room . ")</tr>"; echo "" . $room['name'] . " (" . $user->getRoom() . ")</tr>";
echo "<tr><td><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b1 onclick='location.href=\"lab.php?go=p1\";'>СЕВЕР</button><td><td rowspan=3 style='height:100px;'>&nbsp;<td rowspan=4 width=30% valign=top style='height:100px;'>"; echo "<tr><td><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b1 onclick='location.href=\"lab.php?go=p1\";'>СЕВЕР</button><td><td rowspan=3 style='height:100px;'>&nbsp;<td rowspan=4 width=30% valign=top style='height:100px;'>";
$u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'"); $u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'");
$u_lab_kol = mysql_num_rows($u_lab); $u_lab_kol = mysql_num_rows($u_lab);

View File

@ -16,7 +16,7 @@ $u_res = mysql_fetch_array(mysql_query("select * from `lab_user` where `id_user`
setTimeout("document.all['b1'].disabled=false;document.all['b2'].disabled=false;document.all['b3'].disabled=false;document.all['b4'].disabled=false;", <?=(3 - $tt)?>000); setTimeout("document.all['b1'].disabled=false;document.all['b2'].disabled=false;document.all['b3'].disabled=false;document.all['b4'].disabled=false;", <?=(3 - $tt)?>000);
</script> </script>
<?php <?php
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';")); $room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->getRoom()) . "';"));
if ($_GET['healall'] == 1) { if ($_GET['healall'] == 1) {
$cost = $_GET['cost']; $cost = $_GET['cost'];
@ -122,7 +122,7 @@ if ($_GET['mobkill'] == 1) {
} }
$rand_hp1 = rand(1, 10); $rand_hp1 = rand(1, 10);
$rand_hp = $rand_hp1 * $user['level']; $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")); $bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1"));
$hels = $bot['bot_hp'] - $rand_hp; $hels = $bot['bot_hp'] - $rand_hp;
if ($hels < 0) { if ($hels < 0) {
echo "<b>Вы убили моба!</b><br>"; echo "<b>Вы убили моба!</b><br>";
@ -133,11 +133,11 @@ if ($_GET['mobkill'] == 1) {
echo "Вы получили 1 записку!<br>"; echo "Вы получили 1 записку!<br>";
Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'"); 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"); mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1");
//если просто убивалка //если просто убивалка
} else { } 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("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"); mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1");
} }
} else { } else {
echo "Вы отняли у моба -<b>" . $rand_hp . "</b> HP!<br>"; echo "Вы отняли у моба -<b>" . $rand_hp . "</b> HP!<br>";
@ -175,7 +175,7 @@ if ($_GET['exit'] && $room['exit'] == 1) {
if ($_GET['get']) { 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'] . "';")); $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 ($data['id_room'] == $user->getRoom()) {
switch ($data['type']) { switch ($data['type']) {
case 1: case 1:
@ -239,13 +239,13 @@ if ($_GET['get']) {
if ($_GET['drop']) { 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'] . "';")); $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("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']) . "');"); mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('" . mysql_real_escape_string($user->getRoom()) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "','" . mysql_real_escape_string($user['id']) . "');");
unset($data); unset($data);
} }
if ($_GET['nal1']) { 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'] . "';")); $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) { if ($data['id_room'] == $user->getRoom()) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';")); $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("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']) . "';"); mysql_query("UPDATE `users` SET `money` = `money`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
@ -257,7 +257,7 @@ if ($_GET['nal1']) {
if ($_GET['nal2']) { 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'] . "';")); $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) { if ($data['id_room'] == $user->getRoom()) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';")); $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("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']) . "';"); mysql_query("UPDATE `users` SET `patriotizm` = `patriotizm`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
@ -269,7 +269,7 @@ if ($_GET['nal2']) {
if ($_GET['nal3']) { 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'] . "';")); $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) { if ($data['id_room'] == $user->getRoom()) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';")); $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("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']) . "';"); mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
@ -281,7 +281,7 @@ if ($_GET['nal3']) {
if ($_GET['nal4']) { 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'] . "';")); $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) { if ($data['id_room'] == $user->getRoom()) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';")); $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("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']) . "';"); mysql_query("UPDATE `users` SET `exp` = `exp`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
@ -297,28 +297,28 @@ if ($_GET['go']) {
switch ($_GET['go']) { switch ($_GET['go']) {
case "p1": case "p1":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p1']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); 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']; $user->setRoom($room['p1']);
$_SESSION['time'] = time(); $_SESSION['time'] = time();
break; break;
case "p2": case "p2":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p2']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); 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']; $user->setRoom($room['p2']);
$_SESSION['time'] = time(); $_SESSION['time'] = time();
break; break;
case "p3": case "p3":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p3']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); 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']; $user->setRoom($room['p3']);
$_SESSION['time'] = time(); $_SESSION['time'] = time();
break; break;
case "p4": case "p4":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p4']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); 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']; $user->setRoom($room['p4']);
$_SESSION['time'] = time(); $_SESSION['time'] = time();
break; break;
} }
} }
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';")); $room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->getRoom()) . "';"));
if ($user['hp'] <= 0) { if ($user['hp'] <= 0) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
@ -333,12 +333,12 @@ if ($user['hp'] <= 0) {
} }
$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';"); $data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->getRoom()) . "' AND `id_user`='" . $user['id'] . "';");
$data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($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']) . "';"); $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'] . "';"); $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'] . "';")); $roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '" . mysql_real_escape_string($user->getRoom()) . "' AND `id_user`='" . $user['id'] . "';"));
if ($roow[0]) { if ($roow[0]) {
$msg .= 'В комнате была установлена ловушка...<br>'; $msg .= 'В комнате была установлена ловушка...<br>';
@ -388,7 +388,7 @@ for ($i = 0; $i < mysql_num_rows($log); $i++) {
} }
echo "" . $room['name'] . " (" . $user->room . ")</tr>"; echo "" . $room['name'] . " (" . $user->getRoom() . ")</tr>";
echo "<tr><td><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b1 onclick='location.href=\"lab.php?go=p1\";'>СЕВЕР</button><td><td rowspan=3 style='height:100px;'>&nbsp;<td rowspan=4 width=30% valign=top style='height:100px;'>"; echo "<tr><td><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b1 onclick='location.href=\"lab.php?go=p1\";'>СЕВЕР</button><td><td rowspan=3 style='height:100px;'>&nbsp;<td rowspan=4 width=30% valign=top style='height:100px;'>";
$u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'"); $u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'");
$u_lab_kol = mysql_num_rows($u_lab); $u_lab_kol = mysql_num_rows($u_lab);

View File

@ -308,7 +308,7 @@ Template::header('Вход в Лабиринты');
</div> </div>
<? <?
if (isset($_GET['del_com'])) { if (isset($_GET['del_com'])) {
if ($user->admin) { if ($user->getAdmin()) {
mysql_query('UPDATE `laba_zv` SET `com` = "" WHERE `id` = "' . (int)$_GET['del_com'] . '" LIMIT 1'); mysql_query('UPDATE `laba_zv` SET `com` = "" WHERE `id` = "' . (int)$_GET['del_com'] . '" LIMIT 1');
$re = 'Комментарий удалён'; $re = 'Комментарий удалён';
} else { } else {
@ -400,7 +400,7 @@ while ($pl = mysql_fetch_array($sp)) {
} }
$userszv = ltrim($userszv, ', '); $userszv = ltrim($userszv, ', ');
if ($pl['com'] != '') { if ($pl['com'] != '') {
if ($user->admin) { if ($user->getAdmin()) {
$del = ' <a href=\'lab_enter.php?del_com=' . $pl['id'] . '\'>Удалить комментарий</a>'; $del = ' <a href=\'lab_enter.php?del_com=' . $pl['id'] . '\'>Удалить комментарий</a>';
} else { } else {
$del = ''; $del = '';

View File

@ -36,7 +36,7 @@ if ($user['battle'] > 0) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif ($user['klan'] != '' && ($user['klan'] == $us['klan'])) { } elseif ($user['klan'] != '' && ($user['klan'] == $us['klan'])) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] ==603 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] ==603 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -95,7 +95,7 @@ if ($user['battle'] > 0) {
} else { } else {
$ttt = 1; $ttt = 1;
} }
addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->room); addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->getRoom());
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].''); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
@ -158,7 +158,7 @@ if ($user['battle'] > 0) {
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->room); addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");

View File

@ -32,7 +32,7 @@ if($vip['bloodattack'] <= 0) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif($user->room != $us['room']) { } elseif($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -82,7 +82,7 @@ if($vip['bloodattack'] <= 0) {
$ttt = 1; $ttt = 1;
} }
addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->room); addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->getRoom());
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); } if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>'); addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1');
@ -121,7 +121,7 @@ if($vip['bloodattack'] <= 0) {
$ld = Nick::id($user['id'])->full(1); $ld = Nick::id($user['id'])->full(1);
$lds = Nick::id($user['id'])->short(); $lds = Nick::id($user['id'])->short();
$rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->room); addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->getRoom());
addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}");
header("Location: fbattle.php"); header("Location: fbattle.php");

View File

@ -39,7 +39,7 @@ elseif (!$us['online']) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) { } elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) {
echo "Чтите честь братьев."; echo "Чтите честь братьев.";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -106,7 +106,7 @@ elseif (!$us['online']) {
} else { } else {
$ttt = 1; $ttt = 1;
} }
addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->room); addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->getRoom());
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].''); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
@ -169,7 +169,7 @@ elseif (!$us['online']) {
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->room); addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");

View File

@ -61,7 +61,7 @@ if ($user['battle'] > 0) {
} else { } else {
$ttt = 1; $ttt = 1;
} }
addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->room); addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->getRoom());
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].''); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');

View File

@ -32,7 +32,7 @@ if ($user['battle'] > 0) {
echo "Персонаж под защитой от нападений ..."; echo "Персонаж под защитой от нападений ...";
} elseif ($owntravma['id'] && !$us['battle']) { } elseif ($owntravma['id'] && !$us['battle']) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['level'] < 1) { } elseif ($us['level'] < 1) {
echo "Новички находятся под защитой Мироздателя!"; echo "Новички находятся под защитой Мироздателя!";
@ -81,7 +81,7 @@ if ($user['battle'] > 0) {
} else { } else {
$ttt = 1; $ttt = 1;
} }
addch("<b>" . Nick::id($user['id'])->short() . "</b> вмешался в <a href=logs.php?log=" . $id . " target=_blank>поединок »»</a>. ", $user->room); addch("<b>" . Nick::id($user['id'])->short() . "</b> вмешался в <a href=logs.php?log=" . $id . " target=_blank>поединок »»</a>. ", $user->getRoom());
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].''); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
@ -146,7 +146,7 @@ if ($user['battle'] > 0) {
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>"; $rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user->room); addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");

View File

@ -39,7 +39,7 @@ elseif (!$us['online']) {
echo "Персонаж под защитой от нападений ..."; echo "Персонаж под защитой от нападений ...";
} elseif ($owntravma['id'] && !$us['battle']) { } elseif ($owntravma['id'] && !$us['battle']) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -133,7 +133,7 @@ elseif (!$us['online']) {
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->room); addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");

View File

@ -39,7 +39,7 @@ if ($user['battle'] > 0) {
echo "Вы ожидаете поединка..."; echo "Вы ожидаете поединка...";
} elseif ($owntravma['id'] && !$us['battle']) { } elseif ($owntravma['id'] && !$us['battle']) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -133,7 +133,7 @@ if ($user['battle'] > 0) {
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->room); addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");

View File

@ -39,7 +39,7 @@ elseif (!$us['online']) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) { } elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) {
echo "Чтите честь братьев."; echo "Чтите честь братьев.";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -106,7 +106,7 @@ elseif (!$us['online']) {
} else { } else {
$ttt = 1; $ttt = 1;
} }
addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->room); addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->getRoom());
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].''); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
@ -169,7 +169,7 @@ elseif (!$us['online']) {
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->room); addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");

View File

@ -9,7 +9,7 @@ $raid_t = mysql_fetch_array(mysql_query("SELECT * FROM variables WHERE var='raid
if ($user['battle'] == 0) { if ($user['battle'] == 0) {
echo "Это боевая магия..."; echo "Это боевая магия...";
} elseif ($user->room == 600 || $user->room == 601 || $user->room == 602 || $us['room'] == 43 || $us['room'] == 45) { } elseif ($user->getRoom() == 600 || $user->getRoom() == 601 || $user->getRoom() == 602 || $us['room'] == 43 || $us['room'] == 45) {
echo "В этой локации выход из боя запрещен!"; echo "В этой локации выход из боя запрещен!";
} elseif ($user['battle'] == $raid_t['value']) { } elseif ($user['battle'] == $raid_t['value']) {
echo "Вы защищаете весь город, а не только себя. Победа или смерть!"; echo "Вы защищаете весь город, а не только себя. Победа или смерть!";

View File

@ -24,7 +24,7 @@ elseif ($user['zayavka'] > 0) {
} elseif ($us['align']!=3) { } elseif ($us['align']!=3) {
echo "Персонаж не с темной склонностью!"; echo "Персонаж не с темной склонностью!";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -78,7 +78,7 @@ elseif ($user['zayavka'] > 0) {
} else { } else {
$ttt = 2; $ttt = 2;
} }
addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->room); addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->getRoom());
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].''); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
@ -142,7 +142,7 @@ elseif ($user['zayavka'] > 0) {
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->room); addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");

View File

@ -1,5 +1,5 @@
<?php <?php
if ($user->room == 20) { if ($user->getRoom() == 20) {
//нападение //нападение
$us = mysql_fetch_array(mysql_query("SELECT *,(select `id` from `online` WHERE `real_time` >= " . (time() - 60) . " AND `id` = users.`id`) as `online` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;")); $us = mysql_fetch_array(mysql_query("SELECT *,(select `id` from `online` WHERE `real_time` >= " . (time() - 60) . " AND `id` = users.`id`) as `online` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
@ -18,7 +18,7 @@ if ($user->room == 20) {
echo "Вы ожидаете поединка..."; echo "Вы ожидаете поединка...";
} elseif ($user['klan'] != '' && ($user['klan'] == $us['klan'])) { } elseif ($user['klan'] != '' && ($user['klan'] == $us['klan'])) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['level'] < 3) { } elseif ($us['level'] < 3) {
echo "Нельзя напасть на персонажа ниже 3 уровня! Даже ночью, даже на Центральной площади..."; echo "Нельзя напасть на персонажа ниже 3 уровня! Даже ночью, даже на Центральной площади...";
@ -61,7 +61,7 @@ if ($user->room == 20) {
} else { } else {
$ttt = 1; $ttt = 1;
} }
addch("<b>" . Nick::id($user['id'])->short() . "</b> вмешался в <a href=logs.php?log=" . $id . " target=_blank>поединок »»</a>. ", $user->room); addch("<b>" . Nick::id($user['id'])->short() . "</b> вмешался в <a href=logs.php?log=" . $id . " target=_blank>поединок »»</a>. ", $user->getRoom());
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].''); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
@ -125,7 +125,7 @@ if ($user->room == 20) {
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>"; $rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user->room); addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");

View File

@ -51,7 +51,7 @@ elseif (!$us['online']) {
echo "Вы ожидаете поединка..."; echo "Вы ожидаете поединка...";
} elseif ($owntravma['id'] && !$us['battle']) { } elseif ($owntravma['id'] && !$us['battle']) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -106,7 +106,7 @@ elseif (!$us['online']) {
} else { } else {
$ttt = 1; $ttt = 1;
} }
addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->room); addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->getRoom());
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].''); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
@ -169,7 +169,7 @@ elseif (!$us['online']) {
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->room); addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");

View File

@ -13,7 +13,7 @@ if ($user['battle'] > 0) {echo "Не в бою...";}
elseif ($user['level'] < 4) { echo "Вашего уровня не достаточно для использования этого заклинания!"; } elseif ($user['level'] < 4) { echo "Вашего уровня не достаточно для использования этого заклинания!"; }
elseif ($us['level'] < 4) { echo "Запрещено применять на персонажей до 4 уровня!"; } elseif ($us['level'] < 4) { echo "Запрещено применять на персонажей до 4 уровня!"; }
elseif ($effect['time']) {echo "На персонаже уже есть заклятие Защита от Оружия"; } elseif ($effect['time']) {echo "На персонаже уже есть заклятие Защита от Оружия"; }
elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; }
elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (!$us['online']) {echo "Персонаж не в игре!";}
elseif (rand(1,100) < $int) { elseif (rand(1,100) < $int) {

View File

@ -14,7 +14,7 @@ if ($user['battle'] > 0) {echo "Не в бою...";}
elseif ($user['level'] < 4) { echo "Вашего уровня не достаточно для использования этого заклинания!"; } elseif ($user['level'] < 4) { echo "Вашего уровня не достаточно для использования этого заклинания!"; }
elseif ($us['level'] < 4) { echo "Запрещено применять на персонажей до 4 уровня!"; } elseif ($us['level'] < 4) { echo "Запрещено применять на персонажей до 4 уровня!"; }
elseif ($effect['time']) {echo "На персонаже уже есть заклятие Сокрушение"; } elseif ($effect['time']) {echo "На персонаже уже есть заклятие Сокрушение"; }
elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; }
elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (!$us['online']) {echo "Персонаж не в игре!";}
elseif (rand(1,100) < $int) { elseif (rand(1,100) < $int) {

View File

@ -46,7 +46,7 @@ elseif ($user['zayavka'] > 0) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) { } elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) {
echo "Чтите честь братьев."; echo "Чтите честь братьев.";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -111,7 +111,7 @@ elseif ($user['zayavka'] > 0) {
} else { } else {
$ttt = 1; $ttt = 1;
} }
addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->room); addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->getRoom());
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].''); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
@ -182,7 +182,7 @@ $outok=1;
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->room); addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");

View File

@ -46,7 +46,7 @@ elseif ($user['zayavka'] > 0) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) { } elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) {
echo "Чтите честь братьев."; echo "Чтите честь братьев.";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -111,7 +111,7 @@ elseif ($user['zayavka'] > 0) {
} else { } else {
$ttt = 1; $ttt = 1;
} }
addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->room); addch ("<b>".Nick::id($user['id'])->short()."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>. ",$user->getRoom());
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].''); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
@ -182,7 +182,7 @@ $outok=1;
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->room); addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");

View File

@ -12,7 +12,7 @@ else {$int=0;}
if ($user['battle'] > 0) {echo "РќРµ РІ Р±РѕСЋ...";} if ($user['battle'] > 0) {echo "РќРµ РІ Р±РѕСЋ...";}
elseif ($user['level'] < 0) { echo "Вашего уровня не достаточно для использования этого заклинания!"; } elseif ($user['level'] < 0) { echo "Вашего уровня не достаточно для использования этого заклинания!"; }
elseif ($effect['time']) {echo "На персонаже уже есть заклятие Эликсир брони +5"; } elseif ($effect['time']) {echo "На персонаже уже есть заклятие Эликсир брони +5"; }
elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; }
elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (!$us['online']) {echo "Персонаж не в игре!";}
elseif (rand(0,100) < $int) { elseif (rand(0,100) < $int) {

View File

@ -12,7 +12,7 @@
if ($user['battle'] > 0) {echo "РќРµ РІ Р±РѕСЋ...";} if ($user['battle'] > 0) {echo "РќРµ РІ Р±РѕСЋ...";}
elseif ($user['level'] < 0) { echo "Вашего уровня не достаточно для использования этого заклинания!"; } elseif ($user['level'] < 0) { echo "Вашего уровня не достаточно для использования этого заклинания!"; }
elseif ($effect['time']) {echo "На персонаже уже есть заклятие Эликсир урона +3"; } elseif ($effect['time']) {echo "На персонаже уже есть заклятие Эликсир урона +3"; }
elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; }
elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (!$us['online']) {echo "Персонаж не в игре!";}
elseif (rand(0,100) < $int) { elseif (rand(0,100) < $int) {

View File

@ -7,7 +7,7 @@ $int=101;
if ($user['battle'] > 0) {echo "Не в бою...";} if ($user['battle'] > 0) {echo "Не в бою...";}
elseif ($effect['time']) {echo "На персонаже уже есть заклятие Защита от кулачного нападения"; } elseif ($effect['time']) {echo "На персонаже уже есть заклятие Защита от кулачного нападения"; }
elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; }
elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (!$us['online']) {echo "Персонаж не в игре!";}
elseif (rand(1,100) < $int) { elseif (rand(1,100) < $int) {

View File

@ -33,7 +33,7 @@ if ($user['battle'] > 0) {echo "Не в бою...";}
elseif ($user['level'] < 4) { echo "Вашего уровня не достаточно для использования этого заклинания!"; } elseif ($user['level'] < 4) { echo "Вашего уровня не достаточно для использования этого заклинания!"; }
elseif ($us['level'] < 4) { echo "Запрещено применять на персонажей до 4 уровня!"; } elseif ($us['level'] < 4) { echo "Запрещено применять на персонажей до 4 уровня!"; }
elseif ($effect['time']) {echo "На персонаже уже есть заклятие Удача"; } elseif ($effect['time']) {echo "На персонаже уже есть заклятие Удача"; }
elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; }
elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (!$us['online']) {echo "Персонаж не в игре!";}
elseif (rand(1,100) < $int) { elseif (rand(1,100) < $int) {

View File

@ -25,7 +25,7 @@ if($vip['pers_attack'] <= 0) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif($user->room != $us['room']) { } elseif($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -76,7 +76,7 @@ if($vip['pers_attack'] <= 0) {
$ttt = 1; $ttt = 1;
} }
addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->room); addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->getRoom());
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); } if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>'); addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1');
@ -115,7 +115,7 @@ if($vip['pers_attack'] <= 0) {
$ld = Nick::id($user['id'])->full(1); $ld = Nick::id($user['id'])->full(1);
$lds = Nick::id($user['id'])->short(); $lds = Nick::id($user['id'])->short();
$rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->room); addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->getRoom());
addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}");
header("Location: fbattle.php"); header("Location: fbattle.php");

View File

@ -6,7 +6,7 @@ if (empty($_SESSION['uid'])) {
if ($user['invis'] == 1) { if ($user['invis'] == 1) {
$user['login'] = '<b><i>невидимка</i></b>'; $user['login'] = '<b><i>невидимка</i></b>';
} }
if (($user->room > 2000) && ($user->room < 2100)) { if (($user->getRoom() > 2000) && ($user->getRoom() < 2100)) {
echo "Не в Проходе..."; echo "Не в Проходе...";
} else { } else {
$magictime = (time() + 10 * 60); $magictime = (time() + 10 * 60);
@ -18,7 +18,7 @@ if (($user->room > 2000) && ($user->room < 2100)) {
echo "<font color=red><b>На персонаже \"$target\" уже есть путы </b></font>"; echo "<font color=red><b>На персонаже \"$target\" уже есть путы </b></font>";
} else { } else {
if ($tar['room'] == $user->room) { if ($tar['room'] == $user->getRoom()) {
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Путы','$magictime',10);")) { if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Путы','$magictime',10);")) {
$ldtarget = $target; $ldtarget = $target;

View File

@ -7,7 +7,7 @@ if (empty($_SESSION['uid'])) {
if ($user['invis'] == 1) { if ($user['invis'] == 1) {
$user['login'] = '<b><i>невидимка</i></b>'; $user['login'] = '<b><i>невидимка</i></b>';
} }
if (($user->room > 2000) && ($user->room < 2100)) { if (($user->getRoom() > 2000) && ($user->getRoom() < 2100)) {
echo "Не в Проходе..."; echo "Не в Проходе...";
} else { } else {
$magictime = (time() + 10 * 60 * 10); $magictime = (time() + 10 * 60 * 10);
@ -19,7 +19,7 @@ if (($user->room > 2000) && ($user->room < 2100)) {
echo "<font color=red><b>На персонаже \"$target\" уже есть путы </b></font>"; echo "<font color=red><b>На персонаже \"$target\" уже есть путы </b></font>";
} else { } else {
if ($tar['room'] == $user->room) { if ($tar['room'] == $user->getRoom()) {
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Паралич','$magictime',10);")) { if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Паралич','$magictime',10);")) {
$ldtarget = $target; $ldtarget = $target;

View File

@ -32,7 +32,7 @@ if($vip['attack'] <= 0) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif($user->room != $us['room']) { } elseif($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -83,7 +83,7 @@ if($vip['attack'] <= 0) {
$ttt = 1; $ttt = 1;
} }
addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->room); addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->getRoom());
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); } if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>'); addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\') WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\') WHERE `id` = "'.$jert['battle'].'" LIMIT 1');
@ -122,7 +122,7 @@ if($vip['attack'] <= 0) {
$ld = Nick::id($user['id'])->full(1); $ld = Nick::id($user['id'])->full(1);
$lds = Nick::id($user['id'])->short(); $lds = Nick::id($user['id'])->short();
$rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->room); addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->getRoom());
addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
mysql_query("UPDATE users SET `battle` = {$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); mysql_query("UPDATE users SET `battle` = {$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}");
header("Location: fbattle.php"); header("Location: fbattle.php");

View File

@ -32,7 +32,7 @@ if($vip['bloodattack'] <= 0) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif($user->room != $us['room']) { } elseif($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -83,7 +83,7 @@ if($vip['bloodattack'] <= 0) {
$ttt = 1; $ttt = 1;
} }
addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->room); addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->getRoom());
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); } if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>'); addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1');
@ -122,7 +122,7 @@ if($vip['bloodattack'] <= 0) {
$ld = Nick::id($user['id'])->full(1); $ld = Nick::id($user['id'])->full(1);
$lds = Nick::id($user['id'])->short(); $lds = Nick::id($user['id'])->short();
$rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->room); addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->getRoom());
addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}");
header("Location: fbattle.php"); header("Location: fbattle.php");

View File

@ -32,7 +32,7 @@ if($vip['attack'] <= 0) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif($user->room != $us['room']) { } elseif($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -83,7 +83,7 @@ if($vip['attack'] <= 0) {
$ttt = 1; $ttt = 1;
} }
addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->room); addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->getRoom());
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); } if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>'); addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\') WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\') WHERE `id` = "'.$jert['battle'].'" LIMIT 1');
@ -122,7 +122,7 @@ if($vip['attack'] <= 0) {
$ld = Nick::id($user['id'])->full(1); $ld = Nick::id($user['id'])->full(1);
if($user['invis'] == 1) { $lds = '<i><b>невидимка</b></i>'; } else { $lds = Nick::id($user['id'])->short(); } if($user['invis'] == 1) { $lds = '<i><b>невидимка</b></i>'; } else { $lds = Nick::id($user['id'])->short(); }
$rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->room); addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->getRoom());
addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
mysql_query("UPDATE users SET `battle` = {$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); mysql_query("UPDATE users SET `battle` = {$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}");
header("Location: fbattle.php"); header("Location: fbattle.php");

View File

@ -32,7 +32,7 @@ if($vip['bloodattack'] <= 0) {
echo "Персонаж тяжело травмирован..."; echo "Персонаж тяжело травмирован...";
} elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) {
echo "Чтите честь ваших сокланов."; echo "Чтите честь ваших сокланов.";
} elseif($user->room != $us['room']) { } elseif($user->getRoom() != $us['room']) {
echo "Персонаж в другой комнате!"; echo "Персонаж в другой комнате!";
} elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) {
echo "Нападения в этой локации запрещены!"; echo "Нападения в этой локации запрещены!";
@ -83,7 +83,7 @@ if($vip['bloodattack'] <= 0) {
$ttt = 1; $ttt = 1;
} }
addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->room); addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.", $user->getRoom());
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); } if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>'); addlog($jert['battle'], '<span class=date>'.date("H:i").'</span> '.$lod.' вмешался в поединок!<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1');
@ -122,7 +122,7 @@ if($vip['bloodattack'] <= 0) {
$ld = Nick::id($user['id'])->full(1); $ld = Nick::id($user['id'])->full(1);
$lds = Nick::id($user['id'])->short(); $lds = Nick::id($user['id'])->short();
$rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>"; $rr = "<b>".$ld."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->room); addch("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <b>".$lds."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался.", $user->getRoom());
addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>"); addlog($id, "Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}");
header("Location: fbattle.php"); header("Location: fbattle.php");

View File

@ -57,11 +57,11 @@ if ($user['battle'] > 0) {
echo "Нельзя укусить новичка, они защищены Мироздателем!"; echo "Нельзя укусить новичка, они защищены Мироздателем!";
} elseif ($us['align'] > 2 && $us['align'] < 3) { } elseif ($us['align'] > 2 && $us['align'] < 3) {
echo "Вы решили укусить Ангела? ;)"; echo "Вы решили укусить Ангела? ;)";
} elseif ($user->room != $us['room']) { } elseif ($user->getRoom() != $us['room']) {
echo "Персонаж находится в другой комнате.)"; echo "Персонаж находится в другой комнате.)";
} elseif ($user['battle']) { } elseif ($user['battle']) {
echo "Не в бою..."; echo "Не в бою...";
} elseif ($user->room == 31) { } elseif ($user->getRoom() == 31) {
echo "Нельзя укусить в этой комнате!"; echo "Нельзя укусить в этой комнате!";
} elseif (((int)date("H") < 22) && ((int)date("H") >= 6)) { } elseif (((int)date("H") < 22) && ((int)date("H") >= 6)) {
echo "Вампиры кусают только по ночам"; echo "Вампиры кусают только по ночам";
@ -151,7 +151,7 @@ if ($user['battle'] > 0) {
// создаем лог // создаем лог
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($us['id'])->full(1) . "</b>"; $rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($us['id'])->full(1) . "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($us['id'])->short() . "</b> начался. ", $user->room); addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($us['id'])->short() . "</b> начался. ", $user->getRoom());
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');"); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
addlog($id, 'Часы показывали <span class=date>' . date("Y.m.d H.i") . '</span>, когда ' . $rr . ' бросили вызов друг другу. <BR>'); addlog($id, 'Часы показывали <span class=date>' . date("Y.m.d H.i") . '</span>, когда ' . $rr . ' бросили вызов друг другу. <BR>');

View File

@ -15,7 +15,7 @@ elseif ($user['level'] < $magic_need['nlevel']) { echo "ВашегР
elseif ($user['mgray'] < $magic_need['ngray']) { echo "Не достаточно владения Серой магией для использования этого заклинания!"; } elseif ($user['mgray'] < $magic_need['ngray']) { echo "Не достаточно владения Серой магией для использования этого заклинания!"; }
elseif ($user['intel'] < $magic_need['nintel']) { echo "Вашего интеллекта не достаточно для использования этого заклинания!"; } elseif ($user['intel'] < $magic_need['nintel']) { echo "Вашего интеллекта не достаточно для использования этого заклинания!"; }
elseif ($effect['time']) {echo "На персонаже уже есть заклятие Микстура жизненных сил"; } elseif ($effect['time']) {echo "На персонаже уже есть заклятие Микстура жизненных сил"; }
elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; }
elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (!$us['online']) {echo "Персонаж не в игре!";}
elseif (rand(1,100) < $int) { elseif (rand(1,100) < $int) {

View File

@ -44,7 +44,7 @@ while ($row = $data->fetch_assoc()) {
} }
//Обработчики нажатий на кнопки. //Обработчики нажатий на кнопки.
if ($_POST['battlefield'] ?? 0 && $user->room == 1) { if ($_POST['battlefield'] ?? 0 && $user->getRoom() == 1) {
header('Location: zayavka.php'); header('Location: zayavka.php');
exit(); exit();
} }
@ -52,11 +52,11 @@ if ($_POST['module_quest'] ?? 0) {
header('Location: module_quest.php'); header('Location: module_quest.php');
exit(); exit();
} }
if ($_POST['move_inside'] ?? 0 && $user->room == 20) { if ($_POST['move_inside'] ?? 0 && $user->getRoom() == 20) {
header('Location: main.php?goto=arena'); header('Location: main.php?goto=arena');
exit(); exit();
} }
if ($_POST['move_outside'] ?? 0 && $user->room == 1) { if ($_POST['move_outside'] ?? 0 && $user->getRoom() == 1) {
header('Location: main.php?goto=plo'); header('Location: main.php?goto=plo');
exit(); exit();
} }
@ -67,12 +67,12 @@ if ($_POST['main_page'] ?? 0) {
if ($edit === null) { if ($edit === null) {
/* === проверяем соответствие комнаты и скрипта === */ /* === проверяем соответствие комнаты и скрипта === */
if (in_array($user->room, [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111])) { if (in_array($user->getRoom(), [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111])) {
header('Location: city.php'); header('Location: city.php');
exit(); exit();
} }
if (in_array($user->room, [22, 23, 25, 27, 29, 30, 31, 34, 45, 53, 61, 402, 403, 600, 601, 602, 603, 620, 621, 650, 660, 661, 662, 666, 760, 1051, 1052, 1055])) { if (in_array($user->getRoom(), [22, 23, 25, 27, 29, 30, 31, 34, 45, 53, 61, 402, 403, 600, 601, 602, 603, 620, 621, 650, 660, 661, 662, 666, 760, 1051, 1052, 1055])) {
header('location: ' . Travel::$roomFileName[$user->room]); header('location: ' . Travel::$roomFileName[$user->getRoom()]);
exit(); exit();
} }
} }
@ -174,7 +174,7 @@ if ($goto) {
$eff = db::c()->query('SELECT 1 FROM `users_effects` WHERE `owner_id` = ?i AND (`type` = 14 OR `type` = 13)', $user->getId()); $eff = db::c()->query('SELECT 1 FROM `users_effects` WHERE `owner_id` = ?i AND (`type` = 14 OR `type` = 13)', $user->getId());
//(масса: <?= $getItemsBonuses->getItemsWeight() . '/' . $user->strength * 4 //(масса: <?= $getItemsBonuses->getItemsWeight() . '/' . $user->strength * 4
if ($d['sum_weight'] > $user->strength * 4 && $goto) { if ($d['sum_weight'] > $user->getStrength() * 4 && $goto) {
err('У вас переполнен рюкзак, вы не можете передвигаться...'); err('У вас переполнен рюкзак, вы не можете передвигаться...');
$imove = false; $imove = false;
} }
@ -182,15 +182,15 @@ if ($goto) {
err('У вас тяжелая травма, вы не можете передвигатся...'); err('У вас тяжелая травма, вы не можете передвигатся...');
$imove = false; $imove = false;
} }
if ($goto == 'plo' && !$user->zayavka && $imove && $user->room != 20) { if ($goto == 'plo' && !$user->getZayavka() && $imove && $user->getRoom() != 20) {
db::c()->query('UPDATE users, online SET users.room = 20, online.room = 20 WHERE online.user_id = users.id AND online.user_id = ?i', $_SESSION['uid']); db::c()->query('UPDATE users, online SET users.room = 20, online.room = 20 WHERE online.user_id = users.id AND online.user_id = ?i', $user->getId());
header('Location: city.php'); header('Location: city.php');
exit("<i>Топ-топ-топ...</i>"); exit("<i>Топ-топ-топ...</i>");
} else { } else {
err('Подали заявку на бой и убегаете из клуба? Нехорошо...'); err('Подали заявку на бой и убегаете из клуба? Нехорошо...');
} }
if ($goto == 'arena' && $user->room == 20 && $imove) { if ($goto == 'arena' && $user->getRoom() == 20 && $imove) {
db::c()->query('UPDATE users, online SET users.room = 1, online.room = 1 WHERE online.user_id = users.id AND online.user_id = ?i', $_SESSION['uid']); db::c()->query('UPDATE users, online SET users.room = 1, online.room = 1 WHERE online.user_id = users.id AND online.user_id = ?i', $user->getId());
header('Location: main.php'); header('Location: main.php');
exit("<i>Топ-топ-топ...</i>"); exit("<i>Топ-топ-топ...</i>");
} }
@ -216,7 +216,7 @@ function setShadow($image)
} }
} }
if ($obraz && ($user->shadow == 'g0.gif' || $user->shadow == 'man0.gif')) { if ($obraz && ($user->getShadow() == 'g0.gif' || $user->getShadow() == 'man0.gif')) {
setShadow($obraz); setShadow($obraz);
} }
@ -389,21 +389,21 @@ Template::header('Игра');
<!--Параметры--> <!--Параметры-->
<div> <div>
<div class="container"> <div class="container">
Сила: <?= ($user->free_stat_points ? $user->getStat('strength', 1) . '(' . strval($user->strength + $getItemsBonuses->getStrengthBonus()) . ')' : $user->strength + $getItemsBonuses->getStrengthBonus()) ?> Сила: <?= ($user->getFreeStatPoints() ? $user->getStat('strength', 1) . '(' . strval($user->getStrength() + $getItemsBonuses->getStrengthBonus()) . ')' : $user->getStrength() + $getItemsBonuses->getStrengthBonus()) ?>
<br> <br>
Ловкость: <?= ($user->free_stat_points ? $user->getStat('dexterity', 1) . '(' . strval($user->dexterity + $getItemsBonuses->getDexterityBonus()) . ')' : $user->dexterity + $getItemsBonuses->getDexterityBonus()) ?> Ловкость: <?= ($user->getFreeStatPoints() ? $user->getStat('dexterity', 1) . '(' . strval($user->getDexterity() + $getItemsBonuses->getDexterityBonus()) . ')' : $user->getDexterity() + $getItemsBonuses->getDexterityBonus()) ?>
<br> <br>
Интуиция: <?= ($user->free_stat_points ? $user->getStat('intuition', 1) . '(' . strval($user->intuition + $getItemsBonuses->getIntuitionBonus()) . ')' : $user->intuition + $getItemsBonuses->getIntuitionBonus()) ?> Интуиция: <?= ($user->getFreeStatPoints() ? $user->getStat('intuition', 1) . '(' . strval($user->getIntuition() + $getItemsBonuses->getIntuitionBonus()) . ')' : $user->getIntuition() + $getItemsBonuses->getIntuitionBonus()) ?>
<br> <br>
Выносливость: <?= ($user->free_stat_points ? $user->getStat('endurance', 1) . '(' . strval($user->endurance + $getItemsBonuses->getEnduranceBonus()) . ')' : $user->endurance + $getItemsBonuses->getEnduranceBonus()) ?> Выносливость: <?= ($user->getFreeStatPoints() ? $user->getStat('endurance', 1) . '(' . strval($user->getEndurance() + $getItemsBonuses->getEnduranceBonus()) . ')' : $user->getEndurance() + $getItemsBonuses->getEnduranceBonus()) ?>
<br> <br>
Интеллект: <?= ($user->free_stat_points ? $user->getStat('intelligence', 1) . '(' . strval($user->intelligence + $getItemsBonuses->getIntelliganceBonus()) . ')' : $user->intelligence + $getItemsBonuses->getIntelliganceBonus()) ?> Интеллект: <?= ($user->getFreeStatPoints() ? $user->getStat('intelligence', 1) . '(' . strval($user->getIntelligence() + $getItemsBonuses->getIntelliganceBonus()) . ')' : $user->getIntelligence() + $getItemsBonuses->getIntelliganceBonus()) ?>
<br> <br>
Мудрость: <?= ($user->free_stat_points ? $user->getStat('wisdom', 1) . '(' . strval($user->wisdom + $getItemsBonuses->getWisdomBonus()) . ')' : $user->wisdom + $getItemsBonuses->getWisdomBonus()) ?> Мудрость: <?= ($user->getFreeStatPoints() ? $user->getStat('wisdom', 1) . '(' . strval($user->getWisdom() + $getItemsBonuses->getWisdomBonus()) . ')' : $user->getWisdom() + $getItemsBonuses->getWisdomBonus()) ?>
<br> <br>
<?php if ($user->free_stat_points): ?> <?php if ($user->getFreeStatPoints()): ?>
<small style="color: darkgreen;">Возможных <small style="color: darkgreen;">Возможных
увеличений: <?= $user->free_stat_points ?></small><br> увеличений: <?= $user->getFreeStatPoints() ?></small><br>
<?php endif; ?> <?php endif; ?>
<br> <br>
Здоровье: <?= $user->getHealth() ?><br> Здоровье: <?= $user->getHealth() ?><br>
@ -411,31 +411,31 @@ Template::header('Игра');
Уворот: <?= $getItemsBonuses->getEvasionBonus() ?><br> Уворот: <?= $getItemsBonuses->getEvasionBonus() ?><br>
Точность: <?= $getItemsBonuses->getAccuracyBonus() ?><br> Точность: <?= $getItemsBonuses->getAccuracyBonus() ?><br>
Шанс крита: <?= $getItemsBonuses->getCriticalsBonus() ?><br> Шанс крита: <?= $getItemsBonuses->getCriticalsBonus() ?><br>
Урон: <?= $user->minDamage + $getItemsBonuses->getMinPhysDamage() ?> Урон: <?= $user->getMinDamage() + $getItemsBonuses->getMinPhysDamage() ?>
- <?= $user->maxDamage + $getItemsBonuses->getMaxPhysDamage() ?> <br> - <?= $user->getMaxDamage() + $getItemsBonuses->getMaxPhysDamage() ?> <br>
<br> <br>
Защита от огня: ?? <br> Защита от огня: ?? <br>
Защита от воды: ?? <br> Защита от воды: ?? <br>
Защита от вохдуха: ?? <br> Защита от вохдуха: ?? <br>
Защита от земли: ?? <br> Защита от земли: ?? <br>
Защита от яда: ?? <br> Защита от яда: ?? <br>
Броня головы: <?= $user->headArmor ?> <br> Броня головы: <?= $user->getHeadArmor() ?> <br>
Броня корпуса: <?= $user->chestArmor ?> <br> Броня корпуса: <?= $user->getChestArmor() ?> <br>
Броня ног: <?= $user->legArmor ?> <br> Броня ног: <?= $user->getLegArmor() ?> <br>
</div> </div>
</div> </div>
</td> </td>
<td valign=top> <td valign=top>
<div class="button-container"> <!--Меню-кнопки--> <div class="button-container"> <!--Меню-кнопки-->
<FORM METHOD=POST ACTION="?edit=1" name=f1> <FORM METHOD=POST ACTION="?edit=1" name=f1>
<?php if ($user->shadow == '0.gif' || $user->admin == 1): ?> <?php if ($user->getShadow() == '0.gif' || $user->getAdmin() == 1): ?>
<INPUT class="button primary icon user" TYPE="submit" name="setshadow" value="Образы" <INPUT class="button primary icon user" TYPE="submit" name="setshadow" value="Образы"
title="Образы"> title="Образы">
<?php endif; ?> <?php endif; ?>
<div class="button-group"> <div class="button-group">
<?php if ($user->room == 20): ?> <?php if ($user->getRoom() == 20): ?>
<input class="button icon move" type="submit" name="move_inside" value="Войти внутрь"> <input class="button icon move" type="submit" name="move_inside" value="Войти внутрь">
<?php elseif ($user->room == 1): ?> <?php elseif ($user->getRoom() == 1): ?>
<input class="button primary" type="submit" name="battlefield" value="Поединки"> <input class="button primary" type="submit" name="battlefield" value="Поединки">
<input class="button icon move" type="submit" name="move_outside" value="Выйти на улицу"> <input class="button icon move" type="submit" name="move_outside" value="Выйти на улицу">
<?php endif; ?> <?php endif; ?>
@ -446,7 +446,7 @@ Template::header('Игра');
<div> <!--рюкзак--> <div> <!--рюкзак-->
<table BORDER=0 WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5"> <table BORDER=0 WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5">
<caption>Рюкзак <caption>Рюкзак
(масса: <?= '?? /' . $user->strength * 4 ?>) (масса: <?= '?? /' . $user->getStrength() * 4 ?>)
</caption> </caption>
<?php <?php
foreach ($iteminfo as $ii) { foreach ($iteminfo as $ii) {

View File

@ -60,7 +60,7 @@ if (!empty($q->error)) {
Template::header('Памятник'); Template::header('Памятник');
?> ?>
<div style="float: right;"> <div style="float: right;">
<?php if (($user->getLevel() < 5 || $user->admin) && $user->health < $user->maxHealth): ?> <?php if (($user->getLevel() < 5 || $user->getAdmin()) && $user->getHealth() < $user->getMaxHealth()): ?>
<button onclick="location.href='?hps'">Восстановить здоровье</button> <button onclick="location.href='?hps'">Восстановить здоровье</button>
<? endif ?> <? endif ?>
<button onclick="location.href='?'">Обновить</button> <button onclick="location.href='?'">Обновить</button>

View File

@ -43,7 +43,7 @@ if (mktime() >= ($dateD[0] + 10)) {
$Tournament->ShowTournirFinaliats(); $Tournament->ShowTournirFinaliats();
?> ?>
<form method="post"> <form method="post">
<?php if ($user->admin) { ?> <?php if ($user->getAdmin()) { ?>
<div> <div>
<input type="submit" name="newtournament" value="Добавить новый турнир"> <input type="submit" name="newtournament" value="Добавить новый турнир">
<input type="submit" name="preptournament" value="Приготовить турнир и запустить"> <input type="submit" name="preptournament" value="Приготовить турнир и запустить">

View File

@ -78,14 +78,14 @@ $kol_pl = mysql_num_rows(mysql_query("SELECT `id` FROM `users` WHERE `bot` = 0 a
$tur_data = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_turnir` WHERE `active` = TRUE")); $tur_data = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_turnir` WHERE `active` = TRUE"));
if ($_GET['give']) { if ($_GET['give']) {
$obj = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_items` WHERE `id` = '" . mysql_real_escape_string($_GET['give']) . "' and `room` = '" . $user->room . "' LIMIT 1")); $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 ($obj) {
if ($_SESSION['timei'] - time() <= 0) { if ($_SESSION['timei'] - time() <= 0) {
$_SESSION['timei'] = (time() + 3); $_SESSION['timei'] = (time() + 3);
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '" . $obj['iteam_id'] . "' LIMIT 1")); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '" . $obj['iteam_id'] . "' LIMIT 1"));
if (isset($dress['id'])) { 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("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->room . "' LIMIT 1"); mysql_query("DELETE FROM `deztow_items` WHERE `id` = '" . mysql_real_escape_string($_GET['give']) . "' and `room` = '" . $user->getRoom() . "' LIMIT 1");
} else { } else {
echo '<font color=red>Предмет не найден. Сообщите Администрации данный код #' . $obj['iteam_id'] . '#</font>'; echo '<font color=red>Предмет не найден. Сообщите Администрации данный код #' . $obj['iteam_id'] . '#</font>';
} }
@ -99,7 +99,7 @@ if ($_GET['give']) {
if ($_POST['attack']) { 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")); $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->room && $jert['id'] != $user['id']) { if ($jert['room'] == $user->getRoom() && $jert['id'] != $user['id']) {
if ($jert['id'] == 233 || $jert['id'] == 234 || $jert['id'] == 235) { 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')); $arha = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `prototype` = "' . $jert['id'] . '" LIMIT 1'));
if (isset($arha['id'])) { if (isset($arha['id'])) {
@ -129,7 +129,7 @@ if ($_POST['attack']) {
$ttt = 1; $ttt = 1;
$ttt2 = 2; $ttt2 = 2;
} }
addch("<b>" . Nick::id($user['id'])->short() . "</b> вмешался в <a href=logs.php?log=" . $id . " target=_blank>поединок »»</a>.", $user->room); addch("<b>" . Nick::id($user['id'])->short() . "</b> вмешался в <a href=logs.php?log=" . $id . " target=_blank>поединок »»</a>.", $user->getRoom());
addlog($jert['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вмешался в поединок!<BR>'); addlog($jert['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вмешался в поединок!<BR>');
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 `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 `users` SET `battle` = '" . $jert['battle'] . "', `zayavka` = 0 WHERE `id` = '" . $user['id'] . "' LIMIT 1");
@ -155,7 +155,7 @@ if ($_POST['attack']) {
} }
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>"; $rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>";
addch("<B><b>" . Nick::id($user['id'])->short() . "</b> , применив магию нападения, внезапно напал на <b>" . Nick::id($jert['id'])->short() . "</b>.", $user->room); addch("<B><b>" . Nick::id($user['id'])->short() . "</b> , применив магию нападения, внезапно напал на <b>" . Nick::id($jert['id'])->short() . "</b>.", $user->getRoom());
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>"); addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>");
mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE (`id` = {$user['id']} OR `id` = {$jert['id']})"); 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`,\'' . "<span class=date>" . date("d.m.y H:i") . "</span> " . Nick::id($user['id'])->full(1) . " напал на " . Nick::id($jert['id'])->full(1) . " завязался <a href=\"logs.php?log={$id}\" target=_blank>бой »»</a><BR>" . '\') WHERE `active` = TRUE LIMIT 1'); mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,\'' . "<span class=date>" . date("d.m.y H:i") . "</span> " . Nick::id($user['id'])->full(1) . " напал на " . Nick::id($jert['id'])->full(1) . " завязался <a href=\"logs.php?log={$id}\" target=_blank>бой »»</a><BR>" . '\') WHERE `active` = TRUE LIMIT 1');
@ -167,22 +167,22 @@ if ($_POST['attack']) {
} }
$_GET['path'] = (int)$_GET['path']; $_GET['path'] = (int)$_GET['path'];
if ($rhar[$user->room][$_GET['path']] > 0 && $_GET['path'] < 5 && $_GET['path'] > 0 && ($_SESSION['time'] <= time())) { 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")); $rr = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `type` = 10 AND `owner` = {$user['id']} LIMIT 1"));
if (!isset($rr['id'])) { if (!isset($rr['id'])) {
$list = mysql_query("SELECT `id`, `room`, `login` FROM `users` WHERE `room` = '" . $user->room . "' AND `in_tower` = 1"); $list = mysql_query("SELECT `id`, `room`, `login` FROM `users` WHERE `room` = '" . $user->getRoom() . "' AND `in_tower` = 1");
while ($u = mysql_fetch_array($list)) { while ($u = mysql_fetch_array($list)) {
if ($u['id'] != $user['id']) { if ($u['id'] != $user['id']) {
addchp('<font color=red>Внимание!</font> <b>' . $user['login'] . '</b> отправился в <b>' . $rooms[$rhar[$user->room][$_GET['path']]] . '</b>.', '{[]}' . $u['login'] . '{[]}'); addchp('<font color=red>Внимание!</font> <b>' . $user['login'] . '</b> отправился в <b>' . $rooms[$rhar[$user->getRoom()][$_GET['path']]] . '</b>.', '{[]}' . $u['login'] . '{[]}');
} }
} }
$list = mysql_query("SELECT `id`, `room`, `login` FROM `users` WHERE `room` = '" . $rhar[$user->room][$_GET['path']] . "' AND `in_tower` = 1"); $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)) { while ($u = mysql_fetch_array($list)) {
addchp('<font color=red>Внимание!</font> <B>' . $user['login'] . '</B> вошел в комнату.', '{[]}' . $u['login'] . '{[]}'); addchp('<font color=red>Внимание!</font> <B>' . $user['login'] . '</B> вошел в комнату.', '{[]}' . $u['login'] . '{[]}');
} }
mysql_query("UPDATE `users`, `online` SET `users`.`room` = '" . $rhar[$user->room][$_GET['path']] . "', `online`.`room` = '" . $rhar[$user->room][$_GET['path']] . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'"); 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->room][$_GET['path']]][0]); $_SESSION['time'] = (time() + $rhar[$rhar[$user->getRoom()][$_GET['path']]][0]);
header('Location: towerin.php'); header('Location: towerin.php');
} else { } else {
err('Вы парализованы и не можете двигаться...'); err('Вы парализованы и не можете двигаться...');
@ -229,7 +229,7 @@ if (($kol_pl + $ls) < 2 && ($tur_data['start_time'] + 60) <= time()) {
undressall($user['id']); undressall($user['id']);
$rep = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `bs` = 1"); $rep = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `bs` = 1");
while ($r = mysql_fetch_array($rep)) { while ($r = mysql_fetch_array($rep)) {
mysql_query("INSERT `deztow_items` (`iteam_id`, `name`, `img`, `room`) VALUES ('" . $r['prototype'] . "', '" . $r['name'] . "', '" . $r['img'] . "', '" . $user->room . "');"); 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"); 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']}'")); $tec = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_realchars` WHERE `owner` = '{$user['id']}'"));
@ -302,7 +302,7 @@ if ($user['hp'] <= 0) {
<TR> <TR>
<TD><?= Nick::id($user)->battle() ?></TD> <TD><?= Nick::id($user)->battle() ?></TD>
<TD class='H3' align=right><?= $rooms[$user->room]; ?>&nbsp; &nbsp; <TD class='H3' align=right><?= $rooms[$user->getRoom()]; ?>&nbsp; &nbsp;
<IMG SRC=i/tower/attack.gif WIDTH=66 HEIGHT=24 ALT="Напасть на..." style="cursor:hand" <IMG SRC=i/tower/attack.gif WIDTH=66 HEIGHT=24 ALT="Напасть на..." style="cursor:hand"
onclick="findlogin('Напасть на','towerin.php','attack')"> onclick="findlogin('Напасть на','towerin.php','attack')">
</TD> </TD>
@ -312,7 +312,7 @@ if ($user['hp'] <= 0) {
<? <?
$its = mysql_query("SELECT * FROM `deztow_items` WHERE `room` = '" . $user->room . "';"); $its = mysql_query("SELECT * FROM `deztow_items` WHERE `room` = '" . $user->getRoom() . "';");
if (mysql_num_rows($its) > 0) { if (mysql_num_rows($its) > 0) {
echo '<H4>В комнате разбросаны вещи:</H4>'; echo '<H4>В комнате разбросаны вещи:</H4>';
} }
@ -462,7 +462,7 @@ if ($user['hp'] <= 0) {
<tr> <tr>
<td> <td>
<div style="position:relative; cursor: pointer;" id="ione"><img <div style="position:relative; cursor: pointer;" id="ione"><img
src="i/tower/<?= (500 + $user->room) ?>.jpg" alt="" border="1"/> src="i/tower/<?= (500 + $user->getRoom()) ?>.jpg" alt="" border="1"/>
</div> </div>
</td> </td>
</tr> </tr>
@ -541,15 +541,15 @@ if ($user['hp'] <= 0) {
</tr> </tr>
<tr> <tr>
<td> <td>
<a onclick="return check('m7');" <? if ($rooms[$rhar[$user->room][4]]) { <a onclick="return check('m7');" <? if ($rooms[$rhar[$user->getRoom()][4]]) {
echo 'id="m7"'; echo 'id="m7"';
} ?> href="?rnd=0.817371946556865&path=4"><img } ?> href="?rnd=0.817371946556865&path=4"><img
src="i/move/navigatin_59<? if (!$rooms[$rhar[$user->room][4]]) { src="i/move/navigatin_59<? if (!$rooms[$rhar[$user->getRoom()][4]]) {
echo 'i'; echo 'i';
} ?>.gif" width="21" height="20" border="0" } ?>.gif" width="21" height="20" border="0"
o<? if (!$rooms[$rhar[$user->room][4]]) { o<? if (!$rooms[$rhar[$user->getRoom()][4]]) {
echo 'i'; echo 'i';
} ?>nmousemove="fastshow2('<?= $rooms[$rhar[$user->room][4]] ?>');" } ?>nmousemove="fastshow2('<?= $rooms[$rhar[$user->getRoom()][4]] ?>');"
onmouseout="hideshow();"/></a><img onmouseout="hideshow();"/></a><img
src="i/move/navigatin_60.gif" width="10" src="i/move/navigatin_60.gif" width="10"
height="20" height="20"
@ -572,15 +572,15 @@ if ($user['hp'] <= 0) {
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<td> <td>
<a onclick="return check('m1');" <? if ($rooms[$rhar[$user->room][1]]) { <a onclick="return check('m1');" <? if ($rooms[$rhar[$user->getRoom()][1]]) {
echo 'id="m1"'; echo 'id="m1"';
} ?> href="?rnd=0.817371946556865&path=1"><img } ?> href="?rnd=0.817371946556865&path=1"><img
src="i/move/navigatin_52<? if (!$rooms[$rhar[$user->room][1]]) { src="i/move/navigatin_52<? if (!$rooms[$rhar[$user->getRoom()][1]]) {
echo 'i'; echo 'i';
} ?>.gif" width="19" height="22" border="0" } ?>.gif" width="19" height="22" border="0"
<? if (!$rooms[$rhar[$user->room][1]]) { <? if (!$rooms[$rhar[$user->getRoom()][1]]) {
echo 'i'; echo 'i';
} ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->room][1]] ?>');" } ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->getRoom()][1]] ?>');"
onmouseout="hideshow();"/></a></td> onmouseout="hideshow();"/></a></td>
</tr> </tr>
<tr> <tr>
@ -594,15 +594,15 @@ if ($user['hp'] <= 0) {
</tr> </tr>
<tr> <tr>
<td> <td>
<a onclick="return check('m5');" <? if ($rooms[$rhar[$user->room][3]]) { <a onclick="return check('m5');" <? if ($rooms[$rhar[$user->getRoom()][3]]) {
echo 'id="m5"'; echo 'id="m5"';
} ?> href="?rnd=0.817371946556865&path=3"><img } ?> href="?rnd=0.817371946556865&path=3"><img
src="i/move/navigatin_67<? if (!$rooms[$rhar[$user->room][3]]) { src="i/move/navigatin_67<? if (!$rooms[$rhar[$user->getRoom()][3]]) {
echo 'i'; echo 'i';
} ?>.gif" width="19" height="22" border="0" } ?>.gif" width="19" height="22" border="0"
<? if (!$rooms[$rhar[$user->room][3]]) { <? if (!$rooms[$rhar[$user->getRoom()][3]]) {
echo 'i'; echo 'i';
} ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->room][3]] ?>');" } ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->getRoom()][3]] ?>');"
onmouseout="hideshow();"/></a></td> onmouseout="hideshow();"/></a></td>
</tr> </tr>
</table> </table>
@ -623,15 +623,15 @@ if ($user['hp'] <= 0) {
<tr> <tr>
<td><img src="i/move/navigatin_61.gif" width="8" <td><img src="i/move/navigatin_61.gif" width="8"
height="21"/><a height="21"/><a
onclick="return check('m3');" <? if ($rooms[$rhar[$user->room][2]]) { onclick="return check('m3');" <? if ($rooms[$rhar[$user->getRoom()][2]]) {
echo 'id="m3"'; echo 'id="m3"';
} ?> href="?rnd=0.817371946556865&path=2"><img } ?> href="?rnd=0.817371946556865&path=2"><img
src="i/move/navigatin_62<? if (!$rooms[$rhar[$user->room][2]]) { src="i/move/navigatin_62<? if (!$rooms[$rhar[$user->getRoom()][2]]) {
echo 'i'; echo 'i';
} ?>.gif" width="22" height="21" border="0" } ?>.gif" width="22" height="21" border="0"
<? if (!$rooms[$rhar[$user->room][2]]) { <? if (!$rooms[$rhar[$user->getRoom()][2]]) {
echo 'i'; echo 'i';
} ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->room][2]] ?>');" } ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->getRoom()][2]] ?>');"
onmouseout="hideshow();"/></a></td> onmouseout="hideshow();"/></a></td>
</tr> </tr>
<tr> <tr>

View File

@ -2,7 +2,7 @@
session_start(); session_start();
require_once "functions.php"; require_once "functions.php";
$effect = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = '{$user['id']}' LIMIT 1")); $effect = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = '{$user['id']}' LIMIT 1"));
if ($user->room != 31) { if ($user->getRoom() != 31) {
exit('Для распределения статов необходимо находиться в прихожей "Башни смерти"'); exit('Для распределения статов необходимо находиться в прихожей "Башни смерти"');
} }
if (isset($effect['id'])) { if (isset($effect['id'])) {

View File

@ -2,7 +2,7 @@
session_start(); session_start();
require_once "config.php"; require_once "config.php";
$user = new \Battles\User($_SESSION['uid']); $user = new \Battles\User($_SESSION['uid']);
if ($_GET['id'] && $user->admin) { if ($_GET['id'] && $user->getAdmin()) {
echo "Пробуем перейти на выбранную замковую улицу..."; echo "Пробуем перейти на выбранную замковую улицу...";
$_SESSION["klan"] = $_GET['klan']; $_SESSION["klan"] = $_GET['klan'];
$a = $_GET['klan']; $a = $_GET['klan'];

View File

@ -12,13 +12,13 @@ use Battles\User;
session_start(); session_start();
require_once 'functions.php'; require_once 'functions.php';
$user = $user ?? new User($_SESSION['uid']); $user = $user ?? new User($_SESSION['uid']);
if (!empty($_GET['teleport']) && $user->admin == 1) { if (!empty($_GET['teleport']) && $user->getAdmin() == 1) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']); db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']);
} }
# ORDEN PHP # ORDEN PHP
if ($user->admin) { if ($user->getAdmin()) {
$abil = db::c()->query('SELECT abil FROM users WHERE id = ?i', $user->getId())->fetch_assoc(); $abil = db::c()->query('SELECT abil FROM users WHERE id = ?i', $user->getId())->fetch_assoc();
$abil = unserialize($abil['abil']); $abil = unserialize($abil['abil']);
switch ($_POST['use']) { switch ($_POST['use']) {
@ -449,7 +449,7 @@ $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['u
Template::header('user_abilities'); Template::header('user_abilities');
?> ?>
<div style="float: right;"> <div style="float: right;">
<?php if ($user->admin == 1): ?> <?php if ($user->getAdmin() == 1): ?>
<button onclick="location.href='?teleport=1'">Телепорт на ЦП</button> <button onclick="location.href='?teleport=1'">Телепорт на ЦП</button>
<?php endif; ?> <?php endif; ?>
<input type="button" onClick="location.href='main.php';" value="Вернуться"> <input type="button" onClick="location.href='main.php';" value="Вернуться">

View File

@ -11,7 +11,7 @@ if ($user->getLevel() < 4 && $user->getLevel() > 10) {
exit; exit;
} }
if ($user->room == 403) { if ($user->getRoom() == 403) {
header('Location: canalizaciya.php'); header('Location: canalizaciya.php');
exit; exit;
} }

View File

@ -13,11 +13,11 @@ try {
} }
$do = $_GET['do'] ?? null; $do = $_GET['do'] ?? null;
if ($do == "clear" && $user->admin == 1) { if ($do == "clear" && $user->getAdmin() == 1) {
db::c()->query('UPDATE `zayavka` SET `coment` = "?s" WHERE `id` = ?i', '<em>Вырезано цензурой!</em>', $_GET['zid']); db::c()->query('UPDATE `zayavka` SET `coment` = "?s" WHERE `id` = ?i', '<em>Вырезано цензурой!</em>', $_GET['zid']);
} }
if (!empty($_GET['del']) && $user->admin == 1) { //удаление заявки на бой. if (!empty($_GET['del']) && $user->getAdmin() == 1) { //удаление заявки на бой.
$zayavka = db::c()->query('SELECT `id` FROM `zayavka` WHERE `id` = ?i', $_GET['zid'])->fetch_assoc(); $zayavka = db::c()->query('SELECT `id` FROM `zayavka` WHERE `id` = ?i', $_GET['zid'])->fetch_assoc();
if (isset($zayavka['id'])) { if (isset($zayavka['id'])) {
db::c()->query('UPDATE `users` SET `zayavka` = 0 WHERE `zayavka` = ?i', $zayavka['id']); db::c()->query('UPDATE `users` SET `zayavka` = 0 WHERE `zayavka` = ?i', $zayavka['id']);
@ -635,7 +635,7 @@ Template::header('zayavka');
<TD> <TD>
<?php <?php
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING')); $get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
if ($user->room != 1 && $get != 'current') { if ($user->getRoom() != 1 && $get != 'current') {
exit('В этой комнате невозможно подавать заявки!'); exit('В этой комнате невозможно подавать заявки!');
} }
if (!$get) { if (!$get) {
@ -712,11 +712,11 @@ Template::header('zayavka');
$timeFigth = fread($f, filesize($Path)); $timeFigth = fread($f, filesize($Path));
fclose($f); fclose($f);
if ($timeFigth < time() && ($user->getLevel() <= 14)) { if ($timeFigth < time() && ($user->getLevel() <= 14)) {
if ($get == 'trainstart' && $user->health > $user->maxHealth * 0.33 && ($user->getLevel() <= 7 || $user->admin == 1)) { if ($get == 'trainstart' && $user->getHealth() > $user->getMaxHealth() * 0.33 && ($user->getLevel() <= 7 || $user->getAdmin() == 1)) {
unlink("/tmp/zayavka/" . $user->id . ".txt"); unlink("/tmp/zayavka/" . $user->id . ".txt");
$zay->delzayavka($user->id, $user->zayavka, 2, 0); $zay->delzayavka($user->id, $user->zayavka, 2, 0);
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('" . $user->getLogin() . " (Клон 1)','" . $user->id . "','','" . $user->maxHealth . "');"); mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('" . $user->getLogin() . " (Клон 1)','" . $user->getId() . "','','" . $user->getMaxHealth() . "');");
$bot = mysql_insert_id(); $bot = mysql_insert_id();
$teams = []; $teams = [];
@ -742,7 +742,7 @@ Template::header('zayavka');
$timeFigth = fread($f, filesize($Path)); $timeFigth = fread($f, filesize($Path));
fclose($f); fclose($f);
if ($user->admin == 1) { if ($user->getAdmin() == 1) {
echo " или <input type=button onclick=\"location.href='zayavka.php?trainstart';\" value=\"Начать тренировочный бой\">"; echo " или <input type=button onclick=\"location.href='zayavka.php?trainstart';\" value=\"Начать тренировочный бой\">";
} }