2018-01-28 16:40:49 +00:00
< ? 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' );
2020-08-27 12:17:02 +00:00
$fbattle -> AddToLog ( '<span class=date>' . date ( " H:i " ) . '</span> ' . Nick :: id ( $user [ 'id' ]) -> short () . ' использовал' . $action . ' заклятие восстановления энергии и восстановил' . $action . ' уровень жизни <b>+270</b> [' . ( $hp ) . '/' . $maxhp . ']<BR>' );
2018-01-28 16:40:49 +00:00
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 ;
}
}