2022-06-06 21:30:34 +00:00
|
|
|
|
<?
|
|
|
|
|
if(!defined('GAME'))
|
|
|
|
|
{
|
|
|
|
|
die();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( $itm['magic_inci'] == 'exitbtl' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$pvr = array();
|
|
|
|
|
|
2023-01-10 16:29:32 +00:00
|
|
|
|
//Действие при клике
|
2022-06-06 21:30:34 +00:00
|
|
|
|
if( isset($btl->info['id']) ) {
|
|
|
|
|
|
|
|
|
|
if( $btl->info['dn_id'] > 0 || $btl->info['izlom'] > 0 ) {
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$u->error = '<font color=red><b>Магия не действует в пещерах и подобных локациях...</b></font>';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}elseif( $btl->info['noinc'] > 0 ) {
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$u->error = '<font color=red><b>Бой изолирован и вы не можете его покинуть</b></font>';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}elseif( $btl->info['clone'] > 0 ) {
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$u->error = '<font color=red><b>Невозможно покинуть поединок с клоном</b></font>';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}elseif( $u->info['hpNow'] < 1 ) {
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$u->error = '<font color=red><b>Вы умерли и не можете покинуть бой</b></font>';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}elseif( $btl->info['type'] == 500 || $btl->info['type'] == 33){
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$u->error = '<font color=red><b>Невозможно покинуть этот поединок!</b></font>';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}elseif( $btl->info['smert'] == 1){
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$u->error = '<font color=red><b>Невозможно покинуть этот поединок!</b></font>';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}else{
|
|
|
|
|
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $u->info['enemy'],
|
|
|
|
|
'',
|
2023-01-10 16:29:32 +00:00
|
|
|
|
'{tm1} {u1} сбежал с поля боя... ',
|
2022-06-06 21:30:34 +00:00
|
|
|
|
($btl->hodID)
|
|
|
|
|
);
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$u->error = '<font color=red><b>Вы сбежали с поля боя и потеряли всю энергию...</b></font>';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
//
|
|
|
|
|
mysql_query('INSERT INTO `battle_last` (`login`,`city`,`battle_id`,`uid`,`time`,`team`,`lvl`,`align`,`clan`,`exp`,`bot`,`money`,`money2`,`money3`) VALUES ("'.$u->info['login'].'","'.$u->info['city'].'","'.$btl->info['id'].'","'.$u->info['id'].'","'.time().'","'.$btl->info['team_win'].'","'.$u->info['lvl'].'","'.$u->info['align'].'","'.$u->info['clan'].'","0","0","'.$u->info['money'].'","'.$u->info['money2'].'","'.$u->info['money'].'")');
|
|
|
|
|
mysql_query('UPDATE `stats` SET `battle_yron` = 0, `battle_exp` = 0,`tactic1` = 0 , `tactic2` = 0 , `tactic3` = 0 , `tactic4` = 0 , `tactic5` = 0 , `tactic6` = 0 , `tactic7` = -1 , `last_pr` = 0 , `last_hp` = -1 , `team` = 0 WHERE `id` = '.$u->info['id'].' LIMIT 1');
|
|
|
|
|
mysql_query('UPDATE `users` SET `battle` = "0", `lose` = `lose` + 1 WHERE `id` = '.$u->info['id'].' LIMIT 1');
|
|
|
|
|
//
|
|
|
|
|
mysql_query('DELETE FROM `eff_users` WHERE `v1` = "priem" AND `uid` = "'.$u->info['id'].'"');
|
|
|
|
|
//
|
|
|
|
|
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
|
|
|
|
|
//
|
|
|
|
|
mysql_query('INSERT INTO `battle_last` (`login`,`city`,`battle_id`,`uid`,`time`,`team`,`lvl`,`align`,`clan`,`exp`,`bot`,`money`,`money2`,`money3`) VALUES ('.$u->info['login'].','.$u->info['city'].','.$btl->info['id'].','.$u->info['id'].','.time().','.$btl->info['team_win'].','.$u->info['lvl'].','.$u->info['align'].','.$u->info['clan'].',0,0,'.$u->info['money'].','.$u->info['money2'].','.$u->info['money'].')');
|
|
|
|
|
mysql_query('DELETE FROM `battle_act` WHERE `uid1` = "'.$u->info['id'].'" OR `uid2` = "'.$u->info['id'].'"');
|
|
|
|
|
mysql_query('UPDATE `battle_users` SET `finish` = 1 WHERE `uid` = "'.$u->info['id'].'"');
|
|
|
|
|
mysql_query('UPDATE `stats` SET `hpNow`= 1, `mpNow` = 1,`priems_z` = "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else{
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$u->error = '<font color=red><b>Свиток возможно использовать только в бою</b></font> ';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-01-10 16:29:32 +00:00
|
|
|
|
//Отнимаем тактики
|
2022-06-06 21:30:34 +00:00
|
|
|
|
//$this->mintr($pl);
|
|
|
|
|
|
|
|
|
|
unset($pvr);
|
|
|
|
|
}
|
|
|
|
|
?>
|