battles/magic/cure_rep_90.php
2020-08-27 15:17:02 +03:00

37 lines
1.9 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(!isset($_SESSION['uid'])) { header('Location: ../index.php'); die(); }
if($user['level'] < 6) {
echo "<font style=\"color: Red;\"><b>Уровень маловат ...</b></font>";
} elseif($user['intel'] < 6) {
echo "<font style=\"color: Red;\"><b>Недостаточно Интеллекта ...</b></font>";
} elseif($user['mgray'] < 3) {
echo "<font style=\"color: Red;\"><b>Недостаточно Владения магией ...</b></font>";
} else {
if($user['sex'] == 1) { $action = ''; } else { $action = 'а'; }
if($user['battle'] != 0) {
if($user['hp'] <= 0) {
echo "<font style=\"color: Red;\"><b>Мёртвые не могут пользоваться магией ...</b></font>";
} else {
$user['hp'] += 90;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
if($user['invis'] == 1) { $hp = '??'; $maxhp = '??'; } else { $hp = $user['hp']; $maxhp = $user['maxhp']; }
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$fbattle->AddToLog('<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' использовал'.$action.' заклятие восстановления энергии и восстановил'.$action.' уровень жизни <b>+90</b> ['.($hp).'/'.$maxhp.']<BR>');
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = '".$user['battle']."' LIMIT 1");
$fbattle->write_log();
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
} else {
$user['hp'] += 90;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
}