Файл: b_oh.php
Строк: 538
<?
define('PROTECTOR', 1);
$textl='Битва';
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$lv=time();
$last=date('d.m.Y - H:i:s');
mysql_query("UPDATE `users` SET
`lv`='".$lv."',
`last`='".$last."',
`mesto`='".$textl."'
WHERE `id`='".$udata['id']."'");
$bat=mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$udata['id']."'");
$num=mysql_num_rows($bat);
if($num==0)
{
header('location: game.php');exit;
}
else
{
$bt=mysql_fetch_array($bat);
$lab=mysql_fetch_array(mysql_query("SELECT * FROM `labir` WHERE `id`='".$bt['labir']."'"));
$loka=mysql_fetch_array(mysql_query("SELECT * FROM `labir_loc_usr` WHERE `x`='".$bt['x']."' and `y`='".$bt['y']."' and `usr`='".$udata['id']."'"));
$num_mob=mysql_num_rows(mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$udata['id']."' and `x`='".$bt['x']."' and `y`='".$bt['y']."'"));
if($loka['status']==1){
$mobs=mysql_query("SELECT * FROM `labir_mob` WHERE `labir`='".$lab['id']."' and `x`='".$loka['x']."' and `y`='".$loka['y']."'");
$numas_mob=mysql_num_rows($mobs);
if($numas_mob!=0){
while($mob=mysql_fetch_array($mobs))
{
mysql_query("INSERT INTO `local_mob` SET
`id`='',
`usr`='".$udata['id']."',
`name`='".$mob['name']."',
`sila`='".$mob['sila']."',
`hp`='".$mob['hp']."',
`arm`='".$mob['arm']."',
`x`='".$mob['x']."',
`y`='".$mob['y']."',
`boss`='".$mob['boss']."'
");
}
}
mysql_query("UPDATE `labir_loc_usr` SET `status`='0' WHERE `id`='".$loka['id']."'");
header('location: ?');exit;
}
//$num_mob_all=mysql_num_rows(mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$udata['id']."'"));
if($bt['boss']==0 and $bt['status']==0)
{
mysql_query("UPDATE `labir_usr` SET `enemy`='0', `status`='1' WHERE `id`='".$bt['id']."'");header('location: ?');exit;
}
$bts=mysql_fetch_array(mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$udata['id']."' and `id`='".$bt['enemy']."'"));
$enemy_mob=mysql_num_rows(mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$udata['id']."' and `x`='".$bt['x']."' and `y`='".$bt['y']."' and `id`='".$bt['enemy']."'"));
if($enemy_mob==0 and $bt['enemy']!=0){
if($lab['id']==1 and $udata['kv_d']==13)
{
$kol=$udata['kv_d_n']+1;
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 20</font>'
");
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
mysql_query("UPDATE `labir_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");header('location: ?');exit;}
$gi=mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id`='".$udata['clan']."'"));
$gus=mysql_fetch_array(mysql_query("SELECT * FROM `clan_users` WHERE `clan`='".$gi['id']."' and `usr`='".$udata['id']."'"));
if($bt['hp']==0 and $bt['status']!=2)
{
mysql_query("UPDATE `labir_usr` SET `enemy`='0', `status`='2' WHERE `id`='".$bt['id']."'");header('location: ?');exit;
}
if(isset($_GET['leave']))
{
if($bt['status']==0 or $bt['status']==2)
{
$ld=$lab['dostup']*3600;
$ysl=mysql_num_rows(mysql_query("SELECT * FROM `item` WHERE `usr`='".$udata['id']."' and `tip`='ohot'"));
if($ysl!=0)
{
$ld=$ld/2;
}
$tim=time()+$ld;
mysql_query("INSERT INTO `labir_usr_blok` SET
`id`='',
`usr`='".$udata['id']."',
`labir`='".$lab['id']."',
`time`='".$tim."'
");
mysql_query("DELETE FROM `labir_loc_usr` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `labir_usr` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `log_labir` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `local_mob` WHERE `usr`='".$udata['id']."'");
}
elseif($bt['status']==1)
{
if($lab['id']==1 and $udata['kv_d']==10)
{
$kol=$udata['kv_d_n']+1;
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 1</font>'
");
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($lab['id']==2 and $udata['kv_d']==24)
{
$kol=$udata['kv_d_n']+1;
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 1</font>'
");
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($lab['id']==3 and $udata['kv_d']==30)
{
$kol=$udata['kv_d_n']+1;
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 1</font>'
");
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($lab['id']==4 and $udata['kv_d']==34)
{
$kol=$udata['kv_d_n']+1;
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 1</font>'
");
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($lab['id']>4 and $udata['kv_d']==37)
{
$kol=$udata['kv_d_n']+1;
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 4</font>'
");
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
$gi=mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id`='".$udata['clan']."'"));
$gus=mysql_fetch_array(mysql_query("SELECT * FROM `clan_users` WHERE `clan`='".$gi['id']."' and `usr`='".$udata['id']."'"));
if($gus['kv_s']==5 and $gus['kv_s_n']<5)
{
$rand=rand(1,5);
if($rand<=1)
{
$nd=$gus['kv_s_n']+1;
$dead='<br><img src=img/main/e30.png><font color=#ffffff># Задание Гильдии: '.$nd.' из 5.</font>';
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$dead."'
");
mysql_query("UPDATE `clan_users` SET `kv_s_n`='".$nd."' WHERE `id`='".$gus['id']."'");
}
}
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['ohot_exp']+1;
mysql_query("UPDATE `users_dost` SET `ohot_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
$dat_pay=date('d');
$tim_pay=date('H');
$kl=$udata['kl']+$lab['kl'];
$fim=$udata['fm']+$lab['fim'];
$mon=$udata['money']+$lab['mon'];
if($lab['id']==32)
{
$pr=$udata['pr']+10;
mysql_query("UPDATE `users` SET `pr`='".$pr."' WHERE `id`='".$udata['id']."'");
}
mysql_query("UPDATE `users` SET `kl`='".$kl."', `fm`='".$fim."', `money`='".$mon."' WHERE `id`='".$udata['id']."'");
$ld=$lab['dostup']*3600;
$ysl=mysql_num_rows(mysql_query("SELECT * FROM `item` WHERE `usr`='".$udata['id']."' and `tip`='ohot'"));
if($ysl!=0)
{
$ld=$ld/2;
}
$mobs=mysql_query("SELECT * FROM `item` WHERE `tip`='zarad' and `status`='on' and `usr`='".$udata['id']."' and `img`='1'");
$rows=mysql_num_rows($mobs);
if($rows!=0)
{
$ld=round($ld-$ld/100*20);
}
if($udata['vip_exp']>=1300)
{$ld=round($ld-$ld/100*30);}
$tim=time()+$ld;
mysql_query("INSERT INTO `labir_usr_blok` SET
`id`='',
`usr`='".$udata['id']."',
`labir`='".$lab['id']."',
`time`='".$tim."'
");
mysql_query("DELETE FROM `labir_loc_usr` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `labir_usr` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `log_labir` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `local_mob` WHERE `usr`='".$udata['id']."'");
}
mysql_query("UPDATE `users_stats` SET `hp`='".$bt['hp']."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
$en=mysql_num_rows(mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$bt['usr']."' and `time_us`<'".time()."' and `x`='".$bt['x']."' and `y`='".$bt['y']."'"));
if($en!=0)
{
$ed=mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$bt['usr']."' and `time_us`<'".time()."' and `x`='".$bt['x']."' and `y`='".$bt['y']."'");
while($ens=mysql_fetch_array($ed))
{
if($ens['sfer_5_time']>time())
{
}
else
{
$r=rand(1,8);
if($r==1)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `id` DESC"));
}
if($r==2)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `id` ASC"));
}
if($r==3)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `hp` DESC"));
}
if($r==4)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `hp` ASC"));
}
if($r==5)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `sila` ASC"));
}
if($r==6)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `sila` DESC"));
}
if($r==7)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `arm` DESC"));
}
if($r==8)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `arm` ASC"));
}
if($btt['tip']=='usr')
{
$ssb=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$btt['usr']."'"));
$en_namet=' <img src=img/main/c'.$ssb['klass'].'.png> <img src=img/main/r'.$ssb['rasa'].'.png><font color=#ff0000>'.$ssb['usr'].'</font>';
}
if($btt['tip']=='pit')
{
$ssb=mysql_fetch_array(mysql_query("SELECT * FROM `pit` WHERE `id`='".$btt['pit']."' and `usr`='".$btt['usr']."'"));
$en_namet=' <font color=#ff9900>'.$ssb['name'].'</font>';
}
$blok=rand(1,100);
if($ssb['blok']>=$blok)
{
$lg12='<img src=img/main/b23.png> Вы заблокировали атаку <font color=#ffff00><font color=#00ff99>'.$ens['name'].'</font></font>.';
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$ssb['id']."',
`text`='".$lg12."'
");
$tim=time()+10;
mysql_query("UPDATE `local_mob` SET `time_us`='".$tim."' WHERE `id`='".$ens['id']."'");
}
elseif($btt['mag_ney_time']>time())
{
$lg='<img src=img/main/b1.png> '.$en_namet.' уклонился от атаки <font color=#00ff99>'.$ens['name'].'</font>';
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$btt['usr']."',
`text`='".$lg."'
");
$tim=time()+10;
mysql_query("UPDATE `local_mob` SET `time_us`='".$tim."' WHERE `id`='".$ens['id']."'");
}
else
{
$dmg=$ens['sila'];
if($ens['sfer_11_time']>=time())
{
$dmg=round($dmg-$dmg/100*$ens['sfer_11_ef']);
}
$armr=$btt['arm'];
$dmg=$dmg-$armr;
if($btt['sfer_6_time']>=time())
{
$sks=$btt['sfer_6_ef'];
$dmg=round($dmg-$dmg/100*$sks);
if($dmg<$ens['sila']/100*5)
{
$dmg=round($ens['sila']/100*5);
}
}
else
{
if($dmg<$ens['sila']/100*10)
{
$dmg=round($ens['sila']/100*10);
}
}
$h_us=$btt['hp']-$dmg;
if($btt['tip']!='mob')
{
$lg12='<img src=img/main/b23.png> <font color=#ff0000><font color=#00ff99>'.$ens['name'].'</font> ударил '.$en_namet.' -'.$dmg.'</font>.';
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$btt['usr']."',
`text`='".$lg12."'
");
}
if($h_us<=0)
{
$lg12='<img src=img/main/b23.png> <font color=#ff0000><font color=#00ff99>'.$ens['name'].'</font> сокрушил '.$en_namet.'</font>.';
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$btt['usr']."',
`text`='".$lg12."'
");
if($btt['tip']!='pit')
{
mysql_query("UPDATE `labir_usr` SET `hp`='0', `att2`='".$dmg."', `status`='2' WHERE `id`='".$btt['id']."'");
}
else
{
mysql_query("DELETE FROM `labir_usr` WHERE `id`='".$btt['id']."'");
}
}
else
{
$att2=$dmg;
mysql_query("UPDATE `labir_usr` SET `hp`='".$h_us."', `att2`='".$att2."' WHERE `id`='".$btt['id']."'");
if($btt['sfer_10_time']>=time())
{
$mobss=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$btt['usr']."' and `mag`='10' and `status`='on'");
$skills=mysql_fetch_array($mobss);
$yrs=round($dmg/100*$btt['sfer_10_ef']);
if($yrs<1)
{
$yrs=1;
}
$hpz=$ens['hp']-$yrs;
$lgz='<img src=img/main/b10.png> <font color=#00ff00>заклинание возврата обожгло</font>
<font color=#00ff99>'.$ens['name'].'</font> <font color=#00ff00>-'.$yrs.'</font>';
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$btt['usr']."',
`text`='".$lgz."'
");
if($hpz<=0)
{
$lg2='<img src=img/main/b17.png>'.$en_namet.'</a> <font color=#ff0000>
сокрушает '.$bts['name'].'</font>';
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$btt['usr']."',
`text`='".$lg2."'
");
$nai=$ssb['reit_oh']+1;
$ds=$ssb['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$ssb['id']."'");
mysql_query("DELETE FROM `local_mob` WHERE `id`='".$ens['id']."'");
}
else
{
mysql_query("UPDATE `local_mob` SET `hp`='".$hpz."' WHERE `id`='".$ens['id']."'");
}
mysql_query("UPDATE `labir_usr` SET `att`='".$yrs."' WHERE `id`='".$btt['id']."'");
}
}
$tim=time()+10;
mysql_query("UPDATE `local_mob` SET `time_us`='".$tim."' WHERE `id`='".$ens['id']."'");
}
}
}
}
include('b_oh2.php');
if($bt['enemy']==0)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$udata['id']."' and `x`='".$bt['x']."' and `y`='".$bt['y']."'"));
if($enemy!=0){
$bts1=mysql_fetch_array(mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$udata['id']."' and `x`='".$bt['x']."' and `y`='".$bt['y']."' ORDER BY `id` ASC"));
$bts2=mysql_fetch_array(mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$udata['id']."' and `x`='".$bt['x']."' and `y`='".$bt['y']."' ORDER BY `id` DESC"));
$r=rand($bts1['id'],$bts2['id']);
$bts_en=mysql_fetch_array(mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$udata['id']."' and `x`='".$bt['x']."' and `y`='".$bt['y']."' and `id`='".$r."'"));
mysql_query("UPDATE `labir_usr` SET `enemy`='".$bts_en['id']."' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
}
include('files/head.php');
echo '
<div class="head brs bls bts bbs p"><font color=#00ccff>
<img src=img/main/p6.png>'.$bt['hp'].' | '.$hpw.'
<font color=#ff0000>'.$bt['att'].'</font> | <font color=#ff0000>'.$bt['att2'].'</font>
| '.$bts['name'].' <img src=img/main/p6.png>'.$bts['hp'].'';
$q = mysql_query("SELECT COUNT(*) FROM `msg_kont` WHERE `usr1` = '".$udata['id']."' AND `read` = '1';");
$new_mail = mysql_result($q, 0);
if($new_mail > 0)
{
echo"
<a href="mail.php"><img src=img/main/e1.png></a>";
}
if($udata['clan']!=0)
{
$fridaa=mysql_query("SELECT * FROM `sectors` WHERE `clan`='".$udata['clan']."' and `att_clan`!='0'");
$fra=mysql_num_rows($fridaa);
if($fra!=0)
{
echo'<a href=clan.php?gi=ter><img src=img/main/st.png></a>';
}
}
echo'
</font>
</div>';
$giza=mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id`='".$udata['clan']."'"));
if($giza['gorn_time']>time() and $udata['gorn']==1)
{
echo '<div class="v6 rr rt rl p">'.$giza['gorn'].'<br>
<img src=img/main/e55.png><a href=clan.php?gorn_def>Закрыть</a>
</div>';
}
if($bt['status']==0)
{
if($num_mob==0)
{
echo '<table width=100%><tr><td width=65%>';
echo '<div class="line bts brs bbs bls b p m" style="border-radius: 7px 0 0 7px">Локация: '.$loka['name'].'</div>
</td>
<td>
<a href=?leave><div class="bts brs bbs p m" style="border-radius: 0 7px 7px 0; background: #660000" align=center>
Покинуть
</div></a>
</td></tr></table>
<div class="box bts brs bls bbs p m">';
echo '<div class="p" align=cente><font color=#00cc00>Локация зачищена, вы можете идти дальше.</font></div>';
$x1=$bt['x']-1;
$x2=$bt['x'];
$x3=$bt['x']+1;
$y1=$bt['y']-1;
$y2=$bt['y'];
$y3=$bt['y']+1;
$loks1=mysql_query("SELECT * FROM `labir_loc_usr` WHERE `x`='".$x2."' and `y`='".$y1."' and `usr`='".$udata['id']."'");
$n_l1=mysql_num_rows($loks1);if($n_l1!=0){
$lk1=mysql_fetch_array($loks1);echo '<img src=img/main/e28.png> <a href=b_oh_lok.php?lok=1>'.$lk1['name'].'</a><br>';}
$loks2=mysql_query("SELECT * FROM `labir_loc_usr` WHERE `x`='".$x2."' and `y`='".$y3."' and `usr`='".$udata['id']."'");
$n_l2=mysql_num_rows($loks2);if($n_l2!=0){
$lk2=mysql_fetch_array($loks2);echo '<img src=img/main/e28.png> <a href=b_oh_lok.php?lok=2>'.$lk2['name'].'</a><br>';}
$loks3=mysql_query("SELECT * FROM `labir_loc_usr` WHERE `x`='".$x1."' and `y`='".$y2."' and `usr`='".$udata['id']."'");
$n_l3=mysql_num_rows($loks3);if($n_l3!=0){
$lk3=mysql_fetch_array($loks3);echo '<img src=img/main/e28.png> <a href=b_oh_lok.php?lok=3>'.$lk3['name'].'</a><br>';}
$loks4=mysql_query("SELECT * FROM `labir_loc_usr` WHERE `x`='".$x3."' and `y`='".$y2."' and `usr`='".$udata['id']."'");
$n_l4=mysql_num_rows($loks4);if($n_l4!=0){
$lk4=mysql_fetch_array($loks4);echo '<img src=img/main/e28.png> <a href=b_oh_lok.php?lok=4>'.$lk4['name'].'</a><br>';}
}
else
{
if($bt['enemy']==0)
{
echo '<table width=100%><tr><td width=65%>';
echo '<div class="line bts bbs brs bls b p m" style="border-radius: 7px 0 0 7px">Противники</div>
</td>
<td>
<a href=?leave><div class="bts brs bbs p m" style="border-radius: 0 7px 7px 0; background: #660000" align=center>
Покинуть
</div></a>
</td></tr></table>
<div class="box bts brs bls bbs p m">';
$gr=mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$bt['usr']."' and `x`='".$bt['x']."' and `y`='".$bt['y']."'");
while($mn=mysql_fetch_array($gr))
{
echo '<a href=b_oh_enemy.php?enemy='.$mn['id'].'><font color=#00ff99>'.$mn['name'].'</font></a> <img src=img/main/p6.png>'.$mn['hp'].', ';
}
}
else
{
echo '<table width=100%><tr><td width=65%>';
echo '
<div class="p line bts bbs brs bls m" style="border-radius: 7px 0 0 7px" align=center>'.$udata['usr'].' VS '.$bts['name'].'</div>
<td>
<a href=?leave><div class="bts brs bbs p m" style="border-radius: 0 7px 7px 0; background: #660000" align=center>
Покинуть
</div></a>
</td></tr></table>
';
$mobas=mysql_fetch_array(mysql_query("SELECT hp FROM `labir_mob` WHERE `name`='".$bts['name']."'"));
$hpp=$mobas['hp']/100;
$hpp=$bts['hp']/$hpp;
echo '<div class="box brs bts bbs bls p m">';
echo '<table width=100%>';
echo '<tr>';
echo '<td width=70px><img src=img/mob/0.jpg></td>';
echo '<td>';
echo ''.$bts['name'].'<br>';
echo '<table width=100%>
<tr>
<td width=80%><div class="bts bbs brs bls">
<div style="background: #990000; height: 20px; width:'.$hpp.'%">
</div></td>
<td width=20% align=right>'.round($hpp).'%</td>
</tr>
</table>';
echo '</td>';
echo '</tr>';
echo '</table></div>';
echo '<div class="p bts bbs brs bls m" style="background: #003377">';
if($bt['time_us']<time())
{
echo'<a href=b_oh_kick.php><div style="position: relative;
font-weight: bold;
margin-top: 2px;
margin-bottom: 4px;
color: #ffff00;
text-decoration: none;
text-shadow: 0 -1px 1px #cc5500;
user-select: none;
padding: 5px;
outline: none;
border-radius: 1px;
background: rgb(128,60,60);
background-size: 100% 100%, auto;
background-position: 50% 50%;
box-shadow: inset rgb(188,60,60) 0 -1px 1px, inset 0 1px 1px rgb(188,60,60), rgb(188,60,60) 0 0 0 1px, #000 0 10px 15px -10px; text-align: center">Атака</div></a>';
}
else
{
$time=$bt['time_us']-time();
$h=floor($time/3600);
$m=floor(($time-($h*3600))/60);
$s=$time-($h*3600)-($m*60);
$tim_boss=$h.':'.$m.':'.$s;
echo'<a href=b_oh_kick.php><div style="position: relative;
font-weight: bold;
color: #ffff00;
margin-top: 2px;
margin-bottom: 4px;
text-decoration: none;
text-shadow: 0 -1px 1px #cc5500;
user-select: none;
padding: 5px;
outline: none;
border-radius: 1px;
background: rgb(128,60,60);
background-size: 100% 100%, auto;
background-position: 50% 50%;
box-shadow: inset rgb(188,60,60) 0 -1px 1px, inset 0 1px 1px rgb(188,60,60), rgb(188,60,60) 0 0 0 1px, #000 0 10px 15px -10px; text-align: center; opacity: 0.7">До полного удара: '.$tim_boss.'</div></a>';
}
echo '<table width=100%>';
echo '<tr>';
$tn=time();
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `status`='on' ORDER BY `id`");
while($mag=mysql_fetch_array($mobs))
{
echo '<td align=center>';
if($mag['mag']==1)
{
$sn=1;
$name='заклинание удара';
}
if($mag['mag']==2)
{
$sn=14;
$name='заклинание случайности';
}
if($mag['mag']==3)
{
$sn=3;
$name='заклинание усиления';
}
if($mag['mag']==4)
{
$sn=9;
$name='заклинание пробивания';
}
if($mag['mag']==5)
{
$sn=13;
$name='заклинание стана';
}
if($mag['mag']==6)
{
$sn=2;
$name='заклинание обороны';
}
if($mag['mag']==7)
{
$sn=5;
$name='заклинание молний';
}
if($mag['mag']==8)
{
$sn=4;
$name='заклинание исцеления';
}
if($mag['mag']==9)
{
$sn=11;
$name='заклинание вампира';
}
if($mag['mag']==10)
{
$sn=10;
$name='заклинание возврата';
}
if($mag['mag']==11)
{
$sn=12;
$name='заклинание ослабления';
}
if($mag['mag']==12)
{
$sn=7;
$name='заклинание барьера';
}
if($mag['mag']==13)
{
$sn=8;
$name='заклинание сингулярности';
}
if($mag['mag']==14)
{
$sn=6;
$name='заклинание хаоса';
}
if($mag['time']<=$tn)
{
echo '<a href=b_oh_mag.php?mag='.$mag['mag'].'>
<div class="mag p" style=" margin-top: 3px;
margin-bottom: 4px;"><img src=img/mag/sfera_'.$sn.'.jpg></div></a>';
}
else
{
$mag['time']=$mag['time']-time();
$mag['time']=$mag['time']." с.";
echo '<a href=b_oh_mag.php?mag='.$mag['mag'].'>
<div class="mag p m" style="opacity: 0.8; margin-top: 3px;
margin-bottom: 4px;"><img src=img/mag/sfera_'.$sn.'.jpg>'.$mag['time'].'</div></a>';
}
echo '</td>';
}
echo '</tr>';
echo '</table>';
echo '<table width=100%>';
echo '<tr>';
$eq=mysql_query("SELECT * FROM `elic` WHERE `usr`='".$udata['id']."' and `tip`='hp' and `status`='on'");
while($el=mysql_fetch_array($eq))
{
echo '<td align=center>';
if($el['time']<=$tn)
{
echo '<a href=b_oh_elic.php?ef='.$el['id'].'>
<div class="p elic" style=" margin-top: 3px;
margin-bottom: 4px;">
<img src=img/elic/'.htmlspecialchars($el['tip']).''.$el['ef'].'.png></div></a> ';
}
else
{
$el['time']=$el['time']-time();
if($el['time']<60){
$el['time']=$el['time']." с.</font>";
}
echo '<div style="opacity: 0.8; margin-top: 3px;
margin-bottom: 4px;" class="p elic"><img src=img/elic/'.htmlspecialchars($el['tip']).''.$el['ef'].'.png> '.$el['time'].'</div>';
}
echo '</td>';
}
echo '</tr>';
echo '</table>';
echo '</div>';
echo '<div class="line bts brs bbs bls b p m">Твой противник:</div>';
echo '<div class="bat bts brs bls bbs p">';
$gr=mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$bt['usr']."' and `x`='".$bt['x']."' and `y`='".$bt['y']."'");
while($mn=mysql_fetch_array($gr))
{
echo '<a href=?enemy='.$mn['id'].'><font color=#00ff99>'.$mn['name'].'</font></a> <img src=img/main/p6.png>'.$mn['hp'].', ';
}
echo '</div></div>';
}
}
}
elseif($bt['status']==1)
{
echo '<table width=100%><tr><td width=65%>';
echo '<div class="line bts brs bbs bls b p m" style="border-radius: 7px 0 0 7px">Локация: '.$loka['name'].'</div>
</td>
<td>
<a href=?leave><div class="bts brs bbs p m" style="border-radius: 0 7px 7px 0; background: #660000" align=center>
Покинуть
</div></a>
</td></tr></table>
<div class="box bts brs bls bbs p m">';
echo '
<div class="p v8" align=center><font color=#22ff22>Вы успешно завершили эту охоту.<br>Ваша награда:</font></div>
';
echo '<div class="v5 p v8"><img src=img/main/e28.png> <font color=#11ff11>Награда за прохождение:</font>';
$dat_pay=date('d');
$tim_pay=date('H');
$sob_pay=mysql_query("SELECT * FROM `sob` WHERE `d_start`<='".$dat_pay."' and `d_finish`>='".$dat_pay."' and `t_start`<='".$tim_pay."' and `t_finish`>='".$tim_pay."' and `lvl`<='".$udata['lvl']."' and `tip`='ohota' ORDER BY `kol` DESC LIMIT 1");
$n_sob=mysql_num_rows($sob_pay);
if($n_sob!=0)
{
$lab['kl']=$lab['kl']*2;
$lab['fim']=$lab['fim']*2;
$lab['mon']=$lab['mon']*2;
$jem=$jem*2;
}
if($lab['kl']>0){echo' <img src=img/main/r16.png>'.$lab['kl'].' ';}
if($lab['fim']>0){echo' <img src=img/main/r17.png>'.$lab['fim'].' ';}
if($lab['mon']>0){echo' <img src=img/main/p5.png>'.$lab['mon'].' ';}
if($lab['id']==32)
{
echo' <img src=img/main/pr.png>10';
}
echo'</div>';
echo '<img src=img/main/p11.png><a href=?leave>Покинуть Бой</a>';
}
elseif($bt['status']==2)
{
echo '<table width=100%><tr><td width=65%>';
echo '<div class="line bts brs bbs bls b p m" style="border-radius: 7px 0 0 7px">Локация: '.$loka['name'].'</div>
</td>
<td>
<a href=?leave><div class="bts brs bbs p m" style="border-radius: 0 7px 7px 0; background: #660000" align=center>
Покинуть
</div></a>
</td></tr></table>
<div class="box bts brs bls bbs p m">';
echo '
<div class="p v8" align=center><font color=#22ff22>Вы погибли. Для вас охота закончена.</font>';
echo'</div>';
echo '<img src=img/main/p11.png><a href=?leave>Покинуть Бой</a>';
}
echo '</div></div>';
}
$mobs=mysql_query("SELECT * FROM `log_labir` WHERE `usr`='".$udata['id']."' ORDER BY `id` DESC LIMIT 10");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
}
else
{
echo '<div class=v8><div class="line bbs bts brs bls m p">Лог боя:</div><div class="bat bts brs bls bbs p">';
while($log=mysql_fetch_array($mobs))
{
echo $log['text'].'<br>';
}
}
echo '</div></div>';
include('files/dwn.php');
?>