Compare commits

...

3 Commits

Author SHA1 Message Date
lopar
51eb2c83b5 Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	classes/Battles/User.php
#	user_abilities.php
2021-02-02 23:56:04 +02:00
lopar
8442eb4e7b Немножко допричесал модерацию, с которой теперь можно иметь дело. 2021-02-01 22:53:28 +02:00
lopar
0ccc2d1af5 Зачем-то инкапсулирем. 2021-02-01 21:30:29 +02:00
12 changed files with 113 additions and 901 deletions

View File

@ -47,7 +47,7 @@ $unregisteredClans = new class {
$shortName = $row[$i]->short_name;
$info = nl2br($row[$i]->info);
$i++;
echo <<<UNREGCLAN
echo <<<UNREGCLANLIST
<div>
<fieldset style="display: inline;">
<legend>$fullName [$shortName]</legend>
@ -58,7 +58,7 @@ $unregisteredClans = new class {
<button onclick="location.href='?remclan=$id'">Отказать</button>
</fieldset>
</div>
UNREGCLAN;
UNREGCLANLIST;
}
unset($i);
}
@ -96,11 +96,11 @@ if (!empty($_POST['receiver']) && !empty($_POST['tgmsg'])) {
echo "Успешно.";
}
# Показывает невидимок.
echo '<legend>Невидимки:</legend>';
$row = DBPDO::INIT()->ofetchAll('SELECT id,login FROM users LEFT JOIN users_effects ue on users.id = ue.owner_id WHERE type = 1022 ORDER BY `id` DESC');
$i = 0;
$invisList = '';
while ($i < count($row)) {
echo '<b>[id] = ' . $row[$i]->id . ', ' . $row[$i]->login . ' </b><br>';
$invisList .= '<b>[id] = ' . $row[$i]->id . ', ' . $row[$i]->login . ' </b><br>';
$i++;
}
unset($i);
@ -109,6 +109,8 @@ unset($i);
Template::header('ᐰdminка');
?>
<link rel=stylesheet href="/css/admin.css">
<span class="legend">Абилки. Работают только на себя. Надо дописать цель.</span><br>
<button onclick="location.href='?sleep'"><img src="../i/magic/sleep.gif" alt="sleep"> Молчать 15 мин</button>
<button disabled><img src="../i/magic/sleep.gif" alt="sleep"> Молчать 1 час</button>
<button disabled><img src="../i/magic/sleep.gif" alt="sleep"> Молчать 1 день</button>
@ -125,89 +127,11 @@ Template::header('ᐰdminка');
<button disabled><img src="../i/magic/death.gif" alt="death"> Заблокировать</button>
<button disabled><img src="../i/magic/death_off.gif" alt="death_off"> Разблокировать</button>
<br>
<button disabled>Снять все травмы</button>
<button disabled>Свадьба</button>
<button disabled>Развод</button>
<button disabled>Выйти из боя</button>
<?php
####################################################
## НЕ ТРОГАТЬ! ТУТ ОТКРЫВАЮТСЯ ВСПЛЫВАЮЩИЕ ОКНА!!!##
####################################################
echo "<div class=appblock id=hint3 onclick='closehint3();'></div>";
####################################################
$moj = ['sleep', 'sleepf'];
switch ($_POST['use']) { /* Подключаем строго тот свиток который используем. 36 Свитков править. Мама дорогая! */
case "check":
include("../magic/check.php");
break;
case "brat":
include("../magic/brat.php");
break;
case "vampir":
include("../magic/vampir.php");
break;
case "crush":
include("../magic/devastate.php");
break;
case "def":
include("../magic/defence.php");
break;
case "bexit":
include("../magic/bexit.php");
break;
case "vip":
include("../magic/vips.php");
break;
echo "<div class=abils><span class='legend'>Абилки:</span>Пока что привязаны к общей системе. Работают выборочно.<br>";
$script_name = $magic_name = '';
foreach ($moj as $k => $v) {
switch ($k) { /* 45 скриптов на 36 умелок? Неплохо… */
case "vip":
$script_name = "vipad";
$magic_name = "Вип";
break;
case "hidden":
$script_name = "runmagic1";
$magic_name = "Заклятие невидимости";
break;
case "teleport":
$script_name = "runmagic";
$magic_name = "Телепортация";
break;
case "check":
$script_name = "runmagic1";
$magic_name = "Поставить проверку";
break;
case "pal_buttons":
$script_name = "runmagic";
$magic_name = "Отметить о прохождении проверки";
break;
case "rep":
$script_name = "runmagic";
$magic_name = "Отчет о переводах";
break;
case "rost":
$script_name = "runmagic";
$magic_name = "Присвоить статус";
break;
case "bexit":
$script_name = "runmagic1";
$magic_name = "Выйти из боя";
break;
}
# Эта строка генерирует свитки с навыком. Но нам нужен просто перечень всего…
if ($script_name) {
print "<a onclick=\"$script_name('$magic_name','$k','target','target1') \" href='#'><img src='i/magic/" . $k . ".gif' title='" . $magic_name . "'></a>&nbsp;";
}
}
}
echo "</div>";
?>
<button disabled><img src="../i/magic/ct_all.gif" alt="ct_all"> Снять все травмы</button>
<button disabled><img src="../i/magic/marry.gif" alt="marry"> Свадьба</button>
<button disabled><img src="../i/magic/unmarry.gif" alt="unmarry"> Развод</button>
<button disabled><img src="../i/magic/bexit.gif" alt="bexit"> Выйти из боя</button>
<button disabled><img src="../i/magic/check.gif" alt="check"> Проверка</button>
<form method='post'>
<legend>Добавить в «дело» игрока заметку о нарушении правил, прокрутке и пр.</legend>
@ -232,84 +156,5 @@ echo "</div>";
<input type='submit' value='Изменить статус'>
</form>
<script>
const xmlHttpp = [];
function GetXmlHttpObject1() {
let xmlHttp1 = null;
try {
xmlHttp1 = new XMLHttpRequest();
} catch (e) {
try {
xmlHttp1 = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp1;
}
function show(ele) {
const srcElement = document.getElementById(ele);
if (srcElement != null) {
if (srcElement.style.display == "block") {
srcElement.style.display = 'none';
} else {
srcElement.style.display = 'block';
}
}
}
let Hint3Name = '';
let Hint3Closed = false;
function vipad(title, magic, 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</b></BIG></td></tr><tr><td colspan=2>' +
'<form action="admin.php" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><td colspan=2><INPUT TYPE=hidden name=sd4 value="<?php echo @$user['id']; ?>"><INPUT TYPE=hidden NAME="use" value="' + magic + '">' +
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD align=left><INPUT NAME="' + name + '">' +
'<br /><select style="background-color:#eceddf; color:#000000;" name="vip_type"><option value=1>Silver</option><option value=2>Gold</option><option value=3>Platinum</option></select>' +
'<select style="background-color:#eceddf; color:#000000;" name="time"><option value="1">1 Месяц</option><option value="2">2 Месяца</option><option value="3">3 Месяца</option><option value="4">4 Месяца</option><option value="5">5 Месяцев</option><option value="6">6 Месяцев</option><option value="99999999">Бесконечно</option></select>' +
'</TD><TD width=30><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;
Hint3Closed = false;
}
function runmagic(title, magic, name) {
document.all("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '<td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</b></BIG><tr><td colspan=2>' +
'<form action="admin.php" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><td colspan=2><INPUT TYPE=hidden name=sd4 value="<?php echo @$user['id']; ?>"><INPUT TYPE=hidden NAME="use" value="' + magic + '">' +
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)<TR><TD align=left><INPUT NAME="' + name + '">' +
'<select style="background-color:#eceddf; color:#000000;" name="timer"><option value=15>15 мин</option><option value=30>30 мин</option>' +
'<option value=60>1 час</option><option value=180>3 часа</option><option value=360>6 часов</option><option value=720>12 часов</option><option value=1440>сутки</option> </select>' +
'<TD width=30><INPUT TYPE="submit" value=" »» "></TABLE></FORM></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;
Hint3Closed = false;
}
function runmagic1(title, magic, 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</b></BIG></td></tr><tr><td colspan=2>' +
'<form action="admin.php" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><td colspan=2><INPUT TYPE=hidden name=sd4 value="<?php echo @$user['id']; ?>"> <INPUT TYPE=hidden NAME="use" value="' + magic + '">' +
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD align=left><INPUT NAME="' + name + '">' +
'</TD><TD width=30><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;
Hint3Closed = false;
}
function closehint3() {
document.all("hint3").style.visibility = "hidden";
Hint3Name = '';
Hint3Closed = false;
}
</script>
<span class="legend">Невидимки</span><br>
<div class="abils" style="width: fit-content;"><?= $invisList ?></div>

View File

@ -6,7 +6,7 @@ session_start();
require_once "functions.php";
$user = $user ?? new \Battles\User($_SESSION['uid']);
if ($user->zayavka) {
if ($user->getZayavka()) {
exit;
}

View File

@ -77,4 +77,10 @@ class Moderation
{
DBPDO::INIT()->execute('INSERT INTO chat (user_id,msg,type) VALUES (-1,?,?)', [$message, 'sys']);
}
public static function addUserCheck(int $target): bool
{
self::addEffectStatusToUserLog($target, UserEffects::$effectName[20]);
return User::setUserEffect($target, 20, UserEffects::$effectName[20], strtotime('3days'));
}
}

View File

@ -16,7 +16,7 @@ class User
protected $info;
protected $level = 0;
protected $align = 0;
protected $clan = 0;
protected $clan;
protected $money = 0;
protected $strength = 0;
protected $dexterity = 0;
@ -41,18 +41,18 @@ class User
protected $chestArmor = 0;
protected $legArmor = 0;
protected $free_stat_points = 0;
public const STAT_MAXIMUM_AMOUNT = 40;
private const STAT_MAXIMUM_AMOUNT = 40;
private const ERROR_STAT_IS_MAXIMUM = 'Ошибка: Параметр достиг своего лимита!';
private const ERROR_STAT_UNKNOWN = 'Ошибка: Неизвестный параметр!';
// Пока несуществующие, для совместимости.
public $married = 'Someone или нет.';
public $experience = 200;
public $battle = 0;
public $in_tower = 0; // Скорее башню похороним чем запустим...
public $zayavka = 0;
protected $married = 'Someone или нет.';
protected $experience = 200;
protected $battle = 0;
protected $in_tower = 0; // Скорее башню похороним чем запустим...
protected $zayavka = 0;
// Динамически рассчитываемые
public $maxHealth = 5;
public $maxMana = 5;
protected $maxHealth = 5;
protected $maxMana = 5;
protected static $db;
public function __construct(int $user)
@ -322,9 +322,9 @@ class User
}
/**
* @return int
* @return string
*/
public function getClan(): int
public function getClan(): string
{
return $this->clan;
}
@ -332,7 +332,7 @@ class User
/**
* @param int $clan
*/
public function setClan(int $clan): void
public function setClan(string $clan): void
{
$this->clan = $clan;
}
@ -569,14 +569,6 @@ class User
return $this->minDamage;
}
/**
* @param int $minDamage
*/
public function setMinDamage(int $minDamage): void
{
$this->minDamage = $minDamage;
}
/**
* @return int
*/
@ -585,14 +577,6 @@ class User
return $this->maxDamage;
}
/**
* @param int $maxDamage
*/
public function setMaxDamage(int $maxDamage): void
{
$this->maxDamage = $maxDamage;
}
/**
* @return int
*/
@ -745,14 +729,6 @@ class User
return $this->maxHealth;
}
/**
* @param float|int $maxHealth
*/
public function setMaxHealth($maxHealth): void
{
$this->maxHealth = $maxHealth;
}
/**
* @return float|int
*/
@ -761,13 +737,4 @@ class User
return $this->maxMana;
}
/**
* @param float|int $maxMana
*/
public function setMaxMana($maxMana): void
{
$this->maxMana = $maxMana;
}
}

View File

@ -436,3 +436,9 @@ div.secret-info > span {
img.building:hover {
filter: drop-shadow(2px 2px 2px white) sepia(15%);
}
.legend {
color: dimgray;
font-family: consolas, sans-serif;
font-size: 18px;
margin-top: 10px;
}

View File

@ -54,12 +54,12 @@ $fbattleCheckFiles = [
'zayavka.php',
];
//Может просто отовсюду? О_о
if ($user->battle && in_array(pathinfo(debug_backtrace()[0]['file'])['basename'], $fbattleCheckFiles)) {
if ($user->getBattle() && in_array(pathinfo(debug_backtrace()[0]['file'])['basename'], $fbattleCheckFiles)) {
header('location: fbattle.php');
exit;
}
$towerinCheckFiles = ['main.php', 'city.php', 'tower.php'];
if ($user->in_tower && in_array(pathinfo(debug_backtrace()[0]['file'])['basename'], $towerinCheckFiles)) {
if ($user->getInTower() && in_array(pathinfo(debug_backtrace()[0]['file'])['basename'], $towerinCheckFiles)) {
header('location: towerin.php');
exit;
}
@ -289,9 +289,9 @@ function echoscroll($slot)
{
global $user;
$all_magic = 0;
if ($user->battle) {
if ($user->getBattle()) {
$script = 'fbattle';
$bat = db::c()->query('SELECT `magic` FROM `battle` WHERE `id` = ?i', $user->battle)->fetch_assoc();
$bat = db::c()->query('SELECT `magic` FROM `battle` WHERE `id` = ?i', $user->getBattle())->fetch_assoc();
$all_magic = unserialize($bat['magic']);
} else {
$script = 'main';
@ -792,7 +792,7 @@ function usemagic($id, $target)
{
global $user;
$row = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND id = ?i', $user->getId(), $id)->fetch_assoc_array();
$bat = db::c()->query('SELECT * FROM `battle` WHERE `id` = ?i', $user->battle)->fetch_assoc_array();
$bat = db::c()->query('SELECT * FROM `battle` WHERE `id` = ?i', $user->getBattle())->fetch_assoc_array();
$all_magic = unserialize($bat['magic']);
$charge = 0;
$magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $row['magic'])->fetch_assoc_array();
@ -859,8 +859,8 @@ function usemagic($id, $target)
$charge = 0;
}
//ограничение по кол-ву за ход
if ($user->battle > 0) {
$bat = db::c()->query('SELECT * FROM `battle` WHERE `id` = ?i', $user->battle)->fetch_assoc_array();
if ($user->getBattle()) {
$bat = db::c()->query('SELECT * FROM `battle` WHERE `id` = ?i', $user->getBattle())->fetch_assoc_array();
}
if ($bat['magic'] == '') {
$all_magic = [];
@ -868,7 +868,7 @@ function usemagic($id, $target)
$all_magic = unserialize($bat['magic']);
}
$all_magic[$user->getId()] += $charge;
db::c()->query('UPDATE `battle` SET `magic`= "?s" WHERE id = ?i', serialize($all_magic), $user->battle);
db::c()->query('UPDATE `battle` SET `magic`= "?s" WHERE id = ?i', serialize($all_magic), $user->getBattle());
}
}
return false;

View File

@ -1,39 +0,0 @@
<?php
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
$target = $_POST['target'];
$tar = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
$magictime = time() + 259200;
if ($tar['id']) {
if ($tar['klan'] || $tar['align']) {
echo "<font color=red><b>Персонаж \"$target\" состоит в клане, либо имеет склонность!</b></font>";
} else {
$ok = 0;
if ($user['align'] > '2' && $user['align'] < '3') {
$ok = 1;
} elseif ($user['align'] > '1.6' && $user['align'] < '2') {
$ok = 1;
}
if ($ok == 1) {
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Проверка Паладинов','" . $magictime . "','20');")) {
$messtel = "Помечено, что персонаж чист перед законом";
$mess = "" . $user['login'] . " сделал пометку что " . $_POST['target'] . " чист перед законом";
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
/*Тут была привязка к телеграфу*/
echo "<font color=red><b>Успешно поставлена проверка персонажу \"$target\"</b></font>";
} else {
echo "<font color=red><b>Произошла ошибка!<b></font>";
}
} else {
echo "<font color=red><b>Вы не можете поставить проверку!<b></font>";
}
}
} else {
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
}

View File

@ -1,134 +0,0 @@
<?
if(empty($_SESSION['uid'])) { header('Location: ../index.php'); exit; }
$us = mysql_fetch_array(mysql_query('SELECT `id`, `vip`, `vip_time`, `login` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['target']).'" LIMIT 1'));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `sokr`, `zash`, `invisible`, `attack`, `bloodattack`, `sleep30`, `travmoff`, `dontattack`, `unsleep`, `pers_attack` FROM `abils_vip` WHERE `uid` = "'.$us['id'].'" LIMIT 1'));
$type = (int)$_POST['vip_type'];
$time = (int)$_POST['time'];
$n_time = (time()+60*60*24*($time*30));
$afected = (($user['vip_time'])+60*60*24*($time*30));
$types = array(1 => 'Silver', 2 => 'Gold', 3 => 'Platinum');
if($time > 10) {
$srok = 'Бессрочно.';
} else {
$srok = $time.' мес.';
}
if($user['align'] != 2.99 && $user['login'] != "father") {
echo '<b style=\'color: Red;\'>Вам не доступна данная привелегия ...</b>';
} elseif(!isset($us['id'])) {
echo '<b style=\'color: Red;\'>Персонаж \''.$_POST['target'].'\' не найден ...</b>';
} elseif($type < 1 && $type > 3) {
echo '<b style=\'color: Red;\'>Не верный тип аккаунта ...</b>';
} else {
if($us['vip'] > 0 && $us['vip_time'] > time()) {
if($type == 1) {
if($us['vip'] == 1) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 1; $vip['attack'] = 1; $vip['bloodattack'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "0", `dontattack` = "0", `travmoff` = "0", `unsleep` = "0", `pers_attack` = "0"';
mysql_query('UPDATE `users` SET `vip` = 1, `vip_time` = "'.$afected.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
$t = 'обновлён'; $add = 'обновил';
} elseif($us['vip'] == 2) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 2; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 1; $vip['travmoff'] = 1; $vip['unsleep'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "0"';
mysql_query('UPDATE `users` SET `vip` = 1, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
$t = 'выдан'; $add = 'присвоил';
} elseif($us['vip'] == 3) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 3; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 2; $vip['travmoff'] = 1; $vip['unsleep'] = 2; $vip['pers_attack'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "'.$vip['pers_attack'].'"';
mysql_query('UPDATE `users` SET `vip` = 1, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
$t = 'выдан'; $add = 'присвоил';
}
mysql_query('UPDATE `abils_vip` SET '.$sql.' WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo '<b style=\'color: Red;\'>Персонажу '.$us['login'].', '.$t.' '.$types[$type].' аккаунт. Сроком '.$srok.'</b>';
$txt = 'Ангел <b>'.$user['login'].'</b> '.$add.' вам <b>'.$types[$type].' аккаунт</b>, сроком '.$srok.'';
addchp('<font color=red>Внимание!</font> '.$txt, '{[]}'.Nick::id($us['id'])->short().'{[]}');
} elseif($type == 2) {
if($us['vip'] == 1) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 1; $vip['attack'] = 1; $vip['bloodattack'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "0", `dontattack` = "0", `travmoff` = "0", `unsleep` = "0", `pers_attack` = "0"';
mysql_query('UPDATE `users` SET `vip` = 2, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
$t = 'выдан'; $add = 'присвоил';
} elseif($us['vip'] == 2) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 2; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 1; $vip['travmoff'] = 1; $vip['unsleep'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "0"';
mysql_query('UPDATE `users` SET `vip` = 2, `vip_time` = "'.$afected.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
$t = 'обновлен'; $add = 'обновил';
} elseif($us['vip'] == 3) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 3; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 2; $vip['travmoff'] = 1; $vip['unsleep'] = 2; $vip['pers_attack'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "'.$vip['pers_attack'].'"';
mysql_query('UPDATE `users` SET `vip` = 2, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
$t = 'выдан'; $add = 'присвоил';
}
mysql_query('UPDATE `abils_vip` SET '.$sql.' WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo '<b style=\'color: Red;\'>Персонажу '.$us['login'].', '.$t.' '.$types[$type].' аккаунт. Сроком '.$srok.'</b>';
$txt = 'Ангел <b>'.$user['login'].'</b> '.$add.' вам <b>'.$types[$type].' аккаунт</b>, сроком '.$srok.'';
addchp('<font color=red>Внимание!</font> '.$txt, '{[]}'.Nick::id($us['id'])->short().'{[]}');
} elseif($type == 3) {
if($us['vip'] == 1) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 1; $vip['attack'] = 1; $vip['bloodattack'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "0", `dontattack` = "0", `travmoff` = "0", `unsleep` = "0", `pers_attack` = "0"';
mysql_query('UPDATE `users` SET `vip` = 3, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
$t = 'выдан'; $add = 'присвоил';
} elseif($us['vip'] == 2) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 2; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 1; $vip['travmoff'] = 1; $vip['unsleep'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "0"';
mysql_query('UPDATE `users` SET `vip` = 3, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
$t = 'выдан'; $add = 'присвоил';
} elseif($us['vip'] == 3) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 3; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 2; $vip['travmoff'] = 1; $vip['unsleep'] = 2; $vip['pers_attack'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "'.$vip['pers_attack'].'"';
mysql_query('UPDATE `users` SET `vip` = 3, `vip_time` = "'.$afected.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
$t = 'обновлен'; $add = 'обновил';
}
mysql_query('UPDATE `abils_vip` SET '.$sql.' WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo '<b style=\'color: Red;\'>Персонажу '.$us['login'].', '.$t.' '.$types[$type].' аккаунт. Сроком '.$srok.'</b>';
$txt = 'Ангел <b>'.$user['login'].'</b> '.$add.' вам <b>'.$types[$type].' аккаунт</b>, сроком '.$srok.'';
addchp('<font color=red>Внимание!</font> '.$txt, '{[]}'.Nick::id($us['id'])->short().'{[]}');
}
} else {
if(isset($vip['id'])) {
if($type == 1) {
$vip['invisible'] += 1; $vip['attack'] = 1; $vip['bloodattack'] = 1;
$sql = '`invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'"';
} elseif($type == 2) {
$vip['invisible'] += 2; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 1; $vip['travmoff'] = 1; $vip['unsleep'] = 1;
$sql = '`invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'"';
} elseif($type == 3) {
$vip['invisible'] += 3; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] += 2; $vip['travmoff'] = 1; $vip['unsleep'] += 2; $vip['pers_attack'] = 1;
$sql = '`invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "'.$vip['pers_attack'].'"';
}
$add = 'Выдал';
mysql_query('UPDATE `users` SET `vip` = "'.$type.'", `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_vip` SET '.$sql.' WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo '<b style=\'color: Red;\'>Персонажу '.$us['login'].', выдан '.$types[$type].' аккаунт. Сроком '.$srok.'</b>';
$txt = 'Ангел <b>'.$user['login'].'</b> '.$add.' вам <b>'.$types[$type].' аккаунт</b>, сроком '.$srok.'';
addchp('<font color=red>Внимание!</font> '.$txt, '{[]}'.Nick::id($us['id'])->short().'{[]}');
} else {
if($type == 1) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 1; $vip['attack'] = 1; $vip['bloodattack'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'"';
} elseif($type == 2) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 2; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 1; $vip['travmoff'] = 1; $vip['unsleep'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'"';
} elseif($type == 3) {
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 3; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 2; $vip['travmoff'] = 1; $vip['unsleep'] = 2; $vip['pers_attack'] = 1;
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'"';
}
mysql_query('UPDATE `users` SET `vip` = "'.$type.'", `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
mysql_query('INSERT INTO `abils_vip` SET '.$sql.', `uid` = "'.$us['id'].'"');
echo '<b style=\'color: Red;\'>Персонажу '.$us['login'].', выдан '.$types[$type].' аккаунт. Сроком '.$srok.'</b>';
$txt = 'Ангел <b>'.$user['login'].'</b> присвоил вам <b>'.$types[$type].' аккаунт</b>, сроком '.$srok.'';
addchp('<font color=red>Внимание!</font> '.$txt, '{[]}'.Nick::id($us['id'])->short().'{[]}');
}
}
}

View File

@ -379,7 +379,7 @@ Template::header('Игра');
<td style="vertical-align: top; width: 250px"> <!-- Второй столбец -->
<div>
<br>Уровень: <strong><?= $user->getLevel() ?></strong>
<br>Опыт: <strong><?= $user->experience ?></strong>
<br>Опыт: <strong><?= $user->getExperience() ?></strong>
<br>Побед: <strong>??</strong>
<br>Поражений: <strong>??</strong>
<br>Ничьих: <strong>??</strong>

View File

@ -1,6 +1,6 @@
<?php
session_start();
if ($user->battle) { header('location: fbattle.php'); exit; }
if ($user->getBattle()) { header('location: fbattle.php'); exit; }
include "../config.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
if ($user['admin']) {

View File

@ -17,10 +17,10 @@ if (!empty($_GET['teleport']) && $user->getAdmin() == 1) {
}
# ORDEN PHP
$_POST['use'] = $_POST['use'] ?? null;
if ($user->getAdmin()) {
$abil = db::c()->query('SELECT abil FROM users WHERE id = ?i', $user->getId())->fetch_assoc();
$abil = unserialize($abil['abil']);
$abil = db::c()->query('SELECT 1 FROM users WHERE id = ?i', $user->getId())->fetch_assoc();
//$abil = unserialize($abil['abil']);
switch ($_POST['use']) {
case "healing":
include("./magic/Healing.php");
@ -68,10 +68,6 @@ if ($user->getAdmin()) {
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct_all.php");
break;
case "check":
include("./magic/check.php");
break;
case "attack":
include("./magic/eattack.php");
break;
@ -138,239 +134,9 @@ if ($user->getAdmin()) {
case "bexit":
include("./magic/bexit.php");
break;
case "vip":
include("./magic/vips.php");
break;
}
}
#RELIKT PHP
function klan_relicts()
{
global $user;
$r = '';
if ($user->getClan() > 0) {
$abils = db::c()->query('SELECT `id`, `klan`, `sleep15`, `sleep30`, `closebattle`, `heal20`, `heal35`, `heal50`, `travmoff`, `attack`, `bloodattack`, `death`, `comment`, `openbattle`, `reamdeath`, `clone`, `unclone` FROM `abils_klan` WHERE `klan` = ?i', $user->getClan())->fetch_assoc();
if ($abils['sleep15'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?useds=1", "target")\'><img src=\'i/sh/silence15.gif\' title=\'Заклятие молчания 15 минут\' /></a><div class="amount">' . $abils['sleep15'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/silence15.gif\' style=\'opacity: 0.3;\' title=\'Заклятие молчания 15 минут\' /></a><div class="amount">0</div></div>';
}
if ($abils['sleep30'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?useds=2", "target")\'><img src=\'i/sh/silence30.gif\' title=\'Заклятие молчания 30 минут\' /></a><div class="amount">' . $abils['sleep30'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/silence30.gif\' style=\'opacity: 0.3;\' title=\'Заклятие молчания 30 минут\' /></a><div class="amount">0</div></div>';
}
if ($abils['closebattle'] > 0) {
$r .= '<div class="item"><a href=\'?useds=3\'><img src=\'i/sh/closebattle.gif\' title=\'Закрыть бой\' /></a><div class="amount">' . $abils['closebattle'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/closebattle.gif\' style=\'opacity: 0.3;\' title=\'Закрыть бой\' /></a><div class="amount">0</div></div>';
}
if ($abils['heal20'] > 0) {
$r .= '<div class="item"><a href=\'?useds=4\'><img src=\'i/sh/cureHP15.gif\' title=\'Исцеление +20%\' /></a><div class="amount">' . $abils['heal20'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/cureHP15.gif\' style=\'opacity: 0.3;\' title=\'Исцеление +20%\' /></a><div class="amount">0</div></div>';
}
if ($abils['heal35'] > 0) {
$r .= '<div class="item"><a href=\'?useds=5\'><img src=\'i/sh/cureHP45.gif\' title=\'Исцеление +35%\' /></a><div class="amount">' . $abils['heal35'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/cureHP45.gif\' style=\'opacity: 0.3;\' title=\'Исцеление +35%\' /></a><div class="amount">0</div></div>';
}
if ($abils['heal50'] > 0) {
$r .= '<div class="item"><a href=\'?useds=6\'><img src=\'i/sh/cureHP60.gif\' title=\'Исцеление +50%\' /></a><div class="amount">' . $abils['heal50'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/cureHP60.gif\' style=\'opacity: 0.3;\' title=\'Исцеление +50%\' /></a><div class="amount">0</div></div>';
}
if ($abils['travmoff'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?useds=7", "target")\'><img src=\'i/sh/cure3.gif\' title=\'Лечение тяжелой травмы\' /></a><div class="amount">' . $abils['travmoff'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/cure3.gif\' style=\'opacity: 0.3;\' title=\'Лечение тяжелой травмы\' /></a><div class="amount">0</div></div>';
}
if ($abils['attack'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?useds=8", "target")\'><img src=\'i/sh/attack.gif\' title=\'Нападение\' /></a><div class="amount">' . $abils['attack'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/attack.gif\' style=\'opacity: 0.3;\' title=\'Нападение\' /></a><div class="amount">0</div></div>';
}
if ($abils['bloodattack'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?useds=10", "target")\'><img src=\'i/sh/attackb.gif\' title=\'Кровавое нападение\' /></a><div class="amount">' . $abils['bloodattack'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/attackb.gif\' style=\'opacity: 0.3;\' title=\'Кровавое нападение\' /></a><div class="amount">0</div></div>';
}
if ($abils['death'] > 0) {
$r .= '<div class="item" style=\'display: none;\'><a href=\'javascript: void(0);\'><img src=\'i/sh/poison_e.gif\' title=\'Объятия смерти\' /></a><div class="amount">' . $abils['death'] . '</div></div>';
} else {
$r .= '<div class="item" style=\'display: none;\'><a href=\'javascript: void(0);\'><img src=\'i/sh/poison_e.gif\' style=\'opacity: 0.3;\' title=\'Объятия смерти\' /></a><div class="amount">0</div></div>';
}
if ($abils['comment'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'note("Запрос", "?useds=11", "target");\'><img src=\'i/sh/note.gif\' title=\'Записки Комментатора\' /></a><div class="amount">' . $abils['comment'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/note.gif\' style=\'opacity: 0.3;\' title=\'Записки Комментатора\' /></a><div class="amount">0</div></div>';
}
if ($abils['openbattle'] > 0) {
$r .= '<div class="item"><a href=\'?useds=12\'><img src=\'i/sh/unlockbattle.gif\' title=\'Открыть бой\' /></a><div class="amount">' . $abils['openbattle'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/unlockbattle.gif\' style=\'opacity: 0.3;\' title=\'Открыть бой\' /></a><div class="amount">0</div></div>';
}
if ($abils['reamdeath'] > 0) {
$r .= '<div class="item" style=\'display: none;\'><a href=\'javascript: void(0);\'><img src=\'i/sh/reanimationD.gif\' title=\'Поднять мертвого\' /></a><div class="amount">' . $abils['reamdeath'] . '</div></div>';
} else {
$r .= '<div class="item" style=\'display: none;\'><a href=\'javascript: void(0);\'><img src=\'i/sh/reanimationD.gif\' style=\'opacity: 0.3;\' title=\'Поднять мертвого\' /></a><div class="amount">0</div></div>';
}
if ($abils['clone'] > 0) {
$r .= '<div class="item"><a href=\'?useds=14\'><img src=\'i/sh/mirror.gif\' title=\'Клонирование\' /></a><div class="amount">' . $abils['clone'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/mirror.gif\' style=\'opacity: 0.3;\' title=\'Клонирование\' /></a><div class="amount">0</div></div>';
}
if ($abils['unclone'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?useds=15", "target")\'><img src=\'i/sh/antimirror.gif\' title=\'Эфирное воздействие\' /></a><div class="amount">' . $abils['unclone'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/antimirror.gif\' style=\'opacity: 0.3;\' title=\'Эфирное воздействие\' /></a><div class="amount">0</div></div>';
}
} else {
$r = 'Вы не состоите в клане ...';
}
return $r;
}
function user_relicts()
{
global $user;
$r = '';
$abils = db::c()->query('SELECT `id`, `uid`, `sleep15`, `sleep30`, `closebattle`, `heal20`, `heal35`, `heal50`, `travmoff`, `attack`, `bloodattack`, `death`, `comment`, `openbattle`, `reamdeath`, `clone`, `unclone` FROM `abils_user` WHERE `uid` = ?i', $user->getId())->fetch_assoc();
if ($abils['sleep15'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?used=1", "target")\'><img src=\'i/sh/silence15.gif\' title=\'Заклятие молчания 15 минут\' /></a><div class="amount">' . $abils['sleep15'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/silence15.gif\' style=\'opacity: 0.3;\' title=\'Заклятие молчания 15 минут\' /></a><div class="amount">0</div></div>';
}
if ($abils['sleep30'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?used=2", "target")\'><img src=\'i/sh/silence30.gif\' title=\'Заклятие молчания 30 минут\' /></a><div class="amount">' . $abils['sleep30'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/silence30.gif\' style=\'opacity: 0.3;\' title=\'Заклятие молчания 30 минут\' /></a><div class="amount">0</div></div>';
}
if ($abils['closebattle'] > 0) {
$r .= '<div class="item"><a href=\'?used=3\'><img src=\'i/sh/closebattle.gif\' title=\'Закрыть бой\' /></a><div class="amount">' . $abils['closebattle'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/closebattle.gif\' style=\'opacity: 0.3;\' title=\'Закрыть бой\' /></a><div class="amount">0</div></div>';
}
if ($abils['heal20'] > 0) {
$r .= '<div class="item"><a href=\'?used=4\'><img src=\'i/sh/cureHP15.gif\' title=\'Исцеление +20%\' /></a><div class="amount">' . $abils['heal20'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/cureHP15.gif\' style=\'opacity: 0.3;\' title=\'Исцеление +20%\' /></a><div class="amount">0</div></div>';
}
if ($abils['heal35'] > 0) {
$r .= '<div class="item"><a href=\'?used=5\'><img src=\'i/sh/cureHP45.gif\' title=\'Исцеление +35%\' /></a><div class="amount">' . $abils['heal35'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/cureHP45.gif\' style=\'opacity: 0.3;\' title=\'Исцеление +35%\' /></a><div class="amount">0</div></div>';
}
if ($abils['heal50'] > 0) {
$r .= '<div class="item"><a href=\'?used=6\'><img src=\'i/sh/cureHP60.gif\' title=\'Исцеление +50%\' /></a><div class="amount">' . $abils['heal50'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/cureHP60.gif\' style=\'opacity: 0.3;\' title=\'Исцеление +50%\' /></a><div class="amount">0</div></div>';
}
if ($abils['travmoff'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?used=7", "target")\'><img src=\'i/sh/cure3.gif\' title=\'Лечение тяжелой травмы\' /></a><div class="amount">' . $abils['travmoff'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/cure3.gif\' style=\'opacity: 0.3;\' title=\'Лечение тяжелой травмы\' /></a><div class="amount">0</div></div>';
}
if ($abils['attack'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?used=8", "target")\'><img src=\'i/sh/attack.gif\' title=\'Нападение\' /></a><div class="amount">' . $abils['attack'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/attack.gif\' style=\'opacity: 0.3;\' title=\'Нападение\' /></a><div class="amount">0</div></div>';
}
if ($abils['bloodattack'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?used=9", "target")\'><img src=\'i/sh/attackb.gif\' title=\'Кровавое нападение\' /></a><div class="amount">' . $abils['bloodattack'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/attackb.gif\' style=\'opacity: 0.3;\' title=\'Кровавое нападение\' /></a><div class="amount">0</div></div>';
}
if ($abils['death'] > 0) {
$r .= '<div class="item" style=\'display: none;\'><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?used=10", "target")\'><img src=\'i/sh/poison_e.gif\' title=\'Объятия смерти\' /></a><div class="amount">' . $abils['death'] . '</div></div>';
} else {
$r .= '<div class="item" style=\'display: none;\'><a href=\'javascript: void(0);\'><img src=\'i/sh/poison_e.gif\' style=\'opacity: 0.3;\' title=\'Объятия смерти\' /></a><div class="amount">0</div></div>';
}
if ($abils['comment'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'note("Запрос", "?used=11", "target");\'><img src=\'i/sh/note.gif\' title=\'Записки Комментатора\' /></a><div class="amount">' . $abils['comment'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/note.gif\' style=\'opacity: 0.3;\' title=\'Записки Комментатора\' /></a><div class="amount">0</div></div>';
}
if ($abils['openbattle'] > 0) {
$r .= '<div class="item"><a href=\'?used=12\'><img src=\'i/sh/unlockbattle.gif\' title=\'Открыть бой\' /></a><div class="amount">' . $abils['openbattle'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/unlockbattle.gif\' style=\'opacity: 0.3;\' title=\'Открыть бой\' /></a><div class="amount">0</div></div>';
}
if ($abils['reamdeath'] > 0) {
$r .= '<div class="item" style=\'display: none;\'><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?used=13", "target")\'><img src=\'i/sh/reanimationD.gif\' title=\'Поднять мертвого\' /></a><div class="amount">' . $abils['reamdeath'] . '</div></div>';
} else {
$r .= '<div class="item" style=\'display: none;\'><a href=\'javascript: void(0);\'><img src=\'i/sh/reanimationD.gif\' style=\'opacity: 0.3;\' title=\'Поднять мертвого\' /></a><div class="amount">0</div></div>';
}
if ($abils['clone'] > 0) {
$r .= '<div class="item"><a href=\'?used=14\'><img src=\'i/sh/mirror.gif\' title=\'Клонирование\' /></a><div class="amount">' . $abils['clone'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/mirror.gif\' style=\'opacity: 0.3;\' title=\'Клонирование\' /></a><div class="amount">0</div></div>';
}
if ($abils['unclone'] > 0) {
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?used=15", "target")\'><img src=\'i/sh/antimirror.gif\' title=\'Эфирное воздействие\' /></a><div class="amount">' . $abils['unclone'] . '</div></div>';
} else {
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/antimirror.gif\' style=\'opacity: 0.3;\' title=\'Эфирное воздействие\' /></a><div class="amount">0</div></div>';
}
return $r;
}
if (isset($_GET['used'])) {
if ($_GET['used'] == 3) {
include('magic/usability_user/close_battle.php');
} elseif ($_GET['used'] == 4) {
//include('magic/usability_user/heal20.php');
} elseif ($_GET['used'] == 5) {
//include('magic/usability_user/heal35.php');
} elseif ($_GET['used'] == 6) {
//include('magic/usability_user/heal50.php');
} elseif ($_GET['used'] == 7) {
//Заменён на CureInjury.php class. Придумать вызов.
//include('magic/usability_user/travmoff.php');
} elseif ($_GET['used'] == 8) {
include('magic/usability_user/attack.php');
} elseif ($_GET['used'] == 9) {
include('magic/usability_user/attack_blood.php');
} elseif ($_GET['used'] == 11) {
include('magic/usability_user/note.php');
} elseif ($_GET['used'] == 12) {
include('magic/usability_user/open_battle.php');
} elseif ($_GET['used'] == 13) {
include('magic/usability_user/reamdeath.php');
} elseif ($_GET['used'] == 14) {
include('magic/usability_user/clone.php');
} elseif ($_GET['used'] == 15) {
include('magic/usability_user/unclone.php');
}
}
if (isset($_GET['useds'])) {
if ($_GET['useds'] == 3) {
include('magic/usability_klan/close_battle.php');
} elseif ($_GET['useds'] == 4) {
//include('magic/usability_klan/heal20.php');
} elseif ($_GET['useds'] == 5) {
//include('magic/usability_klan/heal35.php');
} elseif ($_GET['useds'] == 6) {
//include('magic/usability_klan/heal50.php');
} elseif ($_GET['useds'] == 7) {
//Заменён на CureInjury.php class. Придумать вызов.
//include('magic/usability_klan/travmoff.php');
} elseif ($_GET['useds'] == 8) {
include('magic/usability_klan/attack.php');
} elseif ($_GET['useds'] == 9) {
include('magic/usability_klan/attack_blood.php');
} elseif ($_GET['useds'] == 11) {
include('magic/usability_klan/note.php');
} elseif ($_GET['useds'] == 12) {
include('magic/usability_klan/open_battle.php');
} elseif ($_GET['useds'] == 13) {
include('magic/usability_klan/reamdeath.php');
} elseif ($_GET['useds'] == 14) {
include('magic/usability_klan/clone.php');
} elseif ($_GET['useds'] == 15) {
include('magic/usability_klan/unclone.php');
}
}
function show_byu($type)
{
@ -411,8 +177,8 @@ function show_byu($type)
35 => 'antimirror',
];
if ($user->getClan()) {
$clan = db::c()->query('SELECT `id`, `glava` FROM `clans` WHERE `id` = ?i', $user->getClan())->fetch_assoc();
if ($clan['glava'] == $user->getId()) {
$clan = db::c()->query('SELECT owner_id FROM clans WHERE short_name = "?s"', $user->getClan())->fetch_assoc();
if ($clan['owner_id'] == $user->getId()) {
$r = '<div style="text-align: center;"><a href="javascript:void(0);" class="byu_klan" id="' . $type . '">купить 1 шт.</a></div>';
} else {
$r = '<div style="text-align: center;"><a href="javascript:void(0);">Вы не глава</a></div>';
@ -431,250 +197,44 @@ function show_byu($type)
FFFF;
}
$is_ = db::c()->query('SELECT `id` FROM `abils_user` WHERE `uid` = ?i', $user->getId())->fetch_assoc();
if (empty($is_['id'])) {
db::c()->query('INSERT INTO `abils_user` (`uid`) VALUES (?i)', $user->getId());
}
if (empty($user->getClan())) {
$is_ = db::c()->query('SELECT `id` FROM `abils_klan` WHERE `klan` = ?i', $user->getClan())->fetch_assoc();
if (empty($is_['id'])) {
db::c()->query('INSERT INTO `abils_klan` (`klan`) VALUES (?i)', $user->getClan());
}
}
$bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['uid'])->fetch_assoc();
Template::header('user_abilities');
echo <<<RELICTS
<span class='legend'>Клановые и личные реликты</span><br>
<button disabled>sleep15</button>
<button disabled>sleep30</button>
<button disabled>closebattle</button>
<button disabled>heal20</button>
<button disabled>heal35</button>
<button disabled>heal50</button>
<button disabled>travmoff</button>
<button disabled>attack</button>
<button disabled>bloodattack</button>
<button disabled>death</button>
<button disabled>comment</button>
<button disabled>openbattle</button>
<button disabled>reamdeath</button>
<button disabled>clone</button>
<button disabled>unclone</button>
RELICTS;
if ($user->getAdmin()) {
echo <<<A
<button onclick="location.href='?teleport=1'">Телепорт на ЦП</button>
A;
}
?>
<div style="float: right;">
<?php if ($user->getAdmin() == 1): ?>
<button onclick="location.href='?teleport=1'">Телепорт на ЦП</button>
<?php endif; ?>
<input type="button" onClick="location.href='main.php';" value="Вернуться">
</div>
<h2>Особые умения</h2>
<div style="text-align: center;" id=hint3></div>
<div>
<?php
foreach ($moj as $k => $v) {
switch ($k) {
case "sleep":
$script_name = "runmagic0";
$magic_name = "Наложить заклятие молчания";
break;
case "sleepf":
$script_name = "runmagicf";
$magic_name = "Наложить заклятие форумного молчания";
break;
case "healing":
$script_name = "runmagic1";
$magic_name = "Лечение";
break;
case "al_neut_power":
$script_name = "RunmagicSelf";
$magic_name = "Сила нейтралитета";
break;
case "ct1":
$script_name = "runmagic1";
$magic_name = "Исцелить легкую травму";
break;
case "ct2":
$script_name = "runmagic1";
$magic_name = "Исцелить среднюю травму";
break;
case "ct3":
$script_name = "runmagic1";
$magic_name = "Исцелить тяжелую травму";
break;
case "sleep_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие молчания";
break;
case "sleepf_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие форумного молчания";
break;
case "haos":
$script_name = "runmagic2";
$magic_name = "Наложить заклятие хаоса";
break;
case "haos_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие хаоса";
break;
case "death":
$script_name = "runmagic1";
$magic_name = "Наложить заклятие смерти";
break;
case "death_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие смерти";
break;
case "obezl":
$script_name = "runmagic2";
$magic_name = "Наложить заклятие обезличивания";
break;
case "obezl_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие обезличивания";
break;
case "pal_off":
$script_name = "runmagic1";
$magic_name = "Лишить звания Паладин";
break;
case "attack":
$script_name = "runmagic1";
$magic_name = "Нападение";
break;
case "attack_t":
$script_name = "runmagic1";
$magic_name = "Нападение на Темного";
break;
case "battack":
$script_name = "runmagic1";
$magic_name = "Кровавое нападение";
break;
case "attackk_close":
$script_name = "runmagic1";
$magic_name = "Кулачное закрытое кровавое нападение";
break;
case "attackk_open":
$script_name = "runmagic1";
$magic_name = "Кулачное закрытое нападение";
break;
case "marry":
$script_name = "runmagic4";
$magic_name = "Зарегистрировать брак";
break;
case "unmarry":
$script_name = "runmagic4";
$magic_name = "Расторгнуть брак";
break;
case "hidden":
$script_name = "runmagic1";
$magic_name = "Заклятие невидимости";
break;
case "teleport":
$script_name = "runmagic";
$magic_name = "Телепортация";
break;
case "check":
$script_name = "runmagic1";
$magic_name = "Поставить проверку";
break;
case "ct_all":
$script_name = "runmagic1";
$magic_name = "Вылечить от травм";
break;
case "pal_buttons":
$script_name = "runmagic1";
$magic_name = "Отметить о прохождении проверки";
break;
case "vampir":
$script_name = "runmagic1";
$magic_name = "Вампиризм (выпить энергию другого игрока)";
break;
case "brat":
$script_name = "runmagic1";
$magic_name = "Помочь темному собрату (вмешаться в поединок)";
break;
case "dneit":
$script_name = "runmagic1";
$magic_name = "Присвоить склонность (Нейтральное Братство)";
break;
case "dpal":
$script_name = "runmagic";
$magic_name = "Присвоить склонность (Паладин)";
break;
case "ddark":
$script_name = "runmagic1";
$magic_name = "Присвоить склонность (Темное Братство)";
break;
case "dlight":
$script_name = "runmagic1";
$magic_name = "Присвоить склонность (Светлое Братство)";
break;
case "un_align":
$script_name = "runmagic1";
$magic_name = "Лишить склонности";
break;
case "note":
$script_name = "runmagic";
$magic_name = "Редактировать личное дело";
break;
case "sys":
$script_name = "runmagic";
$magic_name = "Отправить в чат системное сообщение";
break;
case "scanner":
$script_name = "runmagic";
$magic_name = "Показать лог действий модератора";
break;
case "rep":
$script_name = "runmagic";
$magic_name = "Отчет о переводах";
break;
case "rost":
$script_name = "runmagic";
$magic_name = "Присвоить статус";
break;
case "ldadd":
$script_name = "";
$magic_name = "Записать причину отправки в Хаос";
break;
case "crush":
$script_name = "runmagic1";
$magic_name = "Сокрушение";
break;
case "def":
$script_name = "runmagic1";
$magic_name = "Защита от оружия";
break;
case "bexit":
$script_name = "runmagic1";
$magic_name = "Выйти из боя";
break;
}
if ($script_name) {
$action_ok = 1;
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
$abil = unserialize($abil['abil']);
if ($user->getAlign() == 2) {
if ($k == 'al_neut_power' && $abil[0] < 1) {
$action_ok = 0;
}
if ($k == 'attackk_close' && $abil[1] < 1) {
$action_ok = 0;
}
if ($k == 'attackk_open' && $abil[2] < 1) {
$action_ok = 0;
}
}
if ($user->getAlign() == 6) {
if ($k == 'ct1' && $abil[0] < 1) {
$action_ok = 0;
}
if ($k == 'ct2' && $abil[1] < 1) {
$action_ok = 0;
}
if ($k == 'ct3' && $abil[2] < 1) {
$action_ok = 0;
}
}
}
if ($action_ok > 0) {
print "<a onclick=\"javascript:$script_name('$magic_name','$k','target','target1') \" href='#'><img src='i/magic/" . $k . ".gif' title='" . $magic_name . "'></a>&nbsp;";
}
}
if ($user->getAlign() == 2) // Нейтралы
if ($user->getAlign() == 2 || $user->getAdmin()) // Нейтралы
{
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
$abil = unserialize($abil['abil']);
$abil = db::c()->query('SELECT 1 FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
//$abil = unserialize($abil['abil']);
for ($i = 0; $i < 3; $i++) {
if (!$abil[$i]) {
$abil[$i] = 0;
@ -686,11 +246,11 @@ Template::header('user_abilities');
echo("<img src='i/magic/attackk_open.gif' title='Кулачное закрытое нападение'> Кулачное закрытое нападение - " . $abil[2] . "<br />");
}
if ($user->getAlign() == 6) // Свет
if ($user->getAlign() == 6 || $user->getAdmin()) // Свет
{
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
$abil = unserialize($abil['abil']);
$abil = db::c()->query('SELECT 1 FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
//$abil = unserialize($abil['abil']);
for ($i = 0; $i < 3; $i++) {
if (!$abil[$i]) {
$abil[$i] = 0;
@ -710,7 +270,7 @@ Template::header('user_abilities');
<legend id="personal" class="box_user" href="#inlin" style="cursor: pointer;"
title="Магазин персональных реликтов">Персональные :
</legend>
<?= user_relicts(); ?>
[список в шапке]
</fieldset>
</div>
<div style="padding-top: 15px;">
@ -718,7 +278,7 @@ Template::header('user_abilities');
<legend id="klans" class="box_klan" href="#inlines" style="cursor: pointer;"
title="Магазин клановых реликтов">Клановые :
</legend>
<?= klan_relicts(); ?>
[список в шапке]
</fieldset>
</div>
<div style="padding-top: 13px; padding-bottom: 13px;">

View File

@ -1,5 +1,6 @@
<?php
use Battles\Nick;
use Battles\Template;
use Battles\User;
@ -655,19 +656,19 @@ Template::header('zayavka');
}
if (!empty($_POST['back'])) {
unlink("/tmp/zayavka/" . $user->getId() . ".txt");
echo $zay->delzayavka($user->getId(), $user->zayavka, 2, 0);
echo $zay->delzayavka($user->getId(), $user->getZayavka(), 2, 0);
}
if (!empty($_POST['back2'])) {
$z = $zay->getlist(2, null, $user->zayavka);
$z = $zay->getlist(2, null, $user->getZayavka());
AddChatSystem('Внимание!' . Nick::id($user->getId())->short() . ' отозвал заявку.');
echo $zay->delteam($user->getId(), $user->zayavka, 2);
echo $zay->delteam($user->getId(), $user->getZayavka(), 2);
}
if (!empty($_POST['cansel'])) {
$z = $zay->getlist(2, null, $user->zayavka);
echo $zay->delteam($z[$user->zayavka]['team2'][0], $user->zayavka, 2);
$z = $zay->getlist(2, null, $user->getZayavka());
echo $zay->delteam($z[$user->getZayavka()]['team2'][0], $user->getZayavka(), 2);
AddChatSystem('Внимание!' . Nick::id($user->getId())->short() . ' отказался от поединка.');
}
if (!empty($_POST['confirm2']) && empty($user->zayavka)) {
if (!empty($_POST['confirm2']) && empty($user->getZayavka())) {
$z = $zay->getlist(2, null, $_REQUEST['gocombat']);
$toper = db::c()->query('SELECT `klan` FROM `users` WHERE `id` = ?i', $z[$_REQUEST['gocombat']]['team1'][0])->fetch_assoc();
if ($user->getClan() != $toper['klan'] || !$user->getClan()) {
@ -677,7 +678,7 @@ Template::header('zayavka');
echo "</b></font><BR>Ожидаем подтверждения боя. <input type=submit name=back2 value='Отозвать заявку'>";
}
if (!empty($_POST['gofi'])) {
$zay->battlestart($user->getId(), $user->zayavka, 2);
$zay->battlestart($user->getId(), $user->getZayavka(), 2);
}
echo "</b>";
echo '<table cellspacing=0 cellpadding=0><tr><td>';
@ -700,12 +701,12 @@ Template::header('zayavka');
<INPUT TYPE=submit name=open value="Подать заявку">
</FIELDSET>
<?php }
$z = $zay->getlist(2, null, $user->zayavka);
$z = $zay->getlist(2, null, $user->getZayavka());
if ($zay->user_status($user->getId()) == 1) {
if (count($z[$user->zayavka]['team2']) > 0) {
echo "<B><font color=red>Внимание! " . Nick::id($z[$user->zayavka]['team2'][0])->full(1) . " принял заявку на бой, нужно отказать или принять вызов.</font></b> <input type=submit value='Битва!' name=gofi> <input type=submit value='Отказать' name=cansel>";
if (count($z[$user->getZayavka()]['team2']) > 0) {
echo "<B><font color=red>Внимание! " . Nick::id($z[$user->getZayavka()]['team2'][0])->full(1) . " принял заявку на бой, нужно отказать или принять вызов.</font></b> <input type=submit value='Битва!' name=gofi> <input type=submit value='Отказать' name=cansel>";
} else {
if ($z[$user->zayavka]['level'] == 2) {
if ($z[$user->getZayavka()]['level'] == 2) {
echo "Заявка на бой подана, ожидаем противника. <input type=submit name=back value='Отозвать заявку'>";
$Path = "/tmp/zayavka/" . $user->getId() . ".txt";
$f = fopen($Path, "r");
@ -714,7 +715,7 @@ Template::header('zayavka');
if ($timeFigth < time() && ($user->getLevel() <= 14)) {
if ($get == 'trainstart' && $user->getHealth() > $user->getMaxHealth() * 0.33 && ($user->getLevel() <= 7 || $user->getAdmin() == 1)) {
unlink("/tmp/zayavka/" . $user->id . ".txt");
$zay->delzayavka($user->id, $user->zayavka, 2, 0);
$zay->delzayavka($user->id, $user->getZayavka(), 2, 0);
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('" . $user->getLogin() . " (Клон 1)','" . $user->getId() . "','','" . $user->getMaxHealth() . "');");
$bot = mysql_insert_id();
@ -750,7 +751,7 @@ Template::header('zayavka');
}
}
}
if ($zay->user_status($user->id) == 2 && $z[$user->zayavka]['level'] == 2) {
if ($zay->user_status($user->id) == 2 && $z[$user->getZayavka()]['level'] == 2) {
echo "Ожидаем подтверждения боя. <input type=submit name=back2 value='Отозвать заявку'>";
}
echo '</td></tr></table></TD><TD align=right valign=top rowspan=2><INPUT TYPE=submit name=tmp value="Обновить"><BR><FIELDSET style="width:150px;"><LEGEND>Показывать заявки</LEGEND><table cellspacing=0 cellpadding=0 ><tr><td width=1%><input type=radio name=view value="' . $user->getLevel() . '" ' . (($_SESSION['view'] != null) ? "checked" : "") . '></td><td>моего уровня</td></tr><tr><td><input type=radio name=view value="" ' . (($_SESSION['view'] == null) ? "checked" : "") . '></td><td>все</td></tr></table></FIELDSET>';
@ -766,9 +767,9 @@ Template::header('zayavka');
if ($get == 'group') {
if ($zay->user_status($user->id) != 0) {
$z = $zay->getlist(4, null, $user->zayavka);
if ($z[$user->zayavka]['level'] == 4) {
$battleStartTime = round(($z[$user->zayavka]['start'] - time()) / 60, 1);
$z = $zay->getlist(4, null, $user->getZayavka());
if ($z[$user->getZayavka()]['level'] == 4) {
$battleStartTime = round(($z[$user->getZayavka()]['start'] - time()) / 60, 1);
echo "<div><b>Ожидаем начала группового боя...</b><br>Бой начнется через: $battleStartTime мин.</div>";
}
} else { ?>
@ -840,7 +841,7 @@ Template::header('zayavka');
<?php }
if (!empty($_POST['goconfirm']) && empty($user->zayavka)) {
if (!empty($_POST['goconfirm']) && empty($user->getZayavka())) {
echo '<TABLE width=100%><TR><TD>';
$z = $zay->getlist(4, null, $_POST['gocombat']);
echo "<B>Ожидаем начала группового боя...</B><BR>Бой начнется через: " . round(($z[$_POST['gocombat']]['start'] - time()) / 60, 1) . " мин.";
@ -880,14 +881,14 @@ if (!empty($_POST['goconfirm']) && empty($user->zayavka)) {
echo "<b style='color: #f80000;'>";
if (!empty($_POST['confirm1']) && !empty($_POST['gocombat']) && empty($user->zayavka)) {
if (!empty($_POST['confirm1']) && !empty($_POST['gocombat']) && empty($user->getZayavka())) {
echo $zay->addteam(1, 4);
}
if (!empty($_POST['confirm2']) && $_POST['gocombat'] && empty($user->zayavka)) {
if (!empty($_POST['confirm2']) && $_POST['gocombat'] && empty($user->getZayavka())) {
echo $zay->addteam(2, 4);
}
if (!empty($_POST['open']) && empty($user->zayavka)) {
if (!empty($_POST['open']) && empty($user->getZayavka())) {
switch ($_POST['levellogin1']) {
default:
case 0 : //любой
@ -915,8 +916,8 @@ if (!empty($_POST['open']) && empty($user->zayavka)) {
$max1 = $user->getLevel();
break;
case 6 : //мой уровень +/- 1
$min1 = (int)$user->getLevel() - 1;
$max1 = (int)$user->getLevel() + 1;
$min1 = $user->getLevel() - 1;
$max1 = $user->getLevel() + 1;
break;
case 99 : // кланы
$min1 = 99;
@ -950,8 +951,8 @@ if (!empty($_POST['open']) && empty($user->zayavka)) {
$max1 = $user->getLevel();
break;
case 6 : //мой уровень +/- 1
$min1 = (int)$user->getLevel() - 1;
$max1 = (int)$user->getLevel() + 1;
$min1 = $user->getLevel() - 1;
$max1 = $user->getLevel() + 1;
break;
case 99 : // кланы
$min1 = 99;
@ -998,7 +999,7 @@ echo '<INPUT TYPE=submit value="Принять участие" NAME=goconfirm></
if ($get == 'haos') {
if (!empty($_POST['open']) && empty($user->zayavka)) {
if (!empty($_POST['open']) && empty($user->getZayavka())) {
switch ($_POST['levellogin1']) {
default:
case 0 :
@ -1030,9 +1031,9 @@ if ($get == 'haos') {
echo 'Хаотичный бой - разновидность группового, где группы формируются автоматически. Бой не начнется, если собралось меньше 4-х человек. <DIV id="dv2" style="display:"><A href="#" onclick="dv1.style.display=\'\'; dv2.style.display=\'none\'; return false">Подать заявку на хаотичный бой</A></DIV><DIV id="dv1" style="display: none"><FIELDSET><LEGEND><B>Подать заявку на хаотичный бой</B> </LEGEND>Начало боя через <SELECT NAME=startime2><option value=180>3 минуты</option><option value=300 selected>5 минут</option><option value=600>10 минут</option><option value=900>15 минут</option><option value=1800>30 минут</option><option value=2700>45 минут</option><option value=3600>1 час</option></SELECT>&nbsp;&nbsp;&nbsp;&nbsp;Таймаут <SELECT NAME=timeout><OPTION value=3 SELECTED>3 мин.<OPTION value=5>5 мин.<OPTION value=10>10 мин.</SELECT><BR>Уровни бойцов &nbsp;&nbsp;<SELECT NAME=levellogin1><option value=0>любой<option value=3>только моего уровня<option value=6 selected>мой уровень +/- 1</SELECT><BR><BR>Тип боя <SELECT NAME=k><OPTION value=3>с оружием<OPTION value=5>кулачный</SELECT><BR><INPUT TYPE=checkbox NAME=travma> Бой без правил (<font class=dsc>проигравшая сторона получает инвалидность</font>)<BR><INPUT TYPE=submit name=open value="Подать заявку">&nbsp;<BR>Комментарий к бою <INPUT TYPE=text NAME=cmt maxlength=40 size=40></FIELDSET><BR></DIV>';
}
if ($zay->user_status($user->id)) {
$z = $zay->getlist(5, null, $user->zayavka);
if ($z[$user->zayavka]['level'] == 5) {
echo "<B>Ожидаем начала группового боя...</B><BR>Бой начнется через: " . round(($z[$user->zayavka]['start'] - time()) / 60, 1) . " мин.";
$z = $zay->getlist(5, null, $user->getZayavka());
if ($z[$user->getZayavka()]['level'] == 5) {
echo "<B>Ожидаем начала группового боя...</B><BR>Бой начнется через: " . round(($z[$user->getZayavka()]['start'] - time()) / 60, 1) . " мин.";
}
}
echo '</td></tr></table></TD><TD align=right valign=top rowspan=2><INPUT TYPE=submit name=tmp value="Обновить"><BR><FIELDSET style="width:150px;"><LEGEND>Показывать заявки</LEGEND><table cellspacing=0 cellpadding=0 ><tr><td width=1%><input type=radio name=view value="' . $user->getLevel() . '" ' . (($_SESSION['view'] != null) ? "checked" : "") . '></td><td>моего уровня</td></tr><tr><td><input type=radio name=view value="" ' . (($_SESSION['view'] == null) ? "checked" : "") . '></td><td>все</td></tr></table></FIELDSET>';