37 lines
1.9 KiB
PHP
37 lines
1.9 KiB
PHP
|
<?php
|
|||
|
if(!isset($_SESSION['uid'])) { header('Location: ../index.php'); die(); }
|
|||
|
|
|||
|
if($user['level'] < 8) {
|
|||
|
echo "<font style=\"color: Red;\"><b>Уровень маловат ...</b></font>";
|
|||
|
} elseif($user['intel'] < 14) {
|
|||
|
echo "<font style=\"color: Red;\"><b>Недостаточно Интеллекта ...</b></font>";
|
|||
|
} elseif($user['mgray'] < 4) {
|
|||
|
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'] += 270;
|
|||
|
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> '.nick5($user['id'], $fbattle->my_class).' использовал'.$action.' заклятие восстановления энергии и восстановил'.$action.' уровень жизни <b>+270</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'] += 270;
|
|||
|
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;
|
|||
|
}
|
|||
|
}
|