battles/magic/hiden.php
2019-01-16 19:45:30 +02:00

23 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if($user['battle']) {
echo "<font color=red><b>Не в бою<b></font>";
} elseif(!$user['in_tower']) {
if($_SESSION['uid'] == null) { header("Location: ../index.php"); }
$magictime = time()+(60*60*2);
$eff = mysql_fetch_row(mysql_query("SELECT `id` FROM `effects` WHERE `owner` = '$user[id]' AND `type` = 1022 LIMIT 1"));
if($_POST['target'] == $user['login']) {
if($eff) {
mysql_query("UPDATE `effects` SET `time` = '$magictime' WHERE `id` = '$eff' LIMIT 1");
echo '<font color=red><b>Успешно наложено заклятие невидимости!<b></font>';
} elseif(isset($user['id'])) {
mysql_query("INSERT INTO `effects` (`owner`, `name`, `time`, `type`) values ('".$user['id']."', 'Заклятие невидимости', '{$magictime}', '1022')");
mysql_query("UPDATE `users` SET `invis` = 1 WHERE `id` = '{$user['id']}' LIMIT 1");
echo '<font color=red><b>Успешно наложено заклятие невидимости!<b></font>';
}
} else {
echo '<font color=red><b>Свиток может быть использован только на себя<b></font>';
}
} else {
echo "<font color=red><b>В Башне Смерти нельзя использовать свиток невидимости!<b></font>";
}