battles/aren_of_angels.php

234 lines
8.4 KiB
PHP
Raw Normal View History

2018-01-28 16:40:49 +00:00
<?php
session_start();
if ($_SESSION['uid'] == null) {
header("Location: index.php");
}
2018-01-28 16:40:49 +00:00
include("config.php");
include("functions.php");
$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();
$eff = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND (`type` = 11 OR `type` = 12)', $user['id'])->fetch_assoc();
$w = db::c()->query('SELECT `value` FROM `variables` WHERE `var` = "arena_win"')->fetch_assoc();
2018-01-28 16:40:49 +00:00
$al = aligntype($user['align']);
if ($w['value'] == 1) {
$winers = 'Прошлая победа за Силами Тьмы';
} elseif ($w['value'] == 2) {
$winers = 'Прошлая победа за Силами Света';
2018-01-28 16:40:49 +00:00
} else {
$winers = 'Прошлая битва завершилась ничьей.';
2018-01-28 16:40:49 +00:00
}
$error = '';
if (isset($_GET['append'])) {
if ($_GET['append'] == 1) { ##### team 2
if ($al == 1 || $al == 3) {
if (isset($is_now['id'])) {
if (!isset($eff['id'])) {
if ($user['level'] >= 7) {
if ($user['hp'] > $user['maxhp'] * 0.33) {
if ($user['align'] != 4) {
if ($is_now['time_m'] < (time() + 60 * 60)) {
$bot = db::c()->query('SELECT `id` FROM `bots` WHERE `battle` = ?i AND `prototype` = 10023', $is_now['id'])->fetch_assoc();
join_arena($user['id'], $is_now['id'], 2, $bot['id']);
} else {
$error = 'Время истекло ...';
}
} else {
$error = 'Хаосникам тут не место ...';
}
} else {
$error = 'Вы слишком ослаблены ...';
}
} else {
$error = 'Данный вид поединков доступен с 7 уровня ...';
}
2018-01-28 16:40:49 +00:00
} else {
$error = 'Вы травмированны и не можете принять участие в поединке ...';
2018-01-28 16:40:49 +00:00
}
} else {
$error = 'Поединок не найден ...';
2018-01-28 16:40:49 +00:00
}
} else {
$error = 'Не Ваша склонность ...';
2018-01-28 16:40:49 +00:00
}
} elseif ($_GET['append'] == 2) { ##### team 1
if ($al == 2 || $al == 3) {
if (isset($is_now['id'])) {
if (!isset($eff['id'])) {
if ($user['level'] >= 7) {
if ($user['hp'] > $user['maxhp'] * 0.33) {
if ($user['align'] != 4) {
if ($is_now['time_m'] < (time() + 60 * 60)) {
$bot = db::c()->query('SELECT `id` FROM `bots` WHERE `battle` = ?i AND `prototype` = 10024', $is_now['id'])->fetch_assoc();
join_arena($user['id'], $is_now['id'], 1, $bot['id']);
} else {
$error = 'Время истекло ...';
}
} else {
$error = 'Хаосникам тут не место ...';
}
} else {
$error = 'Вы слишком ослаблены ...';
}
} else {
$error = 'Данный вид поединков доступен с 7 уровня ...';
}
2018-01-28 16:40:49 +00:00
} else {
$error = 'Вы травмированны и не можете принять участие в поединке ...';
2018-01-28 16:40:49 +00:00
}
} else {
$error = 'Поединок не найден ...';
2018-01-28 16:40:49 +00:00
}
} else {
$error = 'Не Ваша склонность ...';
2018-01-28 16:40:49 +00:00
}
}
}
?>
<html>
<head>
<title>404</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="ru"/>
<link rel="stylesheet" type="text/css" href="design/css/fight.css"/>
2018-01-28 16:40:49 +00:00
</head>
<style>
.hs {
font-weight: bold;
font-size: 19px;
color: #8f0000;
font-family: arial;
text-align: center;
}
2018-01-28 16:40:49 +00:00
.bt {
float: right;
border: solid 1px #b0b0b0;
margin-top: 1px;
margin-bottom: 2px;
font-size: 11px;
color: #191970;
background-color: white;
padding: 1px 6px;
}
2018-01-28 16:40:49 +00:00
.credenzaBox {
width: 800px;
height: 367px;
overflow: hidden;
}
2018-01-28 16:40:49 +00:00
.credenzaItem {
width: 540px;
margin: 15px 120px;
padding: 6px 10px;
/*border: 1px inset #e2e0e0; 299pxxx
background: rgba(226,224,224, 0.9);*/
text-align: center;
}
2018-01-28 16:40:49 +00:00
.credenza-stateCaption {
text-align: center;
font-weight: bold;
margin-bottom: 12px;
color: #FFF;
font: 19px Arial, sans-serif;
text-shadow: red 1px 1px 0, red -1px -1px 0,
red -1px 1px 0, red 1px -1px 0;
2018-01-28 16:40:49 +00:00
/*
text-shadow: 3px 3px 2px rgba(0, 192, 173, 1);
font-size: 19px;
*/
}
.buttonContainer {
position: relative;
right: 0px;
top: 1px;
text-align: center;
overflow: hidden;
padding: 2px;
zoom: 1;
}
.contentContainer {
margin-left: auto;
margin-right: auto;
width: 800px;
height: auto;
position: relative;
}
h2 {
font-size: 13px;
margin-bottom: 0px;
color: #FFF;
font-family: verdana;
}
a {
font-weight: bold;
color: #FFF;
text-decoration: none;
}
a:hover {
color: Red;
}
2018-01-28 16:40:49 +00:00
</style>
<body>
<center>
<div><span class="hs">Арена Ангелов</span></div>
</center>
2018-01-28 16:40:49 +00:00
<div class="contentContainer">
<div class="buttonContainer">
<input type="button" onclick="location.href='city.php?bps=1';" class="bt" value="Вернуться"/>
<input type="button" onclick="location.reload();" class="bt" value="Обновить"/>
</div>
<!-- url('/i/im/1724581.jpg') -->
<div class="credenzaBox" style="background: url('/i/im/u1001573_1407648022.jpg') no-repeat center;">
<div class="credenzaItem">
<? if (!isset($is_now['id'])) { ?>
<div class="credenza-stateCaption">
<center><? echo $winers; ?>.<br/>Следующая битва для 7-21 ур. состоится
: <? echo date("d.m.Y H:i", $start['value']); ?></center>
</div>
<? } else { ?>
<div class="credenza-stateCaption">
<h2>
<center>Идет сражение [7-21 уровни]</center>
</h2>
<br/><a href="/logs.php?log=<?= $is_now['id']; ?>" target="_blank" style="text-align: center;">ход
боя »»</a></div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td align="left">
<a href="?append=1" style="display: inline;"><img src="/i/im/append_1.png"
height="70"/><br/>Вмешаться</a>
</td>
<td align="center">
<img src="/i/im/logo_big2.png"/>
</td>
<td align="right">
<a href="?append=2" style="display: inline;"><img src="/i/im/append_2.png"
height="70"/><br/>Вмешаться</a>
</td>
</tr>
</tbody>
</table>
<? } ?>
</div>
</div>
2018-01-28 16:40:49 +00:00
</div>
<center><? if ($error != '') {
echo '<b style=\'color: Red;\'>' . $error . '</b>';
} ?></center>
2018-01-28 16:40:49 +00:00
</body>
</html>