Файл: ar_m_b.php
Строк: 500
<?
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']."'");
$mobs=mysql_query("SELECT * FROM `craft` WHERE `usr`='".$udata['id']."'");
$rows=mysql_num_rows($mobs);
if($rows!=0)
{
header('location: work.php');exit;
}
$mobs1=mysql_query("SELECT * FROM `arena_usr` WHERE `usr`='".$udata['id']."'");
$rows1=mysql_num_rows($mobs1);
if($rows1!=0)
{
header('location: arena.php');exit;
}
$mobs3=mysql_query("SELECT * FROM `battle` WHERE `usr`='".$udata['id']."'");
$rows3=mysql_num_rows($mobs3);
if($rows3!=0)
{
header('location: battle.php');exit;
}
$mobs6=mysql_query("SELECT * FROM `str_usr` WHERE `usr`='".$udata['id']."'");
$rows6=mysql_num_rows($mobs6);
if($rows6!=0)
{
header('location: b_str.php');exit;
}
$mobs7=mysql_query("SELECT * FROM `terr_usr` WHERE `usr`='".$udata['id']."'");
$rows7=mysql_num_rows($mobs7);
if($rows7!=0)
{
header('location: terr_b.php');exit;
}
$bat=mysql_query("SELECT * FROM `arena_m_usr` WHERE `usr`='".$udata['id']."' and `tip`='usr'");
$num=mysql_num_rows($bat);
if($num==0)
{
header('location: game.php');exit;
}
else
{
$bt=mysql_fetch_array($bat);
$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 `okrest` SET `hp`='".$udata['hp']."', `arm`='".$udata['arm']."', `sila`='".$udata['sila']."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='Ваш уровень повысился до ".$lvl."!'
");
header('location: ?');exit;
}
}
$bts_mob=mysql_query("SELECT * FROM `arena_m_mob` WHERE `usr`='".$udata['id']."'");
$bts_num=mysql_num_rows($bts_mob);
if($bts_num==0)
{
if($bt['status']==0)
{
if($udata['kv_d']==11)
{
$kol=$udata['kv_d_n']+1;
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 3</font>'
");
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($udata['kv_d']==12)
{
$kol=$udata['kv_d_n']+1;
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 5</font>'
");
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($udata['kv_d']==20 and $bt['exp']==9)
{
$kol=$udata['kv_d_n']+1;
mysql_query("INSERT INTO `log_arena_m` 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']."'");
}
$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']==2 and $gus['kv_s_n']<3)
{
$rand=rand(1,5);
if($rand<=5)
{
$nd=$gus['kv_s_n']+1;
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$nd." из 3</font>'
");
mysql_query("UPDATE `clan_users` SET `kv_s_n`='".$nd."' WHERE `id`='".$gus['id']."'");
}
}
mysql_query("UPDATE `arena_m_usr` SET `status`='1' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
}
else
{
$bts=mysql_fetch_array($bts_mob);
}
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_arena_m` 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_arena_m` 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_m_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_arena_m` 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_arena_m` 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;
}
}
$en=mysql_num_rows(mysql_query("SELECT * FROM `arena_m_mob` WHERE `usr`='".$bt['usr']."' and `time_us`<'".time()."'"));
if($en!=0)
{
$ed=mysql_query("SELECT * FROM `arena_m_mob` WHERE `usr`='".$bt['usr']."' and `time_us`<'".time()."'");
while($ens=mysql_fetch_array($ed))
{
if($ens['sfer_so']>time())
{
}
else
{
$r=rand(1,8);
if($r==1)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `arena_m_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `id` DESC"));
}
if($r==2)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `arena_m_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `id` ASC"));
}
if($r==3)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `arena_m_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `hp` DESC"));
}
if($r==4)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `arena_m_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `hp` ASC"));
}
if($r==5)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `arena_m_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `sila` ASC"));
}
if($r==6)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `arena_m_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `sila` DESC"));
}
if($r==7)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `arena_m_usr` WHERE `usr`='".$ens['usr']."' and `status`='0' ORDER BY `arm` DESC"));
}
if($r==8)
{
$btt=mysql_fetch_array(mysql_query("SELECT * FROM `arena_m_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 and $btt['tip']=='usr')
{
$lg12='<img src=img/main/b23.png> Вы заблокировали атаку <font color=#ffff00><font color=#00ff99>'.$ens['name'].'</font></font>.';
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$ssb['id']."',
`text`='".$lg12."'
");
$tim=time()+10;
mysql_query("UPDATE `arena_m_mob` SET `time_us`='".$tim."' WHERE `id`='".$ens['id']."'");
}
else
{
if($btt['tip']=='pit')
{
if($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_arena_m` SET
`id`='',
`usr`='".$btt['usr']."',
`text`='".$lg."'
");
}
$tim=time()+10;
mysql_query("UPDATE `arena_m_mob` SET `time_us`='".$tim."' WHERE `id`='".$ens['id']."'");
}
$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())
{
$dmg=round($dmg-$dmg/100*$btt['sfer_6_ef']);
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);
}
}
$m_dmg=round($ens['sila']/4);
$h_us=$btt['hp']-$dmg-$m_dmg;
$lg12='<img src=img/main/b23.png> <font color=#ff0000><font color=#00ff99>'.$ens['name'].'</font> ударил '.$en_namet.' -'.$dmg.' -<font color=#ff00ff>'.$m_dmg.'</font></font>.';
mysql_query("INSERT INTO `log_arena_m` 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_arena_m` SET
`id`='',
`usr`='".$btt['usr']."',
`text`='".$lg12."'
");
if($btt['tip']!='pit')
{
mysql_query("UPDATE `arena_m_usr` SET `hp`='0', `att2`='".$dmg."', `status`='2' WHERE `id`='".$btt['id']."'");
}
else
{
mysql_query("DELETE FROM `arena_m_usr` WHERE `id`='".$btt['id']."'");
}
}
else
{
$att2=$dmg+$m_dmg;
mysql_query("UPDATE `arena_m_usr` SET `hp`='".$h_us."', `att2`='".$att2."' WHERE `id`='".$btt['id']."'");
if($btt['sfer_10_time']>=time())
{
$yrs=round(($dmg+$m_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_arena_m` 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_arena_m` SET
`id`='',
`usr`='".$btt['usr']."',
`text`='".$lg2."'
");
$ds=$ssb['dost2a']+1;
mysql_query("UPDATE `users` SET `dost2a`='".$ds."' WHERE `id`='".$ssb['id']."'");
mysql_query("DELETE FROM `arena_m_mob` WHERE `id`='".$ens['id']."'");
}
else
{
mysql_query("UPDATE `arena_m_mob` SET `hp`='".$hpz."' WHERE `id`='".$ens['id']."'");
}
mysql_query("UPDATE `arena_m_usr` SET `att`='".$yrs."' WHERE `id`='".$btt['id']."'");
}
}
$tim=time()+10;
mysql_query("UPDATE `arena_m_mob` SET `time_us`='".$tim."' WHERE `id`='".$ens['id']."'");
}
}
}
}
include('b_ar_m2.php');
if(isset($_GET['leav']))
{
if($bt['status']==1)
{
if($udata['exp_arena1']<10000)
{
$ysl=mysql_num_rows(mysql_query("SELECT * FROM `item` WHERE `usr`='".$udata['id']."' and `tip`='arena'"));
if($ysl!=0)
{
$bt['exp']=$bt['exp']*2;
}
$exps=$udata['exp_arena1']+$bt['exp'];
}
else
{
$exps=$udata['exp_arena1']+0;
}
if($udata['vip_exp']<100)
{$vip_z=0;}
elseif($udata['vip_exp']>=100 and $udata['vip_exp']<250)
{$vip_z=0;}
elseif($udata['vip_exp']>=250 and $udata['vip_exp']<500)
{$vip_z=1;}
elseif($udata['vip_exp']>=500 and $udata['vip_exp']<1300)
{$vip_z=1;}
elseif($udata['vip_exp']>=1300 and $udata['vip_exp']<2500)
{$vip_z=1;}
elseif($udata['vip_exp']>=2500 and $udata['vip_exp']<5000)
{$vip_z=2;}
elseif($udata['vip_exp']>=5000){$vip_z=2;}
$mon=$udata['token']+1+$vip_z;
mysql_query("UPDATE `users` SET `token`='".$mon."', `exp_arena1`='".$exps."' WHERE `id`='".$udata['id']."'");
}
mysql_query("DELETE FROM `arena_m_usr` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `arena_m_mob` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `log_arena_m` WHERE `usr`='".$udata['id']."'");
mysql_query("UPDATE `mag` SET
`time`='0' WHERE `usr`='".$udata['id']."'");
header('location: arena.php?ar=mob');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($bts_num!=0)
{
echo ' | '.$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>';
}
echo '<table width=100%><tr><td width=65%>';
echo '<div class="line bts bbs brs bls p m" style="border-radius: 7px 0 0 7px">
Битва
</div>
</td>
<td>
<a href=?leav><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">';
if($bt['status']==0)
{
$mobas=mysql_fetch_array(mysql_query("SELECT hp FROM `arena_mob` WHERE `name`='".$bts['name']."'"));
if($udata['rang_arena1']==0){$mobas['hp']=$mobas['hp'];$sila=$sila;$arm=$arm;}
if($udata['rang_arena1']==1){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*20);}
if($udata['rang_arena1']==2){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*40);}
if($udata['rang_arena1']==3){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*80);}
if($udata['rang_arena1']==4){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*150);}
if($udata['rang_arena1']==5){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*260);}
if($udata['rang_arena1']==6){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*400);}
if($udata['rang_arena1']==7){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*550);}
if($udata['rang_arena1']==8){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*700);}
if($udata['rang_arena1']==9){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*1000);}
if($bt['exp']==3){$mobas['hp']=$mobas['hp'];}
elseif($bt['exp']==6){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*25);}
elseif($bt['exp']==9){$mobas['hp']=round($mobas['hp']+$mobas['hp']/100*50);}
$hpp=$mobas['hp']/100;
$hpp=$bts['hp']/$hpp;
echo '<table width=100%>';
echo '<tr>';
echo '<td width=70px><img src=img/mob/arena_mob/'.$bts['img'].'.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=ar_m_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=ar_m_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=ar_m_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=ar_m_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='.$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 bls m p">Твой противник:</div>';
echo '<div class="bat bts brs bls bbs p"><font color=#cccccc>';
echo ''.$bts['name'].' <img src=img/main/p6.png>'.$bts['hp'].'</font></div>';
}
elseif($bt['status']==1)
{
echo '<div align=center><img src=img/inter/win.jpg></div>
<img src=img/main/b18.png> Вы победили! Бой завершен!<br>';
if($udata['exp_arena1']<10000)
{
$rang1=mysql_fetch_array(mysql_query("SELECT * FROM `arena_rang_mob` WHERE `rang`='".$udata['rang_arena1']."'"));
echo'<img src=img/arena_rang/'.$udata['rang_arena1'].'.png><font color=#ffff00>'.$rang1['name'].'</font> ('.$udata['exp_arena1'].')
+ <font color=#ff0000>'.$bt['exp'].'</font><br>';
}
$tok=$bt['exp']/3;
echo '<img src=img/main/f23.png>Токены: <font color=#ff9900>+ 1</font><br>';
echo'
<a href=?leav><img src=img/main/p21.png> Покинуть бой</a>
</div>
';
}
elseif($bt['status']==2)
{
echo '<div align=center><img src=img/inter/lose.jpg></div>
<img src=img/main/b18.png> Вы проиграли! Бой завершен!<br>
<a href=?leav><img src=img/main/p21.png> Покинуть бой</a>
</div>
';
}
$mobs=mysql_query("SELECT * FROM `log_arena_m` WHERE `usr`='".$udata['id']."' ORDER BY `id` DESC LIMIT 10");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
}
else
{
echo '<div class="line bts brs bls p m">Лог боя:</div><div class="bat bts brs bls bbs p">';
while($log=mysql_fetch_array($mobs))
{
echo $log['text'].'<br>';
}
}
}
echo '</div>';
include('files/dwn.php');
?>