* Project name: Battles-Game
* One file to rule 'em all!
*/
session_start();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
require_once 'functions.php';
$user = $user ?? [];
if (!empty($_GET['teleport']) && $user->admin == 1) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']);
}
?>
admin == 1): ?>
Особые умения
query('SELECT `accses`,`name` FROM `aligns` WHERE `align` = ?i', $user->align)->fetch_assoc();
$moj = expa($al['accses']);
function imp($array)
{
$str = '';
foreach ($array as $k => $v) {
$str .= $k . ";" . $v . ";";
}
return $str;
}
function expa($str)
{
$rarray = '';
$array = explode(";", $str);
for ($i = 0; $i <= count($array) - 2; $i = $i + 2) {
$rarray[$array[$i]] = $array[$i + 1];
}
return $rarray;
}
if (in_array($_POST['use'], array_keys($moj))) {
$abil = db::c()->query('SELECT abil FROM users WHERE id = ?i', $user->id)->fetch_assoc();
$abil = unserialize($abil['abil']);
switch ($_POST['use']) {
case "healing":
include("./magic/Healing.php");
break;
case "al_neut_power":
if ($abil[0] > 0 && $user->align == 2) {
include("./magic/al_neut_power.php");
if ($outok == 1) {
$abil[0] -= 1;
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
}
} elseif ($user->align != 2) {
include("./magic/al_neut_power.php");
}
break;
case "ct1":
if ($abil[0] > 0 && $user->align == 6) {
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct1.php");
if ($outok == 1) {
$abil[0] -= 1;
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
}
} elseif ($user->align != 6) {
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct1.php");
}
break;
case "ct2":
if ($abil[1] > 0 && $user->align == 6) {
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct2.php");
if ($outok == 1) {
$abil[1] -= 1;
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
}
} elseif ($user->align != 6) {
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct2.php");
}
break;
case "ct3":
if ($abil[2] > 0 && $user->align == 6) {
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct3.php");
if ($outok == 1) {
$abil[2] -= 1;
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
}
} elseif ($user->align != 6) {
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct3.php");
}
break;
case "sleep":
include("./magic/sleep.php");
break;
case "sleepf":
include("./magic/sleepf.php");
break;
case "sleep_off":
include("./magic/sleep_off.php");
break;
case "sleepf_off":
include("./magic/sleepf_off.php");
break;
case "haos":
include("./magic/haos.php");
break;
case "haos_off":
include("./magic/haos_off.php");
break;
case "obezl":
include("./magic/obezl.php");
break;
case "obezl_off":
include("./magic/obezl_off.php");
break;
case "death":
include("./magic/death.php");
break;
case "death_off":
include("./magic/death_off.php");
break;
case "ldadd":
include("./magic/ldadd.php");
break;
case "pal_off":
include("./magic/pal_off.php");
break;
case "marry":
include("./magic/marry.php");
break;
case "unmarry":
include("./magic/unmarry.php");
break;
case "ct_all":
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct_all.php");
break;
case "check":
include("./magic/check.php");
break;
case "attack":
include("./magic/eattack.php");
break;
case "attack_t":
include("./magic/attack_t.php");
if ($skipper == 1) {
header("Location:fbattle.php");
exit();
}
break;
case "battack":
include("./magic/ebattack.php");
break;
case "attackk_close":
if ($abil[1] > 0 && $user->align == 2) {
include("./magic/attackk_close.php");
if ($outok == 1) {
$abil[1] -= 1;
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
header("Location:fbattle.php");
exit();
}
} else {
include("./magic/attackk_close.php");
header("Location:fbattle.php");
exit();
}
break;
case "attackk_open":
if ($abil[1] > 0 && $user->align == 2) {
include("./magic/attackk_open.php");
if ($outok == 1) {
$abil[2] -= 1;
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
header("Location:fbattle.php");
exit();
}
} else {
include("./magic/attackk_open.php");
header("Location:fbattle.php");
exit();
}
break;
case "brat":
include("./magic/brat.php");
if ($skipper == 1) {
header("Location:fbattle.php");
exit();
}
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;
case "dlight":
include("./magic/dlight.php");
break;
case "ddark":
include("./magic/ddark.php");
break;
case "dneit":
include("./magic/dneit.php");
break;
case "un_align":
include("./magic/un_align.php");
break;
}
}
echo "
";
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->align == 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->align == 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 " ";
}
}
if ($user->align == 2) // Нейтралы
{
$abil = db::c()->query('SELECT `abil` 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;
echo(" Осталось использований: ");
echo(" Сила нейтралитета - " . $abil[0] . " ");
echo(" Кулачное закрытое кровавое нападение - " . $abil[1] . " ");
echo(" Кулачное закрытое нападение - " . $abil[2] . " ");
}
if ($user->align == 6) // Свет
{
$abil = db::c()->query('SELECT `abil` 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;
echo(" Осталось использований: ");
echo(" Исцелить легкую травму - " . $abil[0] . " ");
echo(" Исцелить среднюю травму - " . $abil[1] . " ");
echo(" Исцелить тяжелую травму - " . $abil[2] . " ");
}
echo " |
";
#RELIKT PHP
function klan_relicts()
{
global $user;
$r = '';
if ($user->clan > 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->clan)->fetch_assoc();
if ($abils['sleep15'] > 0) {
$r .= '' . $abils['sleep15'] . '
';
} else {
$r .= '0
';
}
if ($abils['sleep30'] > 0) {
$r .= '' . $abils['sleep30'] . '
';
} else {
$r .= '0
';
}
if ($abils['closebattle'] > 0) {
$r .= '' . $abils['closebattle'] . '
';
} else {
$r .= '0
';
}
if ($abils['heal20'] > 0) {
$r .= '' . $abils['heal20'] . '
';
} else {
$r .= '0
';
}
if ($abils['heal35'] > 0) {
$r .= '' . $abils['heal35'] . '
';
} else {
$r .= '0
';
}
if ($abils['heal50'] > 0) {
$r .= '' . $abils['heal50'] . '
';
} else {
$r .= '0
';
}
if ($abils['travmoff'] > 0) {
$r .= '' . $abils['travmoff'] . '
';
} else {
$r .= '0
';
}
if ($abils['attack'] > 0) {
$r .= '' . $abils['attack'] . '
';
} else {
$r .= '0
';
}
if ($abils['bloodattack'] > 0) {
$r .= '' . $abils['bloodattack'] . '
';
} else {
$r .= '0
';
}
if ($abils['death'] > 0) {
$r .= '' . $abils['death'] . '
';
} else {
$r .= '0
';
}
if ($abils['comment'] > 0) {
$r .= '' . $abils['comment'] . '
';
} else {
$r .= '0
';
}
if ($abils['openbattle'] > 0) {
$r .= '' . $abils['openbattle'] . '
';
} else {
$r .= '0
';
}
if ($abils['reamdeath'] > 0) {
$r .= '' . $abils['reamdeath'] . '
';
} else {
$r .= '0
';
}
if ($abils['clone'] > 0) {
$r .= '' . $abils['clone'] . '
';
} else {
$r .= '0
';
}
if ($abils['unclone'] > 0) {
$r .= '' . $abils['unclone'] . '
';
} else {
$r .= '0
';
}
} 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->id)->fetch_assoc();
if ($abils['sleep15'] > 0) {
$r .= '' . $abils['sleep15'] . '
';
} else {
$r .= '0
';
}
if ($abils['sleep30'] > 0) {
$r .= '' . $abils['sleep30'] . '
';
} else {
$r .= '0
';
}
if ($abils['closebattle'] > 0) {
$r .= '' . $abils['closebattle'] . '
';
} else {
$r .= '0
';
}
if ($abils['heal20'] > 0) {
$r .= '' . $abils['heal20'] . '
';
} else {
$r .= '0
';
}
if ($abils['heal35'] > 0) {
$r .= '' . $abils['heal35'] . '
';
} else {
$r .= '0
';
}
if ($abils['heal50'] > 0) {
$r .= '' . $abils['heal50'] . '
';
} else {
$r .= '0
';
}
if ($abils['travmoff'] > 0) {
$r .= '' . $abils['travmoff'] . '
';
} else {
$r .= '0
';
}
if ($abils['attack'] > 0) {
$r .= '' . $abils['attack'] . '
';
} else {
$r .= '0
';
}
if ($abils['bloodattack'] > 0) {
$r .= '' . $abils['bloodattack'] . '
';
} else {
$r .= '0
';
}
if ($abils['death'] > 0) {
$r .= '' . $abils['death'] . '
';
} else {
$r .= '0
';
}
if ($abils['comment'] > 0) {
$r .= '' . $abils['comment'] . '
';
} else {
$r .= '0
';
}
if ($abils['openbattle'] > 0) {
$r .= '' . $abils['openbattle'] . '
';
} else {
$r .= '0
';
}
if ($abils['reamdeath'] > 0) {
$r .= '' . $abils['reamdeath'] . '
';
} else {
$r .= '0
';
}
if ($abils['clone'] > 0) {
$r .= '' . $abils['clone'] . '
';
} else {
$r .= '0
';
}
if ($abils['unclone'] > 0) {
$r .= '' . $abils['unclone'] . '
';
} else {
$r .= '0
';
}
return $r;
}
if (isset($_GET['used'])) {
if ($_GET['used'] == 1) {
include('magic/usability_user/sleep15.php');
} elseif ($_GET['used'] == 2) {
include('magic/usability_user/sleep30.php');
} elseif ($_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'] == 1) {
include('magic/usability_klan/sleep15.php');
} elseif ($_GET['useds'] == 2) {
include('magic/usability_klan/sleep30.php');
} elseif ($_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)
{
global $user;
$type = $type + 20;
$typeName = [
21 => '15 минут тишины',
22 => '30 минут тишины',
23 => 'изоляция поединка',
24 => 'исцеление 20%',
25 => 'исцеление 35%',
26 => 'исцеление 50%',
27 => 'лечение тяжёлой травмы',
28 => 'нападение',
29 => 'кровавое нападение',
30 => 'объятия смерти',
31 => 'оставить запись в лог боя',
32 => 'снятие изоляции поединка',
33 => 'воскрешение',
34 => 'порождение клона',
35 => 'эфирное воздействие',
];
$typeImage = [
21 => 'silence15',
22 => 'silence30',
23 => 'closebattle',
24 => 'cureHP15',
25 => 'cureHP45',
26 => 'cureHP60',
27 => 'cure3',
28 => 'attack',
29 => 'attackb',
30 => 'poison_e',
31 => 'note',
32 => 'unlockbattle',
33 => 'reanimationD',
34 => 'mirror',
35 => 'antimirror',
];
if ($user->clan) {
$clan = db::c()->query('SELECT `id`, `glava` FROM `clans` WHERE `id` = ?i', $user->clan)->fetch_assoc();
if ($clan['glava'] == $user->id) {
$r = '';
} else {
$r = '';
}
} else {
$r = '';
}
return <<
$typeName[$type]
$r
FFFF;
}
$is_ = db::c()->query('SELECT `id` FROM `abils_user` WHERE `uid` = ?i', $user->id)->fetch_assoc();
if (empty($is_['id'])) {
db::c()->query('INSERT INTO `abils_user` (`uid`) VALUES (?i)', $user->id);
}
if (empty($user->clan)) {
$is_ = db::c()->query('SELECT `id` FROM `abils_klan` WHERE `klan` = ?i', $user->clan)->fetch_assoc();
if (empty($is_['id'])) {
db::c()->query('INSERT INTO `abils_klan` (`klan`) VALUES (?i)', $user->clan);
}
}
$bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['uid'])->fetch_assoc();
?>
Реликты
Оставить запись в логе боя
= show_byu(1); ?>
= show_byu(2); ?>
= show_byu(3); ?>
= show_byu(4); ?>
= show_byu(5); ?>
= show_byu(6); ?>
= show_byu(7); ?>
= show_byu(8); ?>
= show_byu(9); ?>
= show_byu(10); ?>
= show_byu(11); ?>
= show_byu(12); ?>
= show_byu(13); ?>
= show_byu(14); ?>
= show_byu(15); ?>