2022-06-06 21:30:34 +00:00
< ?
if ( ! defined ( 'GAME' ))
{
die ();
}
if ( $p [ 'unbtl' ] == 1 )
{
function inBattleLog ( $txt , $usr ) {
global $u ;
$lastHOD = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `battle_logs` WHERE `battle` = "' . $u -> info [ 'battle' ] . '" ORDER BY `id_hod` DESC LIMIT 1' ));
if ( isset ( $lastHOD [ 'id' ])) {
$id_hod = $lastHOD [ 'id_hod' ];
if ( $lastHOD [ 'type' ] != 6 ) {
$id_hod ++ ;
}
mysql_query ( 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time () . '","' . $u -> info [ 'battle' ] . '","' . ( $id_hod ) . '","{tm1} ' . $txt . '","login1=' . $u -> info [ 'login' ] . '||t1=' . $u -> info [ 'team' ] . '||login2=' . $usr [ 'login' ] . '||t2=' . $usr [ 'team' ] . '||time1=' . time () . '","","","","","6")' );
}
}
$uu = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string ( $_POST [ 'logingo' ]) . '" ORDER BY `id` ASC LIMIT 1' ));
if ( isset ( $uu [ 'id' ]))
{
if ( $uu [ 'battle' ] == 0 )
{
2023-01-10 16:29:32 +00:00
$uer = 'Персонаж не находится в поединке<br>' ;
2022-06-06 21:30:34 +00:00
} else {
$uu [ 'battle222' ] = $uu [ 'battle' ];
$uu [ 'battle' ] = 0 ;
$upd = mysql_query ( 'UPDATE `users` SET `battle` = "' . $uu [ 'battle' ] . '" WHERE `id` = "' . $uu [ 'id' ] . '" LIMIT 1' );
if ( $upd )
{
mysql_query ( ' UPDATE `stats` SET
`regHP` = " '.time().' "
, `team` = 0
, `battle_yron` = 0
, `battle_exp` = 0
WHERE `id` = " '. $uu['id'] .' " LIMIT 1 ' );
$sx = '' ;
if ( $u -> info [ 'sex' ] == 1 )
{
2023-01-10 16:29:32 +00:00
$sx = 'а ' ;
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
inBattleLog ( '{tm1} ' . $rang . ' "<b>' . $u -> info [ 'cast_login' ] . '</b>" выпустил персонажа "<b>' . $uu [ 'login' ] . '</b>" из поединка.' );
$rtxt = '[img[items/pal_buttonn.gif]] ' . $rang . ' "' . $u -> info [ 'cast_login' ] . '" выпустил' . $sx . ' персонажа "' . $uu [ 'login' ] . '" из поединка' ;
2022-06-06 21:30:34 +00:00
//mysql_query("UPDATE `chat` SET `delete` = 1 WHERE `login` = '".$uu['login']."' LIMIT 1000");
mysql_query ( " INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,' " . $u -> info [ 'city' ] . " ',' " . $u -> info [ 'room' ] . " ','','',' " . $rtxt . " ',' " . time () . " ','6','0','1') " );
2023-01-10 16:29:32 +00:00
$rtxt = $rang . ' "' . $u -> info [ 'login' ] . '" выпустил' . $sx . ' персонажа из поединка №<b>' . $uu [ 'battle222' ] . '</b>.' ;
2022-06-06 21:30:34 +00:00
mysql_query ( " INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES (' " . $uu [ 'id' ] . " ',' " . $_SERVER [ 'REMOTE_ADDR' ] . " ',' " . $u -> info [ 'city' ] . " ',' " . time () . " ',' " . $rtxt . " ',' " . $u -> info [ 'login' ] . " ',0) " );
2023-01-10 16:29:32 +00:00
$uer = 'Вы успешно выпустили персонажа "' . $uu [ 'login' ] . '" из поединка.' ;
2022-06-06 21:30:34 +00:00
} else {
2023-01-10 16:29:32 +00:00
$uer = 'Н е удалось использовать данное заклятие' ;
2022-06-06 21:30:34 +00:00
}
}
} else {
2023-01-10 16:29:32 +00:00
$uer = 'Персонаж не найден в этом городе' ;
2022-06-06 21:30:34 +00:00
}
} else {
2023-01-10 16:29:32 +00:00
$uer = 'У В а с нет прав на использование данного заклятия' ;
2022-06-06 21:30:34 +00:00
}
?>