battles/magic/usability_vip/devastate.php
2018-01-28 18:40:49 +02:00

22 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
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$user['id']}' AND `type` = '202' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `sokr` FROM `abils_vip` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
if($vip['sokr'] <= 0) {
echo 'Магия была исчерпана ...';
} elseif($_POST['target'] != $user['login']) {
echo 'Только на себя ...';
} elseif($user['battle'] > 0) {
echo "Не в бою ...";
} elseif($effect['time']) {
echo "На персонаже уже есть заклятие Сокрушения ...";
} else {
if($user['invis'] == 1) { $user['login'] = 'невидимка'; }
addch("<img src=i/magic/devastate.gif>Персонаж &quot;{$user['login']}&quot; наложил заклятие \"Сокрушение\" на &quot;{$user['login']}&quot;, сроком 2 часа.");
mysql_query("INSERT INTO `effects` (`owner`, `name`, `time`, `type`) values ('".$user['id']."', 'Сокрушение', '".(time()+7200)."', '202')");
$vip['sokr'] -= 1;
mysql_query('UPDATE `abils_vip` SET `sokr` = "'.$vip['sokr'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo "<font color=red><b>На персонажа \"{$user['login']}\" наложено заклятие \"Сокрушение\" </b></font>";
}
?>