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

21 lines
1.1 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
$effect = mysql_fetch_array(mysql_query("SELECT `id` FROM `effects` WHERE `owner` = '{$user['id']}' AND `can` = '1' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `unsleep` FROM `abils_vip` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
if($vip['unsleep'] <= 0) {
echo 'Магия была исчерпана ...';
} elseif($_POST['target'] != $user['login']) {
echo 'Только на себя ...';
} elseif($user['battle'] > 0) {
echo "Не в бою ...";
} elseif(!isset($effect['id'])) {
echo "Нечего снимать...";
} else {
if($user['invis'] == 1) { $user['login'] = 'невидимка'; }
mysql_query("DELETE FROM `effects` WHERE `owner` = '".$user['id']."' AND `id` = '".$effect['id']."' LIMIT 1");
$vip['unsleep'] -= 1;
mysql_query('UPDATE `abils_vip` SET `unsleep` = "'.$vip['unsleep'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo "<font color=red><b>На персонажа \"{$user['login']}\" наложено заклятие \"Снять заклятие молчания\" </b></font>";
}