* Project name: Battles-Game * One file to rule 'em all! */ session_start(); require_once 'functions.php'; $user = $user ?? new \Battles\User($_SESSION['uid']); 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']); } # ORDEN PHP if ($user->admin) { $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 "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 "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; } } #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 .= '
'; } else { $r .= ''; } if ($abils['sleep30'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['closebattle'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['heal20'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['heal35'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['heal50'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['travmoff'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['attack'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['bloodattack'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['death'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['comment'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['openbattle'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['reamdeath'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['clone'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['unclone'] > 0) { $r .= ''; } else { $r .= ''; } } 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 .= ''; } else { $r .= ''; } if ($abils['sleep30'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['closebattle'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['heal20'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['heal35'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['heal50'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['travmoff'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['attack'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['bloodattack'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['death'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['comment'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['openbattle'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['reamdeath'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['clone'] > 0) { $r .= ''; } else { $r .= ''; } if ($abils['unclone'] > 0) { $r .= ''; } else { $r .= ''; } 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) { 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 <<