2018-01-28 16:40:49 +00:00
< ? php
2021-08-26 14:44:14 +00:00
use Battles\GameLogs ;
use Battles\Nick ;
2021-08-27 15:55:18 +00:00
$us = mysql_fetch_array ( mysql_query ( " SELECT *, (SELECT `id` FROM `online` WHERE login_time >= " . ( time () - 60 ) . " AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = ' " . mysql_real_escape_string ( $_POST [ 'target' ]) . " ' LIMIT 1 " ));
2018-01-28 16:40:49 +00:00
$vip = mysql_fetch_array ( mysql_query ( 'SELECT `id`, `klan`, `reamdeath` FROM `abils_klan` WHERE `klan` = "' . $user [ 'klan' ] . '" LIMIT 1' ));
$battle = mysql_fetch_array ( mysql_query ( 'SELECT `id` FROM `battle` WHERE `id` = "' . $user [ 'battle' ] . '" LIMIT 1' ));
if ( ! isset ( $battle [ 'id' ])) {
echo 'Это боевая магия ...' ;
} elseif ( $user [ 'hp' ] <= 0 ) {
echo 'Мервекам нельзя пользоваться магией ...' ;
} elseif ( $vip [ 'reamdeath' ] <= 0 ) {
echo 'Магия исчерпала себя ...' ;
} elseif ( $us [ 'id' ] == $user [ 'id' ]) {
echo 'Себя нельзя воскрешать ...' ;
} elseif ( $us [ 'hp' ] >= 1 ) {
echo 'Живых воскрешать?' ;
} elseif ( $us [ 'battle' ] != $user [ 'battle' ]) {
echo 'Вы в разных поединках ...' ;
} elseif ( ! $us [ 'online' ]) {
echo " Персонаж не в игре! " ;
} else {
2020-08-27 12:17:02 +00:00
if ( $user [ 'invis' ] == 1 ) { $lod = '<i><b>невидимка</b></i>' ; } else { $lod = Nick :: id ( $user [ 'id' ]) -> short (); }
2021-08-26 14:44:14 +00:00
GameLogs :: addBattleLog ( $battle [ 'id' ], '<span class=date>' . date ( " H:i " ) . '</span> ' . $lod . ' применил заклятие "Поднять мертвого", и воскресил персонажа <b>' . $us [ 'login' ] . '</b>!<BR>' );
2018-01-28 16:40:49 +00:00
mysql_query ( 'UPDATE `users` SET `hp` = `maxhp` WHERE `id` = "' . $us [ 'id' ] . '" LIMIT 1' );
$vip [ 'reamdeath' ] -= 1 ;
mysql_query ( 'UPDATE `abils_klan` SET `reamdeath` = "' . $vip [ 'reamdeath' ] . '" WHERE `klan` = "' . $vip [ 'klan' ] . '" LIMIT 1' );
echo 'Персонаж ' . $us [ 'login' ] . ' воскрешен ...' ;
}