game/_incl_data/class/magic/exitbtl.php
2022-06-07 00:30:34 +03:00

60 lines
3.2 KiB
PHP

<?
if(!defined('GAME'))
{
die();
}
if( $itm['magic_inci'] == 'exitbtl' ) {
$pvr = array();
//Äåéñòâèå ïðè êëèêå
if( isset($btl->info['id']) ) {
if( $btl->info['dn_id'] > 0 || $btl->info['izlom'] > 0 ) {
$u->error = '<font color=red><b>Ìàãèÿ íå äåéñòâóåò â ïåùåðàõ è ïîäîáíûõ ëîêàöèÿõ...</b></font>';
}elseif( $btl->info['noinc'] > 0 ) {
$u->error = '<font color=red><b>Áîé èçîëèðîâàí è âû íå ìîæåòå åãî ïîêèíóòü</b></font>';
}elseif( $btl->info['clone'] > 0 ) {
$u->error = '<font color=red><b>Íåâîçìîæíî ïîêèíóòü ïîåäèíîê ñ êëîíîì</b></font>';
}elseif( $u->info['hpNow'] < 1 ) {
$u->error = '<font color=red><b>Âû óìåðëè è íå ìîæåòå ïîêèíóòü áîé</b></font>';
}elseif( $btl->info['type'] == 500 || $btl->info['type'] == 33){
$u->error = '<font color=red><b>Íåâîçìîæíî ïîêèíóòü ýòîò ïîåäèíîê!</b></font>';
}elseif( $btl->info['smert'] == 1){
$u->error = '<font color=red><b>Íåâîçìîæíî ïîêèíóòü ýòîò ïîåäèíîê!</b></font>';
}else{
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $u->info['enemy'],
'',
'{tm1} {u1} ñáåæàë ñ ïîëÿ áîÿ... ',
($btl->hodID)
);
$u->error = '<font color=red><b>Âû ñáåæàëè ñ ïîëÿ áîÿ è ïîòåðÿëè âñþ ýíåðãèþ...</b></font>';
//
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{
$u->error = '<font color=red><b>Ñâèòîê âîçìîæíî èñïîëüçîâàòü òîëüêî â áîþ</b></font> ';
}
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
unset($pvr);
}
?>