2018-01-28 16:40:49 +00:00
< ? 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' );
2018-11-05 20:15:13 +00:00
$fbattle -> AddToLog ( '<span class=date>' . date ( " H:i " ) . '</span> ' . nick :: id ( $user [ 'id' ]) -> short () . ' использовал' . $action . ' заклятие восстановления энергии и восстановил' . $action . ' уровень жизни <b>+90</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' ] += 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 ;
}
}