battles/magic/hidden.php

26 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['level'] < 7) {
echo '<font color=red><b>Уровень маловат ...<b></font>';
} elseif($user['battle']) {
echo "<font color=red><b>Не в бою<b></font>";
} elseif(!$user['in_tower']) {
$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>';
$bet = 1;
} else {
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>';
$bet = 1;
}
} else {
echo '<font color=red><b>Свиток может быть использован только на себя<b></font>';
}
} else {
echo "<font color=red><b>В Башне Смерти нельзя использовать свиток невидимости!<b></font>";
}