Merge pull request 'header.tpl' (#4) from header.tpl into master

Reviewed-on: https://src.liks.pw/lopar/battles/pulls/4
This commit is contained in:
Ivor Barhansky 2020-09-30 22:23:57 +00:00
commit d9d41b9398
1326 changed files with 8828 additions and 17843 deletions

View File

@ -7,11 +7,11 @@
session_start(); session_start();
//require_once '../functions.php'; //require_once '../functions.php';
if (empty($user['admin'])) { $user = new User($_SESSION['uid']);
if (!$user->admin) {
header("HTTP/1.0 404 Not Found"); header("HTTP/1.0 404 Not Found");
exit; exit;
} }
header("Cache-Control: no-cache");
$al = db::c()->query('SELECT * FROM `aligns` WHERE `align` = "?s" LIMIT 1', $user['align'])->fetch_assoc(); $al = db::c()->query('SELECT * FROM `aligns` WHERE `align` = "?s" LIMIT 1', $user['align'])->fetch_assoc();
@ -64,35 +64,11 @@ if ($_POST['ali']) { //Что делает эта штука?
db::c()->query('INSERT INTO `aligns` (`align`,`img`,`name`,`accses`) VALUES ("?s","?s","?s","?s") ON DUPLICATE KEY UPDATE `img` = "?s", `name` = "?s", `accses` = "?s"', $_POST['ali'], $_POST['im'], $_POST['txt'], imp($accs), $_POST['im'], $_POST['txt'], imp($accs)); db::c()->query('INSERT INTO `aligns` (`align`,`img`,`name`,`accses`) VALUES ("?s","?s","?s","?s") ON DUPLICATE KEY UPDATE `img` = "?s", `name` = "?s", `accses` = "?s"', $_POST['ali'], $_POST['im'], $_POST['txt'], imp($accs), $_POST['im'], $_POST['txt'], imp($accs));
} }
if ($_POST['sbr_par']) {
$sb_pers = db::c()->query('SELECT `id`, `nextup`, `level` FROM `users` WHERE `login` = "?s" LIMIT 1', $_POST['sbr_par'])->fetch_assoc_array();
undressall($sb_pers['id']);
$levelstats = statsat($sb_pers['nextup']);
//Ох боюсь я за этот запрос!
db::c()->query('
UPDATE `users`
SET `stats` = ?i, `sila` = ?i, `lovk` = ?i, `inta` = ?i, `intel` = ?i, `vinos` = ?i,
`maxhp` = ?i, `master` = ?i, `noj` = ?i, `mec` = ?i, `topor` = ?i, `dubina` = ?i,
`mlight` = ?i, `mgray` = ?i, `mdark` = ?i
WHERE `id` = ?i',
($levelstats['stats'] - 9), 3, 3, 3, 0, $levelstats['vinos'], ($levelstats['vinos'] * 6), $levelstats['master'], 0, 0, 0, 0, 0, 0, 0, $sb_pers['id']);
echo "<span class='success'>Все прошло удачно. Персонаж может перераспределить параметры.</span>";
}
$aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `align`'); $aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `align`');
Template::header('ᐰdminка');
?> ?>
<link rel=stylesheet href="/css/admin.css">
<!DOCTYPE html> <form method='post'>
<html>
<head>
<meta charset="utf-8">
<link rel=stylesheet href="/css/main.css">
<link rel=stylesheet href="/css/admin.css">
<title>ᐰdmin</title>
</head>
<body>
<form action='admin.php' method='post'>
<fieldset> <fieldset>
<legend><a href='#' onclick='show("sk")'>Склонности</a></legend> <legend><a href='#' onclick='show("sk")'>Склонности</a></legend>
<div id=sk style='display:none;'> <div id=sk style='display:none;'>
@ -196,7 +172,7 @@ $aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `al
</fieldset> </fieldset>
</form> </form>
<form method=post action="admin.php"> <form method=post>
<fieldset> <fieldset>
<legend><a href='#' onclick='show("sk3")'>Кланы</a></legend> <legend><a href='#' onclick='show("sk3")'>Кланы</a></legend>
<div id=sk3 style='display:none;'> <div id=sk3 style='display:none;'>
@ -248,10 +224,6 @@ $aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `al
</div> </div>
</fieldset> </fieldset>
</form> </form>
<form method=post>
<legend>Сброс параметров персонажа</legend>
<input name='sbr_par' placeholder="Логин"> <input type=submit value='Применить'></form>
<form method=post> <form method=post>
<legend><a href='#' onclick='show("sk2")'>Добавить вещь</a></legend> <legend><a href='#' onclick='show("sk2")'>Добавить вещь</a></legend>
<div id=sk2 style='display:none;'> <div id=sk2 style='display:none;'>
@ -871,8 +843,7 @@ if ($_POST['login'] && $_POST['krest']) {
} }
if ($_POST['krest'] == -1) { if ($_POST['krest'] == -1) {
db::c()->query('UPDATE `users` SET `align`="?s", `status`="?s" WHERE `login` = "?s" LIMIT 1;', '0', '', $_POST['login']); db::c()->query('UPDATE `users` SET `align`="?s", `status`="?s" WHERE `login` = "?s" LIMIT 1;', '0', '', $_POST['login']);
} } else {
else {
db::c()->query('UPDATE `users` SET `align` = "?s", `status` = "?s" WHERE `login` = "?s"', $_POST['krest'], $rang, $_POST['login']); db::c()->query('UPDATE `users` SET `align` = "?s", `status` = "?s" WHERE `login` = "?s"', $_POST['krest'], $rang, $_POST['login']);
} }
} }
@ -1126,6 +1097,3 @@ if ($_POST['login'] && $_POST['krest']) {
return xmlHttp1; return xmlHttp1;
} }
</script> </script>
</body>
</html>

View File

@ -45,15 +45,8 @@ if ($del) {
} }
db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $del); db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $del);
} }
Template::header('ᐰdminка инвентаря');
?> ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ᐰdmin</title>
</head>
<link type="text/css" rel="stylesheet" href="../css/main.css">
<body>
<h1>Администрирование инвентаря <?php if (isset($_SESSION['player_name'])) echo $_SESSION['player_name']; ?></h1> <h1>Администрирование инвентаря <?php if (isset($_SESSION['player_name'])) echo $_SESSION['player_name']; ?></h1>
<table class='adm'> <table class='adm'>
<tr> <tr>
@ -96,5 +89,3 @@ if ($del) {
</th> </th>
<?php endif; ?> <?php endif; ?>
</table> </table>
</body>
</html>

View File

@ -1,28 +0,0 @@
<?
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
require_once "../functions.php";
$id = mysql_query("SELECT * FROM `clans`");
$clans = mysql_num_rows($id);
$check = 0;
while($check++ < $clans) {
$shor = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$check}' LIMIT 1"));
$short = $shor['short'];
$exp = mysql_fetch_row(mysql_query("SELECT `exp`, COUNT(*) FROM `users` WHERE `klan` = '{$short}'"));
$id = mysql_query("SELECT `id` FROM `users` WHERE `klan` = '{$short}'");
$kolvo_us = mysql_num_rows($id);
echo "$exp[0];||$kolvo_us Q";
$site_r_clan = 0; // рейтинг клан сайта
$fight_r_clan = 0; // боевой рейтинг клана
$grash_point = 0; // очки гражданства
$Clan_ration = (($exp/$kolvo_us)+($site_r_clan*100000))+$fight_r_clan+$grash_point;
$l_p = mysql_query("UPDATE `clans` SET `rating` = 'Clan_ration' WHERE `id` = '{$check}'");
if($l_p) {
echo "Клановый рейтинг для клана '$short' удачно обновлен";
}
}

View File

@ -1,16 +1,23 @@
<?php <?php
session_start(); session_start();
if ($_SESSION['uid'] == null) header("Location: index.php"); if (empty($_SESSION['uid'])) {
require_once 'functions.php'; header("Location: index.php");
exit;
}
if ($user['room'] != 61) { require_once 'functions.php';
$user = $user ?? null;
if ($user->room != 61) {
header("Location: main.php"); header("Location: main.php");
die(); exit;
} }
if ($user['battle'] != 0) { if ($user->battle) {
header('location: fight.php'); header('location: fight.php');
die(); exit;
} }
const SMITH = 'оружейник';
const MERCENARY = 'наёмник';
const MEDIC = 'лекарь';
$status = 'Внимание! Моментальная оплата без подтверждения!'; $status = 'Внимание! Моментальная оплата без подтверждения!';
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING')); $get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
@ -19,57 +26,71 @@ function setProfession($name, $type, $needMoney, $needLevel)
{ {
global $user; global $user;
$profId = 0; $profId = 0;
if (!in_array($name, ['оружейник', 'наёмник', 'лекарь'])) return 'Такой профессии не существует!'; $status = null;
if ($user['money'] < $needMoney) return 'Недостаточно денег!'; if (!in_array($name, [SMITH, MERCENARY, MEDIC])) {
if ($user['level'] < $needLevel) return 'Ваш уровень ещё мал для этой профессии!'; $status = 'Такой профессии не существует!';
if (!empty($user['prof1']) AND $type == 1) return 'Ошибка! У вас уже есть другая мирная профессия!';
if (!empty($user['prof2']) AND $type == 2) return 'Ошибка! У вас уже есть другая боевая профессия!';
if ($name == 'оружейник') $profId = 1;
if ($name == 'наёмник') $profId = 21;
if ($name == 'лекарь') $profId = 22;
if (!empty($profId)) {
try {
db::c()->query('UPDATE `users` SET ?f = ?i, `money` = `money` - ?i WHERE `id` = ?i', 'prof' . $type, $profId, $needMoney, $_SESSION['uid']);
} catch (\Krugozor\Database\Mysql\Exception $e) {
} }
if ($user['money'] < $needMoney) {
$status = 'Недостаточно денег!';
}
if ($user['level'] < $needLevel) {
$status = 'Ваш уровень ещё мал для этой профессии!';
}
if (!empty($user['prof1']) && $type == 1) {
$status = 'Ошибка! У вас уже есть другая мирная профессия!';
}
if (!empty($user['prof2']) && $type == 2) {
$status = 'Ошибка! У вас уже есть другая боевая профессия!';
}
if ($name == SMITH && !$status) {
$profId = 1;
}
if ($name == MERCENARY && !$status) {
$profId = 21;
}
if ($name == MEDIC && !$status) {
$profId = 22;
}
if (!empty($profId)) {
$user->money -= $needMoney;
Bank::setWalletMoney($user->money, $user->id);
db::c()->query('UPDATE `users` SET ?f = ?i WHERE `id` = ?i', 'prof' . $type, $profId, $user->id);
$deloText = "{$user['login']} купил профессию «{$name}» в академии за {$needMoney} кр."; $deloText = "{$user['login']} купил профессию «{$name}» в академии за {$needMoney} кр.";
addToDelo($deloText); addToDelo($deloText);
$user['prof'.$type] = true; $user['prof' . $type] = true;
$user['money'] -= $needMoney; $status = 'Вы получили профессию!';
return 'Вы получили профессию!'; } else {
} else return 'Что-то пошло не так...'; $status = 'Что-то пошло не так...';
}
return $status;
} }
if ($get == 'smith') $status = setProfession('оружейник', 1, 300, 3); if ($get == 'smith') {
if ($get == 'mercenary') $status = setProfession('наёмник', 2, 700, 5); $status = setProfession(SMITH, 1, 300, 3);
if ($get == 'medic') $status = setProfession('лекарь', 2, 700, 5); }
if ($get == 'mercenary') {
$status = setProfession(MERCENARY, 2, 700, 5);
}
if ($get == 'medic') {
$status = setProfession(MEDIC, 2, 700, 5);
}
if ($get == 'exit') { if ($get == 'exit') {
try { db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $user->id, $user->id);
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $_SESSION['uid'], $_SESSION['uid']);
} catch (\Krugozor\Database\Mysql\Exception $e) {
}
header('Location: city.php'); header('Location: city.php');
} }
Template::header('Академия');
?> ?>
<!DOCTYPE html> <link href="css/secondary.css" rel="stylesheet"/>
<html lang="ru">
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet">
<link href="css/secondary.css" rel="stylesheet"/>
<title></title>
</head>
<body>
<div style="float: right;"> <div style="float: right;">
<button onclick="location.href='?exit'">Вернуться</button> <button onclick="location.href='?exit'">Вернуться</button>
</div> </div>
<h1>Академия</h1> <h1>Академия</h1>
<div><?php if (!empty($status)) err($status); ?></div> <div><?= $status ?></div>
<div class="appblock appblock-main"> <div class="appblock appblock-main">
<span class="legend">Информация</span> <span class="legend">Информация</span>
<span class="wrap">Кредиты<span class="num"><?= $user['money'] ?></span></span> <span class="wrap">Кредиты<span class="num"><?= $user->money ?></span></span>
<span class="wrap">Уровень персонажа<span class="num"><?= $user['level'] ?></span></span> <span class="wrap">Уровень персонажа<span class="num"><?= $user->level ?></span></span>
</div> </div>
<div class="appblock"> <div class="appblock">
<span class="legend">Наёмник</span> <span class="legend">Наёмник</span>
@ -139,5 +160,3 @@ if ($get == 'exit') {
Алхимик может создавать новые зелья используя расходные материалы. Мирная профессия. Алхимик может создавать новые зелья используя расходные материалы. Мирная профессия.
</span> </span>
</div> </div>
</body>
</html>

View File

@ -1,10 +1,11 @@
<?php <?php
session_start(); session_start();
if ($_SESSION['uid'] == null) { if (empty($_SESSION['uid'])) {
header("Location: index.php"); header("Location: index.php");
exit;
} }
include("config.php");
include("functions.php"); require_once "functions.php";
$start = db::c()->query('SELECT `value` FROM `variables` WHERE `var` = "arena_of_gods"')->fetch_assoc(); $start = db::c()->query('SELECT `value` FROM `variables` WHERE `var` = "arena_of_gods"')->fetch_assoc();
$is_now = db::c()->query('SELECT `id` FROM `battle` WHERE `aren_of` = 1 AND `win` = 3 ORDER BY `id` DESC')->fetch_assoc(); $is_now = db::c()->query('SELECT `id` FROM `battle` WHERE `aren_of` = 1 AND `win` = 3 ORDER BY `id` DESC')->fetch_assoc();
@ -19,8 +20,8 @@ function join_arena($u, $btl, $team, $at)
$ak = array_keys($battle[$at]); $ak = array_keys($battle[$at]);
$battle[$u] = $battle[$ak[0]]; $battle[$u] = $battle[$ak[0]];
foreach ($battle[$u] as $k => $v) { foreach ($battle[$u] as $k => $v) {
$battle[$u][$k] = array(0, 0, time()); $battle[$u][$k] = [0, 0, time()];
$battle[$k][$u] = array(0, 0, time()); $battle[$k][$u] = [0, 0, time()];
} }
if ($team == 1) { if ($team == 1) {
$adtxt = 'За сторону <b>Тьмы</b>.'; $adtxt = 'За сторону <b>Тьмы</b>.';
@ -35,9 +36,9 @@ function join_arena($u, $btl, $team, $at)
function aligntype($a) function aligntype($a)
{ {
$lightaligns = array("1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9"); $lightaligns = ["1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9"];
$darkaligns = array("2.2", "3", "8.21"); $darkaligns = ["2.2", "3", "8.21"];
$neutralaligns = array("2", "8.31"); $neutralaligns = ["2", "8.31"];
if (in_array($a, $lightaligns)) { if (in_array($a, $lightaligns)) {
return 1; return 1;
} }
@ -125,15 +126,9 @@ if (isset($_GET['append'])) {
} }
} }
} }
Template::header('Арена Ангелов');
?> ?>
<!DOCTYPE html> <link href="css/fight.css" rel="stylesheet"/>
<html>
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<link href="css/fight.css" rel="stylesheet"/>
</head>
<style> <style>
.hs { .hs {
font-weight: bold; font-weight: bold;
@ -212,7 +207,6 @@ if (isset($_GET['append'])) {
color: Red; color: Red;
} }
</style> </style>
<body>
<h1>Арена Ангелов</h1> <h1>Арена Ангелов</h1>
<div class="contentContainer"> <div class="contentContainer">
<div class="buttonContainer"> <div class="buttonContainer">
@ -223,12 +217,14 @@ if (isset($_GET['append'])) {
<div class="credenzaItem"> <div class="credenzaItem">
<? if (!isset($is_now['id'])) { ?> <? if (!isset($is_now['id'])) { ?>
<div class="credenza-stateCaption"> <div class="credenza-stateCaption">
<?=$winers?>.<br/>Следующая битва для 7-21 ур. состоится: <?=date("d.m.Y H:i", $start['value'])?> <?= $winers ?>.<br/>Следующая битва для 7-21 ур.
состоится: <?= date("d.m.Y H:i", $start['value']) ?>
</div> </div>
<? } else { ?> <? } else { ?>
<div class="credenza-stateCaption"> <div class="credenza-stateCaption">
<h2>Идет сражение [7-21 уровни]</h2> <h2>Идет сражение [7-21 уровни]</h2>
<br/><a href="/logs.php?log=<?=$is_now['id']?>" target="_blank" style="text-align: center;">ход боя »»</a> <br/><a href="/logs.php?log=<?= $is_now['id'] ?>" target="_blank" style="text-align: center;">ход
боя »»</a>
</div> </div>
<table border="0" cellpadding="0" cellspacing="0" width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody> <tbody>
@ -251,6 +247,4 @@ if (isset($_GET['append'])) {
</div> </div>
</div> </div>
</div> </div>
<? if (!empty($error)) err($error); ?> <?= $error ?>
</body>
</html>

View File

@ -1,16 +1,20 @@
<?php <?php
session_start(); session_start();
if ($_SESSION['uid'] == null) header("Location: index.php"); if (empty($_SESSION['uid'])) {
require_once 'functions.php'; header("Location: index.php");
exit;
if ($user['room'] != 50) {
header("Location: main.php");
die();
} }
if ($user['battle'] != 0) { require_once 'functions.php';
if ($user->room != 50) {
header("Location: main.php");
exit;
}
if ($user->battle) {
header('location: fbattle.php'); header('location: fbattle.php');
die(); exit;
} }
$bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id`=?i', $_SESSION['uid'])->fetch_assoc(); $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id`=?i', $_SESSION['uid'])->fetch_assoc();
@ -32,13 +36,14 @@ while ($row = $shopItems->fetch_assoc()) {
} }
if (!empty($_GET['buy'])) { if (!empty($_GET['buy'])) {
$dress = db::c()->query('SELECT * FROM `ashop` WHERE `id`=?i', $_GET['buy'])->fetch_assoc(); $dress = db::c()->query('SELECT * FROM `ashop` WHERE `id`=?i', $_GET['buy'])->fetch_assoc();
$itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $user['id'])->fetch_assoc(); $itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $user['id'])->fetch_assoc();
if (($dress['massa'] + $itemWeight['m']) > (get_meshok())) $status = 'Недостаточно места в рюкзаке.'; if (($dress['massa'] + $itemWeight['m']) > (get_meshok())) {
elseif ($bank['ekr'] >= $dress['ecost'] AND ($dress['count'] > 0 OR $dress['count'] == -1)) { $status = 'Недостаточно места в рюкзаке.';
} elseif ($bank['ekr'] >= $dress['ecost'] && ($dress['count'] > 0 || $dress['count'] == -1)) {
$goden = ''; $goden = '';
if (isset($dress['goden'])) $goden = $dress['goden'] * 24 * 60 * 60 + time(); // Ну вот нахуя? if (isset($dress['goden'])) {
$goden = $dress['goden'] * 24 * 60 * 60 + time(); // Ну вот нахуя?}
db::c()->query(' db::c()->query('
INSERT INTO `inventory` INSERT INTO `inventory`
( (
@ -59,11 +64,11 @@ if (!empty($_GET['buy'])) {
$dress['nlevel'], $dress['nalign'], $goden, $dress['goden'], $dress['razdel'], $dress['artefact'], $dress['koll']); $dress['nlevel'], $dress['nalign'], $goden, $dress['goden'], $dress['razdel'], $dress['artefact'], $dress['koll']);
$inventoryItemId = db::c()->getLastInsertId(); $inventoryItemId = db::c()->getLastInsertId();
if ($dress['count'] != -1) db::c()->query('UPDATE `ashop` SET `count` = `count`- 1 WHERE `id` = ?i', $_GET['buy']); if ($dress['count'] != -1) {
db::c()->query('UPDATE `ashop` SET `count` = `count`- 1 WHERE `id` = ?i', $_GET['buy']);
}
$deloText = "{$user['login']} купил товар «{$dress['name']}» id:({$inventoryItemId}) в магазине «Берёзка» за {$dress['ecost']} екр."; $deloText = "{$user['login']} купил товар «{$dress['name']}» id:({$inventoryItemId}) в магазине «Берёзка» за {$dress['ecost']} екр.";
addToDelo($deloText); addToDelo($deloText);
$status = "Вы купили «{$dress['name']}» за {$dress['ecost']} екр."; $status = "Вы купили «{$dress['name']}» за {$dress['ecost']} екр.";
db::c()->query('UPDATE `bank` SET `ekr` = `ekr` - ?i WHERE `id` = ?i', $dress['ecost'], $_SESSION['uid']); db::c()->query('UPDATE `bank` SET `ekr` = `ekr` - ?i WHERE `id` = ?i', $dress['ecost'], $_SESSION['uid']);
// Для обновления данных о деньгах на странице // Для обновления данных о деньгах на странице
@ -134,18 +139,12 @@ switch ($shopCategoryTypeNumber) {
$shopCategory = "Букеты"; $shopCategory = "Букеты";
break; break;
} }
Template::header('Берёзка');
?> ?>
<!DOCTYPE html> <script src="js/main.js"></script>
<html>
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<script src="js/main.js"></script>
</head>
<body>
<h1>Магазин Берёзка</h1> <h1>Магазин Берёзка</h1>
<a href=# onclick=hrefToFrame('city.php?cp')> ← выйти на Центральную площадь</a> <a href=# onclick=hrefToFrame('city.php?cp')> ← выйти на Центральную площадь</a>
<div><?php if (!empty($status)) err($status); ?></div> <div><?= $status ?></div>
<table border=0 width=100% cellspacing="0" cellpadding="4"> <table border=0 width=100% cellspacing="0" cellpadding="4">
<tr> <tr>
<td valign=top align=left> <td valign=top align=left>
@ -198,5 +197,4 @@ switch ($shopCategoryTypeNumber) {
</td> </td>
</tr> </tr>
</table> </table>
</body> <?php } ?>
</html>

View File

@ -23,6 +23,7 @@ if ($get == 'exit') {
$_SESSION[BANK_SESSION_NAME] = null; $_SESSION[BANK_SESSION_NAME] = null;
} }
$bank = new Bank($user->id); $bank = new Bank($user->id);
$status = '';
if (isset($_POST['userlogin'])) { if (isset($_POST['userlogin'])) {
$_SESSION[BANK_SESSION_NAME] = $bank->user_id; $_SESSION[BANK_SESSION_NAME] = $bank->user_id;
@ -31,7 +32,6 @@ if ($_SESSION[BANK_SESSION_NAME]) {
$toid = (int)$_POST['to_id'] ?? 0; $toid = (int)$_POST['to_id'] ?? 0;
$summa = (int)$_POST['summa'] ?? 0; $summa = (int)$_POST['summa'] ?? 0;
$submit = $_POST['action'] ?? ''; $submit = $_POST['action'] ?? '';
$status = '';
// Зачисление кредитов на счёт. // Зачисление кредитов на счёт.
if ($submit === 'depositMoney' && $summa) { if ($submit === 'depositMoney' && $summa) {
$bank->depositMoney($summa); $bank->depositMoney($summa);
@ -49,17 +49,10 @@ if ($_SESSION[BANK_SESSION_NAME]) {
} }
unset($submit, $summa, $toid); unset($submit, $summa, $toid);
} }
Template::header('Банк');
?> ?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<link href="css/secondary.css" rel="stylesheet"/> <link href="css/secondary.css" rel="stylesheet"/>
<script src="js/main.js"></script> <script src="js/main.js"></script>
<title>Банк</title>
</head>
<body>
<h1>Банк</h1> <h1>Банк</h1>
<?php if (!$_SESSION[BANK_SESSION_NAME]): ?> <?php if (!$_SESSION[BANK_SESSION_NAME]): ?>
<a href=# onclick=hrefToFrame('city.php?strah')> ← выйти из банка</a> <a href=# onclick=hrefToFrame('city.php?strah')> ← выйти из банка</a>
@ -94,8 +87,6 @@ if ($_SESSION[BANK_SESSION_NAME]) {
<input type="hidden" name="action" value="sendMoney"> <input type="hidden" name="action" value="sendMoney">
<input type="submit" value="Перевести кредиты"> <input type="submit" value="Перевести кредиты">
</form> </form>
<span class="wrap">Комиссия: <?= Bank::BANK_COMISSION * 100 ?>% от переводимой суммы, но не менее 1 кр.</span> <span class="wrap">Комиссия: <?= Config::$bank_comission * 100 ?>% от переводимой суммы, но не менее 1 кр.</span>
</div> </div>
<?php endif; ?> <?php endif; ?>
</body>
</html>

View File

View File

@ -1,25 +1,18 @@
<?php <?php
session_start(); session_start();
if ($_SESSION['uid'] == null) { if (empty($_SESSION['uid'])) {
header("Location: index.php"); header("Location: index.php");
exit;
} }
include_once "config.php"; require_once "functions.php";
include_once "functions.php"; $header = $_GET['header'] ?? null;
$ch = $_GET['ch'] ?? null;
header("Cache-Control: no-cache");
$header = filter_input(INPUT_GET, 'header');
$ch = filter_input(INPUT_GET, 'ch');
if ($header) { if ($header) {
die(); exit;
} elseif ($ch != null) { } elseif ($ch != null) {
Template::header('buttons');
?> ?>
<html>
<head>
<link rel="stylesheet" href="css/main.css"/>
<meta charset="utf-8"/>
<script type="text/javascript" src="js/ZeroClipboard.js"></script>
<script language="JavaScript" src="js/ch.js"></script> <script language="JavaScript" src="js/ch.js"></script>
<script language="JavaScript" src="js/sl2.js"></script> <script language="JavaScript" src="js/sl2.js"></script>
<script language="JavaScript" src="js/chat.js"></script> <script language="JavaScript" src="js/chat.js"></script>
@ -212,8 +205,6 @@ if ($header) {
} }
</script> </script>
</head>
<body marginheight=0 marginwidth=0">
<div id="fixednew" <div id="fixednew"
style="position: fixed; margin: -3px; padding: 0; z-index: 999; width: 100%; text-align: center; overflow: auto;"> style="position: fixed; margin: -3px; padding: 0; z-index: 999; width: 100%; text-align: center; overflow: auto;">
<table border="0" cellspacing="0" cellpadding="0" width="100%"> <table border="0" cellspacing="0" cellpadding="0" width="100%">
@ -244,10 +235,7 @@ if ($header) {
<div id="oMenu" style="position: absolute; border:1px solid #666; background-color:#CCC; display:none; "></div> <div id="oMenu" style="position: absolute; border:1px solid #666; background-color:#CCC; display:none; "></div>
<div id="ClearMenu" style="position: absolute; border:1px solid #666; background-color: #e2e0e0; display: none;"></div> <div id="ClearMenu" style="position: absolute; border:1px solid #666; background-color: #e2e0e0; display: none;"></div>
<? } else { ?> <? } else { Template::header(buttons); ?>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-type"/>
<script language="JavaScript" src="js/chat.js"></script> <script language="JavaScript" src="js/chat.js"></script>
<script language="JavaScript"> <script language="JavaScript">
@ -313,8 +301,6 @@ if ($header) {
document.F1.om.value = ''; document.F1.om.value = '';
} }
} }
function subm() { function subm() {
t = top.frames['chat'].currenttab; t = top.frames['chat'].currenttab;
$('input[name="chtype"]:hidden').val(t); $('input[name="chtype"]:hidden').val(t);
@ -440,10 +426,6 @@ if ($header) {
window.onresize = rslength; window.onresize = rslength;
</script> </script>
</head>
<body marginheight=0 marginwidth=0 bgcolor=#E6E6E6 onload="top.strt();"> <!-- rslength(); -->
<form action="ch.php" target="refreshed" method="GET" name="F1" id="F1" onsubmit="subm(); top.NextRefreshChat();"> <form action="ch.php" target="refreshed" method="GET" name="F1" id="F1" onsubmit="subm(); top.NextRefreshChat();">
<input type="hidden" name="color" value="000000"/> <input type="hidden" name="color" value="000000"/>
<input type="hidden" name="sys" value=""/> <input type="hidden" name="sys" value=""/>
@ -552,5 +534,3 @@ if ($header) {
</script> </script>
</FORM> </FORM>
<? } ?> <? } ?>
</body>
</html>

20
buy.php
View File

@ -1,29 +1,29 @@
<?php <?php
//Покупка абилок? Тут?! //Покупка абилок? Тут?!
session_start(); session_start();
if (!isset($_SESSION['uid'])) die(); if (empty($_SESSION['uid'])) {
header('Location: Index.php');
exit;
}
include('config.php'); include('config.php');
#include('functions.php');
$is_now = db::c()->query('SELECT `id`, `uid` FROM `abils_user` WHERE `uid` = ?i', $user['id'])->fetch_assoc(); $is_now = db::c()->query('SELECT `id`, `uid` FROM `abils_user` WHERE `uid` = ?i', $user['id'])->fetch_assoc();
function add_user_abil($ab, $cost) function add_user_abil($ab, $cost)
{ {
global $user, $banks; global $user, $banks;
if (isset($ab)) { if (isset($ab) && $banks['ekr'] >= $cost) {
if ($banks['ekr'] >= $cost) {
$isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_user` WHERE `uid` = "' . $user['id'] . '" LIMIT 1')); $isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_user` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
$isset[$ab] += 1; $isset[$ab] += 1;
mysql_query('UPDATE `abils_user` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `uid` = "' . $user['id'] . '" LIMIT 1'); mysql_query('UPDATE `abils_user` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `uid` = "' . $user['id'] . '"');
$banks['ekr'] -= $cost; $banks['ekr'] -= $cost;
mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '"');
return true; return true;
} }
}
return false; return false;
} }
$cost = array(1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1); $cost = [1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1];
$mag = array('sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone'); $mag = ['sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone'];
if (isset($_POST['type'], $_POST['user'])) { if (isset($_POST['type'], $_POST['user'])) {
if (isset($user['id'])) { if (isset($user['id'])) {
@ -33,7 +33,7 @@ if (isset($_POST['type'], $_POST['user'])) {
if ($banks['ekr'] >= $price) { if ($banks['ekr'] >= $price) {
if (isset($is_now['id'])) { if (isset($is_now['id'])) {
if ($user['battle'] == 0) { if ($user['battle'] == 0) {
if (add_user_abil($abil, $price) == true) { if (add_user_abil($abil, $price)) {
echo 'success'; echo 'success';
} else { } else {
echo 'Error'; echo 'Error';

View File

@ -1,33 +1,30 @@
<?php <?php
session_start(); session_start();
if (!isset($_SESSION['uid'])) { if (empty($_SESSION['uid'])) {
die(); exit;
} }
include('config.php'); require_once "functions.php";
include('functions.php');
if ($user['klan'] == '') { if (empty($user->clan)) {
die(); exit;
} }
$is_now = db::c()->query('SELECT `id` FROM `abils_klan` WHERE `klan` = ?i', $user['klan'])->fetch_assoc(); $is_now = db::c()->query('SELECT `id` FROM `abils_klan` WHERE `klan` = ?i', $user['klan'])->fetch_assoc();
$clan = db::c()->query('SELECT `glava` FROM `clans` WHERE `id` = ?i', $user['klan'])->fetch_assoc(); $clan = db::c()->query('SELECT `glava` FROM `clans` WHERE `id` = ?i', $user['klan'])->fetch_assoc();
$cost = array(1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1); $cost = [1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1];
$mag = array('sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone'); $mag = ['sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone'];
function add_klan_abil($ab, $cost) function add_klan_abil($ab, $cost)
{ {
global $user, $banks; global $user, $banks;
$clan = mysql_fetch_array(mysql_query('SELECT `id`, `glava` FROM `clans` WHERE `id` = "' . $user['klan'] . '" LIMIT 1')); $clan = mysql_fetch_array(mysql_query('SELECT `id`, `glava` FROM `clans` WHERE `id` = "' . $user['klan'] . '"'));
if (isset($ab)) { if (isset($ab) && $banks['ekr'] >= $cost && $clan['glava'] == $user['id']) {
if ($banks['ekr'] >= $cost && $clan['glava'] == $user['id']) { $isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_klan` WHERE `klan` = "' . $user['klan'] . '"'));
$isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_klan` WHERE `klan` = "' . $user['klan'] . '" LIMIT 1'));
$isset[$ab] += 1; $isset[$ab] += 1;
mysql_query('UPDATE `abils_klan` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `klan` = "' . $user['klan'] . '" LIMIT 1'); mysql_query('UPDATE `abils_klan` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `klan` = "' . $user['klan'] . '"');
$banks['ekr'] -= $cost; $banks['ekr'] -= $cost;
mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '"');
return true; return true;
} }
}
return false; return false;
} }
@ -39,7 +36,7 @@ if (isset($_POST['type'], $_POST['user'])) {
if ($banks['ekr'] >= $price && $user['id'] == $clan['glava']) { if ($banks['ekr'] >= $price && $user['id'] == $clan['glava']) {
if (isset($is_now['id'])) { if (isset($is_now['id'])) {
if ($user['battle'] == 0) { if ($user['battle'] == 0) {
if (add_klan_abil($abil, $price) == true) { if (add_klan_abil($abil, $price)) {
echo 'success'; echo 'success';
} else { } else {
echo 'Error'; echo 'Error';

View File

@ -1,28 +1,27 @@
<? <?
session_start(); session_start();
require_once('functions.php'); require_once('functions.php');
if (!isset($_SESSION['uid'])) { if (empty($_SESSION['uid'])) {
header('Location: index.php'); header('Location: index.php');
die(); exit;
} }
if ($user['room'] == 51) { if ($user->room == 51) {
header('location: city.php'); header('location: city.php');
die(); exit;
} }
$forest = db::c()->query('SELECT `id`, `room`, `room_id`, `time`, `user`, `data` FROM `forest` WHERE `user` = ?i', $user['id'])->fetch_assoc(); $forest = db::c()->query('SELECT `id`, `room`, `room_id`, `time`, `user`, `data` FROM `forest` WHERE `user` = ?i', $user['id'])->fetch_assoc();
$error = ''; $error = '';
$map_page = ''; $map_page = '';
if (empty($forest['id'])) { if (empty($forest['id'])) {
die('Ошибка. Сообщите Администрации. Код ошибки : 00.'); exit('Ошибка. Сообщите Администрации. Код ошибки : 00.');
} }
function loadmap_cell() function loadmap_cell()
{ {
global $forest; global $forest;
$dat = unserialize($forest['data']); $dat = unserialize($forest['data']);
$dat = ['Up' => $dat[$forest['room']]['Up'], 'Down' => $dat[$forest['room']]['Down'], 'Left' => $dat[$forest['room']]['Left'], 'Right' => $dat[$forest['room']]['Right']]; return ['Up' => $dat[$forest['room']]['Up'], 'Down' => $dat[$forest['room']]['Down'], 'Left' => $dat[$forest['room']]['Left'], 'Right' => $dat[$forest['room']]['Right']];
return $dat;
} }
$map_user = loadmap_cell(); $map_user = loadmap_cell();
@ -73,33 +72,40 @@ if ($_GET['move'] == 'true') {
} else { } else {
$error = 'Not in this life'; $error = 'Not in this life';
} }
if (empty($error)) db::c()->query('UPDATE `forest` SET `room` = "?s", `room_id` = ?i WHERE `id` = ?i', $forest['room'], $forest['room_id'], $forest['id']); if (empty($error)) {
db::c()->query('UPDATE `forest` SET `room` = "?s", `room_id` = ?i WHERE `id` = ?i', $forest['room'], $forest['room_id'], $forest['id']);
}
} }
if ($map_user['Right'] == 1) $map_page = <<<MAP if ($map_user['Right'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 30px; left: 740px; cursor: pointer; width: 20px; height: 117px;" <img style="position: absolute; bottom: 30px; left: 740px; cursor: pointer; width: 20px; height: 117px;"
class="pngimg" src="i/forest/pointer_2.png" title="{$var_map['cell_' . ($forest['room_id'] + 1)]}" class="pngimg" src="i/forest/pointer_2.png" title="{$var_map['cell_' . ($forest['room_id'] + 1)]}"
onclick="location.href='?move=true&Dir=Right';"/> onclick="location.href='?move=true&Dir=Right';" alt="Вправо">
MAP; MAP;
if ($map_user['Left'] == 1) $map_page = <<<MAP }
if ($map_user['Left'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 30px; left: 20px; cursor: pointer; width: 20px; height: 117px; " <img style="position: absolute; bottom: 30px; left: 20px; cursor: pointer; width: 20px; height: 117px; "
class="pngimg" src="i/forest/pointer_6.png" title="{$var_map['cell_' . ($forest['room_id'] - 1)]}" class="pngimg" src="i/forest/pointer_6.png" title="{$var_map['cell_' . ($forest['room_id'] - 1)]}"
onclick="location.href='?move=true&Dir=Left';"/> onclick="location.href='?move=true&Dir=Left';" alt="Влево">
MAP; MAP;
if ($map_user['Down'] == 1) $map_page = <<<MAP }
if ($map_user['Down'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 10px; left: 332px; cursor: pointer; width: 117px; height: 20px;" <img style="position: absolute; bottom: 10px; left: 332px; cursor: pointer; width: 117px; height: 20px;"
class="pngimg" src="i/forest/pointer_4.png" title="{$var_map['cell_' . ($forest['room_id'] + 5)]}" class="pngimg" src="i/forest/pointer_4.png" title="{$var_map['cell_' . ($forest['room_id'] + 5)]}"
onclick="location.href='?move=true&Dir=Down';"/> onclick="location.href='?move=true&Dir=Down';" alt="Вниз">
MAP; MAP;
if ($map_user['Up'] == 1) $map_page = <<<MAP }
if ($map_user['Up'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 30px; left: 740px; cursor: pointer; width: 117px; height: 20px;" <img style="position: absolute; bottom: 30px; left: 740px; cursor: pointer; width: 117px; height: 20px;"
class="pngimg" src="i/forest/pointer_8.png" title="{$var_map['cell_' . ($forest['room_id'] + 5)]}" class="pngimg" src="i/forest/pointer_8.png" title="{$var_map['cell_' . ($forest['room_id'] + 5)]}"
onclick="location.href='?move=true&Dir=Up';"/> onclick="location.href='?move=true&Dir=Up';" alt="Вверх">
MAP; MAP;
}
Template::header('forest');
?> ?>
<!doctype html>
<html lang="ru">
<head>
<title>forest</title>
<link rel="stylesheet" type="text/css" href="css/hostel.css"/> <link rel="stylesheet" type="text/css" href="css/hostel.css"/>
<style> <style>
.bt { .bt {
@ -112,8 +118,6 @@ MAP;
margin-right: 18px; margin-right: 18px;
} }
</style> </style>
</head>
<body>
<div id="ajaxContainer" style="display: none;"></div> <div id="ajaxContainer" style="display: none;"></div>
<div class="contentContainer"> <div class="contentContainer">
<div class="buttonContainer"> <div class="buttonContainer">
@ -136,5 +140,3 @@ MAP;
<?= $map_page ?> <?= $map_page ?>
</div> </div>
</div> </div>
</body>
</html>

View File

@ -1,279 +1,268 @@
<?php <?php
session_start();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
include "functions.php";
if ($user->room != 600) {
header("Location: main.php");
exit;
}
if ($user->battle) {
header('location: fbattle.php');
exit;
}
session_start(); $in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}';"));
if (!($_SESSION['uid'] >0)) header("Location: index.php"); $owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
include "config.php"; $wait_msg = "Ждем подтверждения от всей группы...";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$user['id']." AND (type=13 OR type=12 OR type=14) limit 1;"));
$wait_msg="Ждем подтверждения от всей группы...";
function getPass($length = 6) /** Генерация случайного пароля через хэш случайной строки.
{ *
$chars = 'abcdefghijklmnopqrstyvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'; * @return string
$numChars = strlen($chars); */
$string = ''; function getPass():string
for ($i = 0; $i < $length; $i++) { {
$string .= substr($chars, rand(1, $numChars) - 1, 1); return hash('crc32', mt_rand());
} }
return $string;
}
if(!$in_haos) if (!$in_haos) {
{
mysql_query("INSERT INTO cit_haos_status(id) values('{$user['id']}');"); mysql_query("INSERT INTO cit_haos_status(id) values('{$user['id']}');");
$in_haos=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;")); $in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
} }
include "functions.php";
$pass_s=getPass(6);
if ($user['room'] != 600) { header("Location: main.php"); die(); }
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); }
if ($_POST['pay'])
{
if(!$_POST['pay_gr']) $_POST['pay_gr']=1;
$group_num=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$_POST['pay_gr']}';"));
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$_POST['pay_gr']."' LIMIT 1;"));
$gps=$_POST['gr_pass_in'.$_POST['pay_gr']];
if($gps)
$gps=str_replace(" ","",$gps);
if($group_num<4) $pass_s = getPass();
if($user['hp']>=(int)($user['maxhp']/3) && !$owntravma[0])
if($user['money']>=20) if ($_POST['pay']) {
if( if (!$_POST['pay_gr']) $_POST['pay_gr'] = 1;
!preg_match('/[\/\:*?"<>|+%]/',$gps)&& $group_num = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$_POST['pay_gr']}';"));
$cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $_POST['pay_gr'] . "' LIMIT 1;"));
$gps = $_POST['gr_pass_in' . $_POST['pay_gr']];
if ($gps)
$gps = str_replace(" ", "", $gps);
if ($group_num < 4)
if ($user['hp'] >= (int)($user['maxhp'] / 3) && !$owntravma[0])
if ($user['money'] >= 20)
if (
!preg_match('/[\/\:*?"<>|+%]/', $gps) &&
( (
($gps==$cit_haos_pl['password'] && strlen($cit_haos_pl['password'])>1)|| ($gps == $cit_haos_pl['password'] && strlen($cit_haos_pl['password']) > 1) ||
(strlen($cit_haos_pl['players'])<3) (strlen($cit_haos_pl['players']) < 3)
) )
) ) {
{
mysql_query("UPDATE `cit_haos_status` SET `status` = '1',`group` = '{$_POST['pay_gr']}' WHERE `id` ='{$user['id']}'; "); mysql_query("UPDATE `cit_haos_status` SET `status` = '1',`group` = '{$_POST['pay_gr']}' WHERE `id` ='{$user['id']}'; ");
mysql_query("UPDATE `users` set `money` = `money`- '20' WHERE id = '{$user['id']}';"); mysql_query("UPDATE `users` set `money` = `money`- '20' WHERE id = '{$user['id']}';");
$cit_haos_gr=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;")); $cit_haos_gr = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
if($_POST['pay_gr']>$cit_haos_gr) if ($_POST['pay_gr'] > $cit_haos_gr)
mysql_query("INSERT INTO `cit_haos_var`(`group`,`password`) values('".$_POST['pay_gr']."','".$pass_s."');"); mysql_query("INSERT INTO `cit_haos_var`(`group`,`password`) values('" . $_POST['pay_gr'] . "','" . $pass_s . "');");
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$_POST['pay_gr']."' LIMIT 1;")); $cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $_POST['pay_gr'] . "' LIMIT 1;"));
if(!in_array($user['id'],explode(";",$cit_haos_pl['players']))) if (!in_array($user['id'], explode(";", $cit_haos_pl['players']))) {
{
if($cit_haos_pl['players']!='') if ($cit_haos_pl['players'] != '')
$ch_pl_t=$cit_haos_pl['players'].";".$user['id']; $ch_pl_t = $cit_haos_pl['players'] . ";" . $user['id'];
else else
$ch_pl_t=$user['id']; $ch_pl_t = $user['id'];
mysql_query("UPDATE `cit_haos_var` SET `players`='{$ch_pl_t}' WHERE `group`='".$_POST['pay_gr']."';"); mysql_query("UPDATE `cit_haos_var` SET `players`='{$ch_pl_t}' WHERE `group`='" . $_POST['pay_gr'] . "';");
} }
} } else ($pass_in_err = "Неверный пароль!");
else ($pass_in_err="Неверный пароль!");
else ($pay_err="Недостаточно денег для подачи стартового взноса!"); else ($pay_err = "Недостаточно денег для подачи стартового взноса!");
else ($pay_err="Вы слишком ослаблены либо травмированы! "); else ($pay_err = "Вы слишком ослаблены либо травмированы! ");
else ($pay_err="Группа уже набрана!"); else ($pay_err = "Группа уже набрана!");
} }
if ($_POST['adm_start_raid'] && $user['id']==1256) if ($_POST['adm_start_raid'] && $user['id'] == 1256) {
{
mysql_query("DELETE FROM `cit_haos_status`;"); mysql_query("DELETE FROM `cit_haos_status`;");
mysql_query("DELETE FROM `cit_haos_var`;"); mysql_query("DELETE FROM `cit_haos_var`;");
AddChatSystem('<font color=red>Начинается прием заявок в рейд на Цитадель Хаоса! Начало рейда через 15 минут.</font>'); AddChatSystem('<font color=red>Начинается прием заявок в рейд на Цитадель Хаоса! Начало рейда через 15 минут.</font>');
$ch_time=time(); $ch_time = time();
mysql_query("UPDATE variables SET value='{$ch_time}' where var='cit_haos_time';"); mysql_query("UPDATE variables SET value='{$ch_time}' where var='cit_haos_time';");
} }
if ($_POST['test_start_raid'] && $user['id']==1256) if ($_POST['test_start_raid'] && $user['id'] == 1256) {
{
mysql_query("DELETE FROM `cit_haos_status`;"); mysql_query("DELETE FROM `cit_haos_status`;");
mysql_query("DELETE FROM `cit_haos_var`;"); mysql_query("DELETE FROM `cit_haos_var`;");
// AddChatSystem('<font color=red>Начинается прием заявок в рейд на Цитадель Хаоса! Начало рейда через 15 минут.</font>'); // AddChatSystem('<font color=red>Начинается прием заявок в рейд на Цитадель Хаоса! Начало рейда через 15 минут.</font>');
$ch_time=time(); $ch_time = time();
mysql_query("UPDATE variables SET value='{$ch_time}' where var='cit_haos_time';"); mysql_query("UPDATE variables SET value='{$ch_time}' where var='cit_haos_time';");
} }
if ($in_haos['room'] != 0 && $in_haos['status'] == 2) if ($in_haos['room'] != 0 && $in_haos['status'] == 2) {
{
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '601',`online`.`room` = '601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;"); mysql_query("UPDATE `users`,`online` SET `users`.`room` = '601',`online`.`room` = '601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
header('location: c_haos_in.php'); header('location: c_haos_in.php');
} }
if ($in_haos['status'] == 2) if ($in_haos['status'] == 2) {
{ $group_num = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';"));
$group_num=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';")); $group_ready = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE (`status` = '2' AND `group` = '{$in_haos['group']}');"));
$group_ready=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE (`status` = '2' AND `group` = '{$in_haos['group']}');")); if ($group_num == $group_ready && $group_ready > 0) {
if($group_num==$group_ready && $group_ready>0)
{
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '601',`online`.`room` = '601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;"); mysql_query("UPDATE `users`,`online` SET `users`.`room` = '601',`online`.`room` = '601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
mysql_query("UPDATE `cit_haos_status` SET room='1' WHERE id = '{$user['id']}'; "); mysql_query("UPDATE `cit_haos_status` SET room='1' WHERE id = '{$user['id']}'; ");
header('location: c_haos_in.php'); header('location: c_haos_in.php');
};
} }
}
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;")); $in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
?> Template::header('Цитадель Хаоса');
<HTML><HEAD> ?>
<!-- JS --> <!-- JS -->
<script> <script>
function refreshPeriodic() function refreshPeriodic() {
{ location.href = 'c_haos.php';//reload()
location.href='c_haos.php';//reload() timerID = setTimeout("refreshPeriodic()", 30000);
timerID=setTimeout("refreshPeriodic()",30000);
} }
timerID=setTimeout("refreshPeriodic()",30000);
</script>
<link rel=stylesheet type="text/css" href="css/main.css"> timerID = setTimeout("refreshPeriodic()", 30000);
<meta content="text/html; charset=utf-8" http-equiv=Content-type> </script>
<META Http-Equiv=Cache-Control Content=no-cache> <TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
</HEAD> <tr>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#d4d4d4> <td><h3>Цитадель Хаоса</td>
</tr>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left> <?php
$tm = time();
<tr><td><h3>Цитадель Хаоса</td></tr> $cit_haos_t = mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'cit_haos_time' LIMIT 1;"));
<?php if ($tm < $cit_haos_t['value'] || $tm > ($cit_haos_t['value'] + 900))//def 900
$tm=time(); {
$cit_haos_t=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'cit_haos_time' LIMIT 1;")); $tob_all = [];
if($tm<$cit_haos_t['value'] || $tm>($cit_haos_t['value']+900))//def 900
{
$tob_all=array();
mysql_query("DELETE FROM `cit_haos_var` WHERE CHAR_LENGTH(players)<3;"); mysql_query("DELETE FROM `cit_haos_var` WHERE CHAR_LENGTH(players)<3;");
if ($in_haos['status']==1) if ($in_haos['status'] == 1) {
{ $dbb = mysql_query("SELECT * FROM `cit_haos_var`;");
$dbb=mysql_query("SELECT * FROM `cit_haos_var`;"); while ($ch_tob = mysql_fetch_array($dbb)) {
while($ch_tob=mysql_fetch_array($dbb)) if (!in_array($ch_tob['players'], $tob_all)) {
if(!in_array($ch_tob['players'],$tob_all)) $tob_all = $tob_all . ";" . $ch_tob['players'];
$tob_all = $tob_all.";".$ch_tob['players']; }
foreach(explode(";",$tob_all) as $tob) }
foreach (explode(";", $tob_all) as $tob) {
mysql_query("UPDATE `cit_haos_status` SET status='2' WHERE id = '{$tob}'; "); mysql_query("UPDATE `cit_haos_status` SET status='2' WHERE id = '{$tob}'; ");
//header('location: c_haos.php');
} }
$tm=time();
$test_tm=time()+900;
$show_tm=$cit_haos_t['value']+0.5*24*60*60;
switch (date("N",$show_tm))
{
case 1:$d_o="в понедельник";break;
case 2:$d_o="во вторник";break;
case 3:$d_o="в среду";break;
case 4:$d_o="в четверг";break;
case 5:$d_o="в пятницу";break;
case 6:$d_o="в субботу";break;
case 7:$d_o="в воскресение";break;
} }
if($tm<$cit_haos_t['value'])echo '<tr><td>Следующий рейд начнется <b>'.date("j.m </b> в <b> H:i</b>",$cit_haos_t['value']).'</td></tr>'; $tm = time();
else echo '<tr><td>Готовьтесь! Следующий рейд будет <b>'.$d_o.'</td></tr>'; $test_tm = time() + 900;
$show_tm = $cit_haos_t['value'] + 0.5 * 24 * 60 * 60;
switch (date("N", $show_tm)) {
default:
case 1:
$d_o = "в понедельник";
break;
case 2:
$d_o = "во вторник";
break;
case 3:
$d_o = "в среду";
break;
case 4:
$d_o = "в четверг";
break;
case 5:
$d_o = "в пятницу";
break;
case 6:
$d_o = "в субботу";
break;
case 7:
$d_o = "в воскресение";
break;
}
if ($tm < $cit_haos_t['value']) {
echo '<tr><td>Следующий рейд начнется <b>' . date("j.m </b> в <b> H:i</b>", $cit_haos_t['value']) . '</td></tr>';
} else {
echo '<tr><td>Готовьтесь! Следующий рейд будет <b>' . $d_o . '</td></tr>';
}
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>'; echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>';
if($user['id']==1256) echo '<tr><td><FORM action="c_haos.php" method=POST><INPUT TYPE="submit" value="Тест (Начать рейд)" name="test_start_raid"><br></FORM></td></tr>'; if ($user['id'] == 1256) {
if($user['id']==1256) echo '<tr><td><FORM action="c_haos.php" method=POST><INPUT TYPE="submit" value="Админ - Начать рейд" name="adm_start_raid"><br></FORM></td></tr>'; echo '<tr><td><FORM method=POST><INPUT TYPE="submit" value="Тест (Начать рейд)" name="test_start_raid"><br></FORM></td></tr>
} <tr><td><FORM method=POST><INPUT TYPE="submit" value="Админ - Начать рейд" name="adm_start_raid"><br></FORM></td></tr>';
elseif ($in_haos['status']==0)
{
$cit_haos_gr=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
if($cit_haos_gr==0)
{
$pass_s=getPass(6);
mysql_query("INSERT INTO `cit_haos_var`(`group`,`password`) values('1','{$pass_s}');");
$cit_haos_gr=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
} }
echo '<tr><td>Рейд начинается <b>'.date("j.m </b> в <b> H:i</b>",$cit_haos_t['value']+900).'</td></tr>'; } elseif ($in_haos['status'] == 0) {
$cit_haos_gr = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
if ($cit_haos_gr == 0) {
$pass_s = getPass();
mysql_query("INSERT INTO `cit_haos_var`(`group`,`password`) values('1','{$pass_s}');");
$cit_haos_gr = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
}
echo '<tr><td>Рейд начинается <b>' . date("j.m </b> в <b> H:i</b>", $cit_haos_t['value'] + 900) . '</td></tr>';
echo '<tr><td><FORM action="c_haos.php" method=POST>Взнос за участие в рейде <strong>20 кр</strong><br>'; echo '<tr><td><FORM action="c_haos.php" method=POST>Взнос за участие в рейде <strong>20 кр</strong><br>';
echo '<tr><td><FORM action="c_haos.php" method=POST>Максимальный размер группы - <strong>4</strong> участника<br>'; echo '<tr><td><FORM action="c_haos.php" method=POST>Максимальный размер группы - <strong>4</strong> участника<br>';
echo '<tr><td>'.$pass_in_err.'<br />'; echo '<tr><td>' . $pass_in_err . '<br />';
$check_em=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group`=1 ;")); $check_em = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group`=1 ;"));
if($check_em<1) if ($check_em < 1) {
{ $i = 1;
$i=1; echo '<INPUT TYPE="radio" value="' . $i . '" name="pay_gr">Группа ' . $i . ":";
echo('<INPUT TYPE="radio" value="'.$i.'" name="pay_gr">Группа '.$i.":"); $cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $i . "' LIMIT 1;"));
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$i."' LIMIT 1;")); if ($cit_haos_pl['players'] != '') {
if($cit_haos_pl['players']!='') foreach (explode(";", $cit_haos_pl['players']) as $ch_p) {
{ echo Nick::id($ch_p)->full(1) . ",";
foreach(explode(";",$cit_haos_pl['players']) as $ch_p) }
echo(Nick::id($ch_p)->full(1).","); echo 'Пароль:<input type="text" size="10" NAME="gr_pass_in' . $i . '">';
echo('Пароль:<input type="text" size="10" NAME="gr_pass_in'.$i.'">'); } else {
echo ' <em>(Создать новую группу)</em>';
} }
else echo(' <em>(Создать новую группу)</em>');
echo '<BR>'; echo '<BR>';
} else {
for ($i = 1; $i <= $cit_haos_gr + 1; $i++) {
echo '<INPUT TYPE="radio" value="' . $i . '" name="pay_gr">Группа ' . $i . ":";
$cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $i . "' LIMIT 1;"));
if (strlen($cit_haos_pl['players']) > 1) {
foreach (explode(";", $cit_haos_pl['players']) as $ch_p) {
echo Nick::id($ch_p)->full(1) . ",";
} }
echo 'Пароль:<input type="text" size="10" NAME="gr_pass_in' . $i . '">';
} else {
else echo ' <em>(Создать новую группу)</em>';
for($i=1;$i<=$cit_haos_gr+1;$i++)
{
echo('<INPUT TYPE="radio" value="'.$i.'" name="pay_gr">Группа '.$i.":");
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$i."' LIMIT 1;"));
if(strlen($cit_haos_pl['players'])>1)
{
foreach(explode(";",$cit_haos_pl['players']) as $ch_p)
echo(Nick::id($ch_p)->full(1).",");
echo('Пароль:<input type="text" size="10" NAME="gr_pass_in'.$i.'">');
} }
else echo(' <em>(Создать новую группу)</em>');
echo '<BR />'; echo '<BR />';
} }
}
echo '<INPUT TYPE="submit" value="Вступить" name="pay"></FORM>'; echo '<INPUT TYPE="submit" value="Вступить" name="pay"></FORM>';
if($pay_err) echo ($pay_err); if ($pay_err) {
echo $pay_err;
}
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>'; echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>';
} } elseif ($in_haos['status'] == 1) {
elseif ($in_haos['status']==1) echo '<tr><td><FORM action="c_haos.php" method=POST>Начать первый рейд: <INPUT TYPE="submit" value="Готов!" name="join_raid"></FORM></td></tr>';
{ $cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $in_haos['group'] . "' LIMIT 1;"));
//echo '<tr><td><FORM action="c_haos.php" method=POST>Начать первый рейд: <INPUT TYPE="submit" value="Готов!" name="join_raid"></FORM></td></tr>'; echo '<tr><td>Рейд начинается <b>' . date("j.m </b> в <b> H:i</b>", $cit_haos_t['value'] + 900) . '</td></tr>';
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$in_haos['group']."' LIMIT 1;")); echo "<tr><td>Ждем начала рейда...<br /></td></tr>";
echo '<tr><td>Рейд начинается <b>'.date("j.m </b> в <b> H:i</b>",$cit_haos_t['value']+900).'</td></tr>'; echo "<tr><td>Ваша группа ";
echo("<tr><td>Ждем начала рейда...<br /></td></tr>"); if (!empty($cit_haos_pl['password'])) {
echo("<tr><td>Ваша группа "); echo ":: <strong>Пароль - [" . $cit_haos_pl['password'] . "]</strong> <br />";
if($cit_haos_pl['password']!='') }
echo(":: <strong>Пароль - [".$cit_haos_pl['password']."]</strong> <br />"); if ($pass_err) {
//else echo $pass_err . "<br />";
//echo(" - <em>без пароля</em><br />"); }
if($pass_err) echo($pass_err."<br />"); $num = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group`='" . $in_haos['group'] . "';"));
$num=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group`='".$in_haos['group']."';")); echo "<br /><b>" . $num . "</b> из <b>4</b>";
echo("<br /><b>".$num."</b> из <b>4</b>"); if ($num == 4) {
//if($num==1) echo (" - <strong>Группа не набрана</strong>"); echo " - <strong>Группа заполнена</strong>";
/*else*/if($num==4) echo (" - <strong>Группа заполнена</strong>"); }
echo("<br />"); echo "<br />";
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$in_haos['group']."' LIMIT 1;")); $cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $in_haos['group'] . "' LIMIT 1;"));
foreach(explode(";",$cit_haos_pl['players']) as $ch_p) foreach (explode(";", $cit_haos_pl['players']) as $ch_p) {
echo(Nick::id($ch_p)->full(1)."<br />"); echo Nick::id($ch_p)->full(1) . "<br />";
}
echo("</td></tr>"); echo "</td></tr>";
} } elseif ($in_haos['status'] == 2) {
elseif ($in_haos['status']==2)
{
echo '<tr><td>'; echo '<tr><td>';
if($wait_msg) echo ($wait_msg); if ($wait_msg) {
echo'</td></tr>'; echo $wait_msg;
}
//echo '<tr><td><FORM action="c_haos.php" method=POST>Еще рейд: <INPUT TYPE="submit" value="Группа 1" name="join_raid"></FORM></td></tr>'; echo '</td></tr>';
header('location: c_haos_in.php'); header('location: c_haos_in.php');
} } elseif ($in_haos['status'] == 4) {
elseif ($in_haos['status']==4)
{
mysql_query("DELETE FROM `cit_haos_status` WHERE `id` ='{$user['id']}'; "); mysql_query("DELETE FROM `cit_haos_status` WHERE `id` ='{$user['id']}'; ");
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>'; echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>';
} } elseif ($in_haos['status'] == 5) {
elseif ($in_haos['status']==5) mysql_query("UPDATE users SET `doblest`=`doblest`+'1' WHERE `id` = '" . $user['id'] . "';");
{ addchp('За убийство босса ЦХ вы получили 1 доблести', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
mysql_query("UPDATE users SET `doblest`=`doblest`+'1' WHERE `id` = '".$user['id']."';");
addchp ('За убийство босса ЦХ вы получили 1 доблести','{[]}'.Nick::id($user['id'])->short().'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$cur_user['id']}','\"".$user['login']."\" получил в ЦХ 1 доблести',1,'".time()."');"); VALUES ('','0','{$cur_user['id']}','\"" . $user['login'] . "\" получил в ЦХ 1 доблести',1,'" . time() . "');");
mysql_query("DELETE FROM `cit_haos_status` WHERE `id` ='{$user['id']}'; "); mysql_query("DELETE FROM `cit_haos_status` WHERE `id` ='{$user['id']}'; ");
header('location: c_haos.php'); header('location: c_haos.php');
/*echo '<tr><td><FORM action="c_haos.php" method=POST>Начать новый рейд: <INPUT TYPE="submit" value="Готов!" name="join_raid"></FORM></td></tr>';*/ }
} ?>
?>
</table> </table>
<div align=right><img width="260" src="i/zitadel/1.jpg" /></div> <div align=right><img width="260" src="i/zitadel/1.jpg"/></div>
<?php
?>
</BODY>
</HTML>

View File

@ -1,264 +1,233 @@
<?php <?php
session_start(); session_start();
if (!($_SESSION['uid'] >0)) header("Location: index.php"); if (empty($_SESSION['uid'])) {
include "config.php"; header("Location: index.php");
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;")); exit;
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;")); }
include "functions.php"; include "functions.php";
$wait_msg="Ждем готовности всей группы..."; $in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
//rooms $wait_msg = "Ждем готовности всей группы...";
$ch_rooms=array //rooms
( $ch_rooms = [
// 0 - empty // 0 - empty
"1"=>"Ворота (1)", "1" => "Ворота (1)",
"2"=>"Двор (2)", "2" => "Двор (2)",
"3"=>"Внешний корридор (3)", "3" => "Внешний корридор (3)",
"4"=>"Спуск в подвал (4)", "4" => "Спуск в подвал (4)",
"5"=>"Подвал (5)",//босс Душа "5" => "Подвал (5)",//босс Душа
"6"=>"Люк на Западную стену (6)", "6" => "Люк на Западную стену (6)",
"7"=>"Западная стена (7)", "7" => "Западная стена (7)",
"8"=>"Галерея Страха (8)", "8" => "Галерея Страха (8)",
"9"=>"Западная башня (9)", "9" => "Западная башня (9)",
"10"=>"Галерея Смерти (10)",//босс Зомби "10" => "Галерея Смерти (10)",//босс Зомби
"11"=>"Проход к Северной стене (11)", "11" => "Проход к Северной стене (11)",
"12"=>"Галерея Тьмы (12)", "12" => "Галерея Тьмы (12)",
"13"=>"Северная стена (13)", "13" => "Северная стена (13)",
"14"=>"Галерея Бликов (14)", "14" => "Галерея Бликов (14)",
"15"=>"Внутренний корридор (15)",//босс Повелитель "15" => "Внутренний корридор (15)",//босс Повелитель
"16"=>"Гостевая (16)", "16" => "Гостевая (16)",
"17"=>"Руины Северной башни (17)", "17" => "Руины Северной башни (17)",
"18"=>"Поминальная комната (18)", "18" => "Поминальная комната (18)",
"19"=>"Галерея Порталов (19)", "19" => "Галерея Порталов (19)",
"20"=>"Зал Посвященных (20)",//босс Хромой Билли "20" => "Зал Посвященных (20)",//босс Хромой Билли
"21"=>"Старая лестница (21)", "21" => "Старая лестница (21)",
"22"=>"Трофейная (22)", "22" => "Трофейная (22)",
"23"=>"Костяной зал (23)", "23" => "Костяной зал (23)",
"24"=>"Склеп (24)", "24" => "Склеп (24)",
"25"=>"Лабиринт (25)",//босс Мародер "25" => "Лабиринт (25)",//босс Мародер
"26"=>"Тронный зал (26)", "26" => "Тронный зал (26)",
"27"=>"Тайный корридор (27)", "27" => "Тайный корридор (27)",
"28"=>"Комната прислуги (28)", "28" => "Комната прислуги (28)",
"29"=>"Королевские покои (29)", "29" => "Королевские покои (29)",
"30"=>"Переход (30)"//босс Грохобот "30" => "Переход (30)"//босс Грохобот
); ];
//bots //bots
$ch_bots=array(); $ch_bots = [];
//1 - упырь //1 - упырь
//2 - падший //2 - падший
//3 - душа //3 - душа
$db=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$in_haos['group']."' limit 1; ")); $db = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $in_haos['group'] . "' limit 1; "));
if(!$db['bots']) if (!$db['bots']) {
{ $bot_low = [
$bot_low=array
(
// 0 - empty // 0 - empty
"1"=>"Упырь", "1" => "Упырь",
"2"=>"Посланник смерти", "2" => "Посланник смерти",
"3"=>"Падший", "3" => "Падший",
"4"=>"Отморозок", "4" => "Отморозок",
"5"=>"Проклятие глубин" "5" => "Проклятие глубин"
); ];
for($i=1;$i<=30;$i++) for ($i = 1; $i <= 30; $i++) {
{ $ch_get_bot = rand(1, 5);
$ch_get_bot=rand(1,5); $ch_bots[$i] = ["0" => $bot_low[$ch_get_bot]];
$ch_bots[$i]=array("0"=>$bot_low[$ch_get_bot]);
} }
$ch_bots[5]=array("0"=>"Душа"); $ch_bots[5] = ["0" => "Душа"];
$ch_bots[10]=array("0"=>"Зомби"); $ch_bots[10] = ["0" => "Зомби"];
$ch_bots[15]=array("0"=>"Повелитель"); $ch_bots[15] = ["0" => "Повелитель"];
$ch_bots[20]=array("0"=>"Хромой Билли"); $ch_bots[20] = ["0" => "Хромой Билли"];
$ch_bots[25]=array("0"=>"Мародер"); $ch_bots[25] = ["0" => "Мародер"];
$ch_bots[30]=array("0"=>"Грохобот"); $ch_bots[30] = ["0" => "Грохобот"];
$dbb=serialize($ch_bots); $dbb = serialize($ch_bots);
mysql_query("UPDATE `cit_haos_var` SET bots='".$dbb."' WHERE `group`='".$in_haos['group']."'; "); mysql_query("UPDATE `cit_haos_var` SET bots='" . $dbb . "' WHERE `group`='" . $in_haos['group'] . "'; ");
} } else {
else $ch_bots = unserialize($db['bots']);
{ }
$ch_bots=unserialize($db['bots']); // комната - опыт == доблесть
} $ch_priz = [
// комната - опыт == доблесть "5" => [100, 1],
$ch_priz=array "10" => [200, 2],
( "15" => [300, 3],
"5" => array (100,1), "20" => [400, 4],
"10" => array (200,2), "25" => [500, 5],
"15" => array (300,3), "30" => [600, 10]
"20" => array (400,4), ];
"25" => array (500,5), // комната - кирка == уник_7 == цветок == уник_8
"30" => array (600,10) $ch_drop = [
); "25" => [10, 60, 95, 100],
// комната - кирка == уник_7 == цветок == уник_8 "30" => [3, 6, 7, 8],
$ch_drop=array ];
( $priz_low =
"25" => array (10,60,95,100), ["727"];
"30" => array (3,6,7,8), $priz_med =
); ["775", "776", "777", "778"];
$priz_low= $priz_flow =
array("727"); ["14"];
$priz_med= $priz_high =
array("775","776","777","778"); ["803", "804", "805", "806"];
$priz_flow=
array("14");
$priz_high=
array("803","804","805","806");
/*$ch_bots[1]=array /*$ch_bots[1]=array
( (
"0"=>"Младший страж глубин", "0"=>"Младший страж глубин",
"1"=>"Младший страж глубин", "1"=>"Младший страж глубин",
"2"=>"Босс глубин" "2"=>"Босс глубин"
); );
$ch_bots[2]=array $ch_bots[2]=array
( (
"0"=>"Младший страж глубин", "0"=>"Младший страж глубин",
"1"=>"Босс глубин" "1"=>"Босс глубин"
);*/ );*/
if ($user['room'] != 601) { header("Location: main.php"); die(); } if ($user->room != 601) {
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); } header("Location: main.php");
if ($in_haos['status'] == 4) exit;
{ }
if ($user->battle) {
header('location: fbattle.php');
exit;
}
if ($in_haos['status'] == 4) {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '600',`online`.`room` = '600' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;"); mysql_query("UPDATE `users`,`online` SET `users`.`room` = '600',`online`.`room` = '600' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
mysql_query("UPDATE `cit_haos_status` SET room='0',bot='0',group='0' WHERE id = '{$user['id']}'; "); mysql_query("UPDATE `cit_haos_status` SET room='0',bot='0',group='0' WHERE id = '{$user['id']}'; ");
header('location: c_haos.php'); header('location: c_haos.php');
} }
if (!$ch_rooms[$in_haos['room']]) if (!$ch_rooms[$in_haos['room']]) {
{
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '600',`online`.`room` = '600' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;"); mysql_query("UPDATE `users`,`online` SET `users`.`room` = '600',`online`.`room` = '600' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
if ($in_haos['status'] == 2) if ($in_haos['status'] == 2) {
{
mysql_query("UPDATE `cit_haos_status` SET room='0',status='5',bot='0' WHERE id = '{$user['id']}'; "); mysql_query("UPDATE `cit_haos_status` SET room='0',status='5',bot='0' WHERE id = '{$user['id']}'; ");
addchp ('Вы пробились до двери на 2 уровень подземелий Цитадели Хаоса. Только опытный воин и храбрый страж сможет пройти через нее (10 уровень, страж 2 уровня)','{[]}'.Nick::id($user['id'])->short().'{[]}'); addchp('Вы пробились до двери на 2 уровень подземелий Цитадели Хаоса. Только опытный воин и храбрый страж сможет пройти через нее (10 уровень, страж 2 уровня)', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
} }
mysql_query("UPDATE `cit_haos_var` SET bots='',players='' WHERE group='".$in_haos['group']."'; "); mysql_query("UPDATE `cit_haos_var` SET bots='',players='' WHERE group='" . $in_haos['group'] . "'; ");
header('location: c_haos.php'); header('location: c_haos.php');
}
Template::header('c_haos_in');
?>
<script>
function refreshPeriodic() {
location.href = 'c_haos_in.php';//reload()
timerID = setTimeout("refreshPeriodic()", 30000);
} }
?> timerID = setTimeout("refreshPeriodic()", 30000);
<HTML><HEAD> </script>
<!-- JS -->
<script>
function refreshPeriodic()
{
location.href='c_haos_in.php';//reload()
timerID=setTimeout("refreshPeriodic()",30000);
}
timerID=setTimeout("refreshPeriodic()",30000);
</script>
<link rel=stylesheet type="text/css" href="css/main.css"> <TABLE border=0 width=340 cellspacing="0" cellpadding="0" align=left>
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
</HEAD> <tr>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#d4d4d4> <td><h3>Цитадель Хаоса: <?= $ch_rooms[$in_haos['room']] ?><br/>
<br/></td>
</tr>
<TABLE border=0 width=340 cellspacing="0" cellpadding="0" align=left> <?php
//attack
<tr><td><h3>Цитадель Хаоса: <?= $ch_rooms[$in_haos['room']]?><br /> if ($_POST['go_attack']) {
<br /></td></tr> if ($in_haos['status'] == 2) {
$bot_name = $ch_bots[$in_haos['room']][$in_haos['bot']];
<!--tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr--> switch ($bot_name) {
<?php
//attack
if($_POST['go_attack'])
{
if($in_haos['status'] == 2)
{
$bot_name=$ch_bots[$in_haos['room']][$in_haos['bot']];
switch ($bot_name)
{
case "Упырь": case "Упырь":
//$bot_hp=200; $bot_id = 2897;
$bot_id=2897; $bot_count = rand(10, 30);
$bot_count=rand(10,30);
break; break;
case "Падший": case "Падший":
//$bot_hp=300; $bot_id = 2903;
$bot_id=2903; $bot_count = rand(3, 9);
$bot_count=rand(3,9);
break; break;
case "Посланник смерти": case "Посланник смерти":
//$bot_hp=700; $bot_id = 2896;
$bot_id=2896; $bot_count = 2;
$bot_count=2;
break; break;
case "Отморозок": case "Отморозок":
//$bot_hp=500; $bot_id = 2893;
$bot_id=2893; $bot_count = 3;
$bot_count=3;
break; break;
case "Проклятие глубин": case "Проклятие глубин":
//$bot_hp=1000; $bot_id = 2892;
$bot_id=2892; $bot_count = rand(1, 5);
$bot_count=rand(1,5);
break; break;
case "Душа": case "Душа":
//$bot_hp=1000; $bot_id = 2895;
$bot_id=2895; $bot_count = 1;
$bot_count=1;
break; break;
case "Зомби": case "Зомби":
//$bot_hp=1000; $bot_id = 2901;
$bot_id=2901; $bot_count = 5;
$bot_count=5;
break; break;
case "Повелитель": case "Повелитель":
//$bot_hp=2000; $bot_id = 2902;
$bot_id=2902; $bot_count = 1;
$bot_count=1;
break; break;
case "Хромой Билли": case "Хромой Билли":
//$bot_hp=3000; $bot_id = 2898;
$bot_id=2898; $bot_count = 1;
$bot_count=1;
break; break;
case "Мародер": case "Мародер":
//$bot_hp=5000; $bot_id = 2899;
$bot_id=2899; $bot_count = 1;
$bot_count=1;
break; break;
case "Грохобот": case "Грохобот":
//$bot_hp=10000; $bot_id = 2900;
$bot_id=2900; $bot_count = 1;
$bot_count=1;
break; break;
}
}; $b_pers = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='{$bot_id}' LIMIT 1;"));
$b_pers=mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='{$bot_id}' LIMIT 1;"));; $bot_hp = $b_pers['maxhp'];
$bot_hp=$b_pers['maxhp']; $bots = [];
$bots=array(); $group_raw = mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}' AND status='2';");
$group_raw=mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}' AND status='2';"); while ($gr = mysql_fetch_array($group_raw)) {
while ($gr = mysql_fetch_array($group_raw)) addchp('<font color=red>Внимание!</font> ' . $bot_name . ' напал на Вашу группу!', '{[]}' . Nick::id($gr['id'])->short() . '{[]}');
{
addchp ('<font color=red>Внимание!</font> '.$bot_name.' напал на Вашу группу!','{[]}'.Nick::id($gr['id'])->short().'{[]}');
} }
for($bot_c=0;$bot_c<$bot_count;$bot_c++) for ($bot_c = 0; $bot_c < $bot_count; $bot_c++) {
{ $nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $bot_name . "%';"));
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$bot_name."%';")); mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('" . $bot_name . " " . ($nb[0] + 1) . "','" . $bot_id . "','','" . $bot_hp . "');");
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('".$bot_name." ".($nb[0]+1)."','".$bot_id."','','".$bot_hp."');");
$bot = mysql_insert_id(); $bot = mysql_insert_id();
$bots[]=$bot; $bots[] = $bot;
} }
// командный вход // командный вход
$group_fight=array(); $group_fight = [];
$group_raw=mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}' AND status='2';"); $group_raw = mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}' AND status='2';");
while ($gr = mysql_fetch_array($group_raw)) while ($gr = mysql_fetch_array($group_raw)) {
$group_fight[]=$gr['id']; $group_fight[] = $gr['id'];
{ }
$teams = array();
foreach($bots as $b) $teams = [];
foreach($group_fight as $gf) foreach ($bots as $b) {
{ foreach ($group_fight as $gf) {
$teams[$gf][$b] = array(0,0,time()); $teams[$gf][$b] = [0, 0, time()];
$teams[$b][$gf] = array(0,0,time()); $teams[$b][$gf] = [0, 0, time()];
mysql_query("UPDATE `cit_haos_status` SET `status` = '3' WHERE `id` ='{$gf}'; "); mysql_query("UPDATE `cit_haos_status` SET `status` = '3' WHERE `id` ='{$gf}'; ");
} }
}
mysql_query("INSERT INTO `battle` mysql_query("INSERT INTO `battle`
( (
@ -266,118 +235,94 @@ if($_POST['go_attack'])
) )
VALUES VALUES
( (
NULL,'','".serialize($teams)."','3','1','0','".implode(";", $group_fight)."','".implode(";", $bots)."','".time()."','".time()."' NULL,'','" . serialize($teams) . "','3','1','0','" . implode(";", $group_fight) . "','" . implode(";", $bots) . "','" . time() . "','" . time() . "'
)"); )");
$id = mysql_insert_id(); $id = mysql_insert_id();
// апдейтим бота // апдейтим бота
foreach($bots as $b) mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$b} LIMIT 1;"); foreach ($bots as $b) {
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$b} LIMIT 1;");
// создаем лог
//$rr = "<b>".nick3($user['id'])."</b> и <b>".nick3($bot)."</b>";
//addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." сошлись в поединке. <BR>");
} }
foreach($group_fight as $gf) mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$gf};");
//} foreach ($group_fight as $gf) {
die("<script>location.href='fbattle.php';</script>"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$gf};");
} }
} exit("<script>location.href='fbattle.php';</script>");
$group_num=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';")); }
$group_ready=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE (`room` = '{$in_haos['room']}' AND `group` = '{$in_haos['group']}');")); }
$cit_haos_t=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'cit_haos_time' LIMIT 1;")); $group_num = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';"));
$tm=time(); $group_ready = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE (`room` = '{$in_haos['room']}' AND `group` = '{$in_haos['group']}');"));
if($in_haos['status'] == 2) $cit_haos_t = mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'cit_haos_time' LIMIT 1;"));
{if(($tm>($cit_haos_t['value']+960))||($tm<($cit_haos_t['value']-600)))//def 960 $tm = time();
{ if ($in_haos['status'] == 2) {
$flag_ref=1; if (($tm > ($cit_haos_t['value'] + 960)) || ($tm < ($cit_haos_t['value'] - 600)))//def 960
foreach($ch_bots[$in_haos['room']] as $bot_id=>$bot_name)
if($bot_id>=$in_haos['bot'])
{ {
$flag_ref = 1;
foreach ($ch_bots[$in_haos['room']] as $bot_id => $bot_name)
if ($bot_id >= $in_haos['bot']) {
echo '<tr><td><FORM action="c_haos_in.php" method=POST>'; echo '<tr><td><FORM action="c_haos_in.php" method=POST>';
if($bot_id==$in_haos['bot']) echo'<strong>'.$bot_name.'</strong>'; else echo($bot_name); if ($bot_id == $in_haos['bot']) echo '<strong>' . $bot_name . '</strong>'; else echo($bot_name);
if($bot_id==$in_haos['bot']) echo' - <INPUT TYPE="submit" value="Напасть" name="go_attack">'; if ($bot_id == $in_haos['bot']) echo ' - <INPUT TYPE="submit" value="Напасть" name="go_attack">';
echo ' </FORM></td></tr>'; echo ' </FORM></td></tr>';
$flag_ref=0; $flag_ref = 0;
} }
if (!array_key_exists($in_haos['bot'],$ch_bots[$in_haos['room']])) if (!array_key_exists($in_haos['bot'], $ch_bots[$in_haos['room']])) {
{
echo($wait_msg); echo($wait_msg);
//проверяем есть ли приз //проверяем есть ли приз
if(array_key_exists($in_haos['room'],$ch_priz)) if (array_key_exists($in_haos['room'], $ch_priz)) {
{ $priz_exp = $ch_priz[$in_haos['room']][0];
$priz_exp=$ch_priz[$in_haos['room']][0]; $priz_dobl = $ch_priz[$in_haos['room']][1];
$priz_dobl=$ch_priz[$in_haos['room']][1]; } else {
$priz_exp = 0;
$priz_dobl = 0;
} }
else if (array_key_exists($in_haos['room'], $ch_drop)) {
{ $got_drop = rand(0, 400);//100 - norm, 400 - 25%
$priz_exp=0; } else {
$priz_dobl=0; $got_drop = -1;
}
if(array_key_exists($in_haos['room'],$ch_drop))
{
$got_drop=rand(0,400);//100 - norm, 400 - 25%
}
else
{
$got_drop=-1;
} }
//выбираем приз //выбираем приз
if($in_haos['room']<30) if ($in_haos['room'] < 30) {
{ if ($got_drop >= 0 && $got_drop < $ch_drop[$in_haos['room']][0]) {
if($got_drop>=0 && $got_drop<$ch_drop[$in_haos['room']][0])
{
$rand_k = array_rand($priz_low, 1); $rand_k = array_rand($priz_low, 1);
$p_id=$priz_low[$rand_k]; $p_id = $priz_low[$rand_k];
$p_shop="shop"; $p_shop = "shop";
} } elseif ($got_drop >= $ch_drop[$in_haos['room']][0] && $got_drop < $ch_drop[$in_haos['room']][1]) {
elseif($got_drop>=$ch_drop[$in_haos['room']][0] && $got_drop<$ch_drop[$in_haos['room']][1])
{
$rand_k = array_rand($priz_med, 1); $rand_k = array_rand($priz_med, 1);
$p_id=$priz_med[$rand_k]; $p_id = $priz_med[$rand_k];
$p_shop="shop"; $p_shop = "shop";
} } elseif ($got_drop >= $ch_drop[$in_haos['room']][1] && $got_drop < $ch_drop[$in_haos['room']][2]) {
elseif($got_drop>=$ch_drop[$in_haos['room']][1] && $got_drop<$ch_drop[$in_haos['room']][2])
{
$rand_k = array_rand($priz_flow, 1); $rand_k = array_rand($priz_flow, 1);
$p_id=$priz_flow[$rand_k]; $p_id = $priz_flow[$rand_k];
$p_shop="fshop"; $p_shop = "fshop";
} } elseif ($got_drop >= $ch_drop[$in_haos['room']][2] && $got_drop <= $ch_drop[$in_haos['room']][3]) {
elseif($got_drop>=$ch_drop[$in_haos['room']][2] && $got_drop<=$ch_drop[$in_haos['room']][3])
{
$rand_k = array_rand($priz_high, 1); $rand_k = array_rand($priz_high, 1);
$p_id=$priz_high[$rand_k]; $p_id = $priz_high[$rand_k];
$p_shop="shop"; $p_shop = "shop";
} }
} } elseif ($in_haos['room'] == 30) {
elseif($in_haos['room']==30) if ($got_drop <= 200)//400max/4=>50%
{ {
if($got_drop<=200)//400max/4=>50% $priz_low =
{ ["808", "809"];
$priz_low=
array("808","809");
$rand_k = array_rand($priz_low, 1); $rand_k = array_rand($priz_low, 1);
$p_id=$priz_low[$rand_k]; $p_id = $priz_low[$rand_k];
$p_shop="shop"; $p_shop = "shop";
} }
} }
//выбираем получателя //выбираем получателя
$all_get=array(); $all_get = [];
$gr_raw=mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';"); $gr_raw = mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';");
while($g_id=mysql_fetch_array($gr_raw)) while ($g_id = mysql_fetch_array($gr_raw)) {
$all_get[]=$g_id['id']; $all_get[] = $g_id['id'];
}
$l_id=rand(0,count($all_get)-1); $l_id = rand(0, count($all_get) - 1);
//$all_get[$l_id];
//if($priz_exp>0) addchp ('CH get priz - '.$all_get[$l_id],'{[]}'.nick7 (1258).'{[]}');
//даем призы //даем призы
if($p_id>0) if ($p_id > 0) {
{
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `{$p_shop}` WHERE `id` = '{$p_id}' LIMIT 1;")); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `{$p_shop}` WHERE `id` = '{$p_id}' LIMIT 1;"));
mysql_query("INSERT INTO `inventory` mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`, (`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
@ -386,42 +331,40 @@ $tm=time();
) )
VALUES VALUES
('{$dress['id']}','{$all_get[$l_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['id']}','{$all_get[$l_id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dur}','Мусорщик' '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dur}','Мусорщик'
) ;"); ) ;");
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','$all_get[$l_id]','\"".$user['login']."\" получил в ЦХ предмет: \"".$dress['name']."\" ".$dresscount."id:(".$dressid.") [0/".$dress['maxdur']."]',1,'".time()."');"); mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','$all_get[$l_id]','\"" . $user['login'] . "\" получил в ЦХ предмет: \"" . $dress['name'] . "\" " . $dresscount . "id:(" . $dressid . ") [0/" . $dress['maxdur'] . "]',1,'" . time() . "');");
addchp ('За убийство босса Цитадели Хаоса вы получили '.$dress['name'],'{[]}'.Nick::id($all_get[$l_id])->short().'{[]}'); addchp('За убийство босса Цитадели Хаоса вы получили ' . $dress['name'], '{[]}' . Nick::id($all_get[$l_id])->short() . '{[]}');
} }
if($priz_exp>0) if ($priz_exp > 0) {
{ GiveExp($all_get[$l_id], $priz_exp);
GiveExp($all_get[$l_id],$priz_exp); addchp('За убийство босса Цитадели Хаоса вы получили ' . $priz_exp . ' опыта', '{[]}' . Nick::id($all_get[$l_id])->short() . '{[]}');
addchp ('За убийство босса Цитадели Хаоса вы получили '.$priz_exp.' опыта','{[]}'.Nick::id($all_get[$l_id])->short().'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$cur_user['id']}','\"".$all_get[$l_id]."\" получил в ЦХ \"".$priz_exp."\" опыта',1,'".time()."');"); VALUES ('','0','{$cur_user['id']}','\"" . $all_get[$l_id] . "\" получил в ЦХ \"" . $priz_exp . "\" опыта',1,'" . time() . "');");
} }
if($priz_dobl>0) if ($priz_dobl > 0) {
{ mysql_query("UPDATE users SET `doblest`=`doblest`+'" . $priz_dobl . "' WHERE `id` = '" . $all_get[$l_id] . "';");
mysql_query("UPDATE users SET `doblest`=`doblest`+'".$priz_dobl."' WHERE `id` = '".$all_get[$l_id]."';"); addchp('За убийство босса Цитадели Хаоса вы получили ' . $priz_dobl . ' доблести', '{[]}' . Nick::id($all_get[$l_id])->short() . '{[]}');
addchp ('За убийство босса Цитадели Хаоса вы получили '.$priz_dobl.' доблести','{[]}'.Nick::id($all_get[$l_id])->short().'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$cur_user['id']}','\"".$all_get[$l_id]."\" получил в ЦХ \"".$priz_dobl."\" доблести',1,'".time()."');"); VALUES ('','0','{$cur_user['id']}','\"" . $all_get[$l_id] . "\" получил в ЦХ \"" . $priz_dobl . "\" доблести',1,'" . time() . "');");
} }
mysql_query("UPDATE `cit_haos_status` SET `room` = `room`+1,`bot`=0 WHERE `group` = '{$in_haos['group']}'; "); mysql_query("UPDATE `cit_haos_status` SET `room` = `room`+1,`bot`=0 WHERE `group` = '{$in_haos['group']}'; ");
if (!headers_sent()) header('location: c_haos_in.php'); if (!headers_sent()) {
header('location: c_haos_in.php');
} }
if($flag_ref==0 && !headers_sent()) header('location: c_haos_in.php');
} }
else if ($flag_ref == 0 && !headers_sent()) {
{ header('location: c_haos_in.php');
echo("<TR><TD>Ждем готовности группы... Приготовьтесь!</TR></TD>"); }
} else {
echo "<TR><TD>Ждем готовности группы... Приготовьтесь!</TR></TD>";
echo '<tr><td><FORM action="c_haos_in.php" method=POST><INPUT TYPE="submit" value="Обновить" name="refresh">'; echo '<tr><td><FORM action="c_haos_in.php" method=POST><INPUT TYPE="submit" value="Обновить" name="refresh">';
echo ' </FORM></td></tr>'; echo ' </FORM></td></tr>';
} }
} }
?> ?>
</table> </table>
<?php <?php
echo('<div align=right><img width="260" src="i/zitadel/'.($in_haos['room']+1).'.jpg" /></div>'); echo '<div align=right><img width="260" src="i/zitadel/' . ($in_haos['room'] + 1) . '.jpg" /></div>';
?> ?>
</BODY>
</HTML>

View File

@ -1,107 +1,102 @@
<?php <?php
session_start();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
$in_park = mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
session_start(); if (!$in_park) {
if (!($_SESSION['uid'] >0)) header("Location: index.php");
include "config.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
$in_park = mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$user['id']." AND (type=13 OR type=12 OR type=14) limit 1;"));
if(!$in_park)
{
mysql_query("INSERT INTO cit_park(id) values('{$user['id']}');"); mysql_query("INSERT INTO cit_park(id) values('{$user['id']}');");
$in_park=mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;")); $in_park = mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
} }
include "functions.php"; include "functions.php";
if ($user['room'] != 602) { header("Location: main.php"); die(); } if ($user->room != 602) {
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); } header("Location: main.php");
exit;
}
if ($user->battle) {
header('location: fbattle.php');
exit;
}
//комнаты парка //комнаты парка
$ch_rooms=array $ch_rooms = [
(
// 0 - empty // 0 - empty
"1"=>"Площадь (1)", "1" => "Площадь (1)",
"2"=>"Аллея Геры (2)", "2" => "Аллея Геры (2)",
"3"=>"Фонтан Снов (3)", "3" => "Фонтан Снов (3)",
"4"=>"Лабиринт Фавна (4)", "4" => "Лабиринт Фавна (4)",
"5"=>"Поляна Сказок (5)",//босс Душа "5" => "Поляна Сказок (5)",//босс Душа
"6"=>"Переулок Зеленый (6)", "6" => "Переулок Зеленый (6)",
"7"=>"Дубрава (7)", "7" => "Дубрава (7)",
"8"=>"Старая Роща (8)", "8" => "Старая Роща (8)",
"9"=>"Лукоморье (9)", "9" => "Лукоморье (9)",
"10"=>"Золотая Роща (10)",//босс Зомби "10" => "Золотая Роща (10)",//босс Зомби
"11"=>"Вечная Осень (11)", "11" => "Вечная Осень (11)",
"12"=>"Заливные Луга (12)", "12" => "Заливные Луга (12)",
"13"=>"Терра Нова (13)", "13" => "Терра Нова (13)",
"14"=>"Гора Райдинг (14)", "14" => "Гора Райдинг (14)",
"15"=>"Пасифик-Риф (15)"//босс Повелитель "15" => "Пасифик-Риф (15)"//босс Повелитель
); ];
// выдаем ботов // выдаем ботов
$ch_bots=array(); $ch_bots = [];
$bot_low=array $bot_low = ["4150", "4152", "4153", "4154", "4155", "4156"];
("4150","4152","4153","4154","4155","4156"); $bot_high = ["4157", "4158", "4159"];
$bot_high=array if ($in_park['bots'] == '') {
("4157","4158","4159"); for ($i = 1; $i <= 15; $i++) {
if($in_park['bots']=='') $rand_num = rand(3, 7);
{ $rand_bot = '';
for($i=1;$i<=15;$i++) for ($j = 1; $j <= $rand_num; $j++) {
{ $rand_bot .= $bot_low[array_rand($bot_low, 1)];
$rand_num=rand(3,7); $rand_bot .= ';';
$rand_bot='';
for($j=1;$j<=$rand_num;$j++)
{
$rand_bot.=$bot_low[array_rand($bot_low,1)];
$rand_bot.=';';
} }
if($i%5==0) if ($i % 5 == 0) {
$rand_bot.=$bot_high[array_rand($bot_high,1)]; $rand_bot .= $bot_high[array_rand($bot_high, 1)];
$rand_bot.=';';
$ch_bots[$i]=$rand_bot;
} }
$dbb=serialize($ch_bots); $rand_bot .= ';';
$ch_bots[$i] = $rand_bot;
}
$dbb = serialize($ch_bots);
mysql_query("UPDATE `cit_park` SET bots='{$dbb}' WHERE `id`='{$user['id']}'; "); mysql_query("UPDATE `cit_park` SET bots='{$dbb}' WHERE `id`='{$user['id']}'; ");
} } else {
else $ch_bots = unserialize($in_park['bots']);
{ }
$ch_bots=unserialize($in_park['bots']);
}
// начинаем расчет действий // начинаем расчет действий
if($_POST['start_raid']) if ($_POST['start_raid']) {
{
mysql_query("UPDATE `cit_park` SET `counter`=`counter`+1, `room`=`room`+1 WHERE `id`='{$user['id']}';"); mysql_query("UPDATE `cit_park` SET `counter`=`counter`+1, `room`=`room`+1 WHERE `id`='{$user['id']}';");
$in_park=mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;")); $in_park = mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
}
//старт боя - началоа
if ($_POST['attack']) {
$bots_raw = explode(";", $ch_bots[$in_park['room']]);
$bots = [];
foreach ($bots_raw as $bot_id) {
if ($bot_id > 0) {
$b_pers = mysql_fetch_array(mysql_query("SELECT `login`,`maxhp` FROM users WHERE id='{$bot_id}' LIMIT 1;"));
$bot_hp = $b_pers['maxhp'];
$bot_name = $b_pers['login'];
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $bot_name . "%';"));
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('" . $bot_name . " " . ($nb[0] + 1) . "','" . $bot_id . "','','" . $bot_hp . "');");
$bots[] = mysql_insert_id();
}
} }
//старт боя - началоа $teams = [];
foreach ($bots as $b) {
if($_POST['attack']) $teams[$user['id']][$b] = [0, 0, time()];
{ $teams[$b][$user['id']] = [0, 0, time()];
$bots_raw=explode(";",$ch_bots[$in_park['room']]);
$bots=array();
foreach($bots_raw as $bot_id)
if($bot_id>0)
{
$b_pers=mysql_fetch_array(mysql_query("SELECT `login`,`maxhp` FROM users WHERE id='{$bot_id}' LIMIT 1;"));
$bot_hp=$b_pers['maxhp'];
$bot_name=$b_pers['login'];
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$bot_name."%';"));
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('".$bot_name." ".($nb[0]+1)."','".$bot_id."','','".$bot_hp."');");
$bots[]=mysql_insert_id();
}
$teams = array();
foreach($bots as $b)
{
$teams[$user['id']][$b] = array(0,0,time());
$teams[$b][$user['id']] = array(0,0,time());
} }
mysql_query("INSERT INTO `battle` mysql_query("INSERT INTO `battle`
@ -110,58 +105,47 @@
) )
VALUES VALUES
( (
NULL,'','".serialize($teams)."','3','1','0','".$user['id']."','".implode(";", $bots)."','".time()."','".time()."' NULL,'','" . serialize($teams) . "','3','1','0','" . $user['id'] . "','" . implode(";", $bots) . "','" . time() . "','" . time() . "'
)"); )");
$id = mysql_insert_id(); $id = mysql_insert_id();
foreach($bots as $b) mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$b} LIMIT 1;"); foreach ($bots as $b) {
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$b} LIMIT 1;");
}
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']};"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']};");
addchp ('<font color=red>Внимание!</font> Вы вступили в бой c бандитами!','{[]}'.Nick::id($user['id'])->short().'{[]}'); addchp('<font color=red>Внимание!</font> Вы вступили в бой c бандитами!', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
die("<script>location.href='fbattle.php';</script>"); exit("<script>location.href='fbattle.php';</script>");
} }
//старт боя - конец //старт боя - конец
Template::header('Городской Парк');
?> ?>
<HTML><HEAD>
<!-- JS -->
<script> <script>
function refreshPeriodic() function refreshPeriodic() {
{ location.href = 'c_park.php';//reload()
location.href='c_park.php';//reload() timerID = setTimeout("refreshPeriodic()", 30000);
timerID=setTimeout("refreshPeriodic()",30000);
} }
timerID=setTimeout("refreshPeriodic()",30000);
timerID = setTimeout("refreshPeriodic()", 30000);
</script> </script>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<link rel=stylesheet type="text/css" href="css/main.css"> <tr>
<meta content="text/html; charset=utf-8" http-equiv=Content-type> <td><h3>Городской Парк</td>
<META Http-Equiv=Cache-Control Content=no-cache> </tr>
<meta http-equiv=PRAGMA content=NO-CACHE> <?php
<META Http-Equiv=Expires Content=0> if ($in_park['room'] == 0 || $in_park['room'] >= 15) {
echo '<tr><td>Вы стоите на парковой площади</strong></td></tr>';
</HEAD> echo "<tr><td>За сегодня Вы посетили парк <b>" . $in_park['counter'] . "/3</b> раз.</td></tr>";
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#d4d4d4> if ($in_park['room'] == 15) {
echo "<tr><td>Вы вышли из парка с чувством глубокого удовлетворения...</td></tr>";
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<tr><td><h3>Городской Парк</td></tr>
<?php
if($in_park['room']==0 || $in_park['room']>=15)
{
echo('<tr><td>Вы стоите на парковой площади</strong></td></tr>');
echo("<tr><td>За сегодня Вы посетили парк <b>".$in_park['counter']."/3</b> раз.</td></tr>");
if($in_park['room']==15)
{
echo("<tr><td>Вы вышли из парка с чувством глубокого удовлетворения...</td></tr>");
//раздача гаек //раздача гаек
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '856' LIMIT 1;")); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '856' LIMIT 1;"));
$gadget_num=mt_rand(1,8); $gadget_num = mt_rand(1, 8);
for($i=0;$i<$gadget_num;$i++) for ($i = 0; $i < $gadget_num; $i++) {
{
mysql_query("INSERT INTO `inventory` mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`, (`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`, `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`,
@ -169,14 +153,13 @@ if($in_park['room']==0 || $in_park['room']>=15)
) )
VALUES VALUES
('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}', ('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;"); ) ;");
} }
//раздача страничек //раздача страничек
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '867' LIMIT 1;")); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '867' LIMIT 1;"));
$gadget_num=mt_rand(1,5); $gadget_num = mt_rand(1, 5);
for($i=0;$i<$gadget_num;$i++) for ($i = 0; $i < $gadget_num; $i++) {
{
mysql_query("INSERT INTO `inventory` mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`, (`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`, `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`,
@ -184,16 +167,15 @@ if($in_park['room']==0 || $in_park['room']>=15)
) )
VALUES VALUES
('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}', ('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;"); ) ;");
} }
//раздача ингридиентов //раздача ингридиентов
$ing_list=array("859","860","861","862","863","864","865"); $ing_list = ["859", "860", "861", "862", "863", "864", "865"];
$ing_id=$ing_list[array_rand($ing_list)]; $ing_id = $ing_list[array_rand($ing_list)];
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$ing_id}' LIMIT 1;")); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$ing_id}' LIMIT 1;"));
$gadget_num=mt_rand(1,3); $gadget_num = mt_rand(1, 3);
for($i=0;$i<$gadget_num;$i++) for ($i = 0; $i < $gadget_num; $i++) {
{
mysql_query("INSERT INTO `inventory` mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`, (`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`, `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`,
@ -201,49 +183,38 @@ if($in_park['room']==0 || $in_park['room']>=15)
) )
VALUES VALUES
('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}', ('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;"); ) ;");
} }
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$user['id']}','\"".$user['login']."\" Подобрал в Парке гайки ( \"".$gadget_num."\" ".$dresscount."id:(".$dressid.") [0/".$dress['maxdur']."]',1,'".time()."');"); mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$user['id']}','\"" . $user['login'] . "\" Подобрал в Парке гайки ( \"" . $gadget_num . "\" " . $dresscount . "id:(" . $dressid . ") [0/" . $dress['maxdur'] . "]',1,'" . time() . "');");
addchp ('В Парке Вы подобрали гайки ('.$gadget_num.' шт.)','{[]}'.Nick::id($user['id'])->short().'{[]}'); addchp('В Парке Вы подобрали гайки (' . $gadget_num . ' шт.)', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
//денежный приз //денежный приз
$priz=mt_rand(1,10); $priz = mt_rand(1, 10);
mysql_query("UPDATE users set money=money+{$priz} where id='{$user['id']}';"); mysql_query("UPDATE users set money=money+{$priz} where id='{$user['id']}';");
addchp ('После посещения Парка Вы обогатились на '.$priz.' кр. ','{[]}'.Nick::id($user['id'])->short().'{[]}'); addchp('После посещения Парка Вы обогатились на ' . $priz . ' кр. ', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$user['id']}','\"".$user['login']."\" нашел в Парке ".$priz." кр. ',1,'".time()."');"); VALUES ('','0','{$user['id']}','\"" . $user['login'] . "\" нашел в Парке " . $priz . " кр. ',1,'" . time() . "');");
//переход //переход
mysql_query("UPDATE `cit_park` SET `room`=0,`bots`='',`time`='".time()."' WHERE `id` ='{$user['id']}'; "); mysql_query("UPDATE `cit_park` SET `room`=0,`bots`='',`time`='" . time() . "' WHERE `id` ='{$user['id']}'; ");
} }
if($in_park['counter']>=3) if ($in_park['counter'] >= 3) {
echo('<tr><td>По какому-то странному совпадению Вам не хочется идти в парк. Может, подождать до завтра? </td></tr>'); echo '<tr><td>По какому-то странному совпадению Вам не хочется идти в парк. Может, подождать до завтра? </td></tr>';
elseif(($in_park['time']+3600)>time()) }
{/**/ elseif (($in_park['time'] + 3600) > time()) {
$tm=time(); $tm = time();
$t_wait=round(((3600-$tm+$in_park['time'])/60),1); $t_wait = round(((3600 - $tm + $in_park['time']) / 60), 1);
echo('<tr><td>Вы совсем недавно вернулись из парка, бесполезно идти туда снова. <br/>(Осталось ждать: <strong>'.$t_wait.'</strong> мин.)</td></tr>'); echo '<tr><td>Вы совсем недавно вернулись из парка, бесполезно идти туда снова. <br/>(Осталось ждать: <strong>' . $t_wait . '</strong> мин.)</td></tr>';
} else {
echo '<tr><td><FORM action="c_park.php" method=POST><INPUT TYPE="submit" value="Прогуляться" name="start_raid"><br></FORM></td></tr>';
} }
else
echo('<tr><td><FORM action="c_park.php" method=POST><INPUT TYPE="submit" value="Прогуляться" name="start_raid"><br></FORM></td></tr>');
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="ps"></FORM></td></tr>'; echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="ps"></FORM></td></tr>';
} } else {
else echo '<tr><td>Вы видите табличку с названием улицы: <strong>' . $ch_rooms[$in_park['room']] . '</strong></td></tr>';
{ echo '<tr><td>В парке пустынно и темно, только какие-то подозрительные личности шныряют по своим делам.</td></tr>';
echo('<tr><td>Вы видите табличку с названием улицы: <strong>'.$ch_rooms[$in_park['room']].'</strong></td></tr>'); echo '<tr><td>Вы видите несколько бандитов. Они замышляют зловещие преступления в городе!</td></tr>';
echo('<tr><td>В парке пустынно и темно, только какие-то подозрительные личности шныряют по своим делам.</td></tr>'); echo '<tr><td><FORM action="c_park.php" method=POST><INPUT TYPE="submit" value="Напасть" name="attack"><br></FORM></td></tr>';
echo('<tr><td>Вы видите несколько бандитов. Они замышляют зловещие преступления в городе!</td></tr>'); }
echo('<tr><td><FORM action="c_park.php" method=POST><INPUT TYPE="submit" value="Напасть" name="attack"><br></FORM></td></tr>'); ?>
}
?>
</table> </table>
<div align=right><img width="260" src="i/park/<?php echo($in_park['room']+1); ?>.jpg" /></div> <div align=right><img width="260" src="i/park/<?php echo($in_park['room'] + 1); ?>.jpg"/></div>
<?php
?>
</BODY>
</HTML>

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<? <?php
if ($user['room'] == 403) { if ($user->room == 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] = "";
@ -320,7 +320,7 @@ if ($user['room'] == 403) {
$s .= '<div style="position:absolute; left:165px; top:115px;"><img src="labirint3/zel.gif" width="50" border="0" height="50" alt="Зелье"></div>'; $s .= '<div style="position:absolute; left:165px; top:115px;"><img src="labirint3/zel.gif" width="50" border="0" height="50" alt="Зелье"></div>';
} }
if (($repa["n$mesto"] == '11.1' or $repa["n$mesto"] == '11.0') and $vector == $repa["v$mesto"]) { if (($repa["n$mesto"] == '11.1' or $repa["n$mesto"] == '11.0') and $vector == $repa["v$mesto"]) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:180px; top:165px;"><img src="labirint3/1/kanal.gif" width="40" height="40" border="0" alt="Водосток" style="CURSOR:pointer;" onClick="stok(' . $mesto . ');"></div>'; $s .= '<div onmouseout="closeMenu();" style="position:absolute; left:180px; top:165px;"><img src="labirint3/1/kanal.gif" width="40" height="40" border="0" alt="Водосток" style="CURSOR:pointer;" onClick="stok(' . $mesto . ')"></div>';
} }
if (($repa["n$loc2"] == '11.1' or $repa["n$loc2"] == '11.0') and $vector == $repa["v$loc2"]) { if (($repa["n$loc2"] == '11.1' or $repa["n$loc2"] == '11.0') and $vector == $repa["v$loc2"]) {
$s .= '<div style="position:absolute; left:180px; top:140px;"><img src="labirint3/1/kanal.gif" width="25" height="25" border="0" alt="Водосток"></div>'; $s .= '<div style="position:absolute; left:180px; top:140px;"><img src="labirint3/1/kanal.gif" width="25" height="25" border="0" alt="Водосток"></div>';
@ -333,7 +333,7 @@ if ($user['room'] == 403) {
} }
///////////// /////////////
if (($repa["n$loc2"] == '12.1' or $repa["n$loc2"] == '12.0') and $vector == $repa["v$loc2"]) { if (($repa["n$loc2"] == '12.1' or $repa["n$loc2"] == '12.0') and $vector == $repa["v$loc2"]) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:160px; top:170px;"><img src="labirint3/1/stok.gif" width="60" height="15" border="0" alt="Водосток" style="CURSOR:pointer;" onClick="stok2(' . $loc2 . ');"></div>'; $s .= '<div onmouseout="closeMenu();" style="position:absolute; left:160px; top:170px;"><img src="labirint3/1/stok.gif" width="60" height="15" border="0" alt="Водосток" style="CURSOR:pointer;" onClick="stok2(' . $loc2 . ')"></div>';
} }
if (($repa["n$loc3"] == '12.1' or $repa["n$loc3"] == '12.0') and $vector == $repa["v$loc3"]) { if (($repa["n$loc3"] == '12.1' or $repa["n$loc3"] == '12.0') and $vector == $repa["v$loc3"]) {
$s .= '<div style="position:absolute; left:175px; top:150px;"><img src="labirint3/1/stok.gif" width="40" height="8" border="0" alt="Водосток"></div>'; $s .= '<div style="position:absolute; left:175px; top:150px;"><img src="labirint3/1/stok.gif" width="40" height="8" border="0" alt="Водосток"></div>';
@ -373,7 +373,7 @@ if ($user['room'] == 403) {
$nomers = '10'; $nomers = '10';
} }
if (($repa["n$mesto"] == 'key1' or $repa["n$mesto"] == 'key2' or $repa["n$mesto"] == 'key3' or $repa["n$mesto"] == 'key4' or $repa["n$mesto"] == 'key5' or $repa["n$mesto"] == 'key6' or $repa["n$mesto"] == 'key7' or $repa["n$mesto"] == 'key8' or $repa["n$mesto"] == 'key9' or $repa["n$mesto"] == 'key10') and $vector == $repa["v$mesto"]) { if (($repa["n$mesto"] == 'key1' or $repa["n$mesto"] == 'key2' or $repa["n$mesto"] == 'key3' or $repa["n$mesto"] == 'key4' or $repa["n$mesto"] == 'key5' or $repa["n$mesto"] == 'key6' or $repa["n$mesto"] == 'key7' or $repa["n$mesto"] == 'key8' or $repa["n$mesto"] == 'key9' or $repa["n$mesto"] == 'key10') and $vector == $repa["v$mesto"]) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:160px; top:165px;"><img src="labirint3/' . $repa["n$mesto"] . '.gif" width="60" height="60" border="0" alt="Ключ №' . $nomers . '" style="CURSOR:pointer;" onClick="key(' . $mesto . ',' . $nomers . ');"></div>'; $s .= '<div onmouseout="closeMenu();" style="position:absolute; left:160px; top:165px;"><img src="labirint3/' . $repa["n$mesto"] . '.gif" width="60" height="60" border="0" alt="Ключ №' . $nomers . '" style="CURSOR:pointer;" onClick="key(' . $mesto . ',' . $nomers . ')"></div>';
} }
if (($repa["n$loc2"] == 'key1' or $repa["n$loc2"] == 'key2' or $repa["n$loc2"] == 'key3' or $repa["n$loc2"] == 'key4' or $repa["n$loc2"] == 'key5' or $repa["n$loc2"] == 'key6' or $repa["n$loc2"] == 'key7' or $repa["n$loc2"] == 'key8' or $repa["n$loc2"] == 'key9' or $repa["n$loc2"] == 'key10') and $vector == $repa["v$loc2"]) { if (($repa["n$loc2"] == 'key1' or $repa["n$loc2"] == 'key2' or $repa["n$loc2"] == 'key3' or $repa["n$loc2"] == 'key4' or $repa["n$loc2"] == 'key5' or $repa["n$loc2"] == 'key6' or $repa["n$loc2"] == 'key7' or $repa["n$loc2"] == 'key8' or $repa["n$loc2"] == 'key9' or $repa["n$loc2"] == 'key10') and $vector == $repa["v$loc2"]) {
$s .= '<div style="position:absolute; left:175px; top:140px;"><img src="labirint3/' . $repa["n$loc2"] . '.gif" width="40" height="40" border="0" alt="Ключ №' . $nomers . '"></div>'; $s .= '<div style="position:absolute; left:175px; top:140px;"><img src="labirint3/' . $repa["n$loc2"] . '.gif" width="40" height="40" border="0" alt="Ключ №' . $nomers . '"></div>';
@ -539,10 +539,10 @@ if ($user['room'] == 403) {
} }
/////////////////////////////////////////// ///////////////////////////////////////////
if ($step1['fwd'] and ($repa["n$loc2"] == '13.1' or $repa["n$loc2"] == '13.0')) { if ($step1['fwd'] and ($repa["n$loc2"] == '13.1' or $repa["n$loc2"] == '13.0')) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:155px; top:130px;"><img src="labirint3/sun.gif" width="60" height="60" border="0" alt="Сундук" style="CURSOR:pointer;" onClick="sunduk(' . $loc2 . ');"></div>'; $s .= '<div onmouseout="closeMenu();" style="position:absolute; left:155px; top:130px;"><img src="labirint3/sun.gif" width="60" height="60" border="0" alt="Сундук" style="CURSOR:pointer;" onClick="sunduk(' . $loc2 . ')"></div>';
} }
if ($step1['fwd'] and ($repa["n$loc2"] == '14.1' or $repa["n$loc2"] == '14.0')) { if ($step1['fwd'] and ($repa["n$loc2"] == '14.1' or $repa["n$loc2"] == '14.0')) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:155px; top:130px;"><img src="labirint3/2.gif" width="60" height="60" border="0" alt="Сундук" style="CURSOR:pointer;" onClick="sunduk2(' . $loc2 . ');"></div>'; $s .= '<div onmouseout="closeMenu();" style="position:absolute; left:155px; top:130px;"><img src="labirint3/2.gif" width="60" height="60" border="0" alt="Сундук" style="CURSOR:pointer;" onClick="sunduk2(' . $loc2 . ')"></div>';
} }
/////////////////////1///////////////////// /////////////////////1/////////////////////
@ -550,20 +550,20 @@ if ($user['room'] == 403) {
if ($k_b2 == '1') { if ($k_b2 == '1') {
if ($rt["n$loc2"] == '8') { if ($rt["n$loc2"] == '8') {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:135px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="Opendialog(' . $loc2 . ',event);"></div>'; $s .= '<div onmouseover="closeMenu();" style="position:absolute; left:135px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="Opendialog(' . $loc2 . ',event)"></div>';
} else { } else {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:135px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>'; $s .= '<div onmouseover="closeMenu();" style="position:absolute; left:135px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
} }
} }
if ($k_b2 == '2') { if ($k_b2 == '2') {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:90px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>'; $s .= '<div onmouseover="closeMenu();" style="position:absolute; left:90px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:180px; top:40px;"><img src="labirint3/' . $ob22 . '.gif" width="100" height="160" title=' . $b_n22 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>'; $s .= '<div onmouseover="closeMenu();" style="position:absolute; left:180px; top:40px;"><img src="labirint3/' . $ob22 . '.gif" width="100" height="160" title=' . $b_n22 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
} }
if ($k_b2 == '3') { if ($k_b2 == '3') {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:80px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>'; $s .= '<div onmouseover="closeMenu();" style="position:absolute; left:80px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:195px; top:40px;"><img src="labirint3/' . $ob23 . '.gif" width="100" height="160" title=' . $b_n23 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>'; $s .= '<div onmouseover="closeMenu();" style="position:absolute; left:195px; top:40px;"><img src="labirint3/' . $ob23 . '.gif" width="100" height="160" title=' . $b_n23 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:140px; top:60px;"><img src="labirint3/' . $ob22 . '.gif" width="100" height="160" title=' . $b_n22 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>'; $s .= '<div onmouseover="closeMenu();" style="position:absolute; left:140px; top:60px;"><img src="labirint3/' . $ob22 . '.gif" width="100" height="160" title=' . $b_n22 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
} }
} }

111
cave.php
View File

@ -207,11 +207,11 @@ function redirectbyroom($r)
{ {
if (in_array($r, Config::$canalenters)) { if (in_array($r, Config::$canalenters)) {
header("location: enter_cave.php"); header("location: enter_cave.php");
die(); exit;
} }
if ($r == 1) { if ($r == 1) {
header("location: main.php"); header("location: main.php");
die(); exit;
} }
} }
@ -229,7 +229,7 @@ if ($user["login"] == "Rallo Tabs") {
if ($user['battle'] > 0) { if ($user['battle'] > 0) {
header("location: fbattle.php"); header("location: fbattle.php");
die(); exit;
} }
$objsizes = [0 => [0, 0], 1 => [120, 60], 2 => [120, 60], 3 => [120, 60], 4 => [110, 72], 5 => [120, 120]]; $objsizes = [0 => [0, 0], 1 => [120, 60], 2 => [120, 60], 3 => [120, 60], 4 => [110, 72], 5 => [120, 120]];
@ -288,15 +288,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->room]['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->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 `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->room]['x' . $floor];
$y = $cavedata[$user['room']]['y' . $floor]; $y = $cavedata[$user->room]['y' . $floor];
$dir = $cavedata[$user['room']]['dir' . $floor]; $dir = $cavedata[$user->room]['dir' . $floor];
updparties(); updparties();
$loses++; $loses++;
} }
@ -447,9 +447,9 @@ function getcavedata($caveleader, $floor)
return unserialize(implode("", file("cavedata/$caveleader-$floor.dat"))); return unserialize(implode("", file("cavedata/$caveleader-$floor.dat")));
} }
if (!in_array($user['room'], Config::$caverooms)) { if (!in_array($user->room, Config::$caverooms)) {
header("Location: main.php"); header("Location: main.php");
die('Not in this life ...'); exit('Not in this life ...');
} }
if (isset($_GET['direction'])) { if (isset($_GET['direction'])) {
@ -472,7 +472,7 @@ while ($rec = mysql_fetch_assoc($r)) {
$party[] = $rec; $party[] = $rec;
} }
if ($user['room'] == 621) { if ($user->room == 621) {
$base = "/underdesigns/alchcave"; $base = "/underdesigns/alchcave";
} }
@ -535,7 +535,7 @@ if (@$_GET['useitem'] || @$_GET['usewallitem']) {
loadmap(); loadmap();
if (@$_GET['useitem']) { if ($_GET['useitem']) {
if ($dir == 0) { if ($dir == 0) {
$tx = $x - 1; $tx = $x - 1;
$ty = $y; $ty = $y;
@ -553,8 +553,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->room.php")) {
include "underground/objects/$user[room].php"; include "underground/objects/$user->room.php";
} }
} }
@ -650,7 +650,7 @@ if ($wander && !isset($_GET['attack'])) {
$ty = $v['y'] + 2; $ty = $v['y'] + 2;
} }
if ($user['room'] == 74 || $user['room'] == 76) { if ($user->room == 74 || $user->room == 76) {
if (strpos($map[$ty][$tx], 's/') !== false && !@$mapbots[$ty][$tx]) { if (strpos($map[$ty][$tx], 's/') !== false && !@$mapbots[$ty][$tx]) {
break; break;
} }
@ -718,8 +718,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->room.php")) {
include("underground/events/$user[room].php"); include("underground/events/$user->room.php");
} }
} }
@ -744,7 +744,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->room]['x' . $floor] == $x && $cavedata[$user->room]['y' . $floor] == $y)) {
if ($ax < $x) { if ($ax < $x) {
$dir1 = 0; $dir1 = 0;
} elseif ($ax > $x) { } elseif ($ax > $x) {
@ -818,12 +818,12 @@ if (@$_GET['speak']) {
$tmp = explode("/", $cell); $tmp = explode("/", $cell);
if ($tmp[0] == "d") { if ($tmp[0] == "d") {
header("location: dialog.php?char=$tmp[2]"); header("location: dialog.php?char=$tmp[2]");
die(); exit;
} }
if ($tmp[0] == "b" && isset($dialogs[CaveBots::$bots[$tmp[1]]])) { if ($tmp[0] == "b" && isset($dialogs[CaveBots::$bots[$tmp[1]]])) {
header("location: dialog.php?char=" . CaveBots::$bots[$tmp[1]]); header("location: dialog.php?char=" . CaveBots::$bots[$tmp[1]]);
die(); exit;
} }
} }
@ -908,28 +908,15 @@ 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->room - 1);
} }
$standingon = $map[$y * 2][$x * 2]; $standingon = $map[$y * 2][$x * 2];
foreach ($party as $k => $v) { foreach ($party as $k => $v) {
$map[$v['y'] * 2][$v['x'] * 2] = "u/" . $v['user']; $map[$v['y'] * 2][$v['x'] * 2] = "u/" . $v['user'];
} }
Template::header('cave');
?> ?>
<head>
<script LANGUAGE='JavaScript'>
document.ondragstart = test;
//запрет на перетаскивание
document.onselectstart = test;
//запрет на выделение элементов страницы
document.oncontextmenu = test;
//запрет на выведение контекстного меню
function test() {
return false
}
</SCRIPT>
<link rel=stylesheet type="text/css" href="/i/main.css">
<style> <style>
body { body {
font-family: Verdana, Arial, Helvetica, sans-serif; font-family: Verdana, Arial, Helvetica, sans-serif;
@ -955,7 +942,7 @@ foreach ($party as $k => $v) {
background-color: #484848; background-color: #484848;
color: #000000; color: #000000;
display: block; display: block;
font-family: Verdana, Arial; font-family: Verdana, Arial, serif;
font-size: 8pt; font-size: 8pt;
font-weight: bold; font-weight: bold;
padding: 2px 12px 2px 8px; padding: 2px 12px 2px 8px;
@ -1332,36 +1319,7 @@ foreach ($party as $k => $v) {
el2.style.top = posy + 33 + "px"; el2.style.top = posy + 33 + "px";
el2.style.visibility = "visible"; el2.style.visibility = "visible";
} }
var delay = 30, TimerOn = -1, tkHP, maxHP, speed = 300, stLen = 185, redHP = 0.33, yellowHP = 0.66;
function setHP(a, b, c) {
tkHP = a;
maxHP = b;
TimerOn >= 0 && (clearTimeout(TimerOn), TimerOn = -1);
speed = c;
setHPlocal()
}
function setHPlocal() {
tkHP > maxHP && (tkHP = maxHP);
var a = Math.round(tkHP) + "/" + maxHP, a = stLen - (a.length + 2) * 7,
b = Math.round((a - 1) / maxHP * tkHP);
a -= b;
HP = document.getElementById("hp_value");
HP1 = document.getElementById("HP1");
HP2 = document.getElementById("HP2");
if (HP) HP1.width = b, HP2.width = a, HP1.src = tkHP / maxHP < redHP ? "i/1red.gif" : tkHP / maxHP < yellowHP ? "i/1yellow.gif" : "i/1green.gif",
HP.innerHTML = Math.round(tkHP) + "/" + maxHP;
tkHP += maxHP / 60 / 20 * (speed / 100);
TimerOn = tkHP < maxHP ? setTimeout("setHPlocal()", delay * 100) : -1
}
setHP(<?=$user['hp'];?>, <?=$user['maxhp'];?>, 100);
</script> </script>
</head>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor="#d7d7d7"
style=" background-image: url(/i/bagr.gif); width=100%; background-repeat:repeat;background-position:top">
<div id=hint3 class=ahint></div> <div id=hint3 class=ahint></div>
<div style="z-index: 100; background-color: #E4F2DF; border-style: solid; border-width: 2px; border-color: #77c3fc; position: absolute; left: 0; top: 0; visibility: hidden; cursor:pointer;" <div style="z-index: 100; background-color: #E4F2DF; border-style: solid; border-width: 2px; border-color: #77c3fc; position: absolute; left: 0; top: 0; visibility: hidden; cursor:pointer;"
id="oMenu"></div> id="oMenu"></div>
@ -1372,10 +1330,11 @@ foreach ($party as $k => $v) {
if ($user['hp'] <= 0) { if ($user['hp'] <= 0) {
makedeath(); makedeath();
} }
$botNames = CaveBots::$botnames;
$botIds = CaveBots::$bots;
function drawmap($map1, $players, $x, $y, $direction) function drawmap($map1, $players, $x, $y, $direction)
{ {
global $base, $user, CaveBots::$botnames, $imgdata; global $base, $user, $botNames, $imgdata;
$startx = max($x * 2 - 8, 0); $startx = max($x * 2 - 8, 0);
$starty = max($y * 2 - 8, 0); $starty = max($y * 2 - 8, 0);
@ -1473,7 +1432,7 @@ function drawmap($map1, $players, $x, $y, $direction)
function drawbot($cell, $x, $y) function drawbot($cell, $x, $y)
{ {
global CaveBots::$botnames, $imgdata, CaveBots::$bots, $dialogs, $user, $floor; global $botNames, $imgdata, $botIds, $dialogs, $user, $floor;
$data = explode("/", $cell); $data = explode("/", $cell);
$i = 1; $i = 1;
$bc = (count($data) - 1) / 2; $bc = (count($data) - 1) / 2;
@ -1517,9 +1476,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->room;
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->room == 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)) . ";" : "") . "\" />";
@ -1544,7 +1503,7 @@ function drawmap($map1, $players, $x, $y, $direction)
function drawuser($cell, $x, $y) function drawuser($cell, $x, $y)
{ {
global CaveBots::$botnames, $imgdata, $party; global $botNames, $imgdata, $party;
$data = explode("/", $cell); $data = explode("/", $cell);
$i = 1; $i = 1;
$bc = (count($data) - 1); $bc = (count($data) - 1);
@ -1609,7 +1568,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->room;
if (!isset($imgmap[$obj])) { if (!isset($imgmap[$obj])) {
$ret .= " $ret .= "
@ -1654,7 +1613,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->room;
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\">" : "") . "
@ -1815,7 +1774,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->room == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82
$ret .= drawobject('//' . $objInWall[2], 3, $i); $ret .= drawobject('//' . $objInWall[2], 3, $i);
} }
} }
@ -2038,10 +1997,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->room - 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->room == 621) {
if ($floor == 1) { if ($floor == 1) {
echo 'Проклятый Рудник, 1 этаж'; echo 'Проклятый Рудник, 1 этаж';
} elseif ($floor == 2) { } elseif ($floor == 2) {

59
ch.php

File diff suppressed because one or more lines are too long

View File

@ -11,13 +11,13 @@ if (empty($_SESSION['uid'])) {
exit; exit;
} }
require_once "config.php"; require_once "config.php";
//include_once "functions.php";
$msg = $_POST['msg'] ?? null; $msg = $_POST['msg'] ?? null;
$uid = $_SESSION['uid']; $uid = $_SESSION['uid'] ?? null;
if ($msg) { if ($msg) {
try { db::c()->query('INSERT INTO `chat` (`user_id`, `msg`) VALUES (?i, "?s")', $uid, $msg); } try {
catch (\Krugozor\Database\Mysql\Exception $e) { db::c()->query('INSERT INTO `chat` (`user_id`, `msg`) VALUES (?i, "?s")', $uid, $msg);
} catch (\Krugozor\Database\Mysql\Exception $e) {
echo "<div style='background-color: #ffaaaa;'>Ошибка: " . $e->getMessage() . "<br> В файле: " . $e->getFile() . " (" . $e->getLine() . ")</div>"; echo "<div style='background-color: #ffaaaa;'>Ошибка: " . $e->getMessage() . "<br> В файле: " . $e->getFile() . " (" . $e->getLine() . ")</div>";
} }
} }
@ -50,24 +50,33 @@ function show_messages()
show_messages(); show_messages();
Template::header('chat');
?> ?>
<!doctype html> <style>
<html> form {
<head> padding: 3px;
<meta charset="utf-8"> position: fixed;
<link rel="stylesheet" href="css/main.css"> bottom: 0;
<style> width: 100%;
form { padding: 3px; position: fixed; bottom: 0; width: 100%; } }
form input { border: 0; padding: 10px; width: 80%; margin-right: .5%; }
form input[type="submit"] { width: 15%; border: none; padding: 10px; } form input {
</style> border: 0;
</head> padding: 10px;
<body> width: 80%;
margin-right: .5%;
}
form input[type="submit"] {
width: 15%;
border: none;
padding: 10px;
}
</style>
<div> <div>
<?php ?> <?php ?>
</div> </div>
<form action="chat.php" method="post"> <form action="chat.php" method="post">
<input id="msg" name="msg" size="100" placeholder="Введите сообщение..."> <input id="msg" name="msg" size="100" placeholder="Введите сообщение...">
<input type="submit" value="Отправить"> <input type="submit" value="Отправить">
</form> </form>
</body>

View File

@ -33,13 +33,13 @@ 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->room);
} }
} 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->room);
} }
} else { } else {
die(); exit;
} }

View File

@ -3,10 +3,11 @@
* Центральная площадь * Центральная площадь
*/ */
session_start(); session_start();
if ($_SESSION['uid'] == null) { if (empty($_SESSION['uid'])) {
header("Location: index.php"); header("Location: index.php");
exit; exit;
} }
require_once "functions.php"; require_once "functions.php";
$user = $user ?? []; $user = $user ?? [];
$tm = time(); $tm = time();
@ -72,11 +73,11 @@ switch ($location[0]) {
move(2702, 'city.php'); move(2702, 'city.php');
break; break;
case 'got': case 'got':
if ($user['room'] == 20) { if ($user->room == 20) {
switch ($location[1]) { switch ($location[1]) {
case 'level1': case 'level1':
header('location: main.php?goto=arena'); header('location: main.php?goto=arena');
die(); exit;
break; break;
case 'level7': case 'level7':
header('location: city.php?strah'); header('location: city.php?strah');
@ -106,7 +107,7 @@ switch ($location[0]) {
move(25, 'comission.php'); move(25, 'comission.php');
break; break;
} }
} elseif ($user['room'] == 21) { } elseif ($user->room == 21) {
switch ($location[1]) { switch ($location[1]) {
case 'level4': case 'level4':
header('location: city.php?cp'); header('location: city.php?cp');
@ -130,7 +131,7 @@ switch ($location[0]) {
move(650, 'ul_clans.php'); move(650, 'ul_clans.php');
break; break;
} }
} elseif ($user['room'] == 2111) { } elseif ($user->room == 2111) {
switch ($location[1]) { switch ($location[1]) {
case 'level1': case 'level1':
header('location: city.php?strah'); header('location: city.php?strah');
@ -148,7 +149,7 @@ switch ($location[0]) {
move(666, 'jail.php'); move(666, 'jail.php');
break; break;
} }
} elseif ($user['room'] == 2601) { } elseif ($user->room == 2601) {
switch ($location[1]) { switch ($location[1]) {
case 'level4': case 'level4':
header('location: city.php?bps'); header('location: city.php?bps');
@ -166,7 +167,7 @@ switch ($location[0]) {
move(404, 'vxod.php'); move(404, 'vxod.php');
break; break;
} }
} elseif ($user['room'] == 2701) { } elseif ($user->room == 2701) {
switch ($location[1]) { switch ($location[1]) {
case 'level1': case 'level1':
header('location: city.php?zaliv'); header('location: city.php?zaliv');
@ -175,7 +176,7 @@ switch ($location[0]) {
move(402, 'lab_chaos_enter.php'); move(402, 'lab_chaos_enter.php');
break; break;
} }
} elseif ($user['room'] == 2702) { } elseif ($user->room == 2702) {
switch ($location[1]) { switch ($location[1]) {
case 'level10': case 'level10':
header('location: city.php?cp'); header('location: city.php?cp');
@ -184,7 +185,7 @@ switch ($location[0]) {
move(61, 'akadem.php'); move(61, 'akadem.php');
break; break;
} }
} elseif ($user['room'] == 2655) { } elseif ($user->room == 2655) {
switch ($location[1]) { switch ($location[1]) {
case 'level10': case 'level10':
header('location: city.php?zamk'); header('location: city.php?zamk');
@ -193,7 +194,7 @@ switch ($location[0]) {
move(603, 'aren_of_angels.php'); move(603, 'aren_of_angels.php');
break; break;
} }
} elseif ($user['room'] == 26) { } elseif ($user->room == 26) {
switch ($location[1]) { switch ($location[1]) {
case 'level4': case 'level4':
header('location: city.php?cp'); header('location: city.php?cp');
@ -255,12 +256,8 @@ function bgset($img)
} }
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60)); $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
Template::header('city');
?> ?>
<!doctype html>
<html lang="ru">
<HEAD>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8">
<style> <style>
img.building:hover { img.building:hover {
filter: drop-shadow(2px 2px 2px white) sepia(15%); filter: drop-shadow(2px 2px 2px white) sepia(15%);
@ -278,9 +275,6 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
document.onmousedown = Down; document.onmousedown = Down;
</script> </script>
<title></title>
</HEAD>
<body>
<table class="allzeroes"> <table class="allzeroes">
<TR> <TR>
<TD align=center></TD> <TD align=center></TD>
@ -289,7 +283,7 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
<TR> <TR>
<TD align=center colspan=2> <TD align=center colspan=2>
<?php <?php
if ($user['room'] == 20) { if ($user->room == 20) {
bgset('cap_cp'); bgset('cap_cp');
buildset(1, "cap_club", 30, 235, "Бойцовский Клуб"); buildset(1, "cap_club", 30, 235, "Бойцовский Клуб");
buildset(2, "cap_shop", 202, 171, "Магазин"); buildset(2, "cap_shop", 202, 171, "Магазин");
@ -304,7 +298,7 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
buildset(9, "cap_tree2", 260, 530, "Новогодняя елка"); buildset(9, "cap_tree2", 260, 530, "Новогодняя елка");
buildset(14, "cap_sneg_3", 210, 390, "Снеговик"); buildset(14, "cap_sneg_3", 210, 390, "Снеговик");
echo "</div>"; echo "</div>";
} elseif ($user['room'] == 21) { } elseif ($user->room == 21) {
bgset('cap_strash'); bgset('cap_strash');
buildset(5, "cap_bank", 180, 485, "Банк"); buildset(5, "cap_bank", 180, 485, "Банк");
buildset(14, "cap_registratura", 170, 113, "Регистратура кланов"); buildset(14, "cap_registratura", 170, 113, "Регистратура кланов");
@ -314,14 +308,14 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
buildset(13, "cap_flowershop", 220, 613, "Цветочный магазин"); buildset(13, "cap_flowershop", 220, 613, "Цветочный магазин");
buildset(4, "cap_arr_left", 258, 21, "Центральная площадь", 1); buildset(4, "cap_arr_left", 258, 21, "Центральная площадь", 1);
echo "</div>"; echo "</div>";
} elseif ($user['room'] == 26) { } elseif ($user->room == 26) {
bgset('cap_park'); bgset('cap_park');
buildset(6, "cap_gate", 170, 340, "Городские ворота", 1); buildset(6, "cap_gate", 170, 340, "Городские ворота", 1);
buildset(660, "cap_vokzal", 163, 43, "Общежитие"); buildset(660, "cap_vokzal", 163, 43, "Общежитие");
buildset(3, "cap_arr_left", 259, 27, "Замковая площадь", 1); buildset(3, "cap_arr_left", 259, 27, "Замковая площадь", 1);
buildset(4, "cap_arr_right", 259, 715, "Центральная площадь", 1); buildset(4, "cap_arr_right", 259, 715, "Центральная площадь", 1);
echo "</div>"; echo "</div>";
} elseif ($user['room'] == 2601) { } elseif ($user->room == 2601) {
bgset('cap_zamk'); bgset('cap_zamk');
buildset(1052, "cap_lavka", 240, 425, "Храмовая лавка"); buildset(1052, "cap_lavka", 240, 425, "Храмовая лавка");
buildset(10, "ava_post", 240, 300, "Сувенирный магазинчик", 1); buildset(10, "ava_post", 240, 300, "Сувенирный магазинчик", 1);
@ -330,12 +324,12 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
buildset(55, "cap_arr_left", 258, 21, "Арена Богов", 1); buildset(55, "cap_arr_left", 258, 21, "Арена Богов", 1);
buildset(4, "cap_arr_right", 260, 710, "Большая парковая улица", 1); buildset(4, "cap_arr_right", 260, 710, "Большая парковая улица", 1);
echo "</div>"; echo "</div>";
} elseif ($user['room'] == 2655) { } elseif ($user->room == 2655) {
bgset('ar_e_n'); bgset('ar_e_n');
buildset(2055, "cap_altr_g", 230, 340, "Арена Ангелов"); buildset(2055, "cap_altr_g", 230, 340, "Арена Ангелов");
buildset(10, "arr_right_png", 260, 710, "Замковая площадь", 1); buildset(10, "arr_right_png", 260, 710, "Замковая площадь", 1);
echo "</div>"; echo "</div>";
} elseif ($user['room'] == 2111) { } elseif ($user->room == 2111) {
bgset('rist_bg'); bgset('rist_bg');
buildset(1, "cap_arr_uleft", 240, 30, "Страшилкина Улица", 1); buildset(1, "cap_arr_uleft", 240, 30, "Страшилкина Улица", 1);
buildset(2, "cap_arr_right", 245, 708, "Секретный Лабиринт", 1); buildset(2, "cap_arr_right", 245, 708, "Секретный Лабиринт", 1);
@ -345,12 +339,12 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
buildset(203, "cap_rist_monstr", 145, 570, "Вход в Груповые сражения"); buildset(203, "cap_rist_monstr", 145, 570, "Вход в Груповые сражения");
buildset(21, "angelscastle", 131, 628, "Замок Мэра Города"); buildset(21, "angelscastle", 131, 628, "Замок Мэра Города");
echo "</div>"; echo "</div>";
} elseif ($user['room'] == 2701) { } elseif ($user->room == 2701) {
bgset('arena_bg1'); bgset('arena_bg1');
buildset(1, "cap_3strelka", 260, 30, "Берег Залива"); buildset(1, "cap_3strelka", 260, 30, "Берег Залива");
buildset(2, "cap_shar_dark", 234, 356, "Лабиринт Хаоса"); buildset(2, "cap_shar_dark", 234, 356, "Лабиринт Хаоса");
echo "</div>"; echo "</div>";
} elseif ($user['room'] == 2702) { } elseif ($user->room == 2702) {
bgset('cap_torg'); bgset('cap_torg');
buildset(6, "cap_arenda", 175, 70, "Академия"); buildset(6, "cap_arenda", 175, 70, "Академия");
buildset(16, "cap_t_build42", 120, 300, "Аукцион"); buildset(16, "cap_t_build42", 120, 300, "Аукцион");
@ -363,5 +357,3 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
</td> </td>
</tr> </tr>
</table> </table>
</body>
</html>

View File

@ -3,10 +3,11 @@ ob_start("ob_gzhandler");
session_start(); session_start();
if (empty($_SESSION['uid'])) { if (empty($_SESSION['uid'])) {
header("Location: index.php"); header("Location: index.php");
exit;
} }
include_once 'functions.php'; include_once 'functions.php';
if (!$user->clan) { if (!$user->clan) {
die(err('Вы не состоите в клане!')); exit(err('Вы не состоите в клане!'));
} }
try { try {
$clanRow = db::c()->query('SELECT * FROM `clans` WHERE `id` = ?i', $user->clan)->fetch_assoc(); $clanRow = db::c()->query('SELECT * FROM `clans` WHERE `id` = ?i', $user->clan)->fetch_assoc();
@ -99,15 +100,8 @@ if ($login && $action == 'edit_status') {
} }
$clan_memberlist = db::c()->query('SELECT `id`, `login`, `status`, `level`, `room`, `align`, (select `id` from `online` WHERE `date` >= ?i AND `id` = users.`id`) AS `online` FROM `users` WHERE `klan` = ?i ORDER BY `online` DESC , `login` ASC', (time() - 60), $clanRow['id']); $clan_memberlist = db::c()->query('SELECT `id`, `login`, `status`, `level`, `room`, `align`, (select `id` from `online` WHERE `date` >= ?i AND `id` = users.`id`) AS `online` FROM `users` WHERE `klan` = ?i ORDER BY `online` DESC , `login` ASC', (time() - 60), $clanRow['id']);
Template::header('clan');
?> ?>
<!doctype html>
<html>
<head>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8">
</head>
<body>
<div> <div>
<button onclick="location.href='main.php'">Вернуться</button> <button onclick="location.href='main.php'">Вернуться</button>
<?php if (!empty($status)) {err($status);} ?> <?php if (!empty($status)) {err($status);} ?>
@ -116,7 +110,7 @@ $clan_memberlist = db::c()->query('SELECT `id`, `login`, `status`, `level`, `roo
<tr> <tr>
<td> <td>
<p style="width: 50%; vertical-align: top;" rowspan=2> <p style="width: 50%; vertical-align: top;" rowspan=2>
<h3><img src="./i/clan/<?= $clanRow['short'] ?>.gif"><?= $clanRow['name'] ?></h3> <h3><img src="./i/clan/<?= $clanRow['short'] ?>.png"><?= $clanRow['name'] ?></h3>
Количество рейтинговых очков клана: <span Количество рейтинговых очков клана: <span
style="color: #428f21; font-size: larger;"><?= $clanRow['rating'] ?></span><br> style="color: #428f21; font-size: larger;"><?= $clanRow['rating'] ?></span><br>
@ -237,5 +231,3 @@ $clan_memberlist = db::c()->query('SELECT `id`, `login`, `status`, `level`, `roo
document.getElementById(option).innerHTML = "<form method='post'><input placeholder='Имя персонажа' name='login'><button name='action' value='" + option + "' type='submit'>Ок</button><button>×</button></form>"; document.getElementById(option).innerHTML = "<form method='post'><input placeholder='Имя персонажа' name='login'><button name='action' value='" + option + "' type='submit'>Ок</button><button>×</button></form>";
} }
</script> </script>
</body>
</html>

View File

@ -1,277 +1,272 @@
<?php <?php
session_start(); session_start();
if (!($_SESSION['uid'] >0)) header("Location: index.php"); if (empty($_SESSION['uid'])) {
header("Location: index.php");
include "config.php"; exit;
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$user['id']." AND (type=13 OR type=12 OR type=14) limit 1;"));
$klan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1;"));
include "functions.php";
if ($user['room'] != 45) { header("Location: main.php"); die(); }
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); }
$cc_date=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var`='cc_time' LIMIT 1;"));
$ccd=$cc_date['value'];
if($_POST['admin_start'])
{
$tm=time();
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
die("<script>location.href='clan_castle.php';</script>");
}
if($_POST['admin_start1'])
{
$tm=time()-900;
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
die("<script>location.href='clan_castle.php';</script>");
}
if($_POST['add_zay'])
{
mysql_query("INSERT INTO `clan_castle` VALUES ('{$user['id']}','{$user['klan']}');");
die("<script>location.href='clan_castle.php';</script>");
}
?>
<HTML><HEAD>
<!-- JS -->
<script>
function refreshPeriodic()
{
location.href='clan_castle.php';
timerID=setTimeout("refreshPeriodic()",30000);
}
timerID=setTimeout("refreshPeriodic()",30000);
</script>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#d4d4d4>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<tr><td><h3>Замок Мэра</td></tr>
<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>
<tr><td>Добро пожаловать в Замок доброго и справедливого Мэра!
Если Вы заинтерисованы в обладании правами на Замок, либо считаете что обладаете достаточными способностями для исполнения
обязанностей Мэра, приглашаем Вас и Ваших единомышлеников поселиться в Замке! <br/> <br/>
Внимание! Администрация не несет ответственности за возможные конфликты на основе спора о правах обладания Замком,
целость и сохранность Ваших личных вещей, здоровье и жизни посетителей!<br/>
<?php
$own=mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
if($own['value']>0) $tmp_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$own['value']}' LIMIT 1;"));
echo('<br />Над Замком развевается флаг ');
if($tmp_k['name'])
echo('<strong>клана <img title="'.$tmp_k['name'].'" src="i/clan/'.$tmp_k['name'].'.gif">'.$tmp_k['name'].'</strong><br />');
else
echo('<strong>сил Хаоса</strong><br />');
if($user['align']==2.99) echo('<FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Админ: запустить" name="admin_start"><br></FORM>');
if($user['align']==2.99) echo('<FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Админ: старт боя" name="admin_start1"><br></FORM>');
if($ccd>=time())
{
echo("Следующая битва: ".(date("j.m",$ccd))." в ".(date("H:i",$ccd)));
} }
elseif($ccd<time() && ($ccd+900)>=time())
{ $owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
$zays=array(); $klan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1;"));
echo("Заявили права на Замок Мэра:");
echo('<TABLE border=0 width=100% cellspacing="0" cellpadding="0" align=left>'); include "functions.php";
$all_c=mysql_query("SELECT * FROM `clan_castle`;"); if ($user->room != 45) {
while ($a_zay=mysql_fetch_array($all_c)) header("Location: main.php");
{ exit;
$zays[]=$a_zay['clan']; }
$tmp_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$a_zay['clan']}' LIMIT 1;")); if ($user->battle) {
echo '<tr><td><strong>Клан <img title="'.$tmp_k['name'].'" src="i/clan/'.$tmp_k['name'].'.gif">'.$tmp_k['name'].'</strong></td></tr>'; header('location: fbattle.php');
exit;
}
$cc_date = mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var`='cc_time' LIMIT 1;"));
$ccd = $cc_date['value'];
if ($_POST['admin_start']) {
$tm = time();
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
exit("<script>location.href='clan_castle.php';</script>");
}
if ($_POST['admin_start1']) {
$tm = time() - 900;
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
exit("<script>location.href='clan_castle.php';</script>");
}
if ($_POST['add_zay']) {
mysql_query("INSERT INTO `clan_castle` VALUES ('{$user['id']}','{$user['klan']}');");
exit("<script>location.href='clan_castle.php';</script>");
}
Template::header('Замок Мэра');
?>
<script>
function refreshPeriodic() {
location.href = 'clan_castle.php';
timerID = setTimeout("refreshPeriodic()", 30000);
} }
if(empty($zays))
timerID = setTimeout("refreshPeriodic()", 30000);
</script>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<tr>
<td><h3>Замок Мэра</td>
</tr>
<tr>
<td>
<FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM>
</td>
</tr>
<tr>
<td>Добро пожаловать в Замок доброго и справедливого Мэра!
Если Вы заинтерисованы в обладании правами на Замок, либо считаете что обладаете достаточными способностями
для исполнения
обязанностей Мэра, приглашаем Вас и Ваших единомышлеников поселиться в Замке! <br/> <br/>
Внимание! Администрация не несет ответственности за возможные конфликты на основе спора о правах обладания
Замком,
целость и сохранность Ваших личных вещей, здоровье и жизни посетителей!<br/>
<?php
$own = mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner'"));
if ($own['value'] > 0) {
$tmp_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$own['value']}'"));
}
echo '<br />Над Замком развевается флаг ';
if ($tmp_k['name']) {
echo '<strong>клана <img title="' . $tmp_k['name'] . '" src="i/clan/' . $tmp_k['name'] . '.png">' . $tmp_k['name'] . '</strong><br />';
} else {
echo '<strong>сил Хаоса</strong><br />';
}
if ($user->admin) {
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>';
}
if ($ccd >= time()) {
echo "Следующая битва: " . (date("j.m", $ccd)) . " в " . (date("H:i", $ccd));
} elseif ($ccd < time() && ($ccd + 900) >= time()) {
$zays = [];
echo "Заявили права на Замок Мэра:";
echo '<TABLE border=0 width=100% cellspacing="0" cellpadding="0" align=left>';
$all_c = mysql_query("SELECT * FROM `clan_castle`;");
while ($a_zay = mysql_fetch_array($all_c)) {
$zays[] = $a_zay['clan'];
$tmp_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$a_zay['clan']}' LIMIT 1;"));
echo '<tr><td><strong>Клан <img title="' . $tmp_k['name'] . '" src="i/clan/' . $tmp_k['name'] . '.png">' . $tmp_k['name'] . '</strong></td></tr>';
}
if (empty($zays)) {
echo '<tr><td><strong>Ждем смелых ...</strong></td></tr>'; echo '<tr><td><strong>Ждем смелых ...</strong></td></tr>';
echo('</TABLE>'); }
echo("<br/>Прием заявок до: <strong>".(date("H:i",$ccd+900))."</strong>"); echo '</TABLE>';
echo "<br/>Прием заявок до: <strong>" . (date("H:i", $ccd + 900)) . "</strong>";
$own=mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;")); $own = mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
if ($klan['glava']==$user['id'] && !in_array($user['klan'],$zays) && $user['klan']!=$own['value']) if ($klan['glava'] == $user['id'] && !in_array($user['klan'], $zays) && $user['klan'] != $own['value']) {
{ echo "<br />Прием заявок от глав кланов:";
echo("<br />Прием заявок от глав кланов:");
echo '<tr><td><FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Заявиться" name="add_zay"></FORM></td></tr>'; echo '<tr><td><FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Заявиться" name="add_zay"></FORM></td></tr>';
} }
} } elseif (($ccd + 900) < time() && ($ccd + 90 + 900) >= time()) {
elseif(($ccd+900)<time() && ($ccd+90+900)>=time()) $zays = [];
{ $all_zay = mysql_query("SELECT * FROM `clan_castle`;");
$zays=array(); while ($a_zay = mysql_fetch_array($all_zay)) {
$all_zay=mysql_query("SELECT * FROM `clan_castle`;"); $cur_c = mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `klan`='{$a_zay['clan']}' AND `room`='45';"));
while ($a_zay=mysql_fetch_array($all_zay)) for ($cc = 0; $cc < $cur_c; $cc++) {
{ $zays[] = $a_zay['clan'];
$cur_c=mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `klan`='{$a_zay['clan']}' AND `room`='45';"));
for($cc=0;$cc<$cur_c;$cc++)
$zays[]=$a_zay['clan'];
} }
$own=mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;")); }
$own = mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
shuffle($zays); shuffle($zays);
$lucky=$zays[array_rand($zays)]; $lucky = $zays[array_rand($zays)];
// if($lucky>0 && $lucky!=$own['vlaue']);
mysql_query("UPDATE `variables` SET `value`='{$lucky}' WHERE `var`='castle_att';"); mysql_query("UPDATE `variables` SET `value`='{$lucky}' WHERE `var`='castle_att';");
$tmp_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$lucky}' LIMIT 1;")); $tmp_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$lucky}' LIMIT 1;"));
if($own['value']>0) if ($own['value'] > 0) {
$tmp_o=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$own['value']}' LIMIT 1;")); $tmp_o = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$own['value']}' LIMIT 1;"));
if($tmp_k) echo('Внимание!<img title="'.$tmp_k['name'].'" src="i/clan/'.$tmp_k['name'].'.gif"><strong>'.$tmp_k['name'].'</strong> собираются штурмовать замок');
if($tmp_k && $own['value']>0) echo('<img title="'.$tmp_o['name'].'" src="i/clan/'.$tmp_o['name'].'.gif"><strong>'.$tmp_o['name'].'</strong>!');
if($tmp_k && !$own['value']>0) echo('!');
}
elseif(($ccd+90+900)<=time())
{
$att=mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_att' LIMIT 1;"));
$own=mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
$at_t=array();
$ow_t=array();
if($att['value']>0)
{
$att_r=mysql_query("SELECT `id` FROM `users` WHERE `klan`='{$att['value']}' AND `room`='45';");
while($a=mysql_fetch_array($att_r))
{
$at_on = mysql_fetch_array(mysql_query("select `id` from `online` WHERE `date` >= ".(time()-60)." AND `id` = '{$a['id']}' LIMIT 1;"));
if($at_on[0])
$at_t[]=$a['id'];
} }
if ($tmp_k) {
echo 'Внимание!<img title="' . $tmp_k['name'] . '" src="i/clan/' . $tmp_k['name'] . '.png"><strong>' . $tmp_k['name'] . '</strong> собираются штурмовать замок';
}
if ($tmp_k && $own['value'] > 0) {
echo '<img title="' . $tmp_o['name'] . '" src="i/clan/' . $tmp_o['name'] . '.png"><strong>' . $tmp_o['name'] . '</strong>!';
}
if ($tmp_k && !$own['value'] > 0) {
echo '!';
}
} elseif (($ccd + 90 + 900) <= time()) {
$att = mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_att' LIMIT 1;"));
$own = mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
$at_t = [];
$ow_t = [];
if ($att['value'] > 0) {
$att_r = mysql_query("SELECT `id` FROM `users` WHERE `klan`='{$att['value']}' AND `room`='45';");
while ($a = mysql_fetch_array($att_r)) {
$at_on = mysql_fetch_array(mysql_query("select `id` from `online` WHERE `date` >= " . (time() - 60) . " AND `id` = '{$a['id']}' LIMIT 1;"));
if ($at_on[0]) {
$at_t[] = $a['id'];
}
}
} }
if($own['value']>0) if ($own['value'] > 0) {
{ $def_r = mysql_query("SELECT `id` FROM `users` WHERE `klan`='{$own['value']}' AND `room`='45';");
$def_r=mysql_query("SELECT `id` FROM `users` WHERE `klan`='{$own['value']}' AND `room`='45';"); while ($o = mysql_fetch_array($def_r)) {
while($o=mysql_fetch_array($def_r)) $df_on = mysql_fetch_array(mysql_query("select `id` from `online` WHERE `date` >= " . (time() - 60) . " AND `id` = '{$o['id']}' LIMIT 1;"));
{ if ($df_on[0]) {
$df_on = mysql_fetch_array(mysql_query("select `id` from `online` WHERE `date` >= ".(time()-60)." AND `id` = '{$o['id']}' LIMIT 1;")); $ow_t[] = $o['id'];
if($df_on[0]) }
$ow_t[]=$o['id']; }
} }
} if (empty($at_t)) {
echo "Смелых так и не нашлось...<br/>";
} elseif (empty($ow_t) && ($own['value'] > 0)) {
echo "Хозяева слили замок без боя...<br/>";
$cc_own = mysql_fetch_array(mysql_query("SELECT `value` FROM variables WHERE var='castle_owner' LIMIT 1;"));
$cc_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$cc_own['value']}' LIMIT 1;"));
$cc_att = mysql_fetch_array(mysql_query("SELECT `value` FROM variables WHERE var='castle_att' LIMIT 1;"));
$cc_a = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$cc_att['value']}' LIMIT 1;"));
if(empty($at_t)) AddChatSystem('<font color=red><strong>Клан <img title="' . $cc_a['name'] . '" src="i/clan/' . $cc_a['name'] . '.png">' . $cc_a['name'] . '</strong> без боя забрал у <strong>клана <img title="' . $cc_k['name'] . '" src="i/clan/' . $cc_k['name'] . '.gif">' . $cc_k['name'] . '</strong> Замок Мэра</font>');
{
echo("Смелых так и не нашлось...<br/>");
}
elseif(empty($ow_t) && ($own['value']>0))
{
echo("Хозяева слили замок без боя...<br/>");
$cc_own=mysql_fetch_array(mysql_query("SELECT `value` FROM variables WHERE var='castle_owner' LIMIT 1;"));
$cc_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$cc_own['value']}' LIMIT 1;"));
$cc_att=mysql_fetch_array(mysql_query("SELECT `value` FROM variables WHERE var='castle_att' LIMIT 1;"));
$cc_a=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$cc_att['value']}' LIMIT 1;"));
{AddChatSystem('<font color=red><strong>Клан <img title="'.$cc_a['name'].'" src="i/clan/'.$cc_a['name'].'.gif">'.$cc_a['name'].'</strong> без боя забрал у <strong>клана <img title="'.$cc_k['name'].'" src="i/clan/'.$cc_k['name'].'.gif">'.$cc_k['name'].'</strong> Замок Мэра</font>');}
$c_prev=mysql_fetch_array(mysql_query("SELECT `glava`,`align` FROM `clans` WHERE `id`='{$own['value']}' LIMIT 1;"));
$c_prev = mysql_fetch_array(mysql_query("SELECT `glava`,`align` FROM `clans` WHERE `id`='{$own['value']}' LIMIT 1;"));
mysql_query("UPDATE `users` SET `align`='{$c_prev['align']}',`abil`='' WHERE `id`='{$c_prev['glava']}';"); mysql_query("UPDATE `users` SET `align`='{$c_prev['align']}',`abil`='' WHERE `id`='{$c_prev['glava']}';");
mysql_query("UPDATE `variables` SET `value`='{$att['value']}' WHERE `var`='castle_owner';"); mysql_query("UPDATE `variables` SET `value`='{$att['value']}' WHERE `var`='castle_owner';");
mysql_query("UPDATE `variables` SET `value`='0' WHERE `var`='castle_att';"); mysql_query("UPDATE `variables` SET `value`='0' WHERE `var`='castle_att';");
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';"); mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
$c_lead=mysql_fetch_array(mysql_query("SELECT `glava` FROM `clans` WHERE `id`='{$att['value']}' LIMIT 1;")); $c_lead = mysql_fetch_array(mysql_query("SELECT `glava` FROM `clans` WHERE `id`='{$att['value']}' LIMIT 1;"));
$abil=array(); $abil = [];
for($i=0;$i<10;$i++) $abil[$i]=9; for ($i = 0; $i < 10; $i++) {
mysql_query("UPDATE `users` SET `align`='7.97',`abil`='".serialize($abil)."' WHERE `id`='{$c_lead['glava']}';"); $abil[$i] = 9;
mysql_query("DELETE FROM `clan_castle`");
} }
elseif($own['value']==0) mysql_query("UPDATE `users` SET `align`='7.97',`abil`='" . serialize($abil) . "' WHERE `id`='{$c_lead['glava']}';");
{ mysql_query("DELETE FROM `clan_castle`");
} elseif ($own['value'] == 0) {
//побоище против ботов //побоище против ботов
//ставим ботов //ставим ботов
$bots_raw=array $bots_raw = ["2897", "2897", "2897", "2897", "2897", "2897", "2897", "2897", "2897", "2897", "4150", "4150", "4156", "4156", "4156", "4156",
("2897","2897","2897","2897","2897","2897","2897","2897","2897","2897","4150","4150","4156","4156","4156","4156", "2895", "2895", "4158", "4158", "4158", "4158", "4158", "2900"];
"2895","2895","4158","4158","4158","4158","4158","2900"); $bots = [];
$bots=array(); foreach ($bots_raw as $bot_id) {
foreach($bots_raw as $bot_id) if ($bot_id > 0) {
if($bot_id>0) $b_pers = mysql_fetch_array(mysql_query("SELECT `login`,`maxhp` FROM users WHERE id='{$bot_id}' LIMIT 1;"));
{ $bot_hp = $b_pers['maxhp'];
$b_pers=mysql_fetch_array(mysql_query("SELECT `login`,`maxhp` FROM users WHERE id='{$bot_id}' LIMIT 1;")); $bot_name = $b_pers['login'];
$bot_hp=$b_pers['maxhp']; $nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $bot_name . "%';"));
$bot_name=$b_pers['login']; mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('" . $bot_name . " " . ($nb[0] + 1) . "','" . $bot_id . "','','" . $bot_hp . "');");
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$bot_name."%';")); $bots[] = mysql_insert_id();
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('".$bot_name." ".($nb[0]+1)."','".$bot_id."','','".$bot_hp."');"); }
$bots[]=mysql_insert_id();
} }
//отаке! //отаке!
$teams = [];
$teams = array(); foreach ($at_t as $b) {
foreach($at_t as $b) foreach ($bots as $gf) {
foreach($bots as $gf) $teams[$gf][$b] = [0, 0, time()];
{ $teams[$b][$gf] = [0, 0, time()];
$teams[$gf][$b] = array(0,0,time()); }
$teams[$b][$gf] = array(0,0,time());
} }
mysql_query("INSERT INTO `battle` mysql_query("INSERT INTO `battle`
( (
`id`,`coment`,`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`,`blood` `id`,`coment`,`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`,`blood`
) )
VALUES VALUES
( (
NULL,'','".serialize($teams)."','3','1','0','".implode(";",$at_t)."','".implode(";",$bots)."','".time()."','".time()."','0' NULL,'','" . serialize($teams) . "','3','1','0','" . implode(";", $at_t) . "','" . implode(";", $bots) . "','" . time() . "','" . time() . "','0'
)"); )");
$id = mysql_insert_id(); $id = mysql_insert_id();
// создаем лог // создаем лог
$rr = "<b>"; $rr = "<b>";
foreach( $at_t as $k=>$v ) { foreach ($at_t as $k => $v) {
if ($k!=0) { $rr.=", "; $rrc.=", "; } if ($k != 0) {
$rr .= ", ";
$rrc .= ", ";
}
$rr .= Nick::id($v)->full(1); $rr .= Nick::id($v)->full(1);
$rrc .= Nick::id($v)->short(); $rrc .= Nick::id($v)->short();
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> и <b>";
$rrc .= "</b> и <b>";
foreach ($bots as $k => $v) {
if ($k != 0) {
$rr .= ", ";
$rrc .= ", ";
} }
$rr .= "</b> и <b>"; $rrc .= "</b> и <b>";
foreach( $bots as $k=>$v ) {
if ($k!=0) { $rr.=", "; $rrc.=", ";}
$rr .= Nick::id($v)->full(1); $rr .= Nick::id($v)->full(1);
$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->room);
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>");
$add_time=time(); $add_time = time();
// всех в БОЙ!!! // всех в БОЙ!!!
foreach($at_t as $k=>$v) { foreach ($at_t as $k => $v) {
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}");
} }
foreach($bots as $k=>$v) { foreach ($bots as $k => $v) {
mysql_query("UPDATE `bots` SET `battle` ={$id} WHERE `id`= {$v}"); mysql_query("UPDATE `bots` SET `battle` ={$id} WHERE `id`= {$v}");
} }
mysql_query("DELETE FROM `clan_castle`"); mysql_query("DELETE FROM `clan_castle`");
} } elseif (!empty($at_t) && !empty($ow_t)) {
elseif(!empty($at_t) && !empty($ow_t))
{
//побоище //побоище
$teams = array(); $teams = [];
foreach($at_t as $b) foreach ($at_t as $b) {
foreach($ow_t as $gf) foreach ($ow_t as $gf) {
{ $teams[$gf][$b] = [0, 0, time()];
$teams[$gf][$b] = array(0,0,time()); $teams[$b][$gf] = [0, 0, time()];
$teams[$b][$gf] = array(0,0,time()); }
} }
mysql_query("INSERT INTO `battle` mysql_query("INSERT INTO `battle`
@ -280,50 +275,55 @@ elseif(($ccd+90+900)<=time())
) )
VALUES VALUES
( (
NULL,'','".serialize($teams)."','3','1','0','".implode(";",$at_t)."','".implode(";",$ow_t)."','".time()."','".time()."','0' NULL,'','" . serialize($teams) . "','3','1','0','" . implode(";", $at_t) . "','" . implode(";", $ow_t) . "','" . time() . "','" . time() . "','0'
)"); )");
$id = mysql_insert_id(); $id = mysql_insert_id();
// создаем лог // создаем лог
$rr = "<b>"; $rr = "<b>";
foreach( $at_t as $k=>$v ) { foreach ($at_t as $k => $v) {
if ($k!=0) { $rr.=", "; $rrc.=", "; } if ($k != 0) {
$rr .= Nick::id($v)->full(1); $rr .= ", ";
$rrc .= Nick::id($v)->short(); $rrc .= ", ";
addchp ('<font color=red>Внимание!</font> Ваш бой начался!<BR>\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ','{[]}'.Nick::id($v)->short().'{[]}');
} }
$rr .= "</b> и <b>"; $rrc .= "</b> и <b>";
foreach( $ow_t as $k=>$v ) {
if ($k!=0) { $rr.=", "; $rrc.=", ";}
$rr .= Nick::id($v)->full(1); $rr .= Nick::id($v)->full(1);
$rrc .= Nick::id($v)->short(); $rrc .= Nick::id($v)->short();
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> и <b>";
$rrc .= "</b> и <b>";
foreach ($ow_t as $k => $v) {
if ($k != 0) {
$rr .= ", ";
$rrc .= ", ";
}
$rr .= Nick::id($v)->full(1);
$rrc .= 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->room);
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>");
$add_time=time(); $add_time = time();
// всех в БОЙ!!! // всех в БОЙ!!!
foreach($at_t as $k=>$v) { foreach ($at_t as $k => $v) {
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}");
} }
foreach($ow_t as $k=>$v) { foreach ($ow_t as $k => $v) {
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}");
} }
mysql_query("DELETE FROM `clan_castle`"); mysql_query("DELETE FROM `clan_castle`");
} }
$tm=time()+23*60*60; $tm = time() + 23 * 60 * 60;
mysql_query("UPDATE `variables` SET `value`='0' WHERE `var`='castle_att';"); mysql_query("UPDATE `variables` SET `value`='0' WHERE `var`='castle_att';");
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';"); mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
mysql_query("DELETE FROM `clan_castle`"); mysql_query("DELETE FROM `clan_castle`");
} }
?> ?>
</td></tr> </td>
</tr>
</table> </table>
<div align=right><img width="260" src="i/zamok/4.jpg" /></div> <div align=right><img width="260" src="i/castle.jpg"></div>
</BODY>
</HTML>

View File

@ -47,20 +47,13 @@ if ($klanName && $klanAbbr && $klanDescr) {
err($errorMessage); err($errorMessage);
} }
} }
Template::header('Регистратура кланов');
?> ?>
<!doctype html> <script>
<html lang="ru">
<head>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8">
<script>
function leave() { function leave() {
top.frames['main'].location = 'city.php?strah' top.frames['main'].location = 'city.php?strah'
} }
</script> </script>
<title>Регистратура кланов</title>
</head>
<body>
<h1>Регистратура кланов</h1> <h1>Регистратура кланов</h1>
<a href=# onclick=leave()> ← выйти из регистратуры</a> <a href=# onclick=leave()> ← выйти из регистратуры</a>
<?php <?php
@ -97,5 +90,3 @@ if ($user->admin) {
<input type="submit" value="Подать заявку"> <input type="submit" value="Подать заявку">
</fieldset> </fieldset>
</form> </form>
</body>
</html>

View File

@ -1,18 +1,10 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<?php <?php
/** /**
* Copyright (c) 2018. * Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com> * Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game * Project name: Battles-Game
*/ */
Template::header('Список кланов');
include_once "config.php"; include_once "config.php";
$claninf = urldecode(filter_input(INPUT_SERVER,'QUERY_STRING')); $claninf = urldecode(filter_input(INPUT_SERVER,'QUERY_STRING'));
@ -20,16 +12,13 @@ if ($claninf AND ($query = db::c()->query('SELECT * FROM `clans` WHERE `name` =
echo "<h1>{$query['name']}</h1><p>{$query['descr']}</p>"; echo "<h1>{$query['name']}</h1><p>{$query['descr']}</p>";
$clanlist = db::c()->query('SELECT `login`,`status` FROM `users` WHERE `klan` = ?i',$query['id']); $clanlist = db::c()->query('SELECT `login`,`status` FROM `users` WHERE `klan` = ?i',$query['id']);
while ($member = $clanlist->fetch_assoc()) { while ($member = $clanlist->fetch_assoc()) {
echo "<img src=i/align_",$query['align'],".gif> <img src=i/clan/",$query['short'],".gif> ",$member['login']," - ",$member['status'],"<br>"; echo "<img src=i/align_",$query['align'],".png> <img src=i/clan/",$query['short'],".png> ",$member['login']," - ",$member['status'],"<br>";
} }
} else { } else {
echo "<h1>Список кланов</h1>"; echo "<h1>Список кланов</h1>";
$query = db::c()->query('SELECT `align`,`name`,`short` FROM `clans` ORDER BY `name` ASC'); $query = db::c()->query('SELECT `align`,`name`,`short` FROM `clans` ORDER BY `name` ASC');
while ($clanrow = $query->fetch_assoc()) { while ($clanrow = $query->fetch_assoc()) {
$frm = "<img src='i/align_%s.gif'> <img src='i/clan/%s.gif'> <a href='?%s'>%s</a><br>"; $frm = "<img src='i/align_%s.png'> <img src='i/clan/%s.png'> <a href='?%s'>%s</a><br>";
echo sprintf($frm,$clanrow['align'],$clanrow['short'],$clanrow['name'],$clanrow['name']); echo sprintf($frm,$clanrow['align'],$clanrow['short'],$clanrow['name'],$clanrow['name']);
} }
} }
?>
</body>
</html>

View File

@ -31,7 +31,7 @@ class Nick extends User
private function getClan() private function getClan()
{ {
if (isset($this->clan)) { if (isset($this->clan)) {
return sprintf('<img src="i/clan/%s.gif">', $this->clan); return sprintf('<img src="i/clan/%s.png">', $this->clan);
} else { } else {
return ''; return '';
} }

View File

@ -10,14 +10,26 @@ class Template
{ {
} }
public static function header($title = null) /**
* @param string|null $title
* @param int|null $return
*
* @return false|string
*/
public static function header(string $title = null, int $return = null)
{ {
return <<<HTML_HEADER $head = <<<HTML_HEADER
<!doctype html> <!doctype html>
<html lang="ru"> <html lang="ru">
<meta charset="utf-8"> <meta charset="utf-8">
<link href="/css/main.css" rel="stylesheet"> <link href="/css/main.css" rel="stylesheet">
<link href="/css/btn.css" rel=stylesheet >
<title>$title</title> <title>$title</title>
HTML_HEADER; HTML_HEADER;
if (!$return) {
echo $head;
return false;
}
return $head;
} }
} }

View File

@ -12,14 +12,14 @@ class Tournament
global $user; global $user;
$chek = mysql_fetch_row(mysql_query("select id from turnament where id=" . $id . " and old=0")); $chek = mysql_fetch_row(mysql_query("select id from turnament where id=" . $id . " and old=0"));
if ($chek[0] == '') { if ($chek[0] == '') {
die("Жаль, очень жаль...."); exit("Жаль, очень жаль....");
} }
if (mysql_query("insert into turnamuser (idturnam,iduser,level) values(" . $id . "," . $user['id'] . "," . $user['level'] . ")")) { if (mysql_query("insert into turnamuser (idturnam,iduser,level) values(" . $id . "," . $user['id'] . "," . $user['level'] . ")")) {
mysql_query("update turnament set kolvo=kolvo+1 where id=" . $id); mysql_query("update turnament set kolvo=kolvo+1 where id=" . $id);
echo "Регистрация пройдена!"; echo "Регистрация пройдена!";
} else { } else {
die("Вы уже зарегистрированы."); exit("Вы уже зарегистрированы.");
} }
} }
@ -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->room);
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

@ -237,7 +237,7 @@ class fbattle
// ставим статус битвы на "нет битвы" // ставим статус битвы на "нет битвы"
$this->status = 0; $this->status = 0;
//header ("Location:main.php"); //header ("Location:main.php");
//die(); //exit;
//$this->return = 5; //$this->return = 5;
//return $this->return; //return $this->return;
} }
@ -414,7 +414,7 @@ class fbattle
// обновить битку // обновить битку
$this->update_battle(); $this->update_battle();
header("Location: " . $_SERVER['PHP_SELF'] . ""); header("Location: " . $_SERVER['PHP_SELF'] . "");
die(); exit;
} }
} else { } else {
return false; return false;
@ -1701,7 +1701,7 @@ class fbattle
} }
if (in_array($user['room'], Config::$caverooms)) { if (in_array($user->room, 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) {
@ -1790,13 +1790,13 @@ 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->room);
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']}");
echo mysql_error(); echo mysql_error();
unset($this->battle); unset($this->battle);
//header("Location: fbattle.php"); die(); //header("Location: fbattle.php"); exit;
return true; return true;
// ================================================================= // =================================================================
} }

View File

@ -1,8 +1,8 @@
<?php <?php
if (in_array($user['room'], Config::$caverooms)) { if (in_array($user->room, 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->room]['x' . $floor])) {
$floor = 1; $floor = 1;
} }
} }
@ -11,12 +11,12 @@ $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->room, 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->room]['x' . $floor] . "', `y` = '" . $cavedata[$user->room]['y' . $floor] . "', `dir` = '" . $cavedata[$user->room]['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');
die('Suka'); exit('Suka');
} }
} }
} }

View File

@ -21,7 +21,7 @@ function cavesys($text)
} }
} }
if (in_array($user['room'], Config::$caverooms)) { if (in_array($user->room, 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->room == 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

@ -391,7 +391,7 @@ TASK;
return $r; return $r;
} }
public function endq($id, $tp, $user) public function endq($id, $tp, $user):void
{ {
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1')); $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1'));
$qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1')); $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1'));
@ -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->room);
} else { } else {
$this->error = 'Не все условия задания были выполнены ...'; $this->error = 'Не все условия задания были выполнены ...';
} }

View File

@ -29,7 +29,9 @@ $byingItemId = (int)filter_input(INPUT_GET, 'set', FILTER_VALIDATE_INT, ['option
if ($putItemId) { if ($putItemId) {
$dress = db::c()->query('SELECT `name`,`duration`,`maxdur`,`cost` FROM `inventory` WHERE `dressed` = 0 AND `id` = ?i AND `owner` = ?i', $putItemId, $_SESSION['uid'])->fetch_assoc(); $dress = db::c()->query('SELECT `name`,`duration`,`maxdur`,`cost` FROM `inventory` WHERE `dressed` = 0 AND `id` = ?i AND `owner` = ?i', $putItemId, $_SESSION['uid'])->fetch_assoc();
if (empty($putItemCost)) $putItemCost = $dress['cost']; if (empty($putItemCost)) {
$putItemCost = $dress['cost'];
}
$commission = ceil($putItemCost / 10); # 10% от суммы с округлением вверх. $commission = ceil($putItemCost / 10); # 10% от суммы с округлением вверх.
if ($user['money'] > $commission) { if ($user['money'] > $commission) {
@ -39,8 +41,12 @@ if ($putItemId) {
db::c()->query('UPDATE `inventory` SET `setsale` = ?i WHERE `id` = ?i', $putItemCost, $putItemId); db::c()->query('UPDATE `inventory` SET `setsale` = ?i WHERE `id` = ?i', $putItemCost, $putItemId);
db::c()->query('UPDATE `users` SET `money` = `money` - ?i WHERE `id` = ?i', $commission, $_SESSION['uid']); db::c()->query('UPDATE `users` SET `money` = `money` - ?i WHERE `id` = ?i', $commission, $_SESSION['uid']);
$status = "Вы сдали в магазин «{$dress['name']}» за {$putItemCost} кр. Вычтено за услуги магазина: {$commission} кр."; $status = "Вы сдали в магазин «{$dress['name']}» за {$putItemCost} кр. Вычтено за услуги магазина: {$commission} кр.";
} else $status = "Предмет не найден в инвентаре!"; } else {
} else $status = "У вас не хватает " . $commission - $user['money'] . " кр. чтобы оплатить комиссию!"; $status = "Предмет не найден в инвентаре!";
}
} else {
$status = "У вас не хватает " . $commission - $user['money'] . " кр. чтобы оплатить комиссию!";
}
} }
if ($returningItemId) { if ($returningItemId) {
@ -50,7 +56,9 @@ if ($returningItemId) {
addToDelo($deloText); addToDelo($deloText);
db::c()->query('UPDATE `inventory` SET `setsale` = 0 WHERE `id` = ?i', $returningItemId); db::c()->query('UPDATE `inventory` SET `setsale` = 0 WHERE `id` = ?i', $returningItemId);
$status = "Вы забрали из магазина ваш «{$dress['name']}»."; $status = "Вы забрали из магазина ваш «{$dress['name']}».";
} else $status = "Предмет не найден на полках магазина!"; } else {
$status = "Предмет не найден на полках магазина!";
}
} }
if ($byingItemId) { if ($byingItemId) {
@ -68,9 +76,13 @@ if ($byingItemId) {
$deloText = "{$seller['login']} продал на рынке товар: «{$dress['name']}» id:({$byingItemId}) [{$dress['duration']}/{$dress['maxdur']}] персонажу {$user['login']} за {$dress['setsale']} кр."; $deloText = "{$seller['login']} продал на рынке товар: «{$dress['name']}» id:({$byingItemId}) [{$dress['duration']}/{$dress['maxdur']}] персонажу {$user['login']} за {$dress['setsale']} кр.";
addToDelo($deloText, $dress['owner']); addToDelo($deloText, $dress['owner']);
$user['money'] = $user['money'] - $dress['setsale']; $user['money'] = $user['money'] - $dress['setsale'];
telegraph($dress['owner'],"Предмет «{$dress['name']}» продан на рынке за {$dress['setsale']} кр."); telegraph($dress['owner'], "Предмет «{$dress['name']}» продан на рынке за {$dress['setsale']} кр.");
} else $status = "Недостаточно средств!"; } else {
} else $status = "Предмет не найден на полках магазина!"; $status = "Недостаточно средств!";
}
} else {
$status = "Предмет не найден на полках магазина!";
}
} }
$classPrintControlName = "marketbuy"; $classPrintControlName = "marketbuy";
@ -132,15 +144,9 @@ while ($row = $data->fetch_assoc()) {
$iteminfo[] = new ShopItem($row); $iteminfo[] = new ShopItem($row);
} }
Template::header('Рынок');
?> ?>
<HTML> <script src="js/main.js"></script>
<HEAD>
<link rel=stylesheet href="css/main.css">
<script src="js/main.js"></script>
<meta charset="utf-8">
<title>Рынок</title>
</HEAD>
<body>
<h1>Рынок</h1> <h1>Рынок</h1>
<a href=# onclick=hrefToFrame('city.php?cp')> ← выйти на Центральную площадь</a> <a href=# onclick=hrefToFrame('city.php?cp')> ← выйти на Центральную площадь</a>
<div><?php if (!empty($status)) err($status); ?></div> <div><?php if (!empty($status)) err($status); ?></div>
@ -199,5 +205,3 @@ while ($row = $data->fetch_assoc()) {
</TD> </TD>
</TR> </TR>
</TABLE> </TABLE>
</BODY>
</HTML>

View File

@ -52,17 +52,21 @@ function getlist($razdel = 1, $level = null, $id = null)
function delzayavka($id, $zay, $r) function delzayavka($id, $zay, $r)
{ {
$z = getlist($r, null, $zay); $z = getlist($r, null, $zay);
if ($z[$zay]['level'] > 3) return 'Ай-ай-ай!'; if ($z[$zay]['level'] > 3) {
return 'Ай-ай-ай!';
}
if (db::c()->query('DELETE FROM `zayavka` WHERE `id` = ?i AND (`team1` LIKE "?S" OR `team2` LIKE "?S")', $zay, $id.';%', $id.';%')) { if (db::c()->query('DELETE FROM `zayavka` WHERE `id` = ?i AND (`team1` LIKE "?S" OR `team2` LIKE "?S")', $zay, $id.';%', $id.';%')) {
if (count($z[$zay]['team1']) > 0) if (count($z[$zay]['team1']) > 0) {
foreach ($z[$zay]['team1'] as $k => $v) foreach ($z[$zay]['team1'] as $k => $v) {
db::c()->query('UPDATE `users` SET `zayavka` = 0 WHERE `id` = ?i', $v); db::c()->query('UPDATE `users` SET `zayavka` = 0 WHERE `id` = ?i', $v);
}
if (count($z[$zay]['team2']) > 0) }
foreach ($z[$zay]['team2'] as $k => $v) if (count($z[$zay]['team2']) > 0) {
foreach ($z[$zay]['team2'] as $k => $v) {
db::c()->query('UPDATE `users` SET `zayavka` = 0 WHERE `id` = ?i', $v); db::c()->query('UPDATE `users` SET `zayavka` = 0 WHERE `id` = ?i', $v);
} }
}
}
return true; return true;
} }
@ -166,16 +170,10 @@ function startbattle($id, $zay, $r)
file_get_contents(GAMEDOMAIN . '/chats.php?id=6&user=' . $v); file_get_contents(GAMEDOMAIN . '/chats.php?id=6&user=' . $v);
} }
mysql_query("DELETE FROM `zayavka` WHERE `id` = '" . $zay . "' LIMIT 1"); mysql_query("DELETE FROM `zayavka` WHERE `id` = '" . $zay . "' LIMIT 1");
die(); exit;
} }
$arr = [3, 4, 5, 7, 10];
if (in_array($z['timeout'], $arr)) {
} else {
$z['timeout'] = 3; $z['timeout'] = 3;
}
if ($z['type'] == 1 || $z['type'] == 4) { if ($z['type'] == 1 || $z['type'] == 4) {
$rs = ', `fiz`'; $rs = ', `fiz`';
@ -267,51 +265,10 @@ if (date("H-i") == "03-00") {
mysql_query("OPTIMIZE `battle`, `delo`"); mysql_query("OPTIMIZE `battle`, `delo`");
} }
// Снятие VIP. Раз в день, полночь.
if (date("H-i") == "00-00") {
$q = db::c()->query('SELECT `id`,`vip`,`vip_time` FROM `users` WHERE `vip` > 0 AND `vip_time` > 0');
while ($unvip = $q->fetch_assoc()) {
if ($unvip['vip'] > 0 AND $unvip['vip_time'] <= time()) {
db::c()->query('UPDATE `users` SET `vip` = 0, `vip_time` = 0 WHERE `id` = ?i', $unvip['id']);
db::c()->query('UPDATE `abils_vip` SET `sokr` = 0, `zash` = 0, `invisible` = 0, `attack` = 0, `bloodattack` = 0, `sleep30` = 0, `travmoff` = 0, `unsleep` = 0, `pers_attack` = 0 WHERE `uid` = ?i', $unvip['id']);
}
}
}
// Обновление вип-способностей.
$sp = db::c()->query('SELECT `id`,`vip` FROM `users` WHERE `vip` > 0 AND `vip_time` > ?i', time());
while ($pl = $sp->fetch_assoc()) {
$abils = db::c()->query('SELECT `attack`, `bloodattack`, `travmoff` FROM `abils_vip` WHERE `uid` = ?i', $pl['id'])->fetch_assoc();
if ($pl['vip'] == 1) $abils['travmoff'] = 0;
else $abils['travmoff'] += 1;
$abils['attack'] += 1;
$abils['bloodattack'] += 1;
if ($abils['attack'] > 10) $abils['attack'] = 10;
if ($abils['bloodattack'] > 10) $abils['bloodattack'] = 10;
if ($abils['travmoff'] > 10) $abils['travmoff'] = 10;
db::c()->query('UPDATE `abils_vip` SET `sokr` = 1, `zash` = 1, `attack` = ?i, `bloodattack` = ?i, `travmoff` = ?i WHERE `uid` = ?i', $abils['attack'], $abils['bloodattack'], $abils['travmoff'], $pl['id']);
}
mysql_query('UPDATE `actions` SET `vals` = "end" WHERE `vars` LIKE "start_quest%" AND `vals` = "go" AND `val` <= "' . time() . '"'); mysql_query('UPDATE `actions` SET `vals` = "end" WHERE `vars` LIKE "start_quest%" AND `vals` = "go" AND `val` <= "' . time() . '"');
// Раз в день. 6 утра.
if (date("H-i") == "06-00") {
// Первое число каждого месяца.
if (date("d") == "01") {
mysql_query("UPDATE `variables` SET `value` = '{$tm}' WHERE `var` = 'ref_month' LIMIT 1");
mysql_query("UPDATE `variables` SET `value` = '0' WHERE `var` = 'ref_m_id' LIMIT 1");
}
// Каждый седьмой день недели.
if (date("N") == "7") {
mysql_query("UPDATE `variables` SET `value` = '{$tm}' WHERE `var` = 'ref_week' LIMIT 1");
mysql_query("UPDATE `variables` SET `value` = '0' WHERE `var` = 'ref_w_id' LIMIT 1");
}
}
$st_ar = mysql_fetch_array(mysql_query('SELECT `value` FROM `variables` WHERE `var` = "arena_of_gods" LIMIT 1')); $st_ar = mysql_fetch_array(mysql_query('SELECT `value` FROM `variables` WHERE `var` = "arena_of_gods" LIMIT 1'));
if ($st_ar['value'] <= time()) { if ($st_ar['value'] <= time()) {
@ -354,36 +311,31 @@ while ($ku = mysql_fetch_array($komp_users)) {
db::c()->query('UPDATE `users` SET `hp` = 0 WHERE `hp` < 0'); db::c()->query('UPDATE `users` SET `hp` = 0 WHERE `hp` < 0');
db::c()->query('UPDATE `users` SET `mana` = 0 WHERE `mana` < 0'); db::c()->query('UPDATE `users` SET `mana` = 0 WHERE `mana` < 0');
$its = mysql_query("SELECT `id`, `owner`, `name` FROM `inventory` WHERE AND ((`maxdur` <= `duration`) OR (`dategoden` > 0 AND `dategoden` <= '" . time() . "'))");
while ($it = mysql_fetch_array($its)) {
mysql_query("DELETE FROM `inventory` WHERE `id` = '" . $it['id'] . "' LIMIT 1;");
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '" . $it['owner'] . "' '\"" . $it['name'] . "\" разрушился id:(cap" . $it['id'] . ").', 1, '" . time() . "')");
}
$effs = mysql_query("SELECT * FROM `effects` WHERE `time` <= " . time() . " AND `sleep` = 0"); $effs = mysql_query("SELECT * FROM `effects` WHERE `time` <= " . time() . " AND `sleep` = 0");
mysql_query("DELETE FROM `effects` WHERE `time` <= " . time() . " AND `sleep` = 0"); mysql_query("DELETE FROM `effects` WHERE `time` <= " . time() . " AND `sleep` = 0");
while ($eff = mysql_fetch_array($effs)) { while ($eff = mysql_fetch_array($effs)) {
switch ($eff['type']) { switch ($eff['type']) {
case 11: case 11:
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1"); mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' ");
break; break;
case 12: case 12:
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1"); mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' ");
break; break;
case 13: case 13:
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1"); mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' ");
break; break;
case 14: case 14:
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1"); mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' ");
break; break;
case 21: case 21:
mysql_query("UPDATE `users` SET `sila` = `sila`-'" . $eff['sila'] . "', `lovk` = `lovk`-'" . $eff['lovk'] . "', `inta` = `inta`-'" . $eff['inta'] . "', `vinos` = `vinos`-'" . $eff['vinos'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1"); mysql_query("UPDATE `users` SET `sila` = `sila`-'" . $eff['sila'] . "', `lovk` = `lovk`-'" . $eff['lovk'] . "', `inta` = `inta`-'" . $eff['inta'] . "', `vinos` = `vinos`-'" . $eff['vinos'] . "' WHERE `id` = '" . $eff['owner'] . "' ");
break; break;
case 4: case 4:
mysql_query("UPDATE `users` SET `align` = '0' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1"); mysql_query("UPDATE `users` SET `align` = '0' WHERE `id` = '" . $eff['owner'] . "'");
break; break;
case 7: case 7:
mysql_query("UPDATE `users` SET `maxhp` = (`maxhp`-200), `hp` = `maxhp` WHERE `id` = '" . $eff['owner'] . "' LIMIT 1"); mysql_query("UPDATE `users` SET `maxhp` = (`maxhp`-200), `hp` = `maxhp` WHERE `id` = '" . $eff['owner'] . "'");
break; break;
case 1022: case 1022:
mysql_query("UPDATE `users` SET `invis` = 0 WHERE `id` = '" . $eff['owner'] . "' LIMIT 1"); mysql_query("UPDATE `users` SET `invis` = 0 WHERE `id` = '" . $eff['owner'] . "' LIMIT 1");

View File

@ -432,7 +432,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->room, 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;
@ -462,7 +462,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->room, 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;
@ -866,7 +866,7 @@ class fbattle
$this->FastDeath(); $this->FastDeath();
$this->UpdateBattle(); $this->UpdateBattle();
#header('Location: fbattle.php'); #header('Location: fbattle.php');
die(); exit;
} }
} else { } else {
return false; return false;
@ -1062,7 +1062,7 @@ class fbattle
} }
$this->UpdateBattle(); $this->UpdateBattle();
header("Location: " . $_SERVER['PHP_SELF'] . ""); header("Location: " . $_SERVER['PHP_SELF'] . "");
die(); exit;
} }
} else { } else {
return false; return false;

View File

@ -1,27 +0,0 @@
<?php
require_once "../config.php";
// Осталось понять что делает, зачем написан и какой интервал запуска.
// 4 hours: time() + 14400;
$q = db::c()->query('SELECT `value` FROM `variables` WHERE `var` = "?s"', 'pole_random')->fetch_assoc();
for ($i = 0; $i < 41; $i++) {
$rand = mt_rand(1, 9);
if ($rand == 1) $h = 100;
elseif ($rand == 2) $h = 80;
elseif ($rand == 3) $h = 70;
elseif ($rand == 4) $h = 60;
elseif ($rand == 5) $h = 50;
elseif ($rand == 6) $h = 40;
elseif ($rand == 7 || $rand == 8 || $rand == 9) $h = 0;
$h += $h * mt_rand(1, 11) / 10;
$rekr = 0.1 + mt_rand(1, 13) / 100;
db::c()->query('UPDATE `pole` SET `type` = ?i, `heals` = ?i, `ekr` = ?i WHERE `id` = ?i', $rand, $h, $rekr, $i);
}
if (empty($q['value']))
db::c()->query('UPDATE `variables` SET `value` = ?i WHERE `var` = "?s"', (time() + 14400), 'pole_random');
elseif ($q['value'] < time())
db::c()->query('UPDATE `variables` SET `value` = `value` + 14400 WHERE `var` = "?s"', 'pole_random');

File diff suppressed because one or more lines are too long

View File

@ -1,42 +0,0 @@
body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
select, textarea, input {
border: solid 1pt #B0B0B0;
font-family: MS Sans Serif;
font-size: 8px;
color: #191970;
MARGIN-BOTTOM: 2px;
MARGIN-TOP: 1px;
}
.text_msg {
border: 1px solid #CCCCCC;
font-size: 11px;
color: #000000;
font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif;
}
.chatBtn1_1,
.chatBtn1_2,
.chatBtn2_1,
.chatBtn2_2,
.chatBtn4_1,
.chatBtn4_2,
.chatBtn5_1,
.chatBtn5_2,
.chatBtn5_3,
.chatBtn6_1,
.chatBtn6_2,
.chatBtn7_1,
.chatBtn7_2,
.chatBtn7_3 {
width: 30px;
height: 30px;
cursor: pointer;
}

File diff suppressed because one or more lines are too long

View File

@ -1,207 +0,0 @@
body {
margin: 0;
height: 100%;
width: 100%;
background-color: #dedede;
font-size:10px;
color: #000000;
}
.main_text {
font-weight: bold;
font-size: 10px;
text-decoration: none;
color:#f0f0f0;
cursor:hand;
}
.menutop, a.menutop:visited, a.menutop:active {
font-weight: bold;
font-size: 10px;
text-decoration: none;
color: #3B3936;
}
a.menutop:hover {
color: #76726b;
}
.name {
font-weight: bold;
font-size: 12px;
}
.parametr_title {
font-weight: bold;
font-size: 11px;
color: #777773;
}
.prname {
padding-left: 4px;
font-size: 11px;
font-family: Arial, Helvetica, sans-serif;
}
.prvalue {
font-size: 11px;
font-family: Arial, Helvetica, sans-serif;
}
.btn {
border: 1px double #9a9996;
background-image: url(i/move/beg_butt.gif);
font-size: 7.5pt;
color: #dfdfdf;
background-color:#504F4C;
}
.mainmenu {
color: #23292C;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: none;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #969697;
border-right-color: #969697;
border-bottom-color: #000000;
border-left-color: #969697;
background-color: #BABABB;
cursor:hand;
}
.maptext {
font-weight: bold;
font-size: 12px;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
}
.posit {
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #FFFFFF;
border-right-color: #666666;
border-bottom-color: #666666;
border-left-color: #FFFFFF;
padding: 2px;
}
td {
font-size: 10pt;
font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif;
}

View File

@ -1,57 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Alpha(opacity=100),Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( ../i/sprites/cs/bg0.gif ) black }
.Dungeon .Floor1{ background: url( ../i/sprites/cs/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( ../i/sprites/cs/Left/4_1.gif ) no-repeat; }
.Dungeon .RightSide4_1 { background: url( ../i/sprites/cs/Right/4_1.gif ) no-repeat; }
.Dungeon .LeftSide4_0 { background: url( ../i/sprites/cs/Left/4_0.gif ) no-repeat; }
.Dungeon .RightSide4_0 { background: url( ../i/sprites/cs/Right/4_0.gif ) no-repeat; }
.Dungeon .LeftFront3_2 { background: url( ../i/sprites/cs/Left/Front/4_2.gif ) no-repeat; }
.Dungeon .RightFront3_2 { background: url( ../i/sprites/cs/Right/Front/4_2.gif ) no-repeat; }
.Dungeon .LeftFront3_1 { background: url( ../i/sprites/cs/Left/Front/4_1.gif ) no-repeat; }
.Dungeon .RightFront3_1 { background: url( ../i/sprites/cs/Right/Front/4_1.gif ) no-repeat; }
.Dungeon .LeftFront3_0 { background: url( ../i/sprites/cs/Left/Front/4_0.gif ) no-repeat; }
.Dungeon .LeftSide3_1 { background: url( ../i/sprites/cs/Left/3_1.gif ) no-repeat; }
.Dungeon .RightSide3_1 { background: url( ../i/sprites/cs/Right/3_1.gif ) no-repeat; }
.Dungeon .LeftSide3_0 { background: url( ../i/sprites/cs/Left/3_0.gif ) no-repeat; }
.Dungeon .RightSide3_0 { background: url( ../i/sprites/cs/Right/3_0.gif ) no-repeat; }
.Dungeon .LeftFront2_1 { background: url( ../i/sprites/cs/Left/Front/3_1.gif ) no-repeat; }
.Dungeon .RightFront2_1 { background: url( ../i/sprites/cs/Right/Front/3_1.gif ) no-repeat; }
.Dungeon .LeftFront2_0 { background: url( ../i/sprites/cs/Left/Front/3_0.gif ) no-repeat; }
.Dungeon .LeftSide2_0 { background: url( ../i/sprites/cs/Left/2_0.gif ) no-repeat; }
.Dungeon .RightSide2_0 { background: url( ../i/sprites/cs/Right/2_0.gif ) no-repeat; }
.Dungeon .LeftFront1_1 { background: url( ../i/sprites/cs/Left/Front/2_1.gif ) no-repeat; }
.Dungeon .RightFront1_1 { background: url( ../i/sprites/cs/Right/Front/2_1.gif ) no-repeat; }
.Dungeon .LeftFront1_0 { background: url( ../i/sprites/cs/Left/Front/2_0.gif ) no-repeat; }
.Dungeon .LeftSide1_0 { background: url( ../i/sprites/cs/Left/1_0.gif ) no-repeat; }
.Dungeon .RightSide1_0 { background: url( ../i/sprites/cs/Right/1_0.gif ) no-repeat; }
.Dungeon .LeftFront0_1 { background: url( ../i/sprites/cs/Left/Front/1_1.gif ) no-repeat; }
.Dungeon .RightFront0_1 { background: url( ../i/sprites/cs/Right/Front/1_1.gif ) no-repeat; }
.Dungeon .LeftFront0_0 { background: url( ../i/sprites/cs/Left/Front/1_0.gif ) no-repeat; }
.Dungeon .LeftSide0_0 { background: url( ../i/sprites/cs/Left/0_0.gif ) no-repeat; }
.Dungeon .RightSide0_0 { background: url( ../i/sprites/cs/Right/0_0.gif ) no-repeat; }

View File

@ -1,57 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Alpha(opacity=100),Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( ../i/sprites/noob/bg0.gif ) black }
.Dungeon .Floor1{ background: url( ../i/sprites/noob/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( ../i/sprites/noob/Left/4_1.gif ) no-repeat; }
.Dungeon .RightSide4_1 { background: url( ../i/sprites/noob/Right/4_1.gif ) no-repeat; }
.Dungeon .LeftSide4_0 { background: url( ../i/sprites/noob/Left/4_0.gif ) no-repeat; }
.Dungeon .RightSide4_0 { background: url( ../i/sprites/noob/Right/4_0.gif ) no-repeat; }
.Dungeon .LeftFront3_2 { background: url( ../i/sprites/noob/Left/Front/4_2.gif ) no-repeat; }
.Dungeon .RightFront3_2 { background: url( ../i/sprites/noob/Right/Front/4_2.gif ) no-repeat; }
.Dungeon .LeftFront3_1 { background: url( ../i/sprites/noob/Left/Front/4_1.gif ) no-repeat; }
.Dungeon .RightFront3_1 { background: url( ../i/sprites/noob/Right/Front/4_1.gif ) no-repeat; }
.Dungeon .LeftFront3_0 { background: url( ../i/sprites/noob/Left/Front/4_0.gif ) no-repeat; }
.Dungeon .LeftSide3_1 { background: url( ../i/sprites/noob/Left/3_1.gif ) no-repeat; }
.Dungeon .RightSide3_1 { background: url( ../i/sprites/noob/Right/3_1.gif ) no-repeat; }
.Dungeon .LeftSide3_0 { background: url( ../i/sprites/noob/Left/3_0.gif ) no-repeat; }
.Dungeon .RightSide3_0 { background: url( ../i/sprites/noob/Right/3_0.gif ) no-repeat; }
.Dungeon .LeftFront2_1 { background: url( ../i/sprites/noob/Left/Front/3_1.gif ) no-repeat; }
.Dungeon .RightFront2_1 { background: url( ../i/sprites/noob/Right/Front/3_1.gif ) no-repeat; }
.Dungeon .LeftFront2_0 { background: url( ../i/sprites/noob/Left/Front/3_0.gif ) no-repeat; }
.Dungeon .LeftSide2_0 { background: url( ../i/sprites/noob/Left/2_0.gif ) no-repeat; }
.Dungeon .RightSide2_0 { background: url( ../i/sprites/noob/Right/2_0.gif ) no-repeat; }
.Dungeon .LeftFront1_1 { background: url( ../i/sprites/noob/Left/Front/2_1.gif ) no-repeat; }
.Dungeon .RightFront1_1 { background: url( ../i/sprites/noob/Right/Front/2_1.gif ) no-repeat; }
.Dungeon .LeftFront1_0 { background: url( ../i/sprites/noob/Left/Front/2_0.gif ) no-repeat; }
.Dungeon .LeftSide1_0 { background: url( ../i/sprites/noob/Left/1_0.gif ) no-repeat; }
.Dungeon .RightSide1_0 { background: url( ../i/sprites/noob/Right/1_0.gif ) no-repeat; }
.Dungeon .LeftFront0_1 { background: url( ../i/sprites/noob/Left/Front/1_1.gif ) no-repeat; }
.Dungeon .RightFront0_1 { background: url( ../i/sprites/noob/Right/Front/1_1.gif ) no-repeat; }
.Dungeon .LeftFront0_0 { background: url( ../i/sprites/noob/Left/Front/1_0.gif ) no-repeat; }
.Dungeon .LeftSide0_0 { background: url( ../i/sprites/noob/Left/0_0.gif ) no-repeat; }
.Dungeon .RightSide0_0 { background: url( ../i/sprites/noob/Right/0_0.gif ) no-repeat; }

View File

@ -1,62 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Alpha(opacity=100),Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
.Dungeon IMG {
width: 352px;
height: 240px;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( http://img.combats.ru/i/sprites/gy0/bg0.gif ) black }
.Dungeon .Floor1{ background: url( http://img.combats.ru/i/sprites/gy0/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/4_1.gif ) }
.Dungeon .RightSide4_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/4_1.gif ) }
.Dungeon .LeftSide4_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/4_0.gif ) }
.Dungeon .RightSide4_0 { background: url( http://img.combats.ru/i/sprites/gy0/Right/4_0.gif ) }
.Dungeon .LeftFront3_2 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/4_2.gif ) }
.Dungeon .RightFront3_2 { background: url( http://img.combats.ru/i/sprites/gy0/Right/Front/4_2.gif ) }
.Dungeon .LeftFront3_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/4_1.gif ) }
.Dungeon .RightFront3_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/Front/4_1.gif ) }
.Dungeon .LeftFront3_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/4_0.gif ) }
.Dungeon .LeftSide3_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/3_1.gif ) }
.Dungeon .RightSide3_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/3_1.gif ) }
.Dungeon .LeftSide3_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/3_0.gif ) }
.Dungeon .RightSide3_0 { background: url( http://img.combats.ru/i/sprites/gy0/Right/3_0.gif ) }
.Dungeon .LeftFront2_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/3_1.gif ) }
.Dungeon .RightFront2_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/Front/3_1.gif ) }
.Dungeon .LeftFront2_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/3_0.gif ) }
.Dungeon .LeftSide2_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/2_0.gif ) }
.Dungeon .RightSide2_0 { background: url( http://img.combats.ru/i/sprites/gy0/Right/2_0.gif ) }
.Dungeon .LeftFront1_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/2_1.gif ) }
.Dungeon .RightFront1_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/Front/2_1.gif ) }
.Dungeon .LeftFront1_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/2_0.gif ) }
.Dungeon .LeftSide1_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/1_0.gif ) }
.Dungeon .RightSide1_0 { background: url( http://img.combats.ru/i/sprites/gy0/Right/1_0.gif ) }
.Dungeon .LeftFront0_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/1_1.gif ) }
.Dungeon .RightFront0_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/Front/1_1.gif ) }
.Dungeon .LeftFront0_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/1_0.gif ) }
.Dungeon .LeftSide0_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/0_0.gif ) }
.Dungeon .RightSide0_0 { background: url( http://img.combats.ru/i/sprites/gy0/Right/0_0.gif ) }

View File

@ -1,57 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Alpha(opacity=100),Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( http://img.combats.ru/i/sprites/kn4/bg0.gif ) black }
.Dungeon .Floor1{ background: url( http://img.combats.ru/i/sprites/kn4/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/4_1.gif ) }
.Dungeon .RightSide4_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/4_1.gif ) }
.Dungeon .LeftSide4_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/4_0.gif ) }
.Dungeon .RightSide4_0 { background: url( http://img.combats.ru/i/sprites/kn4/Right/4_0.gif ) }
.Dungeon .LeftFront3_2 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/4_2.gif ) }
.Dungeon .RightFront3_2 { background: url( http://img.combats.ru/i/sprites/kn4/Right/Front/4_2.gif ) }
.Dungeon .LeftFront3_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/4_1.gif ) }
.Dungeon .RightFront3_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/Front/4_1.gif ) }
.Dungeon .LeftFront3_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/4_0.gif ) }
.Dungeon .LeftSide3_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/3_1.gif ) }
.Dungeon .RightSide3_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/3_1.gif ) }
.Dungeon .LeftSide3_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/3_0.gif ) }
.Dungeon .RightSide3_0 { background: url( http://img.combats.ru/i/sprites/kn4/Right/3_0.gif ) }
.Dungeon .LeftFront2_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/3_1.gif ) }
.Dungeon .RightFront2_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/Front/3_1.gif ) }
.Dungeon .LeftFront2_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/3_0.gif ) }
.Dungeon .LeftSide2_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/2_0.gif ) }
.Dungeon .RightSide2_0 { background: url( http://img.combats.ru/i/sprites/kn4/Right/2_0.gif ) }
.Dungeon .LeftFront1_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/2_1.gif ) }
.Dungeon .RightFront1_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/Front/2_1.gif ) }
.Dungeon .LeftFront1_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/2_0.gif ) }
.Dungeon .LeftSide1_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/1_0.gif ) }
.Dungeon .RightSide1_0 { background: url( http://img.combats.ru/i/sprites/kn4/Right/1_0.gif ) }
.Dungeon .LeftFront0_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/1_1.gif ) }
.Dungeon .RightFront0_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/Front/1_1.gif ) }
.Dungeon .LeftFront0_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/1_0.gif ) }
.Dungeon .LeftSide0_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/0_0.gif ) }
.Dungeon .RightSide0_0 { background: url( http://img.combats.ru/i/sprites/kn4/Right/0_0.gif ) }

View File

@ -1,62 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
.Dungeon IMG {
width: 352px;
height: 240px;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( http://img.combats.ru/i/sprites/sn/bg0.gif ) black }
.Dungeon .Floor1{ background: url( http://img.combats.ru/i/sprites/sn/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/4_1.gif ) }
.Dungeon .RightSide4_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/4_1.gif ) }
.Dungeon .LeftSide4_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/4_0.gif ) }
.Dungeon .RightSide4_0 { background: url( http://img.combats.ru/i/sprites/sn/Right/4_0.gif ) }
.Dungeon .LeftFront3_2 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/4_2.gif ) }
.Dungeon .RightFront3_2 { background: url( http://img.combats.ru/i/sprites/sn/Right/Front/4_2.gif ) }
.Dungeon .LeftFront3_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/4_1.gif ) }
.Dungeon .RightFront3_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/Front/4_1.gif ) }
.Dungeon .LeftFront3_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/4_0.gif ) }
.Dungeon .LeftSide3_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/3_1.gif ) }
.Dungeon .RightSide3_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/3_1.gif ) }
.Dungeon .LeftSide3_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/3_0.gif ) }
.Dungeon .RightSide3_0 { background: url( http://img.combats.ru/i/sprites/sn/Right/3_0.gif ) }
.Dungeon .LeftFront2_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/3_1.gif ) }
.Dungeon .RightFront2_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/Front/3_1.gif ) }
.Dungeon .LeftFront2_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/3_0.gif ) }
.Dungeon .LeftSide2_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/2_0.gif ) }
.Dungeon .RightSide2_0 { background: url( http://img.combats.ru/i/sprites/sn/Right/2_0.gif ) }
.Dungeon .LeftFront1_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/2_1.gif ) }
.Dungeon .RightFront1_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/Front/2_1.gif ) }
.Dungeon .LeftFront1_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/2_0.gif ) }
.Dungeon .LeftSide1_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/1_0.gif ) }
.Dungeon .RightSide1_0 { background: url( http://img.combats.ru/i/sprites/sn/Right/1_0.gif ) }
.Dungeon .LeftFront0_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/1_1.gif ) }
.Dungeon .RightFront0_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/Front/1_1.gif ) }
.Dungeon .LeftFront0_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/1_0.gif ) }
.Dungeon .LeftSide0_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/0_0.gif ) }
.Dungeon .RightSide0_0 { background: url( http://img.combats.ru/i/sprites/sn/Right/0_0.gif ) }

View File

@ -1,62 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
.Dungeon IMG {
width: 352px;
height: 240px;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( http://img.combats.ru/i/sprites/sun/bg0.gif ) black }
.Dungeon .Floor1{ background: url( http://img.combats.ru/i/sprites/sun/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/4_1.gif ) }
.Dungeon .RightSide4_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/4_1.gif ) }
.Dungeon .LeftSide4_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/4_0.gif ) }
.Dungeon .RightSide4_0 { background: url( http://img.combats.ru/i/sprites/sun/Right/4_0.gif ) }
.Dungeon .LeftFront3_2 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/4_2.gif ) }
.Dungeon .RightFront3_2 { background: url( http://img.combats.ru/i/sprites/sun/Right/Front/4_2.gif ) }
.Dungeon .LeftFront3_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/4_1.gif ) }
.Dungeon .RightFront3_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/Front/4_1.gif ) }
.Dungeon .LeftFront3_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/4_0.gif ) }
.Dungeon .LeftSide3_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/3_1.gif ) }
.Dungeon .RightSide3_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/3_1.gif ) }
.Dungeon .LeftSide3_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/3_0.gif ) }
.Dungeon .RightSide3_0 { background: url( http://img.combats.ru/i/sprites/sun/Right/3_0.gif ) }
.Dungeon .LeftFront2_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/3_1.gif ) }
.Dungeon .RightFront2_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/Front/3_1.gif ) }
.Dungeon .LeftFront2_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/3_0.gif ) }
.Dungeon .LeftSide2_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/2_0.gif ) }
.Dungeon .RightSide2_0 { background: url( http://img.combats.ru/i/sprites/sun/Right/2_0.gif ) }
.Dungeon .LeftFront1_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/2_1.gif ) }
.Dungeon .RightFront1_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/Front/2_1.gif ) }
.Dungeon .LeftFront1_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/2_0.gif ) }
.Dungeon .LeftSide1_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/1_0.gif ) }
.Dungeon .RightSide1_0 { background: url( http://img.combats.ru/i/sprites/sun/Right/1_0.gif ) }
.Dungeon .LeftFront0_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/1_1.gif ) }
.Dungeon .RightFront0_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/Front/1_1.gif ) }
.Dungeon .LeftFront0_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/1_0.gif ) }
.Dungeon .LeftSide0_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/0_0.gif ) }
.Dungeon .RightSide0_0 { background: url( http://img.combats.ru/i/sprites/sun/Right/0_0.gif ) }

View File

@ -1,57 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Alpha(opacity=100),Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( http://img.combats.ru/i/sprites/ug/bg0.gif ) black }
.Dungeon .Floor1{ background: url( http://img.combats.ru/i/sprites/ug/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/4_1.gif ) }
.Dungeon .RightSide4_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/4_1.gif ) }
.Dungeon .LeftSide4_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/4_0.gif ) }
.Dungeon .RightSide4_0 { background: url( http://img.combats.ru/i/sprites/ug/Right/4_0.gif ) }
.Dungeon .LeftFront3_2 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/4_2.gif ) }
.Dungeon .RightFront3_2 { background: url( http://img.combats.ru/i/sprites/ug/Right/Front/4_2.gif ) }
.Dungeon .LeftFront3_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/4_1.gif ) }
.Dungeon .RightFront3_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/Front/4_1.gif ) }
.Dungeon .LeftFront3_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/4_0.gif ) }
.Dungeon .LeftSide3_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/3_1.gif ) }
.Dungeon .RightSide3_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/3_1.gif ) }
.Dungeon .LeftSide3_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/3_0.gif ) }
.Dungeon .RightSide3_0 { background: url( http://img.combats.ru/i/sprites/ug/Right/3_0.gif ) }
.Dungeon .LeftFront2_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/3_1.gif ) }
.Dungeon .RightFront2_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/Front/3_1.gif ) }
.Dungeon .LeftFront2_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/3_0.gif ) }
.Dungeon .LeftSide2_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/2_0.gif ) }
.Dungeon .RightSide2_0 { background: url( http://img.combats.ru/i/sprites/ug/Right/2_0.gif ) }
.Dungeon .LeftFront1_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/2_1.gif ) }
.Dungeon .RightFront1_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/Front/2_1.gif ) }
.Dungeon .LeftFront1_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/2_0.gif ) }
.Dungeon .LeftSide1_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/1_0.gif ) }
.Dungeon .RightSide1_0 { background: url( http://img.combats.ru/i/sprites/ug/Right/1_0.gif ) }
.Dungeon .LeftFront0_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/1_1.gif ) }
.Dungeon .RightFront0_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/Front/1_1.gif ) }
.Dungeon .LeftFront0_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/1_0.gif ) }
.Dungeon .LeftSide0_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/0_0.gif ) }
.Dungeon .RightSide0_0 { background: url( http://img.combats.ru/i/sprites/ug/Right/0_0.gif ) }

View File

@ -1,590 +0,0 @@
body, td, ol, ul, li, p {
font-size: 10pt;
font-family: Verdana, Arial, Helvetica, Tahoma, serif;
}
.seehp {
color: #F4F4F4;
line-height: 7px;
font-size: 9px;
font-weight: bold;
padding-top: 1px;
margin-left: 3px;
padding-left: 3px;
}
.senohp {
line-height: 7px;
font-size: 9px;
}
.hp_none {
background: url('../i/hp.jpg') 0 0 repeat-x;
}
.hp_1 {
background: url('../i/hp.jpg') 0 -11px repeat-x;
}
.hp_2 {
background: url('../i/hp.jpg') 0 -21px repeat-x;
}
.hp_3 {
background: url('../i/hp.jpg') 0 -31px repeat-x;
}
.hp_mp {
background: url('../i/hp.jpg') 0 -41px repeat-x;
}
.seemp {
color: #00FFFF;
line-height: 7px;
font-size: 9px;
font-weight: bold;
padding-top: 1px;
margin-left: 3px;
padding-left: 3px;
}
.hpborder {
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #DADADA;
}
.text {
font-size: 10pt;
color: #000000;
font-family: Verdana, Arial, Helvetica, Tahoma, serif;
}
H3 {
COLOR: #8f0000;
FONT-FAMILY: Arial, serif;
FONT-SIZE: 12pt;
FONT-WEIGHT: bold;
TEXT-ALIGN: center;
}
H4 {
COLOR: #8f0000;
FONT-FAMILY: Arial, serif;
FONT-SIZE: 11pt;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 5px;
}
H5 {
COLOR: #4f0000;
FONT-FAMILY: Arial, serif;
FONT-SIZE: 11pt;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0;
MARGIN-TOP: 0;
}
a, a:visited {
text-decoration: none;
FONT-WEIGHT: bold;
color: #003388;
}
a:active {
color: #6F0000
}
a:hover {
color: #0066FF
}
.date {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: none;
font-weight: normal;
color: #007000
}
.date1 {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: none;
font-weight: normal;
color: #b00000;
}
.date2 {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: none;
font-weight: normal;
color: #007000;
background-color: #00FFAA
}
.date22 {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: none;
font-weight: normal;
color: #007000;
background-color: #00FFAA
}
.date3 {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: underline;
font-weight: normal;
color: #007000;
background-color: #00FFAA
}
.priem_hint {
position: absolute;
background-color: #ffffcc;
padding: 2px;
padding-left: 4px;
padding-right: 4px;
border: 1px #666666 solid;
z-index: 1000;
}
.greaytext {
color: grey;
cursor: default;
font-weight: bold;
font-size: 10px;
text-decoration: none;
}
.sysdate {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: none;
font-weight: normal;
color: #B00000
}
.private {
font-weight: bold;
color: red;
background-color: #FAE0E0
}
.klan {
font-weight: bold;
color: green;
background-color: #99FFCC;
}
.number {
font-size: 11pt;
font-weight: bold;
color: #6F0000
}
.dsc {
color: #606060;
font-weight: normal;
}
select, textarea, input {
border: solid 1pt #B0B0B0;
font-family: MS Sans Serif, serif;
font-size: 10px;
color: #191970;
MARGIN-BOTTOM: 2px;
MARGIN-TOP: 1px;
}
.ahint {
font-family: MS Sans Serif, serif;
font-size: 8px;
text-decoration: none;
color: #666666;
z-index: 99;
}
#hint2 {
position: absolute;
width: 140;
background-color: #FFF6DD;
visibility: hidden
}
#hint3 {
position: absolute;
width: 240;
background-color: #FFF6DD;
visibility: hidden
}
.hint {
position: absolute;
background-color: #ffffcc;
padding: 5px;
}
.hpborder {
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #DADADA;
}
#hint4 {
position: absolute;
width: 240;
visibility: hidden
}
.B1 {
font-weight: bold;
color: #6666CC
}
.B2 {
font-weight: bold;
color: #B06A00
}
.B3 {
font-weight: bold;
color: #269088
}
.B4 {
font-weight: bold;
color: #A0AF20
}
.B5 {
font-weight: bold;
color: #0F79D3
}
.B6 {
font-weight: bold;
color: #D85E23
}
.B7 {
font-weight: bold;
color: #5C832F
}
.B8 {
font-weight: bold;
color: #842B61
}
.B9 {
font-weight: bold;
color: navy
}
.Bs1 {
font-size: 8pt;
font-weight: bold;
color: #6666CC
}
.Bs2 {
font-weight: bold;
color: #B06A00
}
img, table {
border: 0
}
.ismagic {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic1.gif)
}
.glow_pink {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_pink.gif)
}
.glow_red {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_red.gif)
}
.glow_green {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_green.gif)
}
.glow_yellow {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_yellow.gif)
}
.glow_dark {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_dark.gif)
}
.glow_blue {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_blue.gif)
}
.hpStyle1 {
color: #F4F4F4;
line-height: 7px;
font-size: 9px;
font-weight: bold;
padding-top: 1px;
margin-left: 3px;
}
.mpStyle1 {
color: #00FFFF;
line-height: 7px;
font-size: 9px;
font-weight: bold;
padding-top: 1px;
margin-left: 3px;
}
.ahint {
FONT-SIZE: 8px;
COLOR: #000080;
FONT-FAMILY: MS Sans Serif, serif;
TEXT-DECORATION: none
}
#hint2 {
VISIBILITY: hidden;
WIDTH: 140px;
POSITION: absolute;
BACKGROUND-COLOR: #fff6dd;
}
#hint3 {
VISIBILITY: hidden;
WIDTH: 240px;
POSITION: absolute;
BACKGROUND-COLOR: #fff6dd;
}
.genwnew {
background-color: #EBEBEB;
border: 1px solid #C1C1C1;
}
.priem_style {
margin: 0;
width: 40px;
height: 25px;
}
.priem_styleHover {
margin: 1px;
width: 38px;
height: 23px;
}
.priem_style2 {
cursor: pointer;
margin: 0;
width: 40px;
height: 25px;
}
.priem_styleHover2 {
cursor: pointer;
margin: 1px;
width: 38px;
height: 23px;
}
.menutop, a.menutop:visited, a.menutop:active {
font-weight: bold;
font-size: 10px;
text-decoration: none;
color: #3B3936;
}
.btn {
cursor: pointer;
border: 1px double #9a9996;
font-size: 12px;
color: #dfdfdf;
background-color: #504F4C;
}
.btn:hover {
color: #CECECE;
background-color: #393937;
}
.yesbtn {
border: 1px solid #b0b0b0;
background-color: #ece9d8;
width: 70px;
padding-bottom: 2px;
padding-top: 2px;
color: #333333;
text-decoration: none;
font-size: 13px;
}
img {
border: 0;
}
.iframeMain {
width: inherit;
height: inherit;
}
.windowsmf_css1 {
position: absolute;
background-color: #ddd5bf;
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
border: solid #D8D8D8 1px;
FONT-SIZE: 10pt;
font-family: Verdana, Arial, Helvetica, Tahoma, serif;
}
.windowsmf_css1_active2 {
position: absolute;
background-color: #F9F9F9;
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
border: solid #FDFDFD 1px;
}
.inpt1 {
font-size: 8pt;
border: 1px solid #CDC698;
}
.windowsmf_css1_title {
background-color: #b1a993;
color: #000000;
padding-top: 2px;
padding-left: 3px;
padding-right: 3px;
padding-bottom: 2px;
FONT-SIZE: 10pt;
font-family: Verdana, Arial, Helvetica, Tahoma, serif;
}
.usermenu {
z-index: 900;
position: absolute;
LEFT: 0;
TOP: 0;
background-color: #E5E5E5;
border: 1px ridge #CCCCCC;
}
.usermenu1 {
background-color: #E5E5E5;
cursor: pointer;
padding-left: 3px;
padding-right: 3px;
padding-top: 1px;
padding-bottom: 1px;
}
.usermenu1:hover {
background-color: #CECECE;
}
.windowsmf_css1_title_active {
background-color: #C9C4B4;
color: #1A1A1A;
padding-top: 2px;
padding-left: 3px;
padding-right: 3px;
padding-bottom: 2px;
cursor: move;
}
.windowsmf_css1_title_active2 {
background-color: #D7D3C8;
color: #333333;
padding-top: 2px;
padding-left: 3px;
padding-right: 3px;
padding-bottom: 2px;
}
.windowsmf_css1_main_active2 {
background-color: #FDFDFD;
color: #FDFDFD;
padding: 10px;
}
.windowsmf_css1_main {
padding: 10px;
}
.btn_grey {
border-top-width: 1px;
background-color: #e5e5e5;
background-image: url(line1.jpg);
border-top-style: solid;
border-top-color: #EFEFEF;
padding-top: 2px;
padding-bottom: 2px;
padding-left: 7px;
padding-right: 7px;
border-right-width: 1px;
border-left-width: 1px;
border-right-style: solid;
border-left-style: solid;
border-right-color: #D8D8D8;
border-left-color: #D8D8D8;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #D8D8D8;
color: #494949;
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
text-decoration: none;
}
.btn_grey:hover {
background-image: url(line2.jpg);
color: #333333;
}
.btn_grey:active {
background-color: #e5e5e5;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #EFEFEF;
border-right-width: 1px;
border-left-width: 1px;
border-right-style: solid;
border-left-style: solid;
border-right-color: #D8D8D8;
border-left-color: #D8D8D8;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #D8D8D8;
}
.mainframe {
width: inherit;
height: inherit;
}
.message {
font-size: 10pt;
font-family: Verdana, Arial, Helvetica, Tahoma, serif;
}

View File

@ -1,6 +0,0 @@
BODY { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}TD { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}OL { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}UL { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}LI { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}P { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}.inup { BORDER-RIGHT: #302F2A 1px double; BORDER-TOP: #302F2A 1px double; FONT-SIZE: 8pt; BORDER-LEFT: #302F2A 1px double; COLOR: #000000; BORDER-BOTTOM: #302F2A 1px double; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #DED7BD}.text { FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}H3 { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #8f0000; FONT-FAMILY: Arial; TEXT-ALIGN: center}H4 { FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN-BOTTOM: 5px; COLOR: #8f0000; FONT-FAMILY: Arial}A:link { FONT-WEIGHT: normal; COLOR: #524936; TEXT-DECORATION: none}A:visited { FONT-WEIGHT: normal; COLOR: #633525; TEXT-DECORATION: none}A:active { FONT-WEIGHT: normal; COLOR: #77684d; TEXT-DECORATION: none}A:hover { COLOR: #68727B; TEXT-DECORATION: underline}.date { FONT-WEIGHT: normal; FONT-SIZE: 8pt; COLOR: #007000; FONT-FAMILY: Courier; TEXT-DECORATION: none}.dsc { FONT-WEIGHT: normal; COLOR: #606060}SELECT { BORDER-RIGHT: #b0b0b0 1pt solid; BORDER-TOP: #b0b0b0 1pt solid; MARGIN-TOP: 1px; FONT-SIZE: 10px; MARGIN-BOTTOM: 2px; BORDER-LEFT: #b0b0b0 1pt solid; COLOR: #191970; BORDER-BOTTOM: #b0b0b0 1pt solid; FONT-FAMILY: MS Sans Serif}TEXTAREA { BORDER-RIGHT: #b0b0b0 1pt solid; BORDER-TOP: #b0b0b0 1pt solid; MARGIN-TOP: 1px; FONT-SIZE: 10px; MARGIN-BOTTOM: 2px; BORDER-LEFT: #b0b0b0 1pt solid; COLOR: #191970; BORDER-BOTTOM: #b0b0b0 1pt solid; FONT-FAMILY: MS Sans Serif}INPUT { BORDER-RIGHT: #b0b0b0 1pt solid; BORDER-TOP: #b0b0b0 1pt solid; MARGIN-TOP: 1px; FONT-SIZE: 10px; MARGIN-BOTTOM: 2px; BORDER-LEFT: #b0b0b0 1pt solid; COLOR: #191970; BORDER-BOTTOM: #b0b0b0 1pt solid; FONT-FAMILY: MS Sans Serif}.pagetknum { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0; MARGIN: 0; WIDTH: 1em; COLOR: #6f0000; PADDING-TOP: 0; TEXT-DECORATION: underline} .pagenum A:link { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 0; MARGIN: 0; WIDTH: 1em; PADDING-TOP: 0
} .pagenum A:visited { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 0; MARGIN: 0; WIDTH: 1em; PADDING-TOP: 0
} .pagenum A:active { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 0; MARGIN: 0; WIDTH: 1em; PADDING-TOP: 0
} .pagenum A:hover { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 0; MARGIN: 0; WIDTH: 1em; PADDING-TOP: 0; BACKGROUND-COLOR: white} .phpeft { PADDING-RIGHT: 0; PADDING-LEFT: 20px; PADDING-BOTTOM: 7px; MARGIN: 0; PADDING-TOP: 3px} .pages { BACKGROUND-COLOR: #ffefbf} IMG { BORDER-RIGHT: 0; BORDER-TOP: 0; BORDER-LEFT: 0; BORDER-BOTTOM: 0
} TABLE { BORDER-RIGHT: 0; BORDER-TOP: 0; BORDER-LEFT: 0; BORDER-BOTTOM: 0
} .btn { BORDER-RIGHT: #817a63 1px double; BORDER-TOP: #817a63 1px double; FONT-SIZE: 7.5pt; BORDER-LEFT: #817a63 1px double; COLOR: #dfddd3; BORDER-BOTTOM: #817a63 1px double; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #2b2b18}

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
#tiptip_holder { display: none; position: absolute; top: 0; left: 0; z-index: 99999; }
#tiptip_holder.tip_top { padding-bottom: 5px; }
#tiptip_holder.tip_bottom { padding-top: 5px; }
#tiptip_holder.tip_left { padding-right: 5px;}
#tiptip_content { font-size: 11px; color: #000; text-shadow: 0 0 2px #fff; padding: 4px 8px; border: 1px solid rgba(255,255,255,0.25); background: #fff; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; box-shadow: 0 0 3px #555; -webkit-box-shadow: 0 0 3px #555; -moz-box-shadow: 0 0 3px #555; }
#tiptip_arrow, #tiptip_arrow_inner { position: absolute; border-color: transparent; border-style: solid; border-width: 6px; height: 0; width: 0; }
#tiptip_holder.tip_top #tiptip_arrow { border-top-color: #fff; border-top-color: rgba(255,255,255,0.35); }
#tiptip_holder.tip_bottom #tiptip_arrow { border-bottom-color: #fff; border-bottom-color: rgba(255,255,255,0.35); }
#tiptip_holder.tip_right #tiptip_arrow { border-right-color: #fff; border-right-color: rgba(255,255,255,0.35); }
#tiptip_holder.tip_left #tiptip_arrow { border-left-color: #fff; border-left-color: rgba(255,255,255,0.35); }
#tiptip_holder.tip_top #tiptip_arrow_inner { margin-top: -7px; margin-left: -6px; border-top-color: rgb(25,25,25); border-top-color: rgba(25,25,25,0.92); }
#tiptip_holder.tip_bottom #tiptip_arrow_inner { margin-top: -5px; margin-left: -6px; border-bottom-color: rgb(25,25,25); border-bottom-color: rgba(25,25,25,0.92); }
#tiptip_holder.tip_right #tiptip_arrow_inner { margin-top: -6px; margin-left: -5px; border-right-color: rgb(25,25,25); border-right-color: rgba(25,25,25,0.92); }
#tiptip_holder.tip_left #tiptip_arrow_inner { margin-top: -6px; margin-left: -7px; border-left-color: rgb(25,25,25); border-left-color: rgba(25,25,25,0.92); }
.txt { font-style: italic; }

View File

@ -51,19 +51,9 @@ if ($username && $password) {
} else { } else {
$error = ERROR_EMPTY_CREDENTIALS; $error = ERROR_EMPTY_CREDENTIALS;
} }
?>
<!doctype html> Template::header('Входим...');
<html lang="ru-RU">
<head> if ($error) {
<meta charset=UTF-8"> echo sprintf('<a href="/"> ← на главную</a><h1>%s</h1>', $error);
<link href="css/main.css" rel="stylesheet"> }
<title>Входим...</title>
</head>
<body>
<?php if (!empty($error)): ?>
<a href="/"> на главную</a>
<h1><?= $error ?></h1>
<?php endif; ?>
</body>
</html>

View File

@ -1,7 +1,7 @@
<?php <?php
session_start(); session_start();
if (!isset($_SESSION['uid'])) { if (empty($_SESSION['uid'])) {
header("Location: index.php"); header("Location: index.php");
exit; exit;
} }
@ -70,39 +70,23 @@ if ($_GET['ext'] == 1) {
} }
if (in_array($user['room'], Config::$canalenters)) { if (in_array($user->room, Config::$canalenters)) {
$podzemroom = $user['room'] + 1; $podzemroom = $user->room + 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"] ?? '';
<HTML> Template::header('enter_cave');
<HEAD> if ($warning) {
<script LANGUAGE='JavaScript'> echo sprintf('<b style="color: #f80000">%s</b>', $warning);
document.ondragstart = test;
//запрет на перетаскивание
document.onselectstart = test;
//запрет на выделение элементов страницы
document.oncontextmenu = test;
//запрет на выведение контекстного меню
function test() {
return false
} }
</SCRIPT> ?>
<link rel=stylesheet href="css/main.css">
<meta charset="UTF-8">
</HEAD>
<BODY style="background-color: #dedede;">
<? if ($_GET["warning"] && strlen($_GET["warning"]) > 1) {
echo "<b><font color=red>$_GET[warning]</font></b>";
} ?>
<div id=hint4 class=ahint></div> <div id=hint4 class=ahint></div>
<TABLE width=100%> <TABLE width=100%>
<TR> <TR>
<TD valign=top width=100%> <TD valign=top width=100%>
<center><h3><?= $rooms[$user["room"]] ?></h3></center> <center><h3><?= $rooms[$user["room"]] ?></h3></center>
<? <?php
$select = mysql_query("SELECT `time` FROM `visit_podzem` WHERE `room` = '$podzemroom' AND `login` = '" . $user['login'] . "' AND `time` > 0 LIMIT 1"); $select = mysql_query("SELECT `time` FROM `visit_podzem` WHERE `room` = '$podzemroom' AND `login` = '" . $user['login'] . "' AND `time` > 0 LIMIT 1");
if ($el = mysql_fetch_array($select)) { if ($el = mysql_fetch_array($select)) {
$wait_sec = $el['time']; $wait_sec = $el['time'];
@ -113,11 +97,10 @@ 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->room' LIMIT 1");
} }
if ($wait_sec > $new_t) { if ($wait_sec > $new_t && $_GET['donate']) {
if ($_GET['donate']) {
if ($user['money'] >= $podzemdata[$podzemroom]['passprice']) { if ($user['money'] >= $podzemdata[$podzemroom]['passprice']) {
mysql_query("UPDATE `users` SET `money` = (`money`-" . $podzemdata[$podzemroom]['passprice'] . ") WHERE `id` = '$user[id]' LIMIT 1"); mysql_query("UPDATE `users` SET `money` = (`money`-" . $podzemdata[$podzemroom]['passprice'] . ") WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("INSERT INTO `delo` (`id`, `author`, `pers`, `text`, `type`, `date`) VALUES ('', '0', '{$_SESSION['uid']}', '\"" . $user['login'] . "\" пожертвовал на благоустройство пещеры \"" . $podzemdata[$podzemroom]['passprice'] . "\" кр. ($user[money]/$user[ekr]). ', 7, '" . time() . "')"); mysql_query("INSERT INTO `delo` (`id`, `author`, `pers`, `text`, `type`, `date`) VALUES ('', '0', '{$_SESSION['uid']}', '\"" . $user['login'] . "\" пожертвовал на благоустройство пещеры \"" . $podzemdata[$podzemroom]['passprice'] . "\" кр. ($user[money]/$user[ekr]). ', 7, '" . time() . "')");
@ -126,7 +109,6 @@ if (in_array($user['room'], Config::$canalenters)) {
echo "<b><font color=red>У вас недостаточно денег</font></b>"; echo "<b><font color=red>У вас недостаточно денег</font></b>";
} }
} }
}
if ($wait_sec > $new_t) { if ($wait_sec > $new_t) {
echo " <font style='font-size: 12px;'>Вы можете посетить " . $podzemdata[$podzemroom]['name1'] . " через <font style='font-size: 11px; color: #000;'> " . secs2hrs($left_time) . "</font><br />"; echo " <font style='font-size: 12px;'>Вы можете посетить " . $podzemdata[$podzemroom]['name1'] . " через <font style='font-size: 11px; color: #000;'> " . secs2hrs($left_time) . "</font><br />";
@ -225,7 +207,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->room'");
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'];
@ -292,7 +274,7 @@ if (in_array($user['room'], Config::$canalenters)) {
<TD height=1 colspan=2><SPAN></SPAN></TD> <TD height=1 colspan=2><SPAN></SPAN></TD>
</TR> </TR>
</TABLE> </TABLE>
<? <?php
///////////////Подача заявки//////////////////// ///////////////Подача заявки////////////////////
if ($_GET['open']) { if ($_GET['open']) {
@ -302,7 +284,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->room')");
$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>";
@ -332,7 +314,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->room + 1, Config::$caverooms) ? 5 : 4)) {
echo "<script>location.href='?warning=5'</script>"; echo "<script>location.href='?warning=5'</script>";
exit(); exit();
} }
@ -379,8 +361,8 @@ 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->room + 1, Config::$caverooms)) {
$nc = 1; $nc = 1;
$locs = []; $locs = [];
} }
@ -402,8 +384,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->room + 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->room + 1] . "\" персонажу $user[login] ($esth[money]).", 1);
} }
if ($esth['level'] > $level) { if ($esth['level'] > $level) {
$level = $esth['level']; $level = $esth['level'];
@ -416,12 +398,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->room + 1]['x1'] . "', `y` = '" . $cavedata[$user->room + 1]['y1'] . "', `dir` = '" . $cavedata[$user->room + 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->room + 1) . "', `online`.`room` = '" . ($user->room + 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->room'");
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) {
@ -452,21 +434,21 @@ if (in_array($user['room'], Config::$canalenters)) {
} }
?> ?>
<script>top.frames['online'].location = 'ch.php?online=' + Math.round(Math.random() * 100000);</script> <script>top.frames['online'].location = 'ch.php?online=' + Math.round(Math.random() * 100000);</script>
<? <?php
mysql_query("DELETE FROM `vxod` WHERE `login` = '$login'"); mysql_query("DELETE FROM `vxod` WHERE `login` = '$login'");
mysql_query("DELETE FROM `vxodd` WHERE `glav_id` = " . $user['id'] . ""); mysql_query("DELETE FROM `vxodd` WHERE `glav_id` = " . $user['id'] . "");
mysql_query("DELETE FROM `vxodd` WHERE `login` = '$login'"); mysql_query("DELETE FROM `vxodd` WHERE `login` = '$login'");
print "<script>location.href='cave.php'</script>"; print "<script>location.href='cave.php'</script>";
exit(); exit();
} }
} }
?> ?>
<TD nowrap valign=top> <TD nowrap valign=top>
<BR> <BR>
<DIV align=right> <DIV align=right>
<INPUT style="font-size:12px;" onClick="document.location.href='enter_cave.php?<? echo time(); ?>'" <INPUT style="font-size:12px;" onClick="document.location.href='enter_cave.php?<?= time(); ?>'"
value=Обновить type=button> value=Обновить type=button>
<input style="font-size: 12px;" type="button" value="Вернуться" <input style="font-size: 12px;" type="button" value="Вернуться"
onclick="document.location.href='enter_cave.php?ext=1';"/> onclick="document.location.href='enter_cave.php?ext=1';"/>
@ -478,10 +460,7 @@ if (in_array($user['room'], Config::$canalenters)) {
</TABLE> </TABLE>
<div id="goto" style="text-align:right;white-space:nowrap">&nbsp;</div> <div id="goto" style="text-align:right;white-space:nowrap">&nbsp;</div>
<br><br> <br><br>
</BODY> <?php
</HTML>
<?
} else { } else {
header("location: main.php"); header("location: main.php");
} }
?>

View File

@ -1,7 +1,7 @@
<?php <?php
ob_start("ob_gzhandler"); ob_start("ob_gzhandler");
session_start(); session_start();
if (!isset($_SESSION['uid'])) { if (empty($_SESSION['uid'])) {
header("Location: index.php"); header("Location: index.php");
exit; exit;
} }
@ -21,18 +21,11 @@ if (isset($user['id'])) {
include('./classes/battle_new.class.php'); include('./classes/battle_new.class.php');
$fbattle = new fbattle($user['battle']); $fbattle = new fbattle($user['battle']);
Template::header('fbattle');
?> ?>
<html>
<head>
<link rel="stylesheet" href="css/main.css">
<meta charset="utf-8">
<script type="text/javascript" src="js/ZeroClipboard.js"></script>
<script type="text/javascript" src="js/sl2.js"></script> <script type="text/javascript" src="js/sl2.js"></script>
<script type="text/javascript" src="js/ch.js"></script> <script type="text/javascript" src="js/ch.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script>
<script src="js/tooltip.js"></script>
<link rel="stylesheet" type="text/css" href="css/tooltip.css"/>
<SCRIPT>
function refreshPeriodic() { function refreshPeriodic() {
<?php if($fbattle->battle) { ?>location.href = '<?=$_SERVER['PHP_SELF']?>?batl=<?=$_REQUEST['batl']?>';//reload(); <?php if($fbattle->battle) { ?>location.href = '<?=$_SERVER['PHP_SELF']?>?batl=<?=$_REQUEST['batl']?>';//reload();
<?}?> <?}?>
@ -40,8 +33,6 @@ $fbattle = new fbattle($user['battle']);
} }
timerID = setTimeout("refreshPeriodic()", 20000); timerID = setTimeout("refreshPeriodic()", 20000);
</SCRIPT>
<script>
let Hint3Name = ''; let Hint3Name = '';
function findlogin(title, script, name) { function findlogin(title, script, name) {
@ -135,8 +126,6 @@ $fbattle = new fbattle($user['battle']);
cursor: pointer; cursor: pointer;
} }
</style> </style>
</head>
<body onLoad="top.setHP(<?= $user['hp'] ?>,<?= $user['maxhp'] ?>)">
<div id="hint3" class="ahint"></div> <div id="hint3" class="ahint"></div>
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="POST" name="f1" id="f1"> <form action="<?= $_SERVER['PHP_SELF'] ?>" method="POST" name="f1" id="f1">
<table width=100% cellspacing=0 cellpadding=0 border=0> <table width=100% cellspacing=0 cellpadding=0 border=0>
@ -183,7 +172,7 @@ $fbattle = new fbattle($user['battle']);
$bb = str_replace('"', "&quot;", (strip_tags($bb[0]))); $bb = str_replace('"', "&quot;", (strip_tags($bb[0])));
header("Location: " . $_SERVER['PHP_SELF'] . "?buf=" . $bb); header("Location: " . $_SERVER['PHP_SELF'] . "?buf=" . $bb);
} else { } else {
die(); exit;
} }
} }
@ -542,12 +531,8 @@ $fbattle = new fbattle($user['battle']);
</td></tr> </td></tr>
</table> </table>
</form> </form>
<div id="oMenu" onmouseout="closeMenu()" <div id="oMenu" onmouseout="closeMenu()"
style="position: absolute; border: 1px solid #666; background-color: #CCC; display: none; "></div> style="position: absolute; border: 1px solid #666; background-color: #CCC; display: none; "></div>
</body>
</html>
<?php <?php
db::c()->query('UNLOCK TABLES'); db::c()->query('UNLOCK TABLES');
?> ?>

View File

@ -11,12 +11,8 @@ if (empty($userLoginStatus)) {
} else { } else {
db::c()->query('UPDATE `users` SET `enter_game` = 0 WHERE `enter_game` = 1 AND `id` = ?i', $_SESSION['uid']); db::c()->query('UPDATE `users` SET `enter_game` = 0 WHERE `enter_game` = 1 AND `id` = ?i', $_SESSION['uid']);
} }
Template::header('Окно игры');
?> ?>
<!doctype html>
<html lang="ru">
<head>
<title>Окно игры</title>
<meta charset="utf-8">
<script> <script>
if (!navigator.cookieEnabled) { if (!navigator.cookieEnabled) {
document.write('Внимание! В вашем браузере отключена поддержка Cookies. Включите чтобы играть.'); document.write('Внимание! В вашем браузере отключена поддержка Cookies. Включите чтобы играть.');
@ -51,8 +47,6 @@ if (empty($userLoginStatus)) {
padding: 0; padding: 0;
} }
</style> </style>
</head>
<body>
<table class="frametable"> <table class="frametable">
<tr style="height: 25px;"> <tr style="height: 25px;">
<td class="frametd"> <td class="frametd">
@ -72,5 +66,3 @@ if (empty($userLoginStatus)) {
</td> </td>
</tr> </tr>
</table> </table>
</body>
</html>

View File

@ -1,42 +1,44 @@
<?php <?php
session_start(); session_start();
if(!isset($_SESSION['uid'])) { die();} if (empty($_SESSION['uid'])) {
exit;
}
require_once "functions.php"; require_once "functions.php";
if($user['room'] == 51) { header('location: city.php'); die(); } if ($user->room == 51) {
header('location: city.php');
exit;
}
if($_GET['go'] == 'vixod') { if ($_GET['go'] == 'vixod') {
$les_login = mysql_fetch_array(mysql_query("SELECT `room` FROM `les_game` WHERE `owner` = '".$user['id']."' LIMIT 1")); $les_login = mysql_fetch_array(mysql_query("SELECT `room` FROM `les_game` WHERE `owner` = '" . $user['id'] . "' LIMIT 1"));
if($les_login['room'] == 'G8') { if ($les_login['room'] == 'G8') {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '51', `online`.`room` = '51' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$user['id']."'"); mysql_query("UPDATE `users`,`online` SET `users`.`room` = '51', `online`.`room` = '51' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `les_res` WHERE `owner` = '".$user['id']."' LIMIT 1"); mysql_query("DELETE FROM `les_res` WHERE `owner` = '" . $user['id'] . "' LIMIT 1");
} }
} }
$tes = mysql_query("SELECT * FROM `les_res` WHERE `owner` = '".$user['id']."'"); $tes = mysql_query("SELECT * FROM `les_res` WHERE `owner` = '" . $user['id'] . "'");
if(!$les_res = mysql_fetch_array($tes)) { if (!$les_res = mysql_fetch_array($tes)) {
$i = 0; $i = 0;
while($i++ < 25) { while ($i++ < 25) {
$res = array('', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore'); $res = ['', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore'];
$img = array('', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg'); $img = ['', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg'];
$otdel = rand(1, 9); $otdel = rand(1, 9);
$komnata = rand(0, 7); $komnata = rand(0, 7);
$kmn[1] = array('A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8'); $kmn[1] = ['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8'];
$kmn[2] = array('B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8'); $kmn[2] = ['B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8'];
$kmn[3] = array('C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8'); $kmn[3] = ['C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8'];
$kmn[4] = array('D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8'); $kmn[4] = ['D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8'];
$kmn[5] = array('E1', 'E2', 'E3', 'E4', 'E5', 'E6', 'E7', 'E8'); $kmn[5] = ['E1', 'E2', 'E3', 'E4', 'E5', 'E6', 'E7', 'E8'];
$kmn[6] = array('F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8'); $kmn[6] = ['F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8'];
$kmn[7] = array('G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8'); $kmn[7] = ['G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8'];
$kmn[8] = array('H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'H7', 'H8'); $kmn[8] = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'H7', 'H8'];
$kmn[9] = array('I1', 'I2', 'I3', 'I4', 'I5', 'I6', 'I7', 'I8'); $kmn[9] = ['I1', 'I2', 'I3', 'I4', 'I5', 'I6', 'I7', 'I8'];
mysql_query("INSERT INTO les_res (`owner`, `name`, `img`, `kom`) VALUES ('".$user['id']."', '".$res[$i]."', '".$img[$i]."', '".$kmn[$otdel][$komnata]."')"); mysql_query("INSERT INTO les_res (`owner`, `name`, `img`, `kom`) VALUES ('" . $user['id'] . "', '" . $res[$i] . "', '" . $img[$i] . "', '" . $kmn[$otdel][$komnata] . "')");
} }
} }
#nick99($user['id']);
$rand = rand(25, 100); $rand = rand(25, 100);
$rbot = rand(1, 5); $rbot = rand(1, 5);
$bots[1] = 'Медведь'; $bots[1] = 'Медведь';
@ -44,189 +46,205 @@ $bots[2] = 'Заяц';
$bots[3] = 'Лось'; $bots[3] = 'Лось';
$bots[4] = 'Волк'; $bots[4] = 'Волк';
$bots[5] = 'Лесник'; $bots[5] = 'Лесник';
if($rand < 15 && $user['battle'] == 0) { if ($rand < 15 && $user['battle'] == 0) {
$sex = mysql_query("SELECT `id`, `maxhp` FROM `users` WHERE `login` = '".$bots[$rbot]."' LIMIT 1"); $sex = mysql_query("SELECT `id`, `maxhp` FROM `users` WHERE `login` = '" . $bots[$rbot] . "' LIMIT 1");
$dded = mysql_fetch_array($sex); $dded = mysql_fetch_array($sex);
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) VALUES ('".$bots[$rbot]."', '".$dded["id"]."', '', '".$dded["maxhp"]."')"); mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) VALUES ('" . $bots[$rbot] . "', '" . $dded["id"] . "', '', '" . $dded["maxhp"] . "')");
$bot = mysql_insert_id(); $bot = mysql_insert_id();
$teams = array(); $teams = [];
$teams[$user['id']][$bot] = array(0, 0, time()); $teams[$user['id']][$bot] = [0, 0, time()];
$teams[$bot][$user['id']] = array(0, 0, time()); $teams[$bot][$user['id']] = [0, 0, time()];
mysql_query("INSERT INTO `battle`(`teams`, `timeout`, `type`, `status`, `t1`, `t2`, `to1`, `to2`) VALUES ('".serialize($teams)."', '3', '1', '0', '".$user['id']."', '".$bot."', '".time()."', '".time()."')"); mysql_query("INSERT INTO `battle`(`teams`, `timeout`, `type`, `status`, `t1`, `t2`, `to1`, `to2`) VALUES ('" . serialize($teams) . "', '3', '1', '0', '" . $user['id'] . "', '" . $bot . "', '" . time() . "', '" . time() . "')");
$id = mysql_insert_id(); $id = mysql_insert_id();
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$bot} LIMIT 1"); mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$bot} LIMIT 1");
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($bot)->full(1)."</b>"; $rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($bot)->full(1) . "</b>";
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']."' LIMIT 1"); mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE `id` = '" . $user['id'] . "' LIMIT 1");
addchp ('<b style="color:#990000">Внимание!</b> На вас напал "'.$bots[$rbot].'". ','{[]}'.Nick::id($user["id"])->short().'{[]}'); addchp('<b style="color:#990000">Внимание!</b> На вас напал "' . $bots[$rbot] . '". ', '{[]}' . Nick::id($user["id"])->short() . '{[]}');
} }
if ($user['battle'] > 0) {
header('location: fbattle.php');
exit;
}
if($user['battle'] > 0) { header('location: fbattle.php'); die(); } $les_login = mysql_fetch_array(mysql_query("SELECT * FROM `les_game` WHERE `owner` = '" . $user['id'] . "' LIMIT 1"));
$les_login = mysql_fetch_array(mysql_query("SELECT * FROM `les_game` WHERE `owner` = '".$user['id']."' LIMIT 1")); $rooms = ["A1" => ['20', '', 'A2', '', 'B1'], "A2" => ['15', 'A1', 'A3', '', ''], "A3" => ['15', 'A2', '', '', ''], "A4" => ['15', '', 'A5', '', 'B4'], "A5" => ['15', 'A4', '', '', 'B5'], "A6" => ['15', '', 'A7', '', 'B6'], "A7" => ['15', 'A6', 'A8', '', ''], "A8" => ['15', 'A7', '', '', 'B8'], "B1" => ['20', '', '', 'A1', ''], "B2" => ['15', '', 'B3', '', 'C2'], "B3" => ['15', 'B2', 'B4', '', ''], "B4" => ['15', 'B3', '', 'A4', ''], "B5" => ['15', '', 'B6', 'A5', ''], "B6" => ['15', 'B5', 'B7', 'A6', ''], "B7" => ['15', 'B6', '', '', 'C7'], "B8" => ['15', '', '', 'A8', 'C8'], "C1" => ['20', '', '', '', 'D1'], "C2" => ['15', '', 'C3', 'B2', 'D2'], "C3" => ['15', 'C2', '', '', 'D3'], "C4" => ['15', '', '', '', 'D4'], "C5" => ['15', '', '', '', 'D5'], "C6" => ['15', '', 'C7', '', ''], "C7" => ['15', 'C6', 'C8', 'B7', ''], "C8" => ['15', 'C7', '', 'B8', 'D8'], "D1" => ['20', '', 'D2', 'C1', 'E1'], "D2" => ['15', 'D1', 'D3', 'C2', 'E2'], "D3" => ['15', 'D2', 'D4', 'C3', 'E3'], "D4" => ['15', 'D3', 'D5', 'C4', 'E4'], "D5" => ['15', 'D4', '', 'C5', ''], "D6" => ['15', '', 'D7', '', 'E6'], "D7" => ['15', 'D6', '', '', ''], "D8" => ['15', '', '', 'C8', 'E8'], "E1" => ['20', '', 'E2', 'D1', 'F1'], "E2" => ['15', 'E1', 'E3', 'D2', 'F2'], "E3" => ['15', 'E2', 'E4', 'D3', 'F3'], "E4" => ['15', 'E3', 'E5', 'D4', 'F4'], "E5" => ['15', 'E4', 'E6', '', 'F5'], "E6" => ['15', 'E5', '', 'D6', ''], "E7" => ['15', '', 'E8', '', 'F7'], "E8" => ['15', 'E7', '', 'D8', 'F8'], "F1" => ['20', '', 'F2', 'E1', 'G1'], "F2" => ['15', 'F1', 'F3', 'E2', 'G2'], "F3" => ['15', 'F2', 'F4', 'E3', 'G3'], "F4" => ['15', 'F3', 'F5', 'E4', 'G4'], "F5" => ['15', 'F4', '', 'E5', 'G5'], "F6" => ['15', '', '', '', 'G6'], "F7" => ['15', '', '', 'E7', 'G7'], "F8" => ['15', '', '', 'E8', 'G8'], "G1" => ['20', '', '', 'F1', 'H1'], "G2" => ['15', '', '', 'F2', ''], "G3" => ['15', '', '', 'F3', ''], "G4" => ['15', '', '', 'F4', ''], "G5" => ['15', '', 'G6', 'F5', ''], "G6" => ['15', 'G5', 'G7', 'F6', ''], "G7" => ['15', 'G6', 'G8', 'F7', ''], "G8" => ['15', 'G7', '', 'F8', 'H8'], "H1" => ['20', '', 'H2', 'G1', 'I1'], "H2" => ['15', 'H1', '', '', 'I2'], "H3" => ['15', '', '', '', 'I3'], "H4" => ['15', '', 'H5', '', 'I4'], "H5" => ['15', 'H4', '', '', 'I5'], "H6" => ['15', '', 'H7', '', 'I6'], "H7" => ['15', 'H6', '', '', 'I7'], "H8" => ['15', 'H7', '', 'G8', 'I8'], "I1" => ['20', '', 'I2', 'H1', ''], "I2" => ['15', 'I1', 'I3', 'H2', ''], "I3" => ['15', 'I2', 'I4', 'H3', ''], "I4" => ['15', 'I3', 'I5', 'H4', ''], "I5" => ['15', 'I4', 'I6', 'H5', ''], "I6" => ['15', 'I5', 'I7', 'H6', ''], "I7" => ['15', 'I6', 'I8', 'H7', ''], "I8" => ['15', 'I7', '', 'H8', '']];
$rooms = array("A1" => array('20', '', 'A2', '', 'B1'), "A2" => array('15', 'A1', 'A3', '', ''), "A3" => array('15', 'A2', '', '', ''), "A4" => array('15', '', 'A5', '', 'B4'), "A5" => array('15', 'A4', '', '', 'B5'), "A6" => array('15', '', 'A7', '', 'B6'), "A7" => array('15', 'A6', 'A8', '', ''), "A8" => array('15', 'A7', '', '', 'B8'), "B1" => array('20', '', '', 'A1', ''), "B2" => array('15', '', 'B3', '', 'C2'), "B3" => array('15', 'B2', 'B4', '', ''), "B4" => array('15', 'B3', '', 'A4', ''), "B5" => array('15', '', 'B6', 'A5', ''), "B6" => array('15', 'B5', 'B7', 'A6', ''), "B7" => array('15', 'B6', '', '', 'C7'), "B8" => array('15', '', '', 'A8', 'C8'), "C1" => array('20', '', '', '', 'D1'), "C2" => array('15', '', 'C3', 'B2', 'D2'), "C3" => array('15', 'C2', '', '', 'D3'), "C4" => array('15', '', '', '', 'D4'), "C5" => array('15', '', '', '', 'D5'), "C6" => array('15', '', 'C7', '', ''), "C7" => array('15', 'C6', 'C8', 'B7', ''), "C8" => array('15', 'C7', '', 'B8', 'D8'), "D1" => array('20', '', 'D2', 'C1', 'E1'), "D2" => array('15', 'D1', 'D3', 'C2', 'E2'), "D3" => array('15', 'D2', 'D4', 'C3', 'E3'), "D4" => array('15', 'D3', 'D5', 'C4', 'E4'), "D5" => array('15', 'D4', '', 'C5', ''), "D6" => array('15', '', 'D7', '', 'E6'), "D7" => array('15', 'D6', '', '', ''), "D8" => array('15', '', '', 'C8', 'E8'), "E1" => array('20', '', 'E2', 'D1', 'F1'), "E2" => array('15', 'E1', 'E3', 'D2', 'F2'), "E3" => array('15', 'E2', 'E4', 'D3', 'F3'), "E4" => array('15', 'E3', 'E5', 'D4', 'F4'), "E5" => array('15', 'E4', 'E6', '', 'F5'), "E6" => array('15', 'E5', '', 'D6', ''), "E7" => array('15', '', 'E8', '', 'F7'), "E8" => array('15', 'E7', '', 'D8', 'F8'), "F1" => array('20', '', 'F2', 'E1', 'G1'), "F2" => array('15', 'F1', 'F3', 'E2', 'G2'), "F3" => array('15', 'F2', 'F4', 'E3', 'G3'), "F4" => array('15', 'F3', 'F5', 'E4', 'G4'), "F5" => array('15', 'F4', '', 'E5', 'G5'), "F6" => array('15', '', '', '', 'G6'), "F7" => array('15', '', '', 'E7', 'G7'), "F8" => array('15', '', '', 'E8', 'G8'), "G1" => array('20', '', '', 'F1', 'H1'), "G2" => array('15', '', '', 'F2', ''), "G3" => array('15', '', '', 'F3', ''), "G4" => array('15', '', '', 'F4', ''), "G5" => array('15', '', 'G6', 'F5', ''), "G6" => array('15', 'G5', 'G7', 'F6', ''), "G7" => array('15', 'G6', 'G8', 'F7', ''), "G8" => array('15', 'G7', '', 'F8', 'H8'), "H1" => array('20', '', 'H2', 'G1', 'I1'), "H2" => array('15', 'H1', '', '', 'I2'), "H3" => array('15', '', '', '', 'I3'), "H4" => array('15', '', 'H5', '', 'I4'), "H5" => array('15', 'H4', '', '', 'I5'), "H6" => array('15', '', 'H7', '', 'I6'), "H7" => array('15', 'H6', '', '', 'I7'), "H8" => array('15', 'H7', '', 'G8', 'I8'), "I1" => array('20', '', 'I2', 'H1', ''), "I2" => array('15', 'I1', 'I3', 'H2', ''), "I3" => array('15', 'I2', 'I4', 'H3', ''), "I4" => array('15', 'I3', 'I5', 'H4', ''), "I5" => array('15', 'I4', 'I6', 'H5', ''), "I6" => array('15', 'I5', 'I7', 'H6', ''), "I7" => array('15', 'I6', 'I8', 'H7', ''), "I8" => array('15', 'I7', '', 'H8', '')); $time = $_SESSION['time'] - time();
if ($time < 0) {
$time = 0;
}
$time = $_SESSION['time']-time(); if ($_GET["v"] && $_GET["v"] != '' && $time <= 0 && $rooms[$les_login['room']][1] == $_GET["v"]) {
if($time < 0) { $time = 0; } $_SESSION['time'] = time() + $rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '" . $_GET["v"] . "' WHERE `owner` = '" . $user['id'] . "' LIMIT 1");
if($_GET["v"] && $_GET["v"] != '' && $time <= 0 && $rooms[$les_login['room']][1] == $_GET["v"]) {
$_SESSION['time'] = time()+$rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '".$_GET["v"]."' WHERE `owner` = '".$user['id']."' LIMIT 1");
$_GET["v"] = 0; $_GET["v"] = 0;
} }
if($_GET["n"] && $_GET["n"] != '' && $time <= 0 && $rooms[$les_login['room']][2] == $_GET["n"]) { if ($_GET["n"] && $_GET["n"] != '' && $time <= 0 && $rooms[$les_login['room']][2] == $_GET["n"]) {
$_SESSION['time'] = time()+$rooms[$les_login['room']][0]; $_SESSION['time'] = time() + $rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '".$_GET["n"]."' WHERE `owner` = '".$user['id']."' LIMIT 1"); mysql_query("UPDATE `les_game` SET `room` = '" . $_GET["n"] . "' WHERE `owner` = '" . $user['id'] . "' LIMIT 1");
$_GET["n"] = 0; $_GET["n"] = 0;
} }
if($_GET["l"] && $_GET["l"] != '' && $time <= 0 && $rooms[$les_login['room']][3] == $_GET["l"]) { if ($_GET["l"] && $_GET["l"] != '' && $time <= 0 && $rooms[$les_login['room']][3] == $_GET["l"]) {
$_SESSION['time'] = time()+$rooms[$les_login['room']][0]; $_SESSION['time'] = time() + $rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '".$_GET["l"]."' WHERE `owner` = '".$user['id']."' LIMIT 1"); mysql_query("UPDATE `les_game` SET `room` = '" . $_GET["l"] . "' WHERE `owner` = '" . $user['id'] . "' LIMIT 1");
$_GET["l"] = 0; $_GET["l"] = 0;
} }
if($_GET["p"] && $_GET["p"] != '' && $time <= 0 && $rooms[$les_login['room']][4] == $_GET["p"]) { if ($_GET["p"] && $_GET["p"] != '' && $time <= 0 && $rooms[$les_login['room']][4] == $_GET["p"]) {
$_SESSION['time'] = time()+$rooms[$les_login['room']][0]; $_SESSION['time'] = time() + $rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '".$_GET["p"]."' WHERE `owner` = '".$user['id']."' LIMIT 1"); mysql_query("UPDATE `les_game` SET `room` = '" . $_GET["p"] . "' WHERE `owner` = '" . $user['id'] . "' LIMIT 1");
$_GET["p"] = 0; $_GET["p"] = 0;
} }
///////////////Сбор///////////// ///////////////Сбор/////////////
if($_GET['res']) { if ($_GET['res']) {
$gss = mysql_fetch_array(mysql_query("SELECT * FROM `les_res` WHERE `owner` = '".$user['id']."' AND `id` = '".mysql_real_escape_string($_GET['res'])."' AND `kom` = '".$les_login['room']."' LIMIT 1")); $gss = mysql_fetch_array(mysql_query("SELECT * FROM `les_res` WHERE `owner` = '" . $user['id'] . "' AND `id` = '" . mysql_real_escape_string($_GET['res']) . "' AND `kom` = '" . $les_login['room'] . "' LIMIT 1"));
if($gss) { if ($gss) {
$f = mysql_query("SELECT `koll` FROM `inventory` WHERE `owner` = '".$user['id']."' AND `type` = '200' AND `name` = '".$gss['name']."' LIMIT 1"); $f = mysql_query("SELECT `koll` FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `type` = '200' AND `name` = '" . $gss['name'] . "' LIMIT 1");
if($g = mysql_fetch_array($f)) { if ($g = mysql_fetch_array($f)) {
mysql_query("UPDATE `inventory` SET `koll` = (`koll`+1), `massa` = (`massa`+0.1) WHERE `owner` = '".$user['id']."' AND `type` = '200' AND `name` = '".$gss['name']."' LIMIT 1"); mysql_query("UPDATE `inventory` SET `koll` = (`koll`+1), `massa` = (`massa`+0.1) WHERE `owner` = '" . $user['id'] . "' AND `type` = '200' AND `name` = '" . $gss['name'] . "' LIMIT 1");
} else { } else {
$fo = mysql_query("INSERT INTO `inventory`(`name`, `koll`, `img`, `owner`, `type`, `massa`, `isrep`, `podzem`, `maxdur`, `present`) VALUES ('".$gss['name']."', '1', '".$gss['img']."', '".$user['id']."', '200', '0.1', '0', '1', '1', 'Лес')"); $fo = mysql_query("INSERT INTO `inventory`(`name`, `koll`, `img`, `owner`, `type`, `massa`, `isrep`, `podzem`, `maxdur`, `present`) VALUES ('" . $gss['name'] . "', '1', '" . $gss['img'] . "', '" . $user['id'] . "', '200', '0.1', '0', '1', '1', 'Лес')");
} }
mysql_query("DELETE FROM `les_res` WHERE `id` = '".$gss['id']."' LIMIT 1"); mysql_query("DELETE FROM `les_res` WHERE `id` = '" . $gss['id'] . "' LIMIT 1");
addchp ('<b style="color:#990000">Внимание!</b> <b>'.$user["login"].'</b>, поднял предмет "'.$gss['name'].'".', '{[]}'.Nick::id($user["id"])->short().'{[]}'); addchp('<b style="color:#990000">Внимание!</b> <b>' . $user["login"] . '</b>, поднял предмет "' . $gss['name'] . '".', '{[]}' . Nick::id($user["id"])->short() . '{[]}');
echo "<font style='color:#990000'>Вы подняли <b>'".$gss['name']."'</b>.</font>"; echo "<font style='color:#990000'>Вы подняли <b>'" . $gss['name'] . "'</b>.</font>";
} else { } else {
echo "&nbsp;<font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";} echo "&nbsp;<font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";
}
} }
Template::header('Лес');
?> ?>
<html>
<head>
<META HTTP-EQUIV=imagetoolbar CONTENT=no>
<script src="i/forest/char1.32.js"></script> <script src="i/forest/char1.32.js"></script>
<script src="i/forest/funcs1.6.js"></script> <script src="i/forest/funcs1.6.js"></script>
</head>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor="#e2e0e0" onLoad="top.setHP(<?=$user['hp']?>,<?=$user['maxhp']?>,<? if (!$user['battle']){echo"10";}else{echo"0";}?>)">
<center><h4>Лес</h4></center> <center><h4>Лес</h4></center>
<dd> <dd>
<table cellspacing=2 cellpadding=0>
<dd><table cellspacing=2 cellpadding=0>
<tr>
<td>
<center><table width="450" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tr> <tr>
<td background="i/forest/bg_scroll_01.gif" align="center">Имя</td> <td>
<td background="i/forest/bg_scroll_01.gif" align="center">Hp</td> <center>
<td background="i/forest/bg_scroll_01.gif" align="center">Расположение</td> <table width="450" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tr>
<td background="i/forest/bg_scroll_01.gif" align="center">Имя</td>
<td background="i/forest/bg_scroll_01.gif" align="center">Hp</td>
<td background="i/forest/bg_scroll_01.gif" align="center">Расположение</td>
</tr> </tr>
<? <?
$rog = mysql_query("SELECT * FROM `les_game` WHERE `owner` = '".$user['id']."'"); $rog = mysql_query("SELECT * FROM `les_game` WHERE `owner` = '" . $user['id'] . "'");
while($more = mysql_fetch_array($rog)) { while ($more = mysql_fetch_array($rog)) {
$big = mysql_fetch_array(mysql_query("SELECT `hp`, `maxhp`, `id`, `login` FROM `users` WHERE `id` = '".$more['owner']."'")); $big = mysql_fetch_array(mysql_query("SELECT `hp`, `maxhp`, `id`, `login` FROM `users` WHERE `id` = '" . $more['owner'] . "'"));
?> ?>
<tr> <tr>
<td background="i/forest/bg_scroll_05.gif" align="center"> <td background="i/forest/bg_scroll_05.gif" align="center">
<a href=inf.php?<?=$big['id']?> target=_blank title="Информация о <?=$big['login']?>"><?=$big['login']?></a></td> <a href=inf.php?<?= $big['id'] ?> target=_blank
<td background="i/forest/bg_scroll_05.gif" align="center"><?=$big['hp']?>/<?=$big['maxhp']?> </td> title="Информация о <?= $big['login'] ?>"><?= $big['login'] ?></a></td>
<td background="i/forest/bg_scroll_05.gif" align="center"><?=$more['room']?></td> <td background="i/forest/bg_scroll_05.gif" align="center"><?= $big['hp'] ?>
<? /<?= $big['maxhp'] ?> </td>
echo "</tr>"; <td background="i/forest/bg_scroll_05.gif" align="center"><?= $more['room'] ?></td>
} <?
?> echo "</tr>";
</table></center> }
</td> ?>
</tr> </table>
</table> </center>
</td>
</tr>
</table>
<table cellpadding=5 width=100%><tr valign=top><td> <table cellpadding=5 width=100%>
<table align=center width=95% height=100% cellpadding=5> <tr valign=top>
<tr valign=top> <td>
<td width=100%> <table align=center width=95% height=100% cellpadding=5>
<tr valign=top>
<td width=100%>
<table width=100%><tr> <table width=100%>
<tr>
<td align=center colspan=2 id="navtbl"> <td align=center colspan=2 id="navtbl">
<? <?
if($rooms[$les_login['room']][1] != '') { if ($rooms[$les_login['room']][1] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?v=".$rooms[$les_login['room']][1]."';\" value=\"На север\" />"; echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?v=" . $rooms[$les_login['room']][1] . "';\" value=\"На север\" />";
} else { } else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?v=".$rooms[$les_login['room']][1]."';\" value=\"\" />"; echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?v=" . $rooms[$les_login['room']][1] . "';\" value=\"\" />";
} }
?> ?>
<br /><br /> <br/><br/>
<? <?
if($rooms[$les_login['room']][3] != '') { if ($rooms[$les_login['room']][3] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?l=".$rooms[$les_login['room']][3]."';\" value=\"На запад\" />"; echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?l=" . $rooms[$les_login['room']][3] . "';\" value=\"На запад\" />";
} else { } else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onClick=\"location.href='?l=".$rooms[$les_login['room']][3]."';\" value=\"\" />"; echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onClick=\"location.href='?l=" . $rooms[$les_login['room']][3] . "';\" value=\"\" />";
} }
?> ?>
&nbsp; &nbsp;
<? <?
if($rooms[$les_login['room']][4] != '') { if ($rooms[$les_login['room']][4] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?p=".$rooms[$les_login['room']][4]."';\" value=\"На восток\" />"; echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?p=" . $rooms[$les_login['room']][4] . "';\" value=\"На восток\" />";
} else { } else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?p=".$rooms[$les_login['room']][4]."';\" value=\"\" />"; echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?p=" . $rooms[$les_login['room']][4] . "';\" value=\"\" />";
} }
?>&nbsp; ?>&nbsp;
<br /><br /> <br/><br/>
<? <?
if($rooms[$les_login['room']][2] != '') { if ($rooms[$les_login['room']][2] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?n=".$rooms[$les_login['room']][2]."';\" value=\"На юг\" />"; echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?n=" . $rooms[$les_login['room']][2] . "';\" value=\"На юг\" />";
} else { } else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?n=".$rooms[$les_login['room']][2]."';\" value=\"\" />"; echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?n=" . $rooms[$les_login['room']][2] . "';\" value=\"\" />";
} }
?> ?>
<br /><br /> <br/><br/>
<? if($les_login['room'] == 'G8') { ?> <? if ($les_login['room'] == 'G8') { ?>
<input class=btn style="width:150px;height:20" type="button" value="Выйти из леса" onclick="location.href='?go=vixod';" /><br /><br /> <input class=btn style="width:150px;height:20" type="button"
<? } ?> value="Выйти из леса" onclick="location.href='?go=vixod';"/><br/>
</td> <br/>
<? $les = mysql_query("SELECT `id` FROM `les_res` WHERE `owner` = '".$user['id']."'"); ?> <? } ?>
</tr> </td>
<tr valign=top> <? $les = mysql_query("SELECT `id` FROM `les_res` WHERE `owner` = '" . $user['id'] . "'"); ?>
<td width="40%" valign="top"> </tr>
<a href='i/forest/les.jpg' target="_blank">Карта</a> <tr valign=top>
<br /> <td width="40%" valign="top">
<span>Расположение : <b><?=$les_login['room']?></b></span><br /> <a href='i/forest/les.jpg' target="_blank">Карта</a>
<span>Не собрано ресурсов : <b><?=$col = mysql_num_rows($les);?></b></span><br /><span id="moveid"></span> <br/>
<? <span>Расположение : <b><?= $les_login['room'] ?></b></span><br/>
$time = ($_SESSION['time']-time()); <span>Не собрано ресурсов : <b><?= $col = mysql_num_rows($les); ?></b></span><br/><span
if($time < 0) { $time = 0; } id="moveid"></span>
?> <?
<script>go_timer_on(<?=$time?>,200);</script> $time = ($_SESSION['time'] - time());
</td> if ($time < 0) {
<td width="60%" align=right valign="bottom"> $time = 0;
<? }
$le = mysql_query("SELECT `id`, `img`, `name`, `owner`, `kom` FROM `les_res` WHERE `owner` = '".$user['id']."' AND `kom` = '".$les_login['room']."'"); ?>
while($res = mysql_fetch_array($le)) { <script>go_timer_on(<?=$time?>, 200);</script>
echo "<a href='forest.php?res=".$res['id']."'><img src=\"i/sh/".$res['img']."\" title=\"".$res['name']."\" border=0 /></a>"; </td>
} <td width="60%" align=right valign="bottom">
?> <?
</td> $le = mysql_query("SELECT `id`, `img`, `name`, `owner`, `kom` FROM `les_res` WHERE `owner` = '" . $user['id'] . "' AND `kom` = '" . $les_login['room'] . "'");
</tr> while ($res = mysql_fetch_array($le)) {
</table> echo "<a href='forest.php?res=" . $res['id'] . "'><img src=\"i/sh/" . $res['img'] . "\" title=\"" . $res['name'] . "\" border=0 /></a>";
<? }
$img = rand(1, 24); ?>
?> </td>
<td align=center><div id=bgid style="background-color:#cccccc;border:#666666 1px solid;position:relative;width:450px;height:300px"><img class=img2 height=300 src="forest/<?=$img?>.jpg" /></div></td> </tr>
</tr> </table>
</table></td></tr></table> <?
</body> $img = rand(1, 24);
</html> ?>
<td align=center>
<div id=bgid
style="background-color:#cccccc;border:#666666 1px solid;position:relative;width:450px;height:300px">
<img class=img2 height=300 src="forest/<?= $img ?>.jpg"/></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</dd>

166
forum.php
View File

@ -33,7 +33,7 @@ $replasepost = '';
function parse_bb_code($text) function parse_bb_code($text)
{ {
$bbCodes = array( $bbCodes = [
// Стандартные BB коды // Стандартные BB коды
'/\[(\/?)(b|i|u|s)\s*\]/' => "<$1$2>", '/\[(\/?)(b|i|u|s)\s*\]/' => "<$1$2>",
'/\[(left|center|right)\]/' => '<p style="text-align:$1;">', '/\[(left|center|right)\]/' => '<p style="text-align:$1;">',
@ -44,138 +44,9 @@ function parse_bb_code($text)
'/\[quote\](.+?)\[\/quote\]/' => "<blockquote>$1</blockquote>", '/\[quote\](.+?)\[\/quote\]/' => "<blockquote>$1</blockquote>",
'/\[code\](.+?)\[\/code\]/' => "<pre><code>$1</code></pre>", '/\[code\](.+?)\[\/code\]/' => "<pre><code>$1</code></pre>",
// Смайлы // Смайлы
'/\:smile0\:/' => '<img src="i/forum/icon7.gif" />',
'/\:baby\:/' => '<img src="i/smile/baby.gif" />',
'/\:sniper\:/' => '<img src="i/smile/sniper.gif" />',
'/\:trup\:/' => '<img src="i/smile/trup.gif" />',
'/\:beggar\:/' => '<img src="i/smile/beggar.gif" />',
'/\:rotate\:/' => '<img src="i/smile/rotate.gif" />',
'/\:hello\:/' => '<img src="i/smile/hello.gif" />',
'/\:sten\:/' => '<img src="i/smile/sten.gif" />',
'/\:shuffle\:/' => '<img src="i/smile/shuffle.gif" />',
'/\:elix\:/' => '<img src="i/smile/elix.gif" />',
'/\:smil\:/' => '<img src="i/smile/smil.gif" />',
'/\:mdr\:/' => '<img src="i/smile/mdr.gif" />',
'/\:podz\:/' => '<img src="i/smile/podz.gif" />',
'/\:dont\:/' => '<img src="i/smile/dont.gif" />',
'/\:grust\:/' => '<img src="i/smile/grust.gif" />',
'/\:boks\:/' => '<img src="i/smile/boks.gif" />',
'/\:susel\:/' => '<img src="i/smile/susel.gif" />', '/\:susel\:/' => '<img src="i/smile/susel.gif" />',
'/\:dedmoroz\:/' => '<img src="i/smile/dedmoroz.gif" />',
'/\:creator\:/' => '<img src="i/smile/creator.gif" />',
'/\:no\:/' => '<img src="i/smile/no.gif" />',
'/\:horse\:/' => '<img src="i/smile/horse.gif" />',
'/\:vamp\:/' => '<img src="i/smile/vamp.gif" />',
'/\:eek\:/' => '<img src="i/smile/eek.gif" />',
'/\:sorry\:/' => '<img src="i/smile/sorry.gif" />',
'/\:friday\:/' => '<img src="i/smile/friday.gif" />',
'/\:obm\:/' => '<img src="i/smile/obm.gif" />',
'/\:smile\:/' => '<img src="i/smile/smile.gif" />',
'/\:nail\:/' => '<img src="i/smile/nail.gif" />',
'/\:gent\:/' => '<img src="i/smile/gent.gif" />',
'/\:beer\:/' => '<img src="i/smile/beer.gif" />',
'/\:inv\:/' => '<img src="i/smile/inv.gif" />',
'/\:fire\:/' => '<img src="i/smile/fire.gif" />',
'/\:dance1\:/' => '<img src="i/smile/dance1.gif" />',
'/\:maniac\:/' => '<img src="i/smile/maniac.gif" />',
'/\:kiss4\:/' => '<img src="i/smile/kiss4.gif" />',
'/\:confused\:/' => '<img src="i/smile/confused.gif" />',
'/\:kiss2\:/' => '<img src="i/smile/kiss2.gif" />',
'/\:snowfight\:/' => '<img src="i/smile/snowfight.gif" />',
'/\:row\:/' => '<img src="i/smile/row.gif" />',
'/\:naem\:/' => '<img src="i/smile/naem.gif" />',
'/\:radio1\:/' => '<img src="i/smile/radio1.gif" />',
'/\:fie\:/' => '<img src="i/smile/fie.gif" />',
'/\:love\:/' => '<img src="i/smile/love.gif" />',
'/\:sneeze\:/' => '<img src="i/smile/sneeze.gif" />',
'/\:mol\:/' => '<img src="i/smile/mol.gif" />',
'/\:showng\:/' => '<img src="i/smile/showng.gif" />',
'/\:rocket\:/' => '<img src="i/smile/rocket.gif" />',
'/\:dustman\:/' => '<img src="i/smile/dustman.gif" />',
'/\:rupor\:/' => '<img src="i/smile/rupor.gif" />',
'/\:nnn\:/' => '<img src="i/smile/nnn.gif" />',
'/\:snegur\:/' => '<img src="i/smile/snegur.gif" />',
'/\:dance2\:/' => '<img src="i/smile/dance2.gif" />',
'/\:jeer\:/' => '<img src="i/smile/jeer.gif" />',
'/\:kiss\:/' => '<img src="i/smile/kiss.gif" />',
'/\:ponder\:/' => '<img src="i/smile/ponder.gif" />', '/\:ponder\:/' => '<img src="i/smile/ponder.gif" />',
'/\:drink\:/' => '<img src="i/smile/drink.gif" />', ];
'/\:angel\:/' => '<img src="i/smile/angel.gif" />',
'/\:idea\:/' => '<img src="i/smile/idea.gif" />',
'/\:lady\:/' => '<img src="i/smile/lady.gif" />',
'/\:gun\:/' => '<img src="i/smile/gun.gif" />',
'/\:pif\:/' => '<img src="i/smile/pif.gif" />',
'/\:help\:/' => '<img src="i/smile/help.gif" />',
'/\:alch\:/' => '<img src="i/smile/alch.gif" />',
'/\:kiss3\:/' => '<img src="i/smile/kiss3.gif" />',
'/\:hug\:/' => '<img src="i/smile/hug.gif" />',
'/\:lordhaos\:/' => '<img src="i/smile/lordhaos.gif" />',
'/\:rose\:/' => '<img src="i/smile/rose.gif" />',
'/\:radio2\:/' => '<img src="i/smile/radio2.gif" />',
'/\:boks2\:/' => '<img src="i/smile/boks2.gif" />',
'/\:str\:/' => '<img src="i/smile/str.gif" />',
'/\:invis\:/' => '<img src="i/smile/invis.gif" />',
'/\:rev\:/' => '<img src="i/smile/rev.gif" />',
'/\:ok\:/' => '<img src="i/smile/ok.gif" />',
'/\:alien\:/' => '<img src="i/smile/alien.gif" />',
'/\:smash\:/' => '<img src="i/smile/smash.gif" />',
'/\:super\:/' => '<img src="i/smile/super.gif" />',
'/\:love2\:/' => '<img src="i/smile/love2.gif" />',
'/\:victory\:/' => '<img src="i/smile/victory.gif" />',
'/\:kruger\:/' => '<img src="i/smile/kruger.gif" />',
'/\:agree\:/' => '<img src="i/smile/agree.gif" />',
'/\:hi\:/' => '<img src="i/smile/hi.gif" />',
'/\:privet\:/' => '<img src="i/smile/privet.gif" />',
'/\:devil\:/' => '<img src="i/smile/devil.gif" />',
'/\:naem2\:/' => '<img src="i/smile/naem2.gif" />',
'/\:tongue\:/' => '<img src="i/smile/tongue.gif" />',
'/\:red\:/' => '<img src="i/smile/red.gif" />',
'/\:doc\:/' => '<img src="i/smile/doc.gif" />',
'/\:icon7\:/' => '<img src="i/forum/icon7.gif" />',
'/\:lightfly\:/' => '<img src="i/smile/lightfly.gif" />',
'/\:owl\:/' => '<img src="i/smile/owl.gif" />',
'/\:pirate\:/' => '<img src="i/smile/pirate.gif" />',
'/\:sword\:/' => '<img src="i/smile/sword.gif" />',
'/\:bye\:/' => '<img src="i/smile/bye.gif" />',
'/\:mad\:/' => '<img src="i/smile/mad.gif" />',
'/\:fingal\:/' => '<img src="i/smile/fingal.gif" />',
'/\:nono\:/' => '<img src="i/smile/nono.gif" />',
'/\:loveya\:/' => '<img src="i/smile/loveya.gif" />',
'/\:cry\:/' => '<img src="i/smile/cry.gif" />',
'/\:superng\:/' => '<img src="i/smile/superng.gif" />',
'/\:yes\:/' => '<img src="i/smile/yes.gif" />',
'/\:crying\:/' => '<img src="i/smile/crying.gif" />',
'/\:\'\(\:/' => '<img src="i/smile/crying.gif" />',
'/\:flowers\:/' => '<img src="i/smile/flowers.gif" />',
'/\:tease\:/' => '<img src="i/smile/tease.gif" />',
'/\:wink\:/' => '<img src="i/smile/wink.gif" />',
'/\:sharp\:/' => '<img src="i/smile/sharp.gif" />',
'/\:nunu\:/' => '<img src="i/smile/nunu.gif" />',
'/\:angel2\:/' => '<img src="i/smile/angel2.gif" />',
'/\:naem3\:/' => '<img src="i/smile/naem3.gif" />',
'/\:lick\:/' => '<img src="i/smile/lick.gif" />',
'/\:ninja\:/' => '<img src="i/smile/ninja.gif" />',
'/\:cat\:/' => '<img src="i/smile/cat.gif" />',
'/\:smoke\:/' => '<img src="i/smile/smoke.gif" />',
'/\:chtoza\:/' => '<img src="i/smile/chtoza.gif" />',
'/\:grace\:/' => '<img src="i/smile/grace.gif" />',
'/\:tongue2\:/' => '<img src="i/smile/tongue2.gif" />',
'/\:sorry2\:/' => '<img src="i/smile/sorry2.gif" />',
'/\:yar\:/' => '<img src="i/smile/yar.gif" />',
'/\:king2\:/' => '<img src="i/smile/king2.gif" />',
'/\:carreat\:/' => '<img src="i/smile/carreat.gif" />',
'/\:hlw\:/' => '<img src="i/smile/hlw.gif" />',
'/\:grenade\:/' => '<img src="i/smile/grenade.gif" />',
'/\:bow\:/' => '<img src="i/smile/bow.gif" />',
'/\:doc2\:/' => '<img src="i/smile/doc2.gif" />',
'/\:duel\:/' => '<img src="i/smile/duel.gif" />',
'/\:mag\:/' => '<img src="i/smile/mag.gif" />',
'/\:king\:/' => '<img src="i/smile/king.gif" />',
'/\:laugh\:/' => '<img src="i/smile/laugh.gif" />',
'/\:pal\:/' => '<img src="i/smile/pal.gif" />',
'/\:nun\:/' => '<img src="i/smile/nun.gif" />',
'/\:ura\:/' => '<img src="i/smile/ura.gif" />',
);
$text = preg_replace(array_keys($bbCodes), array_values($bbCodes), $text); $text = preg_replace(array_keys($bbCodes), array_values($bbCodes), $text);
$text = close_dangling_tags($text); $text = close_dangling_tags($text);
@ -335,19 +206,11 @@ if (isset($_GET['do']) && $isModerator == true) {
exit(); exit();
} }
} }
Template::header('Форум');
?> ?>
<!DOCTYPE HTML>
<html>
<head>
<title>Форум</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/wysibb/theme/default/wbbtheme.css"/> <link rel="stylesheet" href="css/wysibb/theme/default/wbbtheme.css"/>
<script type="text/javascript" language="JavaScript" src='js/forum.js'></script> <script type="text/javascript" language="JavaScript" src='js/forum.js'></script>
</head> <table width="100%" border="0">
<body>
<table width="100%" border="0">
<tr valign="top"> <tr valign="top">
<td width="200"> <td width="200">
<br/> <br/>
@ -449,7 +312,7 @@ if (isset($_GET['do']) && $isModerator == true) {
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if ($isModerator AND (isset($_GET['conf']) OR isset($_GET['page']))): ?> <?php if ($isModerator and (isset($_GET['conf']) or isset($_GET['page']))): ?>
<a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>"> <a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<small>Удалить</small> <small>Удалить</small>
</a> | </a> |
@ -473,8 +336,9 @@ if (isset($_GET['do']) && $isModerator == true) {
<table width="100%"> <table width="100%">
<tr> <tr>
<td> <td>
<?= $row['author'] ?> <span class="date">(<?= $row['date'] ?>)</span> <?= $row['author'] ?> <span
<?php if ($isModerator AND isset($_GET['conf']) AND isset($_GET['page'])): ?> class="date">(<?= $row['date'] ?>)</span>
<?php if ($isModerator and isset($_GET['conf']) and isset($_GET['page'])): ?>
<a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>"> <a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<small>Удалить</small> <small>Удалить</small>
</a> </a>
@ -692,9 +556,11 @@ if (isset($_GET['do']) && $isModerator == true) {
<input type="hidden" name="icon" value="13"> <input type="hidden" name="icon" value="13">
</td> </td>
<td align="right"> <td align="right">
<input type="submit" class="btn" value="Добавить" name="add"/> <input type="submit" class="btn" value="Добавить"
name="add"/>
<input type="hidden" name="n" value="klans"> <input type="hidden" name="n" value="klans">
<input type="hidden" id="act" name="act" value="add_branch"/> <input type="hidden" id="act" name="act"
value="add_branch"/>
</td> </td>
</tr> </tr>
</table> </table>
@ -708,13 +574,15 @@ if (isset($_GET['do']) && $isModerator == true) {
<? <?
} }
} }
} else echo ' <div style="width: 300px; margin: auto; font-weight: bold;">Ничего не найдено!</div> '; } else {
echo ' <div style="width: 300px; margin: auto; font-weight: bold;">Ничего не найдено!</div> ';
}
} }
?> ?>
<!-- End of text --> <!-- End of text -->
</td> </td>
</tr> </tr>
</table> </table>
<?php if ($isModerator == true): ?> <?php if ($isModerator == true): ?>
<form name='repltopic' method='post'> <form name='repltopic' method='post'>
@ -722,5 +590,3 @@ if (isset($_GET['do']) && $isModerator == true) {
<input type='hidden' id='numt' name='numt'/> <input type='hidden' id='numt' name='numt'/>
</form> </form>
<? endif; ?> <? endif; ?>
</body>
</html>

View File

@ -145,8 +145,6 @@ function takeshopitem($item, $table = "shop", $present = '', $onlyonetrip = '',
define('_BOTSEPARATOR_', 10000000); define('_BOTSEPARATOR_', 10000000);
header("Cache-Control: no-cache");
function level_up($uid) function level_up($uid)
{ {
$us = db::c()->query('SELECT `id`, `login`, `level`, `money`, `exp`, `nextup`, `stats`, `master`, `ip`, `in_tower` FROM `users` WHERE `id` =?i', $uid)->fetch_assoc(); $us = db::c()->query('SELECT `id`, `login`, `level`, `money`, `exp`, `nextup`, `stats`, `master`, `ip`, `in_tower` FROM `users` WHERE `id` =?i', $uid)->fetch_assoc();

View File

@ -6,20 +6,15 @@
*/ */
session_start(); session_start();
if (!isset($_SESSION['uid'])) header("Location: index.php"); if (empty($_SESSION['uid'])) header("Location: index.php");
//include("config.php"); //include("config.php");
//$msg = filter_input(INPUT_POST,'msg'); //$msg = filter_input(INPUT_POST,'msg');
//$uid = $_SESSION['uid']; //$uid = $_SESSION['uid'];
//if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg); //if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
Template::header('Окно игры');
?> ?>
<!doctype html> <style>
<html>
<head>
<title>Окно игры</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<style>
form { form {
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -69,10 +64,8 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
a img:hover { a img:hover {
box-shadow: 0 0 7px slategray; box-shadow: 0 0 7px slategray;
} }
</style> </style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<div class="wrap"> <div class="wrap">
<header> <header>
<a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32/33ff33?text=A"/></a> <a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32/33ff33?text=A"/></a>
@ -98,14 +91,12 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
<script> <script>
$("#game").load("main.php"); $("#game").load("main.php");
function loadlink(){ function loadlink() {
$('#chat').load('chat.php'); $('#chat').load('chat.php');
} }
loadlink(); // This will run on page load loadlink(); // This will run on page load
setInterval(function(){ setInterval(function () {
loadlink() // this will run after every 5 seconds loadlink() // this will run after every 5 seconds
}, 5000); }, 5000);
</script> </script>
</body>
</html>

103
game2.php
View File

@ -6,20 +6,15 @@
*/ */
session_start(); session_start();
if (!isset($_SESSION['uid'])) header("Location: index.php"); if (empty($_SESSION['uid'])) header("Location: index.php");
//include("config.php"); //include("config.php");
//$msg = filter_input(INPUT_POST,'msg'); //$msg = filter_input(INPUT_POST,'msg');
//$uid = $_SESSION['uid']; //$uid = $_SESSION['uid'];
//if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg); //if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
Template::header('Окно игры');
?> ?>
<!doctype html> <style>
<html>
<head>
<title>Окно игры</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<style>
form { form {
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -72,63 +67,71 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
.chat { .chat {
border:1px solid #333; border: 1px solid #333;
margin:15px; margin: 15px;
width:40%; width: 40%;
height:70%; height: 70%;
background:#555; background: #555;
color:#fff; color: #fff;
} }
.chat-messages { .chat-messages {
min-height:93%; min-height: 93%;
max-height:93%; max-height: 93%;
overflow:auto; overflow: auto;
} }
.chat-messages__content { .chat-messages__content {
padding:1px; padding: 1px;
} }
.chat__message { .chat__message {
border-left:3px solid #333; border-left: 3px solid #333;
margin-top:2px; margin-top: 2px;
padding:2px; padding: 2px;
} }
.chat__message_black { .chat__message_black {
border-color:#000; border-color: #000;
} }
.chat__message_blue { .chat__message_blue {
border-color:blue; border-color: blue;
} }
.chat__message_green { .chat__message_green {
border-color:green; border-color: green;
} }
.chat__message_red { .chat__message_red {
border-color:red; border-color: red;
} }
.chat-input { .chat-input {
min-height:6%; min-height: 6%;
} }
input { input {
font-family:arial; font-family: arial;
font-size:16px; font-size: 16px;
vertical-align:middle; vertical-align: middle;
background:#333; background: #333;
color:#fff; color: #fff;
border:0; border: 0;
display:inline-block; display: inline-block;
margin:1px; margin: 1px;
height:30px; height: 30px;
} }
.chat-form__input { .chat-form__input {
width:79%; width: 79%;
} }
.chat-form__submit { .chat-form__submit {
width:18%; width: 18%;
} }
</style> </style>
</head>
<body>
<div class="wrap"> <div class="wrap">
<header> <header>
Всякие заголовки, кнопки, ссылки, etc... Всякие заголовки, кнопки, ссылки, etc...
@ -143,7 +146,9 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
</div> </div>
<div class='chat-input'> <div class='chat-input'>
<form method='post' id='chat-form'> <form method='post' id='chat-form'>
<input id='message-text' class='chat-form__input' placeholder='Введите сообщение'> <input type='submit' class='chat-form__submit' value='=>'> <input id='message-text' class='chat-form__input' placeholder='Введите сообщение'> <input type='submit'
class='chat-form__submit'
value='=>'>
</form> </form>
</div> </div>
</div> </div>
@ -165,22 +170,22 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
//Переменные, которые будут отправляться //Переменные, которые будут отправляться
var var1 = null; var var1 = null;
var var2 = null; var var2 = null;
if(act == 'auth') { if (act == 'auth') {
//Если нужно авторизоваться, получаем логин и пароль, которые были переданы в функцию //Если нужно авторизоваться, получаем логин и пароль, которые были переданы в функцию
var1 = login; var1 = login;
var2 = password; var2 = password;
} else if(act == 'send') { } else if (act == 'send') {
//Если нужно отправить сообщение, то получаем текст из поля ввода //Если нужно отправить сообщение, то получаем текст из поля ввода
var1 = messageInput.value; var1 = messageInput.value;
} }
$.post('includes/chat.php',{ //Отправляем переменные $.post('includes/chat.php', { //Отправляем переменные
act: act, act: act,
var1: var1, var1: var1,
var2: var2 var2: var2
}).done(function (data) { }).done(function (data) {
//Заносим в контейнер ответ от сервера //Заносим в контейнер ответ от сервера
messages__container.innerHTML = data; messages__container.innerHTML = data;
if(act == 'send') { if (act == 'send') {
//Если нужно было отправить сообщение, очищаем поле ввода //Если нужно было отправить сообщение, очищаем поле ввода
messageInput.value = ''; messageInput.value = '';
} }
@ -190,7 +195,8 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
function update() { function update() {
send_request('load'); send_request('load');
} }
interval = setInterval(update,500);
interval = setInterval(update, 500);
//отлавливается событие отправки формы — это поможет отказаться от обновления страницы: //отлавливается событие отправки формы — это поможет отказаться от обновления страницы:
sendForm.onsubmit = function () { sendForm.onsubmit = function () {
@ -198,6 +204,3 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
return false; //Возвращаем ложь, чтобы остановить классическую отправку формы return false; //Возвращаем ложь, чтобы остановить классическую отправку формы
}; };
</script> </script>
</body>
</html>

View File

@ -3,30 +3,46 @@
* */ * */
session_start(); session_start();
define("CASTLE_MAX_LEVEL", 10); define("CASTLE_MAX_LEVEL", 10);
if ($_SESSION['uid'] == null) header("Location: index.php"); if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
require_once 'functions.php'; require_once 'functions.php';
if (!($user['room'] >= 37 AND $user['room'] <= 41)) { if (!($user->room >= 37 && $user->room <= 41)) {
header("Location: main.php"); header("Location: main.php");
die(); exit;
} }
$castleOwners = db::c()->query('SELECT * FROM `clans` WHERE `short` = (SELECT * FROM `variables` WHERE `var` = "?s")', 'gotzamok'); $castleOwners = db::c()->query('SELECT * FROM `clans` WHERE `short` = (SELECT * FROM `variables` WHERE `var` = "?s")', 'gotzamok');
if ($castleOwners['id'] == $user['klan']) { if ($castleOwners['id'] == $user['klan']) {
// если мой клан // если мой клан
if ($_GET['goto'] == 'arsenal') $user['room'] = 38; if ($_GET['goto'] == 'arsenal') {
if ($_GET['goto'] == 'home') $user['room'] = 37; $user->room = 38;
if ($_GET['goto'] == 'dvor') $user['room'] = 39; }
if ($_GET['goto'] == 'master') $user['room'] = 40; if ($_GET['goto'] == 'home') {
if ($_GET['goto'] == 'rest') $user['room'] = 41; $user->room = 37;
}
if ($_GET['goto'] == 'dvor') {
$user->room = 39;
}
if ($_GET['goto'] == 'master') {
$user->room = 40;
}
if ($_GET['goto'] == 'rest') {
$user->room = 41;
}
if (in_array($_GET['goto'], ['arsenal', 'home', 'dvor', 'master', 'rest'])) { 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->room, $user->room, $_SESSION['uid']);
header('location: gotzamok.php'); header('location: gotzamok.php');
} else $status = 'В этом замке нет такого места!'; } else {
$status = 'В этом замке нет такого места!';
}
} }
switch ($user['room']) { switch ($user->room) {
case '37' : case '37' :
$backgroundImage = '689_small_550.jpg'; $backgroundImage = '689_small_550.jpg';
break; break;
@ -35,13 +51,13 @@ switch ($user['room']) {
break; break;
} }
if ($user['room'] == 38) { if ($user->room == 38) {
$glava = db::c()->query('SELECT `glava` FROM `clans` WHERE `short` = "?s"', $user['klan'])->fetch_assoc(); $glava = db::c()->query('SELECT `glava` 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();
if ($_SESSION['uid'] == $item['owner'] OR $_SESSION['uid'] == $glava['glava']) { if ($_SESSION['uid'] == $item['owner'] or $_SESSION['uid'] == $glava['glava']) {
$status = 'Вы забрали вещь из арсенала.'; $status = 'Вы забрали вещь из арсенала.';
db::c()->query('UPDATE `inventory` SET `owner` = ?i WHERE `id` = ?i', $_SESSION['uid'], $item['id_it']); db::c()->query('UPDATE `inventory` SET `owner` = ?i WHERE `id` = ?i', $_SESSION['uid'], $item['id_it']);
db::c()->query('DELETE FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back']); db::c()->query('DELETE FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back']);
@ -59,7 +75,7 @@ if ($user['room'] == 38) {
} }
} }
if ($user['room'] == 40) { if ($user->room == 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();
@ -80,24 +96,20 @@ if ($user['room'] == 40) {
} else $status = 'Не хватает денег!'; } else $status = 'Не хватает денег!';
} }
} }
Template::header('Клановый замок');
?> ?>
<HTML>
<head>
<link rel=stylesheet href="css/main.css">
<script src="js/main.js"></script> <script src="js/main.js"></script>
<meta charset="utf-8">
<style> <style>
body { body {
background: url('i/<?= $backgroundImage ?>.jpg') no-repeat top right; background: url('i/<?= $backgroundImage ?>.jpg') no-repeat top right;
} }
</style> </style>
</head> <h3>Приветствую тебя в замке <img src='i/clan/<?= $castleOwners['short'] ?>.png'> <?= $castleOwners['name'] ?>,
<body> воин!</h3>
<h3>Приветствую тебя в замке <img src='i/clan/<?= $castleOwners['short'] ?>.gif'> <?= $castleOwners['name'] ?>, воин!</h3> <div style="text-align: right;">
<div style="text-align: right;">
<button onClick="hrefToFrame('city.php?bps')">Вернуться</button> <button onClick="hrefToFrame('city.php?bps')">Вернуться</button>
</div> </div>
<div><?php if (!empty($status)) err($status); ?></div> <div><?php if (!empty($status)) err($status); ?></div>
<?php <?php
if ($castleOwners['id'] == $user['klan']) { ?> if ($castleOwners['id'] == $user['klan']) { ?>
@ -107,32 +119,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->room == 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->room == 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->room == 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->room == 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->room == 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->room == 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;">
@ -149,12 +161,12 @@ if ($castleOwners['id'] == $user['klan']) { ?>
<BR> <BR>
<small>Положил: <?= Nick::id($item['owner'])->full(1) ?><BR></small> <small>Положил: <?= Nick::id($item['owner'])->full(1) ?><BR></small>
<?php <?php
if ($_SESSION['uid'] == $item['owner'] OR $_SESSION['uid'] == $glava['glava']): ?> if ($_SESSION['uid'] == $item['owner'] or $_SESSION['uid'] == $glava['glava']): ?>
<A HREF="?back=<?= $item['id'] ?>">забрать</A><BR> <A HREF="?back=<?= $item['id'] ?>">забрать</A><BR>
<?php else: $status = 'Вы не можете забрать эту вещь из арсенала.'; <?php else: $status = 'Вы не можете забрать эту вещь из арсенала.';
endif; ?> endif; ?>
</TD> </TD>
<TD valign=top> Тут был showitem($row); </TD> <TD valign=top> Тут был showitem($row);</TD>
</TR> </TR>
<?php endwhile; ?> <?php endwhile; ?>
</table> </table>
@ -168,14 +180,14 @@ if ($castleOwners['id'] == $user['klan']) { ?>
<IMG SRC="i/sh/<?= $row['img'] ?>"> <IMG SRC="i/sh/<?= $row['img'] ?>">
<BR><A HREF="?add=<?= $row['id'] ?>&sid=&sale=1">сдать в арсенал</A> <BR><A HREF="?add=<?= $row['id'] ?>&sid=&sale=1">сдать в арсенал</A>
</TD> </TD>
<TD valign=top> Тут был showitem($row); </TD> <TD valign=top> Тут был showitem($row);</TD>
</TR> </TR>
<?php endwhile; ?> <?php endwhile; ?>
</table> </table>
<?php <?php
endif; endif;
endif; endif;
if ($user['room'] == 40): ?> if ($user->room == 40): ?>
<h4>Мастерские</h4> <h4>Мастерские</h4>
<div style="background: silver; border: 1px solid dimgray;"> <div style="background: silver; border: 1px solid dimgray;">
Здесь вы можете улучшить оборонные способности вашего замка. Здесь вы можете улучшить оборонные способности вашего замка.
@ -192,7 +204,7 @@ if ($castleOwners['id'] == $user['klan']) { ?>
</div> </div>
</div> </div>
<?php endif; <?php endif;
if ($user['room'] == 41): ?> if ($user->room == 41): ?>
<h4>Комнаты отдыха</h4> <h4>Комнаты отдыха</h4>
<div style="background: silver; border: 1px solid dimgray;"> <div style="background: silver; border: 1px solid dimgray;">
Посиди в тишине, внутри стен. Тут нет врагов. Тут спокойно. Посиди в тишине, внутри стен. Тут нет врагов. Тут спокойно.
@ -202,5 +214,3 @@ if ($castleOwners['id'] == $user['klan']) { ?>
</tr> </tr>
</table> </table>
<? } else $status = 'Ворота замка закрыты, привратник отказывается даже разговаривать с тобой...'; ?> <? } else $status = 'Ворота замка закрыты, привратник отказывается даже разговаривать с тобой...'; ?>
</body>
</HTML>

View File

@ -1,21 +1,24 @@
<?php <?php
session_start(); session_start();
if(!isset($_SESSION['uid'])) { die(); } if (empty($_SESSION['uid'])) {
exit;
}
require_once 'functions.php'; require_once 'functions.php';
$error = ''; $error = '';
function login($uid) { function login($uid)
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan` FROM `users` WHERE `id` = "'.mysql_real_escape_string($uid).'" LIMIT 1')); {
if(isset($user['id'])) { $user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan` FROM `users` WHERE `id` = "' . mysql_real_escape_string($uid) . '" LIMIT 1'));
$align_img = '<img src="i/align_'.($user['align']?$user['align']:0).'.gif" /> '; if (isset($user['id'])) {
if($user['klan'] != '') { $align_img = '<img src="i/align_' . ($user['align'] ? $user['align'] : 0) . '.gif" /> ';
$clan = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `clans` WHERE `id` = "'.$user['klan'].'" LIMIT 1')); if ($user['klan'] != '') {
$clan_img = '<img title="'.$clan['name'].'" src="i/clan/'.$clan['name'].'.gif" /> '; $clan = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `clans` WHERE `id` = "' . $user['klan'] . '" LIMIT 1'));
$clan_img = '<img title="' . $clan['name'] . '" src="i/clan/' . $clan['name'] . '.png" /> ';
} else { } else {
$clan_img = ''; $clan_img = '';
} }
$r = $align_img.$clan_img.' <b>'.$user['login'].' ['.$user['level'].']</b><a href="http://capitalcity.old-dark.ru/inf.php?id='.$user['id'].'" target="_blank"><img src="http://capitalcity.old-dark.ru/i/inf.gif" /></a>'; $r = $align_img . $clan_img . ' <b>' . $user['login'] . ' [' . $user['level'] . ']</b><a href="/inf.php?' . $user['id'] . '" target="_blank"><img src="/i/inf.gif" /></a>';
} else { } else {
$r = 'Место свободно'; $r = 'Место свободно';
} }
@ -23,46 +26,47 @@ function login($uid) {
} }
function form_start($uid) { function form_start($uid)
$r = ''; $go = ''; {
if($uid > 0) { $r = '';
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan`, `zayrist` FROM `users` WHERE `id` = "'.$uid.'" LIMIT 1')); $go = '';
if(isset($user['id'])) { if ($uid > 0) {
if($user['zayrist']) { $user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan`, `zayrist` FROM `users` WHERE `id` = "' . $uid . '" LIMIT 1'));
$zv = mysql_fetch_array(mysql_query('SELECT `id`, `name`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1')); if (isset($user['id']) ?? $user['zayrist']) {
if(isset($zv['id'])) { $zv = mysql_fetch_array(mysql_query('SELECT `id`, `name`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1'));
if (isset($zv['id'])) {
$r .= '<form method="POST">'; $r .= '<form method="POST">';
if($zv['uid1'] == $user['id']) { if ($zv['uid1'] == $user['id']) {
$go = '<input type="submit" name="startZv" value="Начать поход" /> / '; $go = '<input type="submit" name="startZv" value="Начать поход" /> / ';
} }
for($i = 1; $i <= 3; $i++) { for ($i = 1; $i <= 3; $i++) {
$nick .= login($zv['uid'.$i]).', '; $nick .= login($zv['uid' . $i]) . ', ';
} }
$nc = rtrim($nick, ', '); $nc = rtrim($nick, ', ');
$r .= '<table style="padding-top: 25px;"><tr><td>Ваша группа («'.$zv['name'].'»): '.$nc.' '.$go.'<input type="submit" name="leaveZv" value="Покинуть заявку" /></td></tr></table>'; $r .= '<table style="padding-top: 25px;"><tr><td>Ваша группа («' . $zv['name'] . '»): ' . $nc . ' ' . $go . '<input type="submit" name="leaveZv" value="Покинуть заявку" /></td></tr></table>';
$r .= '</form>'; $r .= '</form>';
} else { } else {
$user['zayrist'] = 0; $user['zayrist'] = 0;
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
}
} }
} }
} }
return $r; return $r;
} }
function forms($level) { function forms($level)
{
$r = '<br /></br />'; $r = '<br /></br />';
$sp = mysql_query('SELECT `id`, `name`, `pass`, `comment`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `level` = "'.(int)$level.'" ORDER BY `id` DESC'); $sp = mysql_query('SELECT `id`, `name`, `pass`, `comment`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `level` = "' . (int)$level . '" ORDER BY `id` DESC');
if(mysql_num_rows($sp) > 0) { if (mysql_num_rows($sp) > 0) {
while($pl = mysql_fetch_array($sp)) { while ($pl = mysql_fetch_array($sp)) {
$i = 1; $i = 1;
while($i <= 3) { while ($i <= 3) {
$nick .= login($pl['uid'.$i]).', '; $nick .= login($pl['uid' . $i]) . ', ';
$i++; $i++;
} }
$nc = rtrim($nick, ', '); $nc = rtrim($nick, ', ');
$r .= '<table><tr><td>Группа («'.$pl['name'].'»): '.$nc.' <input type="hidden" name="zvId" value="'.$pl['id'].'" /> <input type="submit" name="gotoZv" value="Вступить в заявку" /></td></tr></table>'; $r .= '<table><tr><td>Группа («' . $pl['name'] . '»): ' . $nc . ' <input type="hidden" name="zvId" value="' . $pl['id'] . '" /> <input type="submit" name="gotoZv" value="Вступить в заявку" /></td></tr></table>';
} }
} else { } else {
$r .= '<i>Заявок вашего уровня нет</i>'; $r .= '<i>Заявок вашего уровня нет</i>';
@ -71,21 +75,21 @@ function forms($level) {
return $r; return $r;
} }
if(isset($_POST['buyFirst'])) { if (isset($_POST['buyFirst'])) {
if(isset($user['id'])) { if (isset($user['id'])) {
if($user['money'] >= 5) { if ($user['money'] >= 5) {
$Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "'.$user['id'].'" LIMIT 1')); $Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if(isset($Firts['id'])) { if (isset($Firts['id'])) {
$error = 'У Вас уже есть Фамильный Герб'; $error = 'У Вас уже есть Фамильный Герб';
} else { } else {
$Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "'.$user['id'].'" LIMIT 1')); $Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if(isset($Second['id'])) { if (isset($Second['id'])) {
$error = 'У Вас уже есть Фамильный Герб'; $error = 'У Вас уже есть Фамильный Герб';
} else { } else {
$user['money'] -= 5; $user['money'] -= 5;
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
takeshopitem(1930, 'shop', '', '', 0, 0, $user['id'], 1, '', 0); takeshopitem(1930, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"".$user['login']."\" купил Фамильный Герб за 5кр.', '1', '".time()."')"); mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил Фамильный Герб за 5кр.', '1', '" . time() . "')");
$error = 'Вы купили Фамильный Герб'; $error = 'Вы купили Фамильный Герб';
} }
} }
@ -97,21 +101,21 @@ if(isset($_POST['buyFirst'])) {
} }
} }
if(isset($_POST['buySecond'])) { if (isset($_POST['buySecond'])) {
if(isset($user['id'])) { if (isset($user['id'])) {
if($user['money'] >= 15) { if ($user['money'] >= 15) {
$Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "'.$user['id'].'" LIMIT 1')); $Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if(isset($Firts['id'])) { if (isset($Firts['id'])) {
$error = 'У Вас уже есть Фамильный Герб'; $error = 'У Вас уже есть Фамильный Герб';
} else { } else {
$Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "'.$user['id'].'" LIMIT 1')); $Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if(isset($Second['id'])) { if (isset($Second['id'])) {
$error = 'У Вас уже есть Фамильный Герб'; $error = 'У Вас уже есть Фамильный Герб';
} else { } else {
$user['money'] -= 15; $user['money'] -= 15;
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
takeshopitem(1931, 'shop', '', '', 0, 0, $user['id'], 1, '', 0); takeshopitem(1931, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"".$user['login']."\" купил Фамильный Герб (x2) за 15кр.', '1', '".time()."')"); mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил Фамильный Герб (x2) за 15кр.', '1', '" . time() . "')");
$error = 'Вы купили Фамильный Герб (x2)'; $error = 'Вы купили Фамильный Герб (x2)';
} }
} }
@ -123,27 +127,27 @@ if(isset($_POST['buySecond'])) {
} }
} }
if($_POST['addZayavka']) { if ($_POST['addZayavka']) {
if(isset($user['id'])) { if (isset($user['id'])) {
$name = mysql_real_escape_string($_POST['nameZv']); $name = mysql_real_escape_string($_POST['nameZv']);
$pass = mysql_real_escape_string($_POST['passZv']); $pass = mysql_real_escape_string($_POST['passZv']);
$comment = mysql_real_escape_string($_POST['commentZv']); $comment = mysql_real_escape_string($_POST['commentZv']);
$zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1')); $zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1'));
if($user['zayrist'] > 0 && isset($zv['id'])) { if ($user['zayrist'] > 0 && isset($zv['id'])) {
$error = 'Вы уже состоите в заявке'; $error = 'Вы уже состоите в заявке';
} elseif(strlen($name) > 15) { } elseif (strlen($name) > 15) {
$error = 'Название может состоять максимум из 15 символов'; $error = 'Название может состоять максимум из 15 символов';
} elseif(strlen($name) < 3) { } elseif (strlen($name) < 3) {
$error = 'Название может состоять минимум из 3 символов'; $error = 'Название может состоять минимум из 3 символов';
} elseif(strlen($pass) > 6) { } elseif (strlen($pass) > 6) {
$error = 'Пароль может состоять максимум из 6 символов'; $error = 'Пароль может состоять максимум из 6 символов';
} elseif(strlen($comment) > 20) { } elseif (strlen($comment) > 20) {
$error = 'Комментарий может состоять максимум из 20 символов'; $error = 'Комментарий может состоять максимум из 20 символов';
} else { } else {
mysql_query('INSERT INTO `group_ristal` (`name`, `pass`, `comment`, `time`, `uid1`) VALUES ("'.$name.'", "'.$pass.'", "'.$comment.'", "'.time().'", "'.$user['id'].'")'); mysql_query('INSERT INTO `group_ristal` (`name`, `pass`, `comment`, `time`, `uid1`) VALUES ("' . $name . '", "' . $pass . '", "' . $comment . '", "' . time() . '", "' . $user['id'] . '")');
$user['zayrist'] = mysql_insert_id(); $user['zayrist'] = mysql_insert_id();
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
$error = 'Заявка создана'; $error = 'Заявка создана';
} }
} else { } else {
@ -151,121 +155,156 @@ if($_POST['addZayavka']) {
} }
} }
if(isset($_POST['leaveZv'])) { if (isset($_POST['leaveZv']) ?? $user['zayrist']) {
if($user['zayrist'] > 0) { $zv = mysql_fetch_array(mysql_query('SELECT `id`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1'));
$zv = mysql_fetch_array(mysql_query('SELECT `id`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1')); if (isset($zv['id'])) {
if(isset($zv['id'])) { $i = 1;
$i = 1; $j = 3; $k = 0; $h = 0; $j = 3;
while($i <= 3) { $k = 0;
if($k == 0 && $zv['uid'.$i] != $user['id']) { $h = 0;
$k = $zv['uid'.$i]; while ($i <= 3) {
if ($k == 0 && $zv['uid' . $i] != $user['id']) {
$k = $zv['uid' . $i];
$h = $i; $h = $i;
} }
$i++; $i++;
} }
$i = 1; $i = 1;
while($i <= 3) { while ($i <= 3) {
if($zv['uid'.$i] == $user['id']) { if ($zv['uid' . $i] == $user['id']) {
if($i > 1) { if ($i > 1) {
$zv['uid'.$i] = 0; $zv['uid' . $i] = 0;
} else { } else {
$zv['uid'.$i] = $k; $zv['uid' . $i] = $k;
$zv['uid'.$h] = 0; $zv['uid' . $h] = 0;
} }
} }
if($zv['uid'.$i] == 0) { if ($zv['uid' . $i] == 0) {
$j--; $j--;
} }
$i++; $i++;
} }
if($j < 1) { if ($j < 1) {
mysql_query('DELETE FROM `group_ristal` WHERE `id` = "'.$zv['id'].'" LIMIT 1'); mysql_query('DELETE FROM `group_ristal` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
$error = 'Заявка была удалена<br />'; $error = 'Заявка была удалена<br />';
$user['zayrist'] = 0; $user['zayrist'] = 0;
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
} else { } else {
mysql_query('UPDATE `group_ristal` SET `uid1` = "'.$zv['uid1'].'", `uid2` = "'.$zv['uid2'].'", `uid3` = "'.$zv['uid3'].'" WHERE `id` = "'.$zv['id'].'" lIMIT 1'); mysql_query('UPDATE `group_ristal` SET `uid1` = "' . $zv['uid1'] . '", `uid2` = "' . $zv['uid2'] . '", `uid3` = "' . $zv['uid3'] . '" WHERE `id` = "' . $zv['id'] . '" lIMIT 1');
$user['zayrist'] = 0; $user['zayrist'] = 0;
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
$error = 'Вы покинули заявку<br />'; $error = 'Вы покинули заявку<br />';
} }
unset($zv); unset($zv);
} }
}
} }
if($_GET['exit'] == 1) { if ($_GET['exit'] == 1) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"'); mysql_query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
header('Location: city.php'); header('Location: city.php');
} }
Template::header('group_arena');
?> ?>
<html lang="ru"> <script>
<head> function growl(title, color, message, stycky) {
<title></title> if (!stycky) {
<meta charset="UTF-8" /> stycky = false;
<link rel="stylesheet" href="css/main.css" /> }
<script>function growl(title, color, message, stycky) { if(!stycky) { stycky = false; } if(!color) { color = 'Red'; } $.jGrowl(message, { header: '<img src="/i/jgrowl_moover.png" class="jgrowl-moover" title="Передвинуть" style="cursor: pointer;" /> <font style="color: '+color+';">'+title+'</font>', sticky: stycky, glue: 'before' }); }</script> if (!color) {
<script>function shows() { color = 'Red';
const clas = $("#alt").attr('class'); }
$("#mkgrp").toggle(); if(clas == 'show') { $("#alt").attr('class','hide'); $("#alt").text('Скрыть ...'); } else { $("#alt").attr('class','show'); $("#alt").text('Создать группу'); } }</script> $.jGrowl(message, {
<style>body { background-image: url('i/r240_1.jpg'); background-repeat: no-repeat; background-position: top right; }</style> header: '<img src="/i/jgrowl_moover.png" class="jgrowl-moover" title="Передвинуть" style="cursor: pointer;" /> <font style="color: ' + color + ';">' + title + '</font>',
</head> sticky: stycky,
glue: 'before'
});
}
<body > function shows() {
<table class="allzeroes"> const clas = $("#alt").attr('class');
$("#mkgrp").toggle();
if (clas == 'show') {
$("#alt").attr('class', 'hide');
$("#alt").text('Скрыть ...');
} else {
$("#alt").attr('class', 'show');
$("#alt").text('Создать группу');
}
}</script>
<style>
body {
background-image: url('i/r240_1.jpg');
background-repeat: no-repeat;
background-position: top right;
}
</style>
<table class="allzeroes">
<tr> <tr>
<td> <td>
<div align=center> <div align=center>
<h3>Турниры: Групповые сражения.</h3> <h3>Турниры: Групповые сражения.</h3>
<b>Внимание! В боях этой локации разрешается использовать свитки "Восстановления энергии" номиналом не более 180НР!</b><br /><br /> <b>Внимание! В боях этой локации разрешается использовать свитки "Восстановления энергии" номиналом не
<span style="color: Red;"><b>Внимание! При старте группового турнира руны автоматически будут сняты с персонажа. <br />Проверьте, что ваши вещи после снятия рун не упадут, и не забудьте надеть руны после выхода из локации!</b></span> более 180НР!</b><br/><br/>
<span style="color: Red;"><b>Внимание! При старте группового турнира руны автоматически будут сняты с персонажа. <br/>Проверьте, что ваши вещи после снятия рун не упадут, и не забудьте надеть руны после выхода из локации!</b></span>
</div> </div>
<? if($user['zayrist'] == 0) { ?><div align=left><h4>Принять участие в турнире:</h4></div><a onclick="shows();" href="#" class="show" id="alt">Создать группу</a><br /><? echo forms($user['level']); } else { echo form_start($user['id']); } ?> <? if ($user['zayrist'] == 0) { ?>
<div align=left><h4>Принять участие в турнире:</h4></div><a onclick="shows();" href="#" class="show"
id="alt">Создать группу</a>
<br/><? echo forms($user['level']);
} else {
echo form_start($user['id']);
} ?>
<div id="mkgrp" style="display: none;"> <div id="mkgrp" style="display: none;">
<fieldset style="text-align: justify; width: 250px; max-width: 250px; height: 100px; max-height: 100px; margin-top: 15px;"> <fieldset
style="text-align: justify; width: 250px; max-width: 250px; height: 100px; max-height: 100px; margin-top: 15px;">
<form method="post"> <form method="post">
Название: <input type="text" name="nameZv" size="20" /><br /> Название: <input type="text" name="nameZv" size="20"/><br/>
Комментарий: <input type="text" name="commentZv" size="15" /><br /> Комментарий: <input type="text" name="commentZv" size="15"/><br/>
Пароль: <input type="text" name="passZv" size="10" /><br /><br /> Пароль: <input type="text" name="passZv" size="10"/><br/><br/>
<input type="submit" name="addZayavka" value="Создать группу" /> <input type="submit" name="addZayavka" value="Создать группу"/>
</form> </form>
</fieldset> </fieldset>
</div> </div>
<div align="left"><p>&nbsp;</p><h4>Победители 10-ти предыдущих турниров: <span id="levelCheck"><?=$user['level'];?></span>-е уровни </h4></div> <div align="left"><p>&nbsp;</p><h4>Победители 10-ти предыдущих турниров: <span
id="levelCheck"><?= $user['level']; ?></span>-е уровни </h4></div>
<div id="rate"></div> <div id="rate"></div>
</td> </td>
<td align=right><button onclick="location.href='city.php?zaliv'">Вернуться</button><br /><br /> <td align=right>
<button onclick="location.href='city.php?zaliv'">Вернуться</button>
<br/><br/>
<form method="POST"> <form method="POST">
<input type="submit" value="Купить «Фамильный Герб» 5 кр." style="background-color: #A9AFC0;" name="buyFirst" /> <input type="submit" value="Купить «Фамильный Герб» 5 кр." style="background-color: #A9AFC0;"
<input type="submit" value="Купить «Фамильный Герб (х2)» 15 кр." style="background-color: #A9AFC0;" name="buySecond" /> name="buyFirst"/>
<input type="submit" value="Купить «Фамильный Герб (х2)» 15 кр." style="background-color: #A9AFC0;"
name="buySecond"/>
</form> </form>
</td> </td>
</tr> </tr>
</table> </table>
<div id="response"></div> <div id="response"></div>
<script> <script>
$(function() { $(function () {
let level =; let level =;
$('#rate').load('ajax/rate_ruins.php?level='+level); $('#rate').load('ajax/rate_ruins.php?level=' + level);
$.jGrowl.defaults.closerTemplate = '<div style="text-align: center; cursor: pointer;"><b>[ Закрыть ]</b></div>'; $.jGrowl.defaults.closerTemplate = '<div style="text-align: center; cursor: pointer;"><b>[ Закрыть ]</b></div>';
$.jGrowl.defaults.closeTemplate = '<img src="i/clear.gif" alt="x" title="Закрыть" />'; $.jGrowl.defaults.closeTemplate = '<img src="i/clear.gif" alt="x" title="Закрыть" />';
$('body').delegate('div#jGrowl .jgrowl-moover', 'click', function() { $('body').delegate('div#jGrowl .jgrowl-moover', 'click', function () {
const j = $(this).closest('div#jGrowl'); const j = $(this).closest('div#jGrowl');
const c = j.hasClass('top-right') ? 'top-left' : 'top-right'; const c = j.hasClass('top-right') ? 'top-left' : 'top-right';
j.removeClass('top-left top-right').addClass(c); j.removeClass('top-left top-right').addClass(c);
}); });
$("#rate").on("click", "a", function(e) { $("#rate").on("click", "a", function (e) {
const level = $(this).attr("id"); const level = $(this).attr("id");
$('#rate').load('ajax/rate_ruins.php?level='+level); $('#rate').load('ajax/rate_ruins.php?level=' + level);
}); });
}); });
</script> </script>
<?if($error != '') { echo "<script>growl('Внимание', 'Red', '$error');</script>"; } ?> <? if ($error != '') {
</body> echo "<script>growl('Внимание', 'Red', '$error');</script>";
</html> }

View File

@ -42,34 +42,21 @@ $hr = new hellround;
$mytrip = $hr->is_in_trip($user['id']); $mytrip = $hr->is_in_trip($user['id']);
$tr = $hr->get_par($mytrip); $tr = $hr->get_par($mytrip);
Template::header('hell');
if ($mytrip > 0) { if ($mytrip > 0) {
?> ?>
<HTML>
<HEAD>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<style> <style>
body { body {
background-image: url('i/hell. jpg'); background-image: url('i/hell.jpg');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: top right; background-position: top right;
} }
</style> </style>
</HEAD> <?php
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#e0e0e0>
<?
echo "<h3>Приближается <i>" . ($tr['volna'] + 1) . "</i> волна нашествия...</h3>"; echo "<h3>Приближается <i>" . ($tr['volna'] + 1) . "</i> волна нашествия...</h3>";
// диалоговый бот // диалоговый бот
?>
<table width=100%>
</table>
</BODY>
</HTML>
<?
} else { } else {
if ($_GET['start'] > 0) { if ($_GET['start'] > 0) {
$f = mysql_fetch_array(mysql_query("SELECT `date_out` FROM `hellround_pohod` WHERE `owner`= " . $user['id'] . " ORDER by `id` DESC LIMIT 1;")); $f = mysql_fetch_array(mysql_query("SELECT `date_out` FROM `hellround_pohod` WHERE `owner`= " . $user['id'] . " ORDER by `id` DESC LIMIT 1;"));
if ((time() - strtotime($f['date_out'])) < 3600 * 24) { if ((time() - strtotime($f['date_out'])) < 3600 * 24) {
@ -82,20 +69,14 @@ if ($mytrip > 0) {
} }
?> ?>
<HTML>
<HEAD>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<style> <style>
body { body {
background-image: url('i/hell. jpg'); background-image: url('i/hell.jpg');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: top right; background-position: top right;
} }
</style> </style>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#e0e0e0>
<TABLE border=0 width=100% cellspacing="0" cellpadding="0"> <TABLE border=0 width=100% cellspacing="0" cellpadding="0">
<td align=left> <td align=left>
<INPUT TYPE="button" onclick="location.href = 'hell.php?start=1';" value="НАЧАТЬ ПОХОД" name="strah"> <INPUT TYPE="button" onclick="location.href = 'hell.php?start=1';" value="НАЧАТЬ ПОХОД" name="strah">
@ -139,8 +120,5 @@ if ($mytrip > 0) {
</fieldset> </fieldset>
</center> </center>
</FORM> </FORM>
</BODY>
</HTML>
<? <?
} }
?>

View File

@ -1,14 +1,18 @@
<? <?php
session_start(); session_start();
if(!isset($_SESSION['uid'])) { header('Location: index.php'); die(); } if (empty($_SESSION['uid'])) {
header('Location: index.php');
exit;
}
include('config.php'); include('config.php');
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$_SESSION['uid'].'" LIMIT 1')); $user = new User($_SESSION['uid']);
$hostel = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `type`, `time` FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1')); $hostel = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `type`, `time` FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
#include('functions.php'); #include('functions.php');
$error = ''; $rs = ''; $error = '';
$base = array(1 => array('type' => 'Сумка'), 2 => array('type' => 'Сундук'), 3 => array('type' => 'Комната'), 4 => array('type' => 'Амбар')); $rs = '';
$times = array(1 => 7, 2 => 14, 3 => 21, 4 => 28); $base = [1 => ['type' => 'Сумка'], 2 => ['type' => 'Сундук'], 3 => ['type' => 'Комната'], 4 => ['type' => 'Амбар']];
$cost = array(1 => array(8, 16, 24, 32), 2 => array(15, 30, 45, 60), 3 => array(25, 50, 75, 100), 4 => array(40, 80, 120, 160)); $times = [1 => 7, 2 => 14, 3 => 21, 4 => 28];
$cost = [1 => [8, 16, 24, 32], 2 => [15, 30, 45, 60], 3 => [25, 50, 75, 100], 4 => [40, 80, 120, 160]];
function remove_hostel_items($u) function remove_hostel_items($u)
{ {
@ -21,7 +25,7 @@ function remove_hostel_items($u)
function select_arenda($u, $type, $redirect = false) function select_arenda($u, $type, $redirect = false)
{ {
$hostel = mysql_fetch_array(mysql_query('SELECT `id` FROM `hostel` WHERE `uid` = "' . $u['id'] . '" LIMIT 1')); $hostel = mysql_fetch_array(mysql_query('SELECT `id` FROM `hostel` WHERE `uid` = "' . $u['id'] . '" LIMIT 1'));
$price = array(1 => 8, 2 => 15, 3 => 25, 4 => 40); $price = [1 => 8, 2 => 15, 3 => 25, 4 => 40];
if (!isset($u['id'])) { if (!isset($u['id'])) {
$r = 'Персонаж не найден ...'; $r = 'Персонаж не найден ...';
} else { } else {
@ -42,26 +46,25 @@ function select_arenda($u, $type, $redirect = false)
$r = 'Неверный тип аренды ...'; $r = 'Неверный тип аренды ...';
} }
} }
if ($redirect == true) { if ($redirect) {
header('Location: main.php'); header('Location: main.php');
} }
return $r; return $r;
} }
if ($_GET['exit'] == 1) {
if($_GET['exit'] == 1) { if ($user['sleep'] == 0) {
if($user['sleep'] == 0) { mysql_query('UPDATE `users`,`online` SET `users`.`room` = 26, `online`.`room` = 26 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 26, `online`.`room` = 26 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"');
header('Location: city.php'); header('Location: city.php');
} else { } else {
$error = 'Вы спите ...'; $error = 'Вы спите ...';
} }
} }
if($_GET['to_room'] == 1) { if ($_GET['to_room'] == 1) {
if(isset($hostel['id'])) { if (isset($hostel['id'])) {
if($hostel['time'] > time()) { if ($hostel['time'] > time()) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 661, `online`.`room` = 661 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"'); mysql_query('UPDATE `users`,`online` SET `users`.`room` = 661, `online`.`room` = 661 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
header('Location: hostel_room.php'); header('Location: hostel_room.php');
} else { } else {
$error = 'У Вас просрочена аренда. Оплатите что-бы продолжить пользоваться нашими услугами ...'; $error = 'У Вас просрочена аренда. Оплатите что-бы продолжить пользоваться нашими услугами ...';
@ -71,15 +74,14 @@ if($_GET['to_room'] == 1) {
} }
} }
if($_GET['pays']) { if ($_GET['pays'] && (int)$_GET['pays'] >= 1 && (int)$_GET['pays'] <= 4) {
if((int)$_GET['pays'] >= 1 && (int)$_GET['pays'] <= 4) { if (isset($hostel['id'])) {
if(isset($hostel['id'])) { if ($user['money'] >= $cost[$hostel['type']][(int)$_GET['pays']]) {
if($user['money'] >= $cost[$hostel['type']][(int)$_GET['pays']]) { $time = $hostel['time'] + 60 * 60 * 24 * $times[(int)$_GET['pays']];
$time = $hostel['time']+60*60*24*$times[(int)$_GET['pays']];
$user['money'] -= $cost[$hostel['type']][(int)$_GET['pays']]; $user['money'] -= $cost[$hostel['type']][(int)$_GET['pays']];
$hostel['time'] = $time; $hostel['time'] = $time;
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('UPDATE `hostel` SET `time` = "'.$time.'" WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1'); mysql_query('UPDATE `hostel` SET `time` = "' . $time . '" WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1');
$error = 'Всё прошло успешно ...'; $error = 'Всё прошло успешно ...';
} else { } else {
$error = 'Недостаточно денег ...'; $error = 'Недостаточно денег ...';
@ -87,103 +89,102 @@ if($_GET['pays']) {
} else { } else {
$error = 'Ошибка #1'; $error = 'Ошибка #1';
} }
}
} }
if(isset($_POST['select']) && isset($_POST['tariff'])) { if (isset($_POST['select']) && isset($_POST['tariff'])) {
if($_POST['tariff'] == 0) { if ($_POST['tariff'] == 0) {
$error = 'Выберите тариф ...'; $error = 'Выберите тариф ...';
} else { } else {
$error = select_arenda($user, (int)$_POST['tariff']); $error = select_arenda($user, (int)$_POST['tariff']);
} }
} }
if($_GET['del'] == 1) { if ($_GET['del'] == 1) {
if(isset($hostel['id']) && $hostel['time'] > time()) { if (isset($hostel['id']) && $hostel['time'] > time()) {
mysql_query('DELETE FROM `hostel` WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1'); mysql_query('DELETE FROM `hostel` WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1');
remove_hostel_items($user['id']); remove_hostel_items($user['id']);
$error = 'Вы успешно отказались от аренды ...'; $error = 'Вы успешно отказались от аренды ...';
unset($hostel); unset($hostel);
} elseif(isset($hostel['id']) && $hostel['time'] < time()) { } elseif (isset($hostel['id']) && $hostel['time'] < time()) {
$error = 'Нельзя отказаться от услуг если имеется задолежнность ...'; $error = 'Нельзя отказаться от услуг если имеется задолежнность ...';
} }
} }
if(isset($_POST['deselect']) && isset($_POST['retariff'])) { if (isset($_POST['deselect']) && isset($_POST['retariff'])) {
if(isset($hostel['id']) && $hostel['time'] > time()) { if (isset($hostel['id']) && $hostel['time'] > time()) {
mysql_query('DELETE FROM `hostel` WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1'); mysql_query('DELETE FROM `hostel` WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1');
remove_hostel_items($user['id']); remove_hostel_items($user['id']);
select_arenda($user, (int)$_POST['retariff'], true); select_arenda($user, (int)$_POST['retariff'], true);
} elseif(isset($hostel['id']) && $hostel['time'] < time()) { } elseif (isset($hostel['id']) && $hostel['time'] < time()) {
$error = 'Нельзя сменить услугу если имеется задолежнность ...'; $error = 'Нельзя сменить услугу если имеется задолежнность ...';
} }
} }
if($_GET['sleep'] && $user['sleep'] == 0) { if ($_GET['sleep'] && $user['sleep'] == 0) {
if($user['sleep_time'] <= time()) { if ($user['sleep_time'] <= time()) {
if($user['vip'] == 1) { $sl = 8; } elseif($user['vip'] == 2) { $sl = 12; } elseif($user['vip'] == 3) { $sl = 18; } else { $sl = 2; } if ($user['vip'] == 1) {
mysql_query('UPDATE `users` SET `sleep` = "'.(time()+60*60*$sl).'", `sleep_time` = "'.(time()+60*60*8).'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); $sl = 8;
mysql_query('INSERT INTO `effects` (`type`, `name`, `time`, `owner`) VALUES ("8", "Сон", "'.(time()+60*60*$sl).'", "'.$user['id'].'")'); } elseif ($user['vip'] == 2) {
$ef = mysql_query('SELECT `id`, `time`, `type` FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `type` != 11 AND `type` != 12 AND `type` != 13 AND `type` != 14 AND `type` != 5 AND `type` != 4 AND `type` != 2 AND `type` != 3 AND `type` != 8'); $sl = 12;
while($pl = mysql_fetch_array($ef)) { } elseif ($user['vip'] == 3) {
$tm = $pl['time']-time(); $sl = 18;
mysql_query('UPDATE `effects` SET `sleep` = "'.$tm.'" WHERE `id` = "'.$pl['id'].'" AND `owner` = "'.$user['id'].'"'); } else {
$sl = 2;
}
mysql_query('UPDATE `users` SET `sleep` = "' . (time() + 60 * 60 * $sl) . '", `sleep_time` = "' . (time() + 60 * 60 * 8) . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('INSERT INTO `effects` (`type`, `name`, `time`, `owner`) VALUES ("8", "Сон", "' . (time() + 60 * 60 * $sl) . '", "' . $user['id'] . '")');
$ef = mysql_query('SELECT `id`, `time`, `type` FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `type` != 11 AND `type` != 12 AND `type` != 13 AND `type` != 14 AND `type` != 5 AND `type` != 4 AND `type` != 2 AND `type` != 3 AND `type` != 8');
while ($pl = mysql_fetch_array($ef)) {
$tm = $pl['time'] - time();
mysql_query('UPDATE `effects` SET `sleep` = "' . $tm . '" WHERE `id` = "' . $pl['id'] . '" AND `owner` = "' . $user['id'] . '"');
} }
header('Location: hostel.php'); header('Location: hostel.php');
} else { } else {
$error = 'Нельзя спать ... Приходите через : '.timeOut($user['sleep_time']-time()); $error = 'Нельзя спать ... Приходите через : ' . timeOut($user['sleep_time'] - time());
} }
} }
if($_GET['unsleep'] && $user['sleep'] > 0) { if ($_GET['unsleep'] && $user['sleep'] > 0) {
mysql_query('UPDATE `users` SET `sleep` = "0" WHERE `id` = "'.$user['id'].'" LIMIT 1'); mysql_query('UPDATE `users` SET `sleep` = "0" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `type` = "8" LIMIT 1'); mysql_query('DELETE FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `type` = "8" LIMIT 1');
$ef = mysql_query('SELECT `id`, `time`, `sleep` FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `sleep` != 0'); $ef = mysql_query('SELECT `id`, `time`, `sleep` FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `sleep` != 0');
while($pl = mysql_fetch_array($ef)) { while ($pl = mysql_fetch_array($ef)) {
$tm = time()+$pl['sleep']; $tm = time() + $pl['sleep'];
mysql_query('UPDATE `effects` SET `time` = "'.$tm.'", `sleep` = "0" WHERE `id` = "'.$pl['id'].'" AND `owner` = "'.$user['id'].'"'); mysql_query('UPDATE `effects` SET `time` = "' . $tm . '", `sleep` = "0" WHERE `id` = "' . $pl['id'] . '" AND `owner` = "' . $user['id'] . '"');
} }
header('Location: hostel.php'); header('Location: hostel.php');
} }
Template::header('Хостел');
?> ?>
<!doctype html> <script src="js/ajaxLoad.js"></script>
<html> <? if (isset($hostel['id'])) { ?>
<head>
<title>404</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="ru" />
<script src="js/ajaxLoad.js"></script>
<? if(isset($hostel['id'])) { ?>
<script> <script>
$(document).ready(function() { $(document).ready(function () {
$("#retariff option[value='<?=$hostel['type']; ?>']").remove(); $("#retariff option[value='<?=$hostel['type']; ?>']").remove();
}); });
</script> </script>
<? } ?> <? } ?>
<link rel="stylesheet" type="text/css" href="css/hostel.css" /> <link rel="stylesheet" href="css/hostel.css"/>
</head>
<body>
<div class="contentContainer"> <div class="contentContainer">
<div style="text-align: center;"><span class="hs">Гостиница, Холл</span></div> <div style="text-align: center;"><span class="hs">Гостиница, Холл</span></div>
<div class="buttonContainer"> <div class="buttonContainer">
<? if($user['sleep'] == 0) { ?> <? if ($user['sleep'] == 0) { ?>
<input type="button" class="btns button-route" value="Уснуть" onclick="location.href='?sleep=1';" /> <input type="button" class="btns button-route" value="Уснуть" onclick="location.href='?sleep=1';"/>
<? } else { ?> <? } else { ?>
<input type="button" class="btns button-route" value="Пробудиться" onclick="location.href='?unsleep=1';" /> <input type="button" class="btns button-route" value="Пробудиться" onclick="location.href='?unsleep=1';"/>
<? } ?> <? } ?>
<input type="button" class="btns" value="Обновить" onclick="location.href='main.php';" /> <input type="button" class="btns" value="Обновить" onclick="location.href='main.php';"/>
<input type="button" class="btns button-route" value="На улицу" onclick="location.href='?exit=1';" /> <input type="button" class="btns button-route" value="На улицу" onclick="location.href='?exit=1';"/>
<input type="button" class="btns button-route" value="Комната" onclick="location.href='?to_room=1';" /> <input type="button" class="btns button-route" value="Комната" onclick="location.href='?to_room=1';"/>
</div> </div>
<div id="hostelLeft"> <div id="hostelLeft">
<div id="hostelInteractive"> <div id="hostelInteractive">
<? if(!isset($hostel['id'])) { ?> <? if (!isset($hostel['id'])) { ?>
<fieldset class="hostelClientState"> <fieldset class="hostelClientState">
<legend>Станьте нашим клиентом</legend> <legend>Станьте нашим клиентом</legend>
<form method="post" style="text-align: center; width: 100%;"> <form method="post" style="text-align: center; width: 100%;">
<input type="hidden" name="act" value="settariff" /> <input type="hidden" name="act" value="settariff"/>
<p>Выберите подходящий для Вас вариант обслуживания:</p> <p>Выберите подходящий для Вас вариант обслуживания:</p>
<div style="text-align: center; width: 100%;"> <div style="text-align: center; width: 100%;">
<select name="tariff" class="tariff"> <select name="tariff" class="tariff">
@ -193,8 +194,10 @@ if($_GET['unsleep'] && $user['sleep'] > 0) {
<option value="3">Комната</option> <option value="3">Комната</option>
<option value="4">Амбар</option> <option value="4">Амбар</option>
</select> </select>
<input type="submit" class="button" value="Выбрал" name="select" /> <input type="submit" class="button" value="Выбрал" name="select"/>
<? if($error != '') { echo '<br /><b style="color: Red;">'.$error.'</b><br />'; } ?> <? if ($error != '') {
echo '<br /><b style="color: Red;">' . $error . '</b><br />';
} ?>
</div> </div>
</form> </form>
</fieldset> </fieldset>
@ -202,8 +205,9 @@ if($_GET['unsleep'] && $user['sleep'] > 0) {
<fieldset class="hostelClientState"> <fieldset class="hostelClientState">
<legend>Добро пожаловать!</legend> <legend>Добро пожаловать!</legend>
<form method="post" style="text-align: center; width: 100%;"> <form method="post" style="text-align: center; width: 100%;">
<p>Вы выбрали вариант предоставления жилья : <b><?=$base[$hostel['type']]['type']; ?></b></p> <p>Вы выбрали вариант предоставления жилья : <b><?= $base[$hostel['type']]['type']; ?></b></p>
<p>Аренда оплачена по: <? echo date('h:i d.m.y', $hostel['time']); ?> (<small><? echo timeOut($hostel['time']-time()); ?></small>)</p> <p>Аренда оплачена по: <? echo date('h:i d.m.y', $hostel['time']); ?>
(<small><? echo timeOut($hostel['time'] - time()); ?></small>)</p>
<div style="text-align: center; width: 100%;"> <div style="text-align: center; width: 100%;">
Сменить вариант аренды <select name="retariff" id="retariff"> Сменить вариант аренды <select name="retariff" id="retariff">
<option value="0">Выбор ...</option> <option value="0">Выбор ...</option>
@ -212,11 +216,17 @@ if($_GET['unsleep'] && $user['sleep'] > 0) {
<option value="3">Комната</option> <option value="3">Комната</option>
<option value="4">Амбар</option> <option value="4">Амбар</option>
</select> </select>
<input type="submit" class="button" value="Сменить" name="deselect" /> <input type="submit" class="button" value="Сменить" name="deselect"/>
</div> </div>
</form> </form>
<a href="javascript: void(0);" style="float: left; margin-left: 3px;" onclick="if(confirm('Вы уверены?')) { location.href='?del=1'; }">Расторгнуть договор</a> <a href="javascript: void(0);" onclick="ajaxLoad('/hostel_checkpoint.php', 'hostelInteractive', {act:'pay'})" style="float: right; margin-right: 3px;">Внести предоплату</a> <a href="javascript: void(0);" style="float: left; margin-left: 3px;"
<? if($error != '') { echo '<br /><center><b style="color: Red;">'.$error.'</b></center><br />'; } ?> onclick="if(confirm('Вы уверены?')) { location.href='?del=1'; }">Расторгнуть договор</a> <a
href="javascript: void(0);"
onclick="ajaxLoad('/hostel_checkpoint.php', 'hostelInteractive', {act:'pay'})"
style="float: right; margin-right: 3px;">Внести предоплату</a>
<? if ($error != '') {
echo '<br /><center><b style="color: Red;">' . $error . '</b></center><br />';
} ?>
</fieldset> </fieldset>
<? } ?> <? } ?>
</div> </div>
@ -229,22 +239,24 @@ if($_GET['unsleep'] && $user['sleep'] > 0) {
<br/>- хранить свое барахло и прочий хлам. <br/>- хранить свое барахло и прочий хлам.
<h2>Охрана у вас есть? Не воруют?</h2> <h2>Охрана у вас есть? Не воруют?</h2>
Самые любопытные могут получить в сурло прямо здесь - в холле. Самые любопытные могут получить в сурло прямо здесь - в холле.
<br />- Устраивать беспорядки в комнатах не позволено. <br/>- Устраивать беспорядки в комнатах не позволено.
<br />- Прислуга у нас проверенная - пожитки твои не тронут. <br/>- Прислуга у нас проверенная - пожитки твои не тронут.
<h2>И сколько стоит всё это удовольствие?</h2> <h2>И сколько стоит всё это удовольствие?</h2>
- Комнаты есть разные, для людей разного достатка. Смотри справа расценки. - Комнаты есть разные, для людей разного достатка. Смотри справа расценки.
<br />- Платить нужно каждый день. Пока не заплатишь - на лестницу не ногой. <br/>- Платить нужно каждый день. Пока не заплатишь - на лестницу не ногой.
<br />- Вместимость - это сколько твоих вещей влезет в комнату, имеется ввиду общая масса инвентаря. <br/>- Вместимость - это сколько твоих вещей влезет в комнату, имеется ввиду общая масса инвентаря.
<h2>Как всем этим пользоваться?</h2> <h2>Как всем этим пользоваться?</h2>
Всё просто. Плати и живи. Всё просто. Плати и живи.
<br />Приходишь, платишь по долгам, проходишь в аппартаменты. В сундуке есть секции для каждого вида вещей, фильтр поможет разобраться. <br/>Приходишь, платишь по долгам, проходишь в аппартаменты. В сундуке есть секции для каждого вида
вещей, фильтр поможет разобраться.
<h2>Что ещё мне нужно знать?</h2> <h2>Что ещё мне нужно знать?</h2>
- При смене размера комнаты, ты теряешь оставшееся оплаченное время. - При смене размера комнаты, ты теряешь оставшееся оплаченное время.
<br />- При просрочке платы более 60 суток, мы оставляем за собой право сдать вещи на аукцион для погашения задолжености. <br/>- При просрочке платы более 60 суток, мы оставляем за собой право сдать вещи на аукцион для
<br />- Если долг будет разумный, то подарки забирать с полки не будем. погашения задолжености.
<br />- Быстро сориентироваться с шмотом поможет фильтр предметов. <br/>- Если долг будет разумный, то подарки забирать с полки не будем.
<br />- Если что потеряешь - твои проблемы. <br/>- Быстро сориентироваться с шмотом поможет фильтр предметов.
<br/>- Если что потеряешь - твои проблемы.
</div> </div>
</div> </div>
</fieldset> </fieldset>
@ -253,41 +265,62 @@ if($_GET['unsleep'] && $user['sleep'] > 0) {
<div id="hostelRight"> <div id="hostelRight">
<fieldset> <fieldset>
<legend>Тарифы и услуги</legend> <legend>Тарифы и услуги</legend>
<br /> <br/>
<table class="tarifsList" cellpadding="0" cellspacing="0"> <table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Сумка</caption> <caption>Сумка</caption>
<tbody> <tbody>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">15 ед.</td></tr> <tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">8.00 кр.</td></tr> <td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">15 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">8.00 кр.</td>
</tr>
</tbody> </tbody>
</table> </table>
<br /> <br/>
<table class="tarifsList" cellpadding="0" cellspacing="0"> <table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Сундук</caption> <caption>Сундук</caption>
<tbody> <tbody>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">30 ед.</td></tr> <tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">15.00 кр.</td></tr> <td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">30 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">15.00 кр.</td>
</tr>
</tbody> </tbody>
</table> </table>
<br /> <br/>
<table class="tarifsList" cellpadding="0" cellspacing="0"> <table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Комната</caption> <caption>Комната</caption>
<tbody> <tbody>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">50 ед.</td></tr> <tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">25.00 кр.</td></tr> <td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">50 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">25.00 кр.</td>
</tr>
</tbody> </tbody>
</table> </table>
<br /> <br/>
<table class="tarifsList" cellpadding="0" cellspacing="0"> <table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Амбар</caption> <caption>Амбар</caption>
<tbody> <tbody>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">100 ед.</td></tr> <tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">40.00 кр.</td></tr> <td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">100 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">40.00 кр.</td>
</tr>
</tbody> </tbody>
</table> </table>
</fieldset> </fieldset>
</div> </div>
</div> </div>
</body>
</html>

View File

@ -1,24 +1,24 @@
<? <?
session_start(); session_start();
if(!isset($_SESSION['uid'])) { header('Location: index.php'); die(); } if (empty($_SESSION['uid'])) {
include('config.php'); header('Location: index.php');
include('functions.php'); exit;
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1')); }
$base = array(1 => array(8, 16, 24, 32), 2 => array(15, 30, 45, 60), 3 => array(25, 50, 75, 100), 4 => array(40, 80, 120, 160)); require_once "functions.php";
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
$base = [1 => [8, 16, 24, 32], 2 => [15, 30, 45, 60], 3 => [25, 50, 75, 100], 4 => [40, 80, 120, 160]];
if(isset($_POST['act']) && $_POST['act'] == 'pay') { if (isset($_POST['act']) && $_POST['act'] == 'pay' && isset($user['id']) && isset($hostel['id'])) {
if(isset($user['id']) && isset($hostel['id'])) {
echo '<fieldset class="hostelClientState">'; echo '<fieldset class="hostelClientState">';
echo '<legend>Предварительная оплата</legend>'; echo '<legend>Предварительная оплата</legend>';
echo '<div style="text-align: center;"><p class="NORMAL" style="margin: 5px 0">'; echo '<div style="text-align: center;"><p class="NORMAL" style="margin: 5px 0">';
echo 'Аренда оплачена по: <b>'.date('h:i d.m.y', $hostel['time']).'</b> <small>('.timeOut($hostel['time']-time()).')</small></p></div>'; echo 'Аренда оплачена по: <b>' . date('h:i d.m.y', $hostel['time']) . '</b> <small>(' . timeOut($hostel['time'] - time()) . ')</small></p></div>';
echo '<table align="center" class="periods"><caption style="text-align: left;">Выберите срок предоплаты.</caption> echo '<table align="center" class="periods"><caption style="text-align: left;">Выберите срок предоплаты.</caption>
<tbody> <tbody>
<tr class="caption"><th>Сутки</th><td title="7 дн.">7</td><td title="14 дн.">14</td><td title="21 дн.">21</td><td title="28 дн.">28</td></tr> <tr class="caption"><th>Сутки</th><td title="7 дн.">7</td><td title="14 дн.">14</td><td title="21 дн.">21</td><td title="28 дн.">28</td></tr>
<tr class="value"><th>Сумма</th><td title="7 дн."><a href="?pays=1">'.$base[$hostel['type']][0].'</a></td><td title="14 дн."><a href="?pays=2">'.$base[$hostel['type']][1].'</a></td><td title="21 дн."><a href="?pays=3">'.$base[$hostel['type']][2].'</a></td><td title="28 дн."><a href="?pays=4">'.$base[$hostel['type']][3].'</a></td></tr> <tr class="value"><th>Сумма</th><td title="7 дн."><a href="?pays=1">' . $base[$hostel['type']][0] . '</a></td><td title="14 дн."><a href="?pays=2">' . $base[$hostel['type']][1] . '</a></td><td title="21 дн."><a href="?pays=3">' . $base[$hostel['type']][2] . '</a></td><td title="28 дн."><a href="?pays=4">' . $base[$hostel['type']][3] . '</a></td></tr>
</tbody> </tbody>
</table> </table>
<div style="color: red; font-size: 9px; padding-top: 3px;"><b>Внимание!</b> При расторжении договора или смене тарифа, внесенная плата не возвращается</div></fieldset></div>'; <div style="color: red; font-size: 9px; padding-top: 3px;"><b>Внимание!</b> При расторжении договора или смене тарифа, внесенная плата не возвращается</div></fieldset></div>';
}
} }

View File

@ -1,23 +1,29 @@
<?php <?php
session_start(); session_start();
if(!isset($_SESSION['uid'])) { header('Location: index.php'); die(); } if (empty($_SESSION['uid'])) {
include('config.php'); header('Location: index.php');
include('functions.php'); exit;
}
require_once "functions.php";
$d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `setsale` = 0")); $d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `setsale` = 0"));
$in = mysql_fetch_array(mysql_query('SELECT COUNT(*) AS `cnt` FROM `inventory` WHERE `owner` = "-101'.$user['id'].'"')); $in = mysql_fetch_array(mysql_query('SELECT COUNT(*) AS `cnt` FROM `inventory` WHERE `owner` = "-101' . $user['id'] . '"'));
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1')); $hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
$base = array(1 => 15, 2 => 30, 3 => 50, 4 => 100); $base = [1 => 15, 2 => 30, 3 => 50, 4 => 100];
$vips = array(1 => 0.15, 2 => 0.30, 3 => 0.45); $vips = [1 => 0.15, 2 => 0.30, 3 => 0.45];
function show_item($row, $txt, $place) function show_item($row, $txt, $place)
{ {
if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) destructitem($row['id']); if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) {
destructitem($row['id']);
}
$r = ''; $r = '';
$ntxt = "В инвентаре"; $ntxt = "В инвентаре";
if ($txt == "В сундук") $ntxt = "В сундуке"; if ($txt == "В сундук") {
$ntxt = "В сундуке";
}
$magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $$row['magic'])->fetch_assoc(); $magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $$row['magic'])->fetch_assoc();
$incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = \'' . $row['includemagic'] . '\' LIMIT 1')); $incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = \'' . $row['includemagic'] . '\' LIMIT 1'));
@ -29,8 +35,8 @@ function show_item($row, $txt, $place)
$magic['time'] = $incmagic['time']; $magic['time'] = $incmagic['time'];
$magic['targeted'] = $incmagic['targeted']; $magic['targeted'] = $incmagic['targeted'];
} }
#href="?search=1&otdel='.$row['otdel'].'&place='.$place.'&itm='.$row['id'].'&set=1"
if (isset($row['id'])) { if (isset($row['id'])) {
//todo подтянуть отображение предмета из класса
$r .= '<div id="inv_' . $row['id'] . '"><table><tbody>'; $r .= '<div id="inv_' . $row['id'] . '"><table><tbody>';
$r .= '<tr valign="top" style="border: 2px groove threedface;">'; $r .= '<tr valign="top" style="border: 2px groove threedface;">';
$r .= '<td class="even links original"><img src="/i/sh/' . $row['img'] . '"> $r .= '<td class="even links original"><img src="/i/sh/' . $row['img'] . '">
@ -57,7 +63,9 @@ function show_item($row, $txt, $place)
if (!$row['needident']) { if (!$row['needident']) {
if ($magic['chanse']) { if ($magic['chanse']) {
if ($magic['chanse'] >= 95) $magic['chanse'] = 95; if ($magic['chanse'] >= 95) {
$magic['chanse'] = 95;
}
$r .= 'Вероятность срабатывания: ' . $magic['chanse'] . '%<br />'; $r .= 'Вероятность срабатывания: ' . $magic['chanse'] . '%<br />';
} }
if ($magic['time']) { if ($magic['time']) {
@ -68,7 +76,7 @@ function show_item($row, $txt, $place)
} }
$r .= '<div class="need">'; $r .= '<div class="need">';
$user = array(); $user = [];
if ($row['nsila']) { if ($row['nsila']) {
$r .= '&bull; '; $r .= '&bull; ';
@ -239,7 +247,7 @@ function show_item($row, $txt, $place)
$r .= '<span style="color: maroon;"><b>Свойства предмета не идентифицированы</b></span><br />'; $r .= '<span style="color: maroon;"><b>Свойства предмета не идентифицированы</b></span><br />';
} }
$osob = array(22, 23); $osob = [22, 23];
if (in_array($row['type'], $osob)) { if (in_array($row['type'], $osob)) {
$r .= 'Особенности:<br />'; $r .= 'Особенности:<br />';
if ($row['type'] == 22) { if ($row['type'] == 22) {
@ -278,121 +286,125 @@ function show_itm_hostel($uid, $otdel, $type = 1)
return $r; return $r;
} }
if($user['vip'] > 0 && $user['vip_time'] > time()) { if ($user['vip'] > 0 && $user['vip_time'] > time()) {
$count = $base[$hostel['type']]; $count = $base[$hostel['type']];
$count += floor($base[$hostel['type']]*$vips[$user['vip']]); $count += floor($base[$hostel['type']] * $vips[$user['vip']]);
} else { } else {
$count = $base[$hostel['type']]; $count = $base[$hostel['type']];
} }
if($_GET['search']) { if ($_GET['search']) {
$r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']); $r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']);
} else { } else {
$r = '<tr><td width="100%" align="center" class="even" style="text-align: center;"><b><center>Поиск ...</center></b></td></tr>'; $r = '<tr><td width="100%" align="center" class="even" style="text-align: center;"><b><center>Поиск ...</center></b></td></tr>';
} }
if($_GET['set'] && $_GET['set'] == 1) { if ($_GET['set'] && $_GET['set'] == 1) {
$it = mysql_fetch_array(mysql_query('SELECT `id`, `owner` FROM `inventory` WHERE `id` = "'.(int)$_GET['itm'].'" LIMIT 1')); $it = mysql_fetch_array(mysql_query('SELECT `id`, `owner` FROM `inventory` WHERE `id` = "' . (int)$_GET['itm'] . '" LIMIT 1'));
if(isset($it['id'])) { if (isset($it['id'])) {
if($it['owner'] == $user['id']) { if ($it['owner'] == $user['id']) {
if($in['cnt'] < $count) { if ($in['cnt'] < $count) {
mysql_query('UPDATE `inventory` SET `owner` = "-101'.$user['id'].'" WHERE `id` = "'.$it['id'].'" LIMIT 1'); mysql_query('UPDATE `inventory` SET `owner` = "-101' . $user['id'] . '" WHERE `id` = "' . $it['id'] . '" LIMIT 1');
$in['cnt']++; $in['cnt']++;
} else { } else {
$error = 'Не хватает места ...'; $error = 'Не хватает места ...';
} }
} elseif($it['owner'] == '-101'.$user['id']) { } elseif ($it['owner'] == '-101' . $user['id']) {
mysql_query('UPDATE `inventory` SET `owner` = "'.$user['id'].'" WHERE `id` = "'.$it['id'].'" LIMIT 1'); mysql_query('UPDATE `inventory` SET `owner` = "' . $user['id'] . '" WHERE `id` = "' . $it['id'] . '" LIMIT 1');
$in['cnt']--; $in['cnt']--;
} }
} }
unset($it); unset($it);
header('Location: hostel_room.php?search=1&otdel='.$_GET['otdel'].'&place='.$_GET['place']); header('Location: hostel_room.php?search=1&otdel=' . $_GET['otdel'] . '&place=' . $_GET['place']);
} }
if($_GET['search']) { if ($_GET['search']) {
$r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']); $r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']);
} }
####### #######
$w = (270*$d['mass']/get_meshok()); $w_a = 270-$w; $w = (270 * $d['mass'] / get_meshok());
$h = (270*$in['cnt']/$count); $h_a = 270-$h; $w_a = 270 - $w;
$h = (270 * $in['cnt'] / $count);
$h_a = 270 - $h;
####### #######
if($_GET['go_back'] == 1) { if ($_GET['go_back'] == 1) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 660, `online`.`room` = 660 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"'); mysql_query('UPDATE `users`,`online` SET `users`.`room` = 660, `online`.`room` = 660 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
header('Location: hostel.php'); header('Location: hostel.php');
} }
Template::header('hostel_room');
?> ?>
<!doctype html>
<html>
<head>
<title>404</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="ru" />
<script src="js/ajaxLoad.js"></script> <script src="js/ajaxLoad.js"></script>
<link rel="stylesheet" type="text/css" href="css/hostel.css" /> <link rel="stylesheet" type="text/css" href="css/hostel.css"/>
</head> <div class="contentContainer" id="hostelContainer">
<body> <div id="systemMsg" class="system-msg"></div>
<div class="contentContainer" id="hostelContainer"> <div class="buttonContainer">
<div id="systemMsg" class="system-msg"></div><div class="buttonContainer"> <input type="button" class="btns" value="Обновить" onclick="location.href='hostel_room.php';"/>
<input type="button" class="btns" value="Обновить" onclick="location.href='hostel_room.php';" /> <input type="button" class="btns button-route" value="Спуститься" onclick="location.href='?go_back=1';"/>
<input type="button" class="btns button-route" value="Спуститься" onclick="location.href='?go_back=1';" /> <h1>Комнатуха</h1>
<h1>Комнатуха</h1> </div>
</div> <style type="text/css">
<style type="text/css"> .hides {
.hides {
display: none; display: none;
} }
#hstInventory td.item {
width: 85%;
}
#hstInventory td.links {
text-align:center;
vertical-align:middle;
width:117px;
}
#hstInventory td.links span {
display: block;
}
#hstInventory td.original span.pk-current{
display:none;
}
#hstInventory td.moved {
font-weight: bold;
}
#hstInventory td.odd {
background-color: #c7c7c7;
}
#hstInventory td.even {
background-color: #d5d5d5;
}
label{ #hstInventory td.item {
width: 85%;
}
#hstInventory td.links {
text-align: center;
vertical-align: middle;
width: 117px;
}
#hstInventory td.links span {
display: block;
}
#hstInventory td.original span.pk-current {
display: none;
}
#hstInventory td.moved {
font-weight: bold; font-weight: bold;
margin-right:15px; }
}
</style> #hstInventory td.odd {
<script> background-color: #c7c7c7;
function hide_this(id) { }
#hstInventory td.even {
background-color: #d5d5d5;
}
label {
font-weight: bold;
margin-right: 15px;
}
</style>
<script>
function hide_this(id) {
const node = document.getElementById(id); const node = document.getElementById(id);
if(node) { if (node) {
node.style.display = 'none'; node.style.display = 'none';
} }
} }
</script> </script>
<div style="overflow: hidden;"> <div style="overflow: hidden;">
<fieldset id="hstInventoryA" style="width: 377px; float: left; text-align: center;"> <fieldset id="hstInventoryA" style="width: 377px; float: left; text-align: center;">
<legend>Фильтр инвентаря</legend> <legend>Фильтр инвентаря</legend>
<div style="height: 53px"> <div style="height: 53px">
<form method="GET"> <form method="GET">
<input type="radio" class="radio" id="hstF1" name="place" value="2" /><label for="hstF1">мешок</label> <input type="radio" class="radio" id="hstF1" name="place" value="2"/><label
<input type="radio" class="radio" id="hstF2" name="place" value="1" /><label for="hstF2">сундук</label> for="hstF1">мешок</label>
<input type="radio" class="radio" id="hstF2" name="place" value="1"/><label
for="hstF2">сундук</label>
<div style="height: 5px;overflow: hidden;"></div> <div style="height: 5px;overflow: hidden;"></div>
<select name="otdel"> <select name="otdel">
<option value="-1">&nbsp;</option> <option value="-1">&nbsp;</option>
<optgroup label="Оружие"> <optgroup label="Оружие">
<option value="1">кастеты,ножи</option> <option value="1">кастеты,ножи</option>
@ -422,20 +434,37 @@ function hide_this(id) {
<optgroup label="Амуниция"> <optgroup label="Амуниция">
<option value="6">амуниция</option> <option value="6">амуниция</option>
</optgroup> </optgroup>
</select>&nbsp; </select>&nbsp;
<input type="submit" class="button" style="margin-right: 20px;" value="Поиск" name="search" /> <input type="submit" class="button" style="margin-right: 20px;" value="Поиск" name="search"/>
</form> </form>
</div> </div>
</fieldset> </fieldset>
<fieldset id="hstInventoryB"><legend>Состояние</legend> <fieldset id="hstInventoryB">
<div style="height: 53px"> <legend>Состояние</legend>
<div class="progressBar" style='height:14px'><img title="Мешок за спиной" src="/i/bag.gif" height="14px"><img title="Мешок за спиной" src="/i/660000.gif" style="width: <?=$w;?>px; height: 14px;"><img title="Мешок за спиной" src="/i/1silver.gif" style=" width: <?=$w_a;?>px; height:14px"><tt style="font-size:13px"> <?=$d['mass'];?>/<?=get_meshok()?></tt></div><div class="progressBar" style='height:14px'><img title="Заполнение сундука" src="/i/chest.gif" height="14px"><img title="Заполнение сундука" src="/i/1blue.gif" style=" width: <?=$h;?>px; height:14px"><img title="Заполнение сундука" src="/i/1silver.gif" style=" width: <?=$h_a;?>px; height:14px"><tt style="font-size:13px"> <?=$in['cnt'];?>/<?=$count;?></tt></div></div> <div style="height: 53px">
</fieldset> <div class="progressBar" style='height:14px'><img title="Мешок за спиной" src="/i/bag.gif"
</div> height="14px"><img title="Мешок за спиной"
src="/i/660000.gif"
style="width: <?= $w; ?>px; height: 14px;"><img
title="Мешок за спиной" src="/i/1silver.gif"
style=" width: <?= $w_a; ?>px; height:14px"><tt
style="font-size:13px"> <?= $d['mass']; ?>/<?= get_meshok() ?></tt></div>
<div class="progressBar" style='height:14px'><img title="Заполнение сундука" src="/i/chest.gif"
height="14px"><img title="Заполнение сундука"
src="/i/1blue.gif"
style=" width: <?= $h; ?>px; height:14px"><img
title="Заполнение сундука" src="/i/1silver.gif"
style=" width: <?= $h_a; ?>px; height:14px"><tt
style="font-size:13px"> <?= $in['cnt']; ?>/<?= $count; ?></tt></div>
</div>
</fieldset>
</div>
<div id="hstInventory" style="width: 100%; background-color: #a5a5a5;"> <div id="hstInventory" style="width: 100%; background-color: #a5a5a5;">
<?=$r;?> <?= $r; ?>
</div> </div>
<center><? if($error != '') { echo '<br /><b style=\'color: Red;\'>'.$error.'</b>'; } ?></center>
</body> <?php
</html> if (!empty($error)) {
echo sprintf('<div style="text-align: center; font-weight: bold; color: #f80000;">%s</div>', $error);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Some files were not shown because too many files have changed in this diff Show More