* Project name: Battles-Game * One file to rule 'em all! */ use Battles\Template; require_once 'functions.php'; if (!empty($_GET['teleport']) && $user->getAdmin() == 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 $_POST['use'] = $_POST['use'] ?? null; if ($user->getAdmin()) { $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"); break; case "ct1": if ($abil[0] > 0 && $user->getAlign() == 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->getId()); } } elseif ($user->getAlign() != 6) { //Заменён на CureInjury.php class. Придумать вызов. //include("./magic/ct1.php"); } break; case "ct2": if ($abil[1] > 0 && $user->getAlign() == 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->getId()); } } elseif ($user->getAlign() != 6) { //Заменён на CureInjury.php class. Придумать вызов. //include("./magic/ct2.php"); } break; case "ct3": if ($abil[2] > 0 && $user->getAlign() == 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->getId()); } } elseif ($user->getAlign() != 6) { //Заменён на CureInjury.php class. Придумать вызов. //include("./magic/ct3.php"); } break; case "ct_all": //Заменён на CureInjury.php class. Придумать вызов. //include("./magic/ct_all.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->getAlign() == 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->getId()); 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->getAlign() == 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->getId()); 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; } } 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->getClan()) { $clan = db::c()->query('SELECT owner_id FROM clans WHERE short_name = "?s"', $user->getClan())->fetch_assoc(); if ($clan['owner_id'] == $user->getId()) { $r = '
'; } else { $r = ''; } } else { $r = ''; } return <<