519 lines
28 KiB
PHP
519 lines
28 KiB
PHP
<?php
|
||
/**
|
||
* Центральная площадь
|
||
*/
|
||
session_start();
|
||
if ($_SESSION['uid'] == null) {
|
||
header("Location: index.php");
|
||
}
|
||
include("config.php");
|
||
//$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1"));
|
||
//$klan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1"));
|
||
//$digger = mysql_fetch_array(mysql_query("SELECT * FROM `digger` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1"));
|
||
include("functions.php");
|
||
$tm = time();
|
||
|
||
if ($user['battle'] != 0) {
|
||
header('location: fbattle.php');
|
||
die();
|
||
}
|
||
if ($user['in_tower'] == 1) {
|
||
header('Location: towerin.php');
|
||
die();
|
||
}
|
||
if ($user['zayavka'] != 0) {
|
||
die();
|
||
}
|
||
|
||
/**
|
||
* Проверяем можем ли мы двигаться.
|
||
* @param $getparam - имя переменной в GET запросе, который вызывает эту проверку
|
||
*/
|
||
function can_i_move($getparam)
|
||
{
|
||
$d = db::c()->query('SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $user['id'])->fetch_assoc();
|
||
if ($d['mass'] > get_meshok()) {
|
||
err('У вас переполнен рюкзак, вы не можете передвигаться...');
|
||
$_GET[$getparam] = 0;
|
||
}
|
||
|
||
$entangle = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND `type` = 10', $user['id'])->fetch_assoc();
|
||
if ($entangle['id'] > 0) {
|
||
err('Вы парализованы и не можете передвигаться...');
|
||
$_GET[$getparam] = 0;
|
||
}
|
||
|
||
$eff = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND (`type` = 14 OR `type` = 13)', $user['id'])->fetch_assoc();
|
||
if ($eff['id'] > 0) {
|
||
err('У вас тяжелая травма, вы не можете передвигаться...');
|
||
$_GET[$getparam] = 0;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Перемещаемся по заданным параметрам в пределах страницы
|
||
* @param int $room - номер локации
|
||
* @param string $roomname - название локации
|
||
*/
|
||
function move_to_inside($room = 0, $roomname = 'неизвестное место')
|
||
{
|
||
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $room, $room, $_SESSION['uid']);
|
||
?>
|
||
<html>
|
||
<head>
|
||
<link rel="stylesheet" href="css/main.css">
|
||
<meta charset="utf-8">
|
||
</head>
|
||
<body>
|
||
<?php
|
||
die("
|
||
<script>
|
||
function cityg() {
|
||
location.href = 'city.php';
|
||
}
|
||
setTimeout('cityg()', 5000);
|
||
</script>
|
||
<center><br><br><img src='i/ajax-loader.gif'><br>
|
||
<i>Переходим на $roomname...</i>
|
||
</center>
|
||
");
|
||
}
|
||
|
||
/**
|
||
* Перемещаемся по заданным параметрам за пределами страницы
|
||
* @param int $room - номер локации
|
||
* @param string $redirect - имя скрипта на который идёт редирект
|
||
*/
|
||
function move_to_outside($room = 0, $redirect = 'city')
|
||
{
|
||
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $room, $room, $_SESSION['uid']);
|
||
header('location: '.$redirect);
|
||
}
|
||
|
||
$dig_raw = db::c()->query('SELECT `finish_dig`, `finish_guard` FROM `digger` WHERE `id` = ?i', $user['id'])->fetch_assoc();
|
||
if ($dig_raw["finish_dig"] > $tm || $dig_raw["finish_guard"] > $tm) {
|
||
header('location: wall_build.php');
|
||
die();
|
||
}
|
||
|
||
header("Cache-Control: no-cache");
|
||
|
||
if ($_GET['strah']){
|
||
can_i_move('strah');
|
||
move_to_inside(21, 'Страшилкину Улицу');
|
||
}
|
||
|
||
if ($_GET['cp']) {
|
||
can_i_move('cp');
|
||
move_to_inside(20, 'Центральную площадь');
|
||
}
|
||
|
||
if ($_GET['bps']) {
|
||
can_i_move('bps');
|
||
move_to_inside(26, 'Большую Парковую улицу');
|
||
}
|
||
|
||
if ($_GET['zamk']) {
|
||
can_i_move('zamk');
|
||
move_to_inside(2601, 'Замковую площадь');
|
||
}
|
||
|
||
if ($_GET['zaliv']) {
|
||
can_i_move('zaliv');
|
||
move_to_inside(2111, 'Ристалище');
|
||
}
|
||
|
||
if ($_GET['ps']) {
|
||
can_i_move('ps');
|
||
move_to_inside(51, 'Парковую улицу');
|
||
}
|
||
|
||
if ($_GET['torg']) {
|
||
can_i_move('torg');
|
||
move_to_inside(2702, 'Торговую улицу');
|
||
}
|
||
|
||
if ($_GET['abog']) {
|
||
can_i_move('abog');
|
||
move_to_inside(2655, 'Арену Богов');
|
||
}
|
||
|
||
if ($_GET['got']) {
|
||
can_i_move('got');
|
||
|
||
if ($user['room'] ==20) {
|
||
if ($_GET['level1']) { header('location: main.php?setch=1'); die(); }
|
||
if ($_GET['level13']) { header('location: quest_room.php'); }
|
||
if ($_GET['level7']) { header('location: city.php?strah=1'); }
|
||
if ($_GET['level8']) { header('location: city.php?bps=1'); }
|
||
if ($_GET['level222']) { header('location: city.php?torg=1'); }
|
||
if ($_GET['level17']) { move_to_outside(50,'ashop.php'); }
|
||
if ($_GET['level2']) { move_to_outside(22, 'shop.php'); }
|
||
if ($_GET['level4']) { move_to_outside(23, 'repair.php'); }
|
||
if ($_GET['level10']) { move_to_outside(35, 'krshop.php'); }
|
||
if ($_GET['level9']) { move_to_outside(24, 'elka.php'); }
|
||
if ($_GET['level6']) { move_to_outside(27, 'post.php'); }
|
||
if (&& $_GET['level3']) { move_to_outside(26, 'comission.php'); }
|
||
}
|
||
elseif ($user['room'] == 21) {
|
||
if ($_GET['level4']) { header('location: city.php?cp=1'); }
|
||
if ($_GET['level3']) { header('location: city.php?zaliv=1'); }
|
||
if ($_GET['level13']) { move_to_outside(34, 'fshop.php'); }
|
||
if ($_GET['level5']) { move_to_outside(29, 'bank.php'); }
|
||
if ($_GET['level16']) { move_to_outside(31, 'tower.php'); }
|
||
if ($_GET['level14']) { move_to_outside(30, 'klanedit.php'); }
|
||
if ($_GET['level650']) { move_to_outside(650, 'ul_clans.php'); }
|
||
}
|
||
elseif ($user['room'] == 2111) {
|
||
if ($_GET['level1']) { header('location: city.php?strah=1'); }
|
||
if ($_GET['level2']) { header('location: city.php?haos=1'); }
|
||
if ($_GET['level3']) {
|
||
print "<script>alert('Покопавшись среди водорослей вы нашли кулeчек и в нем было...')</script>";
|
||
$_SESSION['usebochka'] = '1';
|
||
}
|
||
if ($_GET['level203']) { move_to_outside(1055, 'group_arena.php'); }
|
||
if ($_GET['level1000']) { move_to_outside(620, 'enter_cave.php'); }
|
||
if ($_GET['room666']) { move_to_outside(666, 'jail.php'); }
|
||
if ($_GET['level5']) { move_to_outside(203, 'church.php'); }
|
||
}
|
||
elseif ($user['room'] == 2601) {
|
||
if ($_GET['level4']) { header('location: city.php?bps=1'); }
|
||
if ($_GET['level55']) { header('location: city.php?abog=1'); }
|
||
if ($_GET['level21']) { move_to_outside(87, 'dshop.php'); }
|
||
if ($_GET['level10']) { move_to_outside(35, 'krshop.php'); }
|
||
if ($_GET['level44']) { move_to_outside(203, 'church.php'); } /*FIXME Второй вход в церковь?*/
|
||
if ($_GET['level1']) { move_to_outside(37, 'gotzamok.php'); }
|
||
if ($_GET['level1052']) { move_to_outside(1053, 'repshop.php'); }
|
||
if ($_GET['level1051']) { move_to_outside(1051, 'lab_enter.php'); }
|
||
if ($_GET['level5']) { move_to_outside(404, 'vxod.php'); }
|
||
}
|
||
elseif ($user['room'] == 2701) {
|
||
if ($_GET['level1']) { header('location: city.php?zaliv=1'); }
|
||
if ($_GET['level2']) { move_to_outside(402, 'lab_chaos_enter.php'); }
|
||
}
|
||
elseif ($user['room'] == 2702) {
|
||
if ($_GET['level10']) { header('location: city.php?cp=1'); }
|
||
if ($_GET['level5'] || $_GET['level202']) { move_to_outside(1054, 'fontan_luck.php'); }
|
||
if ($_GET['level6']) { move_to_outside(61, 'akadem.php'); }
|
||
}
|
||
elseif ($user['room'] == 2655) {
|
||
if ($_GET['level10']) { header('location: city.php?zamk=1'); }
|
||
if ($_GET['level2055']) { move_to_outside(603, 'aren_of_angels.php'); }
|
||
}
|
||
elseif ($user['room'] == 26) {
|
||
if ($_GET['level4']) {header('location: city.php?cp=1');}
|
||
if ($_GET['level3']) {header('location: city.php?zamk=1');}
|
||
if ($_GET['level5']) {move_to_outside(43, 'znahar.php');}
|
||
if ($_GET['level660']) {move_to_outside(660, 'hostel.php');}
|
||
if ($_GET['level20']) {move_to_outside(223, 'bench.php');}
|
||
if ($_GET['level21']) {move_to_outside(222, 'bench_s.php');}
|
||
if ($_GET['level22']) {move_to_outside(224, 'bench_m.php');}
|
||
if ($_GET['level7']) {move_to_outside(777, 'obshaga.php');}
|
||
if ($_GET['level11']) {move_to_outside(42, 'lotery.php');}
|
||
// if ($_GET['level5']) {/*move_to_outside(401, 'hell.php');}
|
||
if ($_GET['level6']) {/*move_to_outside(110, 'jackill.php');*/ print "<script>alert('110: Закрыто.')</script>";}
|
||
}
|
||
}
|
||
|
||
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
|
||
?>
|
||
<!doctype html>
|
||
<html>
|
||
<HEAD>
|
||
<link rel=stylesheet href="css/main.css">
|
||
<link rel="stylesheet" href="/locations/style.css"/>
|
||
<meta charset="utf-8">
|
||
<style>
|
||
IMG.aFilter {
|
||
filter: Glow(Color=d7d7d7, Strength=9, Enabled=0);
|
||
cursor: pointer
|
||
}
|
||
</style>
|
||
<script type="text/javascript">
|
||
function solo(n) {
|
||
top.changeroom = n;
|
||
window.location.href = 'city.php?got=1&level' + n + '=1';
|
||
}
|
||
|
||
function imover(im) {
|
||
im.filters.Glow.Enabled = true;
|
||
// im.style.visibility="hidden";
|
||
}
|
||
|
||
function imout(im) {
|
||
im.filters.Glow.Enabled = false;
|
||
// im.style.visibility="visible";
|
||
}
|
||
|
||
function Down() {
|
||
top.CtrlPress = window.event.ctrlKey
|
||
}
|
||
document.onmousedown = Down;
|
||
</script>
|
||
</HEAD>
|
||
<body>
|
||
<TABLE width=100% height=100% border=0 cellspacing="0" cellpadding="0">
|
||
<TR>
|
||
<TD align=center></TD>
|
||
<TD align=right>Сейчас в игре : <?=$online->getNumRows()?> игроков.</TD>
|
||
</TR>
|
||
<TR>
|
||
<TD align=center colspan=2>
|
||
<?php
|
||
function getSeason()
|
||
{
|
||
$todayMonth = date('n');
|
||
if ($todayMonth >= 3 && $todayMonth <= 5 ) return 'spring_';
|
||
elseif ($todayMonth >= 6 && $todayMonth <= 8) return 'summer_';
|
||
elseif ($todayMonth >= 9 && $todayMonth <=11) return 'fall_';
|
||
else return 'winter_';
|
||
}
|
||
|
||
function buildset($id, $img, $top, $left, $des, $noSeason = 0)
|
||
{
|
||
if (!$noSeason) $img = getSeason() . $img;
|
||
?>
|
||
<div style="position:absolute; left:<?=$left?>px; top:<?=$top?>px; z-index:90;">
|
||
<img src="i/city/sub/<?=$img?>.png" alt="<?=$des?>" title="<?=$des?>" class="aFilter2" id="<?=$id?>"
|
||
onmouseover="this.src='i/city/sub/<?=$img?>2.png'" onmouseout="this.src='i/city/sub/<?=$img?>.png'" onclick="solo(<?=$id?>)" />
|
||
</div>
|
||
<?php
|
||
}
|
||
|
||
function bgset($img)
|
||
{
|
||
$daytime = date('H');
|
||
if ($daytime >=6 && $daytime <=21) $background = getSeason() . $img . '_day';
|
||
else $background = getSeason() . $img . '_night';
|
||
echo sprintf('<div style="position:relative; cursor: pointer;" id="ione"><img src="i/city/%s.jpg">', $background);
|
||
/**
|
||
* Исходные строки:
|
||
* echo "<table width=1><tr><td><div style=\"position:relative; cursor: pointer;\" id=\"ione\"><img src=\"i/city/", $fon, ".jpg\" alt=\"\" border=\"0\"/>";
|
||
* echo "</div></td></tr></table>";
|
||
*/
|
||
}
|
||
|
||
if ($user['room'] == 20) {
|
||
bgset('cap_cp');
|
||
buildset(1, "club", 30, 235, "Бойцовский Клуб");
|
||
buildset(2, "shop", 202, 171, "Магазин");
|
||
buildset(3, "kom", 205, 105, "Комиссионный магазин");
|
||
buildset(4, "rem", 202, 290, "Ремонтная мастерская");;
|
||
buildset(13, "cap_statue", 222, 365, "Памятник Мэру Города");
|
||
buildset(6, "po4ta", 180, 540, "Почта");
|
||
buildset(7, "cap_arr_right", 260, 710, "Страшилкина Улица",1);
|
||
buildset(222, "cap_arr_top", 180, 650, "Торговая улица",1);
|
||
buildset(8, "cap_arr_left", 258, 21, "Большая парковая улица");
|
||
buildset(17, "berezka", 205, 435, "Березка");
|
||
buildset(11, "loto", 230, 615, "Лотерея Сталкера");
|
||
buildset(9, "tree2", 260, 530, "Новогодняя елка");
|
||
buildset(14, "sneg_3", 210, 390, "Снеговик");
|
||
echo "</div>";
|
||
}
|
||
elseif ($user['room'] == 21) {
|
||
bgset('cap_strash');
|
||
buildset(5, "cap_bank", 180, 485, "Банк");;
|
||
buildset(14, "cap_registratura", 170, 113, "Регистратура кланов");
|
||
buildset(16, "cap_tower", 5, 315, "Башня смерти");
|
||
buildset(16555, "cap_tree", 165, 20, "Дерево");
|
||
buildset(3, "cap_arr_right", 255, 708, "Ристалище",1);
|
||
buildset(13, "cap_flowershop", 220, 613, "Цветочный магазин");
|
||
buildset(4, "cap_arr_left", 258, 21, "Центральная площадь",1);
|
||
echo "</div>";
|
||
}
|
||
elseif ($user['room'] == 26) {
|
||
bgset('cap_park');
|
||
buildset(6, "cap_gate", 170, 340, "Городские ворота");
|
||
buildset(660, "cap_vokzal", 163, 43, "Общежитие");
|
||
buildset(5, "cap_znah", 195, 538, "Хижина Знахаря");
|
||
buildset(21, "cap_2sk", 249, 416, "Средняя скамейка");
|
||
buildset(20, "cap_3sk", 250, 630, "Большая скамейка");
|
||
buildset(22, "cap_1sk", 228, 490, "Маленькая скамейка");
|
||
buildset(3, "cap_arr_left", 259, 27, "Замковая площадь",1);
|
||
buildset(4, "cap_arr_right", 259, 715, "Центральная площадь",1);
|
||
echo "</div>";
|
||
}
|
||
elseif ($user['room'] == 2601) {
|
||
bgset('cap_zamk');
|
||
buildset(1052, "cap_lavka", 240, 425, "Храмовая лавка");
|
||
buildset(10, "ava_post", 240, 300, "Сувенирный магазинчик");
|
||
buildset(1, "cap_ruins", 166, 48, "Руины Старого замка");
|
||
buildset(1051, "cap_lab", 130, 327, "Вход в Лабиринт Хаоса");
|
||
buildset(44, "cap_hram", 173, 550, "Храм Древних");
|
||
buildset(55, "cap_arr_left", 258, 21, "Арена Богов",1);
|
||
buildset(4, "arr_right_png", 260, 710, "Большая парковая улица",1);
|
||
echo "</div>";
|
||
}
|
||
elseif ($user['room'] == 2655) {
|
||
bgset('ar_e_n');
|
||
buildset(2055, "altr_g", 230, 340, "Арена Ангелов");
|
||
buildset(2222, "cap_stop", 258, 21, "Проход закрыт",1);
|
||
buildset(10, "arr_right_png", 260, 710, "Замковая площадь",1);
|
||
echo "</div>";
|
||
}
|
||
elseif ($user['room'] == 2111) {
|
||
bgset('rist_bg');
|
||
buildset(1, "cap_arr_uleft", 240, 30, "Страшилкина Улица",1);
|
||
buildset(2, "cap_arr_right", 245, 708, "Секретный Лабиринт",1);
|
||
buildset(14, "cap_rist_solo", 210, 160, "Вход в Одиночные сражения");
|
||
buildset(14, "cap_rist_group", 243, 340, "Вход в Сражение отрядов");
|
||
buildset(1000, "av_zamk_rud", 80, 310, "Рудник");
|
||
buildset(203, "cap_rist_monstr", 145, 570, "Вход в Груповые сражения");
|
||
|
||
$laikas = mysql_result(mysql_query("SELECT `bochka` FROM `users` WHERE `id` = '{$user['id']}'; "), 0);
|
||
if (!isset($laikas)) {
|
||
$laikas = time() - 60 * 60 * 4;
|
||
mysql_query("UPDATE `users` SET `bochka`='" . $laikas . "' WHERE `id` = '{$user['id']}'; ");
|
||
}
|
||
if ($_SESSION['usebochka'] == '1' && $laikas <= time() - 60 * 60 * 4) {
|
||
$laikas = time();
|
||
mysql_query("UPDATE `users` SET `bochka`='" . $laikas . "' WHERE `id` = '{$user['id']}'; ");
|
||
$_SESSION['usebochka'] = '0';
|
||
$bon = mt_rand(1, 4);
|
||
if ($bon == 1) {
|
||
$kr = mt_rand(1, 25);
|
||
if ($kr >= 15) {
|
||
$kr1 = mt_rand(16, 25);
|
||
if ($kr1 >= 20) {
|
||
addchp('<span style="color:red"><b>Внимание!</b></span> <span style="color:red"> В принесенной бочке Вы нашли ' . $kr1 . ' кр. </span> ', '{[]}' . nick::id($user['id'])->short() . '{[]}');
|
||
mysql_query("UPDATE `users` SET `bochka`='" . $laikas . "', `money`=`money`+$kr1 WHERE `id` = '{$user['id']}'; ");
|
||
} else {
|
||
addchp('<spanstyle="color:red"><b>Внимание!</b></span> <span style="color:red"> В принесенной бочке Вы нашли ' . $kr1 . ' кр. </span> ', '{[]}' . nick::id($user['id'])->short() . '{[]}');
|
||
mysql_query("UPDATE `users` SET `bochka`='" . $laikas . "', `money`=`money`+$kr1 WHERE `id` = '{$user['id']}'; ");
|
||
}
|
||
} else {
|
||
addchp('<span style="color:red"><b>Внимание!</b></span> <span style="color:red"> В принесенной бочке Вы нашли ' . $kr . ' кр. </span> ', '{[]}' . nick::id($user['id'])->short() . '{[]}');
|
||
mysql_query("UPDATE `users` SET `bochka`='" . $laikas . "', `money`=`money`+$kr WHERE `id` = '{$user['id']}'; ");
|
||
}
|
||
} elseif ($bon == 2) {
|
||
$doblest = mt_rand(1, 75);
|
||
if ($doblest >= 40) {
|
||
$doblest1 = mt_rand(41, 75);
|
||
if ($doblest1 >= 60) {
|
||
addchp('<span style="color:red"><b>Внимание!</b></span> <span style="color:red"> В принесеной бочке Вы нашли ' . $doblest1 . ' оч.репутации. </span> ', '{[]}' . nick::id($user['id'])->short() . '{[]}');
|
||
mysql_query("UPDATE `users` SET `bochka`='" . $laikas . "', `doblest`=`doblest`+$doblest, `reputation`=`reputation`+'$doblest' WHERE `id` = '{$user['id']}'; ");
|
||
} else {
|
||
addchp('<span style="color:red"><b>Внимание!</b></span> <span style="color:red"> В принесеной бочке Вы нашли ' . $doblest1 . ' оч.репутации. </span> ', '{[]}' . nick::id($user['id'])->short() . '{[]}');
|
||
mysql_query("UPDATE `users` SET `bochka`='" . $laikas . "', `doblest`=`doblest`+$doblest, `reputation`=`reputation`+$doblest WHERE `id` = '{$user['id']}'; ");
|
||
|
||
}
|
||
} else {
|
||
addchp('<span style="color:red"><b>Внимание!</b></span> <span style="color:red"> В принесеной бочке Вы нашли ' . $doblest . ' оч.репутации. </span> ', '{[]}' . nick::id($user['id'])->short() . '{[]}');
|
||
mysql_query("UPDATE `users` SET `bochka`='" . $laikas . "', `doblest`=`doblest`+$doblest, `reputation`=`reputation`+$doblest WHERE `id` = '{$user['id']}'; ");
|
||
}
|
||
} elseif ($bon == 3) {
|
||
$rom = mt_rand(1, 75);
|
||
if ($rom >= 40) {
|
||
$rom1 = mt_rand(41, 75);
|
||
if ($rom1 >= 60) {
|
||
addchp('<span style="color:red"><b>Внимание!</b></span> <span style="color:red"> В принесеной бочке Вы нашли странный сосуд... </span> ', '{[]}' . nick::id($user['id'])->short() . '{[]}');
|
||
mysql_query("INSERT INTO `inventory` (`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`magic`,`otdel`, `isrep`)
|
||
VALUES ('5900400','{$_SESSION['uid']}','Бутыль старого пирата','51','1','5','rom.gif',1,'555','188','0') ;");
|
||
} else {
|
||
addchp('<span style="color:red"><b>Внимание!</b></span> <span style="color:red"> Ничего, кроме не нужных водорослей, Вы не нашли... ', '{[]}' . nick::id($user['id'])->short() . '{[]}');
|
||
}
|
||
} else {
|
||
addchp('<span style="color:red"><b>Внимание!</b></span> <span style="color:red"> Ничего, кроме не нужных водорослей, Вы не нашли... ', '{[]}' . nick::id($user['id'])->short() . '{[]}');
|
||
}
|
||
} else {
|
||
addchp('<span style="color:red"><b>Внимание!</b></span> <span style="color:red"> Ничего, кроме не нужных водорослей, Вы не нашли... ', '{[]}' . nick::id($user['id'])->short() . '{[]}');
|
||
}
|
||
} elseif ($laikas <= time() - 60 * 60 * 4) {
|
||
buildset(3, "bochka", 270, 630, "Бочка");
|
||
}
|
||
|
||
//buildset(21,"angelscastle",131,628,"Замок Мэра Города");
|
||
echo "</div></td></tr></table>";
|
||
} elseif ($user['room'] == 2701) {
|
||
if ((int)date("H") > 5 && (int)date("H") < 22) {
|
||
$fon = 'av_arena_bg1_day2';
|
||
} else {
|
||
$fon = 'av_arena_bg1_day2';
|
||
}
|
||
echo "<table width=1><tr><td><div style=\"position:relative; cursor: pointer;\" id=\"ione\"><img src=\"i/city/", $fon, ".jpg\" alt=\"\" border=\"0\"/>";
|
||
echo "<table width=1><tr><td><div style=\"position:absolute; left: 0px; top: 0px;\" id=\"ione\"><img src=\"i/city/", $fon2, ".gif\" alt=\"\" border=\"50\"/>";
|
||
buildset(1, "3strelka", 260, 30, "Берег Залива");
|
||
buildset(2, "shar_dark", 234, 356, "Лабиринт Хаоса");
|
||
buildset(3, "stop_png", 260, 720, "Проход закрыт");
|
||
echo "</div></td></tr></table>";
|
||
} //Торговая улица
|
||
elseif ($user['room'] == 2702) {
|
||
if ((int)date("H") > 5 && (int)date("H") < 22) {
|
||
//$fon = 'vesna_cap_torg_day';
|
||
$fon = 'zima_cap_torg_day';
|
||
$fon2 = 'snow_transp';
|
||
} else {
|
||
//$fon = 'vesna_cap_torg_night';
|
||
$fon = 'zima_cap_torg_night';
|
||
$fon2 = 'snow_transp';
|
||
}
|
||
echo "<table width=1><tr><td><div style=\"position:relative; cursor: pointer;\" id=\"ione\"><img src=\"i/city/", $fon, ".jpg\" alt=\"\" border=\"0\"/>";
|
||
echo "<table width=1><tr><td><div style=\"position:absolute; left: 0px; top: 0px;\" id=\"ione\"><img src=\"i/city/", $fon2, ".gif\" alt=\"\" border=\"50\"/>";
|
||
//buildset(14,"vesna_cap_build1",175,70,"Арендная лавка");
|
||
buildset(6, "zima_cap_arenda", 175, 70, "Академия");
|
||
//buildset(5,"vesna_cap_fontan",210,350,"Фонтан удачи");
|
||
buildset(202, "zima_cap_fontan", 210, 350, "Фонтан удачи");
|
||
//buildset(16,"t_build42",120,300,"Аукцион");
|
||
buildset(16, "t_build42", 120, 300, "Аукцион");
|
||
//buildset(16555,"vesna_cap_build3",155,480,"Прокатная лавка");
|
||
buildset(16555, "zima_cap_prokat", 155, 480, "Прокатная лавка");
|
||
//buildset(21,"vesna_cap_build2",150,565,"Ломбард");
|
||
buildset(21, "zima_cap_lombard", 150, 565, "Ломбард");
|
||
//buildset(4,"cap_rist_arr_left",259,25,"Центральная площадь");
|
||
buildset(10, "zima_cap_arr_uleft", 259, 25, "Центральная площадь");
|
||
//buildset(3,"stop_png",259,720,"Проход закрыт");
|
||
buildset(3, "zima_cap_stop", 259, 720, "Проход закрыт");
|
||
echo "</div></td></tr></table>";
|
||
}
|
||
?>
|
||
|
||
<?
|
||
//Нападение на Цп после 8
|
||
if ((int)date("H") >= 19 && $user['room'] == 20 || (int)date("H") >= 0 && (int)date("H") < 5 && $user['room'] == 20) {
|
||
$ms_cit = array('Вечер, звёзды... разбойник за каждым углом...',
|
||
'Говорят, ночью тут вампиры гуляют...',
|
||
'Темно, страшно, даже паладинов не видно...'
|
||
);
|
||
echo "<span class=cit_note>" . $ms_cit[rand(0, 2)] . "</span>";
|
||
?>
|
||
<SCRIPT src='js/commoninf.js'></SCRIPT>
|
||
<SCRIPT>
|
||
var Hint3Name = '';
|
||
|
||
// Заголовок, название скрипта, имя поля с логином
|
||
function findlogin(title, script, name) {
|
||
document.all("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' +
|
||
'<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="<? echo @$user['id']; ?>"><td colspan=2>' +
|
||
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
|
||
document.all("hint3").style.visibility = "visible";
|
||
document.all("hint3").style.left = 100;
|
||
document.all("hint3").style.top = 100;
|
||
document.all(name).focus();
|
||
Hint3Name = name;
|
||
}
|
||
|
||
function closehint3() {
|
||
document.all("hint3").style.visibility = "hidden";
|
||
Hint3Name = '';
|
||
}
|
||
</SCRIPT>
|
||
|
||
<div align="right" id="hint3"></div>
|
||
<INPUT TYPE="button" value="Напасть"
|
||
onclick="findlogin('Введите имя персонажа', 'city.php?nap=attack', 'target'); ">
|
||
<?
|
||
//сам скрипт нападения
|
||
if ($_GET['nap'] == "attack" && $user['room'] == 20) {
|
||
include "magic/cityattack.php";
|
||
}
|
||
}
|
||
?>
|
||
|
||
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
<script language="javascript" src="js/refreshonline.js"></script>
|
||
</body>
|
||
</html>
|