battles/city.php

229 lines
6.8 KiB
PHP
Raw Normal View History

2018-01-28 16:40:49 +00:00
<?php
2018-03-09 02:13:08 +00:00
/**
* Центральная площадь
*/
2018-01-28 16:40:49 +00:00
session_start();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
require_once "functions.php";
$user = $user ?? [];
2018-01-28 16:40:49 +00:00
if ($user->battle) {
header('location: fbattle.php');
exit;
}
if ($user->in_tower == 1) {
header('Location: towerin.php');
exit;
}
if ($user->zayavka) {
exit;
}
2018-01-28 16:40:49 +00:00
2020-10-26 18:16:28 +00:00
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
$location = explode('/', filter_input(INPUT_SERVER, 'QUERY_STRING'));
2020-10-26 18:16:28 +00:00
switch ($location[0]) {
2020-10-26 18:16:28 +00:00
default:
break;
case 'cp':
2020-10-26 18:16:28 +00:00
Travel::toRoom(20);
break;
case 'strah':
2020-10-26 18:16:28 +00:00
Travel::toRoom(21);
break;
case 'bps':
2020-10-26 18:16:28 +00:00
Travel::toRoom(26);
break;
case 'ps':
2020-10-26 18:16:28 +00:00
Travel::toRoom(51);
break;
case 'zaliv':
2020-10-26 18:16:28 +00:00
Travel::toRoom(2111);
break;
case 'zamk':
2020-10-26 18:16:28 +00:00
Travel::toRoom(2601);
break;
case 'abog':
2020-10-26 18:16:28 +00:00
Travel::toRoom(2655);
break;
case 'torg':
2020-10-26 18:16:28 +00:00
Travel::toRoom(2702);
break;
case 'got':
if ($user->room == 20) {
switch ($location[1]) {
2020-10-26 18:16:28 +00:00
default:
break;
case 'level1':
header('location: main.php?goto=arena');
exit;
break;
case 'level7':
2020-10-26 18:16:28 +00:00
Travel::toRoom(21);
break;
case 'level8':
2020-10-26 18:16:28 +00:00
Travel::toRoom(26);
break;
case 'level13':
header('location: quest_room.php');
break;
case 'level222':
2020-10-26 18:16:28 +00:00
Travel::toRoom(2702);
break;
case 'level17':
2020-10-26 18:16:28 +00:00
Travel::toRoom(50, 'ashop.php');
break;
case 'level2':
2020-10-26 18:16:28 +00:00
Travel::toRoom(22, 'shop.php');
break;
case 'level4':
2020-10-26 18:16:28 +00:00
Travel::toRoom(23, 'repair.php');
break;
case 'level6':
2020-10-26 18:16:28 +00:00
Travel::toRoom(27, 'post.php');
break;
case 'level3':
2020-10-26 18:16:28 +00:00
Travel::toRoom(25, 'comission.php');
break;
}
} elseif ($user->room == 21) {
switch ($location[1]) {
2020-10-26 18:16:28 +00:00
default:
break;
case 'level4':
2020-10-26 18:16:28 +00:00
Travel::toRoom(20);
break;
case 'level3':
2020-10-26 18:16:28 +00:00
Travel::toRoom(2111);
break;
case 'level13':
2020-10-26 18:16:28 +00:00
Travel::toRoom(34, 'fshop.php');
break;
case 'level5':
2020-10-26 18:16:28 +00:00
Travel::toRoom(29, 'bank.php');
break;
case 'level16':
2020-10-26 18:16:28 +00:00
Travel::toRoom(31, 'tower.php');
break;
case 'level14':
2020-10-26 18:16:28 +00:00
Travel::toRoom(30, 'clan_create.php');
break;
case 'level650':
2020-10-26 18:16:28 +00:00
Travel::toRoom(650, 'ul_clans.php');
break;
}
} elseif ($user->room == 2111) {
switch ($location[1]) {
2020-10-26 18:16:28 +00:00
default:
break;
case 'level1':
2020-10-26 18:16:28 +00:00
Travel::toRoom(21);
break;
case 'level2':
header('location: city.php?haos');
break;
case 'level203':
2020-10-26 18:16:28 +00:00
Travel::toRoom(1055, 'group_arena.php');
break;
case 'level1000':
2020-10-26 18:16:28 +00:00
Travel::toRoom(620, 'enter_cave.php');
break;
case 'room666':
2020-10-26 18:16:28 +00:00
Travel::toRoom(666, 'jail.php');
break;
}
} elseif ($user->room == 2601) {
switch ($location[1]) {
2020-10-26 18:16:28 +00:00
default:
break;
case 'level4':
2020-10-26 18:16:28 +00:00
Travel::toRoom(26);
break;
case 'level55':
2020-10-26 18:16:28 +00:00
Travel::toRoom(2655);
break;
case 'level1':
2020-10-26 18:16:28 +00:00
Travel::toRoom(37, 'gotzamok.php');
break;
case 'level1051':
2020-10-26 18:16:28 +00:00
Travel::toRoom(1051, 'lab_enter.php');
break;
case 'level5':
2020-10-26 18:16:28 +00:00
Travel::toRoom(404, 'vxod.php');
break;
}
} elseif ($user->room == 2701) {
switch ($location[1]) {
2020-10-26 18:16:28 +00:00
default:
break;
case 'level1':
2020-10-26 18:16:28 +00:00
Travel::toRoom(2111);
break;
case 'level2':
2020-10-26 18:16:28 +00:00
Travel::toRoom(402, 'lab_chaos_enter.php');
break;
}
} elseif ($user->room == 2702) {
switch ($location[1]) {
2020-10-26 18:16:28 +00:00
default:
break;
case 'level10':
2020-10-26 18:16:28 +00:00
Travel::toRoom(20);
break;
case 'level6':
2020-10-26 18:16:28 +00:00
Travel::toRoom(61, 'akadem.php');
break;
}
} elseif ($user->room == 2655) {
switch ($location[1]) {
2020-10-26 18:16:28 +00:00
default:
break;
case 'level10':
2020-10-26 18:16:28 +00:00
Travel::toRoom(2601);
break;
case 'level2055':
2020-10-26 18:16:28 +00:00
Travel::toRoom(603, 'aren_of_angels.php');
break;
}
} elseif ($user->room == 26) {
switch ($location[1]) {
2020-10-26 18:16:28 +00:00
default:
break;
case 'level4':
2020-10-26 18:16:28 +00:00
Travel::toRoom(20);
break;
case 'level3':
2020-10-26 18:16:28 +00:00
Travel::toRoom(2601);
break;
case 'level660':
2020-10-26 18:16:28 +00:00
Travel::toRoom(660, 'hostel.php');
break;
case 'level7':
2020-10-26 18:16:28 +00:00
Travel::toRoom(777, 'obshaga.php');
break;
2019-01-18 19:56:07 +00:00
case 'level56':
2020-10-26 18:16:28 +00:00
Travel::toRoom(401, 'hell.php');
2019-01-18 19:56:07 +00:00
break;
}
}
2018-03-09 02:13:08 +00:00
}
Template::header('city');
2020-10-26 18:16:28 +00:00
echo sprintf('<div style="text-align: right;">Сейчас в игре: %s игроков.></div>', $online->getNumRows());
if (in_array($user->room, [20, 21, 26, 2601, 2655, 2111, 2701, 2702])) {
/* Улицы:
* 20 Центральная
* 21 Страшилкина
* 26 Парковая
* 2601 Замковая
* 2655 С ареной
* 2111 С ристалищем
* 2701 С ещё одним ристалищем?
* 2702 Торговая
*/
City::showStreet($user->room);
}