Файл: b_bz.php
Строк: 497
<?
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 `arena_usr` WHERE `usr`='".$udata['id']."' and `tip`!='pit'");
$num=mysql_num_rows($bat);
if($num==0)
{
header('location: game.php');exit;
}
else
{
$bt=mysql_fetch_array($bat);
$arena=mysql_num_rows(mysql_query("SELECT * FROM `arena` WHERE `id`='".$bt['arr']."' and `time`<='".time()."' and `st`>'0'"));
if($arena==0)
{
header('location: arena.php');exit;
}
$lvl=$udata['lvl']+1;
$exzn=mysql_num_rows(mysql_query("SELECT * FROM `lvl` WHERE `lvl`='".$lvl."'"));
if($exzn!=0)
{
$ex=mysql_fetch_array(mysql_query("SELECT * FROM `lvl` WHERE `lvl`='".$lvl."'"));
if($udata['exp']>=$ex['exp'])
{
$kl=$udata['lvl']+1;
if($udata['klass']==1)
{
$hp=$udata['hp1']+2;
$sila=$udata['sila1']+3;
$arm=$udata['arm1']+1;
}
if($udata['klass']==2)
{
$hp=$udata['hp1']+3;
$sila=$udata['sila1']+1;
$arm=$udata['arm1']+2;
}
if($udata['klass']==3)
{
$hp=$udata['hp1']+1;
$sila=$udata['sila1']+2;
$arm=$udata['arm1']+3;
}
mysql_query("UPDATE `users` SET `lvl`='".$kl."', `hp1`='".$hp."', `sila1`='".$sila."', `arm1`='".$arm."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `arena_usr` SET `hp`='".$udata['hp']."', `arm`='".$udata['arm']."', `sila`='".$udata['sila']."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='Ваш уровень повысился до ".$lvl."!'
");
header('location: ?');exit;
}}
if(isset($_GET['leave']))
{
if($bt['status']==1)
{
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['bz_exp']+1;
mysql_query("UPDATE `users_dost` SET `bz_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
if($udata['kv_d']==32)
{
$kol=$udata['kv_d_n']+$bt['kil'];
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($udata['kv_d']==33)
{
$kol=$udata['kv_d_n']+1;
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($udata['kv_d']==39)
{
$kol=$udata['kv_d_n']+1;
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($udata['exp_arena3']<5000)
{
$exp=2+round($bt['kil']);
}
else
{
$exp=0;
}
$ysl=mysql_num_rows(mysql_query("SELECT * FROM `item` WHERE `usr`='".$udata['id']."' and `tip`='arena'"));
if($ysl!=0)
{
$exp=$exp*2;
}
$ex=$udata['exp_arena3']+$exp;
$t=1+2*$bt['kil'];
if($udata['vip_exp']<100)
{$t=$t;}
elseif($udata['vip_exp']>=100 and $udata['vip_exp']<250)
{$t=$t;}
elseif($udata['vip_exp']>=250 and $udata['vip_exp']<500)
{$t=$t*2;}
elseif($udata['vip_exp']>=500 and $udata['vip_exp']<1300)
{$t=$t*2;}
elseif($udata['vip_exp']>=1300 and $udata['vip_exp']<2500)
{$t=$t*2;}
elseif($udata['vip_exp']>=2500 and $udata['vip_exp']<5000)
{$t=$t*3;}
elseif($udata['vip_exp']>=5000){$t=$t*3;}
$tok=$udata['token']+$t;
if($udata['lvl']>$udata['rang'])
{
$q=25;
$r=$udata['exp_rang']+$q;
}
else
{
$r=$udata['exp_rang']+0;
}
mysql_query("UPDATE `users` SET `token`='".$tok."', `arena_bz_kol`='".$kol."', `exp_arena3`='".$ex."', `exp_rang`='".$r."' WHERE `id`='".$udata['id']."'");
mysql_query("DELETE FROM `arena_usr` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `log_bz` WHERE `usr`='".$udata['id']."'");
mysql_query("UPDATE `mag` SET `time`='0' WHERE `usr`='".$udata['id']."'");
}
elseif($bt['status']==2)
{
$activ=mysql_query("SELECT * FROM `users_activ` WHERE `usr`='".$udata['id']."'");
$act=mysql_fetch_array($activ);
if($act['act_10']<1)
{
$kol=$act['act_10']+1;
mysql_query("UPDATE `users_activ` SET `act_10`='".$kol."' WHERE `usr`='".$udata['id']."'");
}
if($udata['kv_d']==32)
{
$kol=$udata['kv_d_n']+$bt['kil'];
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($udata['exp_arena3']<5000)
{
$exp=2+round($bt['kil']/2);
}
else
{
$exp=0;
}
$ex=$udata['exp_arena3']+$exp;
$t=1+1*$bt['kil'];
if($udata['vip_exp']<100)
{$t=$t;}
elseif($udata['vip_exp']>=100 and $udata['vip_exp']<250)
{$t=$t;}
elseif($udata['vip_exp']>=250 and $udata['vip_exp']<500)
{$t=$t*2;}
elseif($udata['vip_exp']>=500 and $udata['vip_exp']<1300)
{$t=$t*2;}
elseif($udata['vip_exp']>=1300 and $udata['vip_exp']<2500)
{$t=$t*2;}
elseif($udata['vip_exp']>=2500 and $udata['vip_exp']<5000)
{$t=$t*3;}
elseif($udata['vip_exp']>=5000){$t=$t*3;}
$tok=$udata['token']+$t;
$kol=$udata['arena_bz_kol']-1;
if($udata['lvl']>$udata['rang'])
{
$q=5;
$r=$udata['exp_rang']+$q;
}
else
{
$r=$udata['exp_rang']+0;
}
mysql_query("UPDATE `users` SET `token`='".$tok."', `arena_bz_kol`='".$kol."', `exp_arena3`='".$ex."', `exp_rang`='".$r."' WHERE `id`='".$udata['id']."'");
mysql_query("DELETE FROM `arena_usr` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `log_bz` WHERE `usr`='".$udata['id']."'");
mysql_query("UPDATE `mag` SET `time`='0' WHERE `usr`='".$udata['id']."'");
}
header('location: ?');exit;
}
if(isset($_GET['enemy']))
{
$id=mysql_real_escape_string($_GET['enemy']);
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `arena_usr` WHERE `status`='0' and `arr`='".$bt['arr']."' and `kom`!='".$bt['kom']."' and `id`='".$id."' and `time_kill`<'".time()."'"));
if($enemy!=0)
{
mysql_query("UPDATE `arena_usr` SET `enemy`='".$id."' WHERE `id`='".$bt['id']."'");
}
header('location: ?');exit;
}
if(isset($_GET['elic']))
{
$els=mysql_real_escape_string($_GET['elic']);
$elic=mysql_query("SELECT * FROM `elic` WHERE `id`='".$els."' and `usr`='".$udata['id']."' and `status`='on'");
$cd=mysql_num_rows($elic);
if($cd==0)
{
header('location: ?');exit;
}
else
{
$el=mysql_fetch_array($elic);
if($el['time']>time())
{
$lg='<img src=img/main/e22.png> <font color=#999999>Зелье еще не готово.</font>';
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
header('location: ?');exit;
}
if($bt['hp']==$udata['hp'] or $bt['hp']==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>нет эффекта.</font>';
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
header('location: ?');exit;
}
$hp=$bt['hp']+$el['ef'];
if($hp>$udata['hp'])
{
$hp=$udata['hp'];
}
mysql_query("UPDATE `arena_usr` SET `hp`='".$hp."' WHERE `id`='".$bt['id']."'");
$elk=$el['kol']-1;
if($elk==0)
{
mysql_query("DELETE FROM `elic` WHERE `id`='".$el['id']."'");
}
else
{
$time=time()+$el['rest'];
mysql_query("UPDATE `elic` SET `kol`='".$elk."', `time`='".$time."' WHERE `id`='".$el['id']."'");
}
if($el['ef']!=20000)
{
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/p21.png> <font color=#009900>Ты испил зелья и исцелился +".$el['ef']." <img src=img/main/p6.png></font>'
");
}
else
{
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/p21.png> <font color=#009900>Ты испил зелья и ваше здоровье востановилось <img src=img/main/p6.png></font>'
");
}
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['elic_exp']+1;
mysql_query("UPDATE `users_dost` SET `elic_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?');exit;
}
}
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `arena_usr` WHERE `status`='0' and `arr`='".$bt['arr']."' and `kom`!='".$bt['kom']."' and `id`='".$bt['enemy']."' and `time_kill`<'".time()."'"));
if($enemy==0 and $bt['enemy']!=0)
{
mysql_query("UPDATE `arena_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
$bts=mysql_fetch_array(mysql_query("SELECT * FROM `arena_usr` WHERE `id`='".$bt['enemy']."'"));
if($bts['tip']=='usr')
{
$ussb=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$bts['usr']."'"));
$en_name=' <img src=img/main/c'.$ussb['klass'].'.png> <img src=img/main/r'.$ussb['rasa'].'.png><font color=#ff9900>'.$ussb['usr'].'</font>';
if($ussb['ava']==0)
{
$img='<img src=img/pers/'.$ussb['klass'].''.$ussb['pol'].'.png>
';
}
else
{
$img='<img src=img/pers/ava/'.$ussb['ava'].'.png>';
}
}
$kill1=mysql_result(mysql_query("SELECT SUM(kil) FROM `arena_usr` WHERE `arr`='".$bt['arr']."' and `kom`='1'"),0);
$kill2=mysql_result(mysql_query("SELECT SUM(kil) FROM `arena_usr` WHERE `arr`='".$bt['arr']."' and `kom`='2'"),0);
if($kill1>=10 and $bt['status']==0)
{
mysql_query("UPDATE `arena_usr` SET `status`='1' WHERE `arr`='".$bt['arr']."' and `kom`='1'");
mysql_query("UPDATE `arena_usr` SET `status`='2' WHERE `arr`='".$bt['arr']."' and `kom`='2'");
header('location: ?');exit;
}
if($kill2>=10 and $bt['status']==0)
{
mysql_query("UPDATE `arena_usr` SET `status`='2' WHERE `arr`='".$bt['arr']."' and `kom`='1'");
mysql_query("UPDATE `arena_usr` SET `status`='1' WHERE `arr`='".$bt['arr']."' and `kom`='2'");
header('location: ?');exit;
}
include('files/head.php');
echo '
<div class="head brs bls v8 bts bbs p v12"><font color=#00ccff>
<img src=img/main/p6.png>'.$bt['hp'].' | '.$hpw.'
<font color=#ff0000>'.$bt['att'].'</font> | <font color=#ff0000>'.$bt['att2'].'</font>';
if($bt['enemy']!=0)
{
echo' | '.$en_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>';
}
}
if($bt['kom']==1)
{
echo '<table width=100%><tr>
<td colspan=1 align=left><font color=#009900>свои:</font> <b>'.$kill1.'</b></td>
<td colspan=1 align=right><b>'.$kill2.'</b> <font color=#ff0000>:враги</font></td>
</tr></table>';
}
if($bt['kom']==2)
{
echo '<table width=100%><tr>
<td colspan=1 align=left><font color=#009900>свои:</font> <b>'.$kill2.'</b></td>
<td colspan=1 align=right><b>'.$kill1.'</b> <font color=#ff0000>:враги</font></td>
</tr></table>';
}
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>';
}
echo '<div class=v8><div class="line bbs m bts brs bls b p v12">Бой</div><div class="box bts brs bls bbs p t2">';
if($bt['status']==0)
{
if($bt['time_kill']>time())
{
echo '<img src=img/main/i25.png> <font color=#ff0000>Ваш персонаж мертв. Воскрешение через:</font><br>';
$time=$bt['time_kill']-time();
$h=floor($time/3600);
$m=floor(($time-($h*3600))/60);
$s=$time-($h*3600)-($m*60);
$tim=$h.':'.$m.':'.$s;
echo '<img src=img/main/i25.png> <font color=#00ff99>'.$tim.'</font>';
}
else
{
if($bt['enemy']==0)
{
echo '<table>
<tr>
<td><img src=img/mob/0.jpg></td>
<td> -<i>Нет противника.</i></td>
</tr>
</table>';
}
else
{
echo '<table>
<tr>
<td>'.$img.'</td>
<td> -<i>'.$en_name.'</i><br>
<img src=img/main/p6.png>'.$bts['hp'].'
</td>
</tr>
</table>';
}
echo '</div><div class="bat p bts bbs brs bls">';
if($bt['time_us']<time())
{
echo'<a href=b_bz_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_bz_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_bz_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_bz_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=elic&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>';
}
}
elseif($bt['status']==1)
{
echo '<img src=img/main/i25.png> <font color=#00ff99>Ваша команда выйграла этот поединок. Ваша награда:</font>';
echo '<div class="v5 v8 p">';
if($udata['exp_arena3']<5000)
{
$exp=2+round($bt['kil']);
$rang1=mysql_fetch_array(mysql_query("SELECT * FROM `arena_rang_bz` WHERE `rang`='".$udata['rang_arena3']."'"));
echo'<img src=img/arena_rang/'.$udata['rang_arena3'].'.png><font color=#ffff00>'.$rang1['name'].'</font> ('.$udata['exp_arena3'].')
+ <font color=#ff0000>'.$exp.'</font><br>';
}
$tok=4+4*$bt['kil'];
$titz=mysql_query("SELECT * FROM `titul` WHERE `usr`='".$udata['id']."' and `status`='1' and `img`='100'");
$n_tit=mysql_num_rows($titz);
if($n_tit!=0)
{
$tok=$tok+4;
}
$titz1=mysql_query("SELECT * FROM `titul` WHERE `usr`='".$udata['id']."' and `status`='1' and `img`='101'");
$n_tit1=mysql_num_rows($titz1);
if($n_tit1!=0)
{
$tok=$tok+2;
}
$mobs=mysql_query("SELECT * FROM `item` WHERE `tip`='zarad' and `status`='on' and `usr`='".$udata['id']."' and `img`='2'");
$rows=mysql_num_rows($mobs);
if($rows!=0)
{
$tok=round($tok+$tok/100*20);
}
if($udata['vip_exp']<100)
{$tok=$tok;}
elseif($udata['vip_exp']>=100 and $udata['vip_exp']<250)
{$tok=$tok;}
elseif($udata['vip_exp']>=250 and $udata['vip_exp']<500)
{$tok=$tok*2;}
elseif($udata['vip_exp']>=500 and $udata['vip_exp']<1300)
{$tok=$tok*2;}
elseif($udata['vip_exp']>=1300 and $udata['vip_exp']<2500)
{$tok=$tok*2;}
elseif($udata['vip_exp']>=2500 and $udata['vip_exp']<5000)
{$tok=$tok*3;}
elseif($udata['vip_exp']>=5000){$tok=$tok*3;}
echo ' <img src=img/main/f23.png> Токены: <font color=#ff9900>+ '.$tok.'</font>';
echo'</div>';
echo '<img src=img/main/p12.png> <a href=?leave>Покинуть бой</a>';
}
elseif($bt['status']==2)
{
echo '<img src=img/main/i25.png> <font color=#ff0000>Ваша команда проиграла этот поединок. Ваша награда:</font>';
echo '<div class="v5 v8 p">';
if($udata['exp_arena3']<5000)
{
$exp=2+round($bt['kil']/2);
$rang1=mysql_fetch_array(mysql_query("SELECT * FROM `arena_rang_bz` WHERE `rang`='".$udata['rang_arena3']."'"));
echo'<img src=img/arena_rang/'.$udata['rang_arena3'].'.png><font color=#ffff00>'.$rang1['name'].'</font> ('.$udata['exp_arena3'].')
+ <font color=#ff0000>'.$exp.'</font><br>';
}
$tok=2+2*$bt['kil'];
$titz=mysql_query("SELECT * FROM `titul` WHERE `usr`='".$udata['id']."' and `status`='1' and `img`='100'");
$n_tit=mysql_num_rows($titz);
if($n_tit!=0)
{
$tok=$tok+4;
}
$titz1=mysql_query("SELECT * FROM `titul` WHERE `usr`='".$udata['id']."' and `status`='1' and `img`='101'");
$n_tit1=mysql_num_rows($titz1);
if($n_tit1!=0)
{
$tok=$tok+2;
}
$mobs=mysql_query("SELECT * FROM `item` WHERE `tip`='zarad' and `status`='on' and `usr`='".$udata['id']."' and `img`='2'");
$rows=mysql_num_rows($mobs);
if($rows!=0)
{
$tok=round($tok+$tok/100*20);
}
if($udata['vip_exp']<100)
{$tok=$tok;}
elseif($udata['vip_exp']>=100 and $udata['vip_exp']<250)
{$tok=$tok;}
elseif($udata['vip_exp']>=250 and $udata['vip_exp']<500)
{$tok=$tok*2;}
elseif($udata['vip_exp']>=500 and $udata['vip_exp']<1300)
{$tok=$tok*2;}
elseif($udata['vip_exp']>=1300 and $udata['vip_exp']<2500)
{$tok=$tok*2;}
elseif($udata['vip_exp']>=2500 and $udata['vip_exp']<5000)
{$tok=$tok*3;}
elseif($udata['vip_exp']>=5000){$tok=$tok*3;}
echo ' <img src=img/main/f23.png> Токены: <font color=#ff9900>+ '.$tok.'</font>';
echo'</div>';
echo '<img src=img/main/p11.png> <a href=?leave>Покинуть бой</a>';
}
echo '</div></div>';
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `arena_usr` WHERE `status`='0' and `arr`='".$bt['arr']."' and `kom`!='".$bt['kom']."'"));
if($enemy!=0)
{
echo '<div class=v8><div class="line bbs m bts brs bls b p v12">Противники</div><div class="bat bts brs bls bbs p t2">';
$eny=mysql_query("SELECT * FROM `arena_usr` WHERE `status`='0' and `time_kill`<'".time()."' and `arr`='".$bt['arr']."' and `kom`!='".$bt['kom']."'");
while($en=mysql_fetch_array($eny))
{
if($en['tip']=='usr')
{
$uss=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$en['usr']."'"));
echo ' <img src=img/main/c'.$uss['klass'].'.png> <img src=img/main/r'.$uss['rasa'].'.png> <a href=?enemy='.$en['id'].'><font color=#ffff00>'.$uss['usr'].'</font></a> [<img src=img/main/p6.png><font color=#ff0000>'.$en['hp'].'</font>] <img src=img/main/p10.png>'.$uss['lvl'].', ';
}
if($en['tip']=='pit')
{
$uss=mysql_fetch_array(mysql_query("SELECT * FROM `pit` WHERE `id`='".$en['pit']."' and `usr`='".$en['usr']."'"));
echo ' <a href=?enemy='.$en['id'].'><font color=#ff9900>'.$uss['name'].'</font></a> [<img src=img/main/p6.png><font color=#ff0000>'.$en['hp'].'</font>] <img src=img/main/p10.png>'.$uss['lvl'].', ';
}
if($en['tip']=='mob')
{
echo ' <a href=?enemy='.$en['id'].'><font color=#00ff99>'.$en['name'].'</font></a> [<img src=img/main/p6.png><font color=#ff0000>'.$en['hp'].'</font>], ';
}
}
echo '</div></div>';
}
$mobs=mysql_query("SELECT * FROM `log_bz` 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 m bts brs bls b p v12">Лог боя:</div><div class="bat bts brs bls bbs p t2">';
while($log=mysql_fetch_array($mobs))
{
echo $log['text'].'<br>';
}
}
}
echo '</div></div>';
echo '<div class="line m bbs bts brs bls b p v12">Лог игроков:</div><div class="bat bts brs bls bbs p t2">';
$mobsq=mysql_query("SELECT * FROM `arena_usr` WHERE `arr`='".$bt['arr']."' and `kom`='".$bt['kom']."' and `usr`>'1' and `status`!='2' and `tip`!='pit' ORDER BY `kil` DESC");
while($lus=mysql_fetch_array($mobsq))
{
$us=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$lus['usr']."'"));
echo '<img src=img/main/c'.$us['klass'].'.png> <img src=img/main/r'.$us['rasa'].'.png> <a href=info.php?id='.$us['id'].'>'.$us['usr'].'</a>
['.$lus['kil'].']<br>';
}
echo '</div>';
include('files/dwn.php');
?>