Файл: pdz_bt.php
Строк: 495
<?
define('PROTECTOR', 1);
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$textl='Битва';
include($path.'files/core.php');
$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']."'");
$npdz=mysql_num_rows(mysql_query("SELECT * FROM `pdz_usr` WHERE `usr`='".$udata['id']."'"));
if($npdz==0)
{
header('location: pdz.php');exit;
}
$bt=mysql_fetch_array(mysql_query("SELECT * FROM `pdz_usr` WHERE `usr`='".$udata['id']."'"));
$pdz_kom=mysql_fetch_array(mysql_query("SELECT * FROM `pdz_kom` WHERE `id`='".$bt['arr']."'"));
$pdz_komn=mysql_num_rows(mysql_query("SELECT * FROM `pdz_kom` WHERE `id`='".$bt['arr']."'"));
if($pdz_kom['status']==0 and $pdz_komn!=0)
{
header('location: pdz_b.php');exit;
}
$pdz=mysql_fetch_array(mysql_query("SELECT * FROM `pdz` WHERE `id`='".$pdz_kom['pdz']."'"));
$bts_num=mysql_num_rows(mysql_query("SELECT * FROM `pdz_mob` WHERE `id`='".$bt['enemy']."'"));
$bts=mysql_fetch_array(mysql_query("SELECT * FROM `pdz_mob` WHERE `id`='".$bt['enemy']."'"));
$en_name='<font color=#ff9900>'.$bts['name'].'</font>';
$nmb=mysql_num_rows(mysql_query("SELECT * FROM `pdz_mob` WHERE `arr`='".$pdz_kom['id']."'"));
if($nmb==0 and $pdz_kom['status']==1)
{
$vl=$pdz_kom['voln']-1;
if($vl>0)
{
$mobs1=mysql_query("SELECT * FROM `pdz_mb` WHERE `skill`='0' and `pdz`='".$pdz_kom['pdz']."'");
$mob1=mysql_fetch_array($mobs1);
for($neb_mob_num1=0; $neb_mob_num1++<5;)
{
$hp=$pdz_kom['lvl']*$mob1['hp'];
$sila=$pdz_kom['lvl']*$mob1['sila'];
$arm=$pdz_kom['lvl']*$mob1['arm'];
$ss=$pdz_kom['lvl']*$mob1['st_sila'];
if($pdz_kom['sl']==1){$hp=$hp*1;$sila=$sila*1;$arm=$arm*1;$ss=$ss*1;}
elseif($pdz_kom['sl']==2){$hp=$hp*1.4;$sila=$sila*1.3;$arm=$arm*1.2;$ss=$ss*1.3;}
elseif($pdz_kom['sl']==3){$hp=$hp*2;$sila=$sila*1.7;$arm=$arm*1.5;$ss=$ss*1.7;}
elseif($pdz_kom['sl']==4){$hp=$hp*3;$sila=$sila*2.2;$arm=$arm*1.8;$ss=$ss*2.2;}
elseif($pdz_kom['sl']==5){$hp=$hp*4.3;$sila=$sila*3;$arm=$arm*2.2;$ss=$ss*3;}
elseif($pdz_kom['sl']==6){$hp=$hp*6;$sila=$sila*4;$arm=$arm*2.7;$ss=$ss*4;}
if($pdz_kom['lvl']<=15){$hp=floor($hp/2);$sila=floor($sila/2);$arm=floor($arm/2);$ss=floor($ss/2);}
mysql_query("INSERT INTO `pdz_mob` SET
`id`='',
`arr`='".$pdz_kom['id']."',
`tip`='mob',
`name`='".$mob1['name']."',
`hp`='".$hp."',
`hp_max`='".$hp."',
`arm`='".$arm."',
`sila`='".$sila."',
`st_sila`='".$ss."',
`skill`='".$mob1['skill']."'
");
}
}
elseif($vl==0)
{
$mobs1=mysql_query("SELECT * FROM `pdz_mb` WHERE `skill`!='0' and `pdz`='".$pdz_kom['pdz']."'");
$mob1=mysql_fetch_array($mobs1);
for($neb_mob_num1=0; $neb_mob_num1++<1;)
{
$hp=$pdz_kom['lvl']*$mob1['hp'];
$sila=$pdz_kom['lvl']*$mob1['sila'];
$arm=$pdz_kom['lvl']*$mob1['arm'];
$ss=$pdz_kom['lvl']*$mob1['st_sila'];
if($pdz_kom['sl']==1){$hp=$hp*1;$sila=$sila*1;$arm=$arm*1;$ss=$ss*1;}
elseif($pdz_kom['sl']==2){$hp=$hp*1.4;$sila=$sila*1.3;$arm=$arm*1.2;$ss=$ss*1.3;}
elseif($pdz_kom['sl']==3){$hp=$hp*2;$sila=$sila*1.7;$arm=$arm*1.5;$ss=$ss*1.7;}
elseif($pdz_kom['sl']==4){$hp=$hp*3;$sila=$sila*2.2;$arm=$arm*1.8;$ss=$ss*2.2;}
elseif($pdz_kom['sl']==5){$hp=$hp*4.3;$sila=$sila*3;$arm=$arm*2.2;$ss=$ss*3;}
elseif($pdz_kom['sl']==6){$hp=$hp*6;$sila=$sila*4;$arm=$arm*2.7;$ss=$ss*4;}
mysql_query("INSERT INTO `pdz_mob` SET
`id`='',
`arr`='".$pdz_kom['id']."',
`tip`='mob',
`name`='".$mob1['name']."',
`hp`='".$hp."',
`hp_max`='".$hp."',
`arm`='".$arm."',
`sila`='".$sila."',
`st_sila`='".$ss."',
`skill`='".$mob1['skill']."'
");
}
}
if($vl>=0)
{
mysql_query("UPDATE `pdz_kom` SET `voln`='".$vl."' WHERE `id`='".$pdz_kom['id']."'");
}
else
{
$mobsq=mysql_query("SELECT * FROM `pdz_usr` WHERE `arr`='".$pdz_kom['id']."' and `status`!='2' and `tip`!='pit' ORDER BY `yr` DESC");
while($lus=mysql_fetch_array($mobsq))
{
$rand=rand(1,5);
if($rand==1){$t1='item';$t2='item';$t3='money';$t4='mifril';$t5='token';}
elseif($rand==2){$t1='money';$t2='item';$t3='money';$t4='bez';$t5='mifril';}
elseif($rand==3){$t1='money';$t2='jet';$t3='bez';$t4='almaz';$t5='mifril';}
elseif($rand==4){$t1='almaz';$t2='jet';$t3='money';$t4='mifril';$t5='item';}
elseif($rand==5){$t1='token';$t2='item';$t3='money';$t4='money';$t5='bez';}
mysql_query("INSERT INTO `pdz_syndyk` SET
`id`='',
`usr`='".$lus['usr']."',
`tip`='".$t1."',
`status`='0'
");
mysql_query("INSERT INTO `pdz_syndyk` SET
`id`='',
`usr`='".$lus['usr']."',
`tip`='".$t2."',
`status`='0'
");
mysql_query("INSERT INTO `pdz_syndyk` SET
`id`='',
`usr`='".$lus['usr']."',
`tip`='".$t3."',
`status`='0'
");
mysql_query("INSERT INTO `pdz_syndyk` SET
`id`='',
`usr`='".$lus['usr']."',
`tip`='".$t4."',
`status`='0'
");
mysql_query("INSERT INTO `pdz_syndyk` SET
`id`='',
`usr`='".$lus['usr']."',
`tip`='".$t5."',
`status`='0'
");
}
mysql_query("UPDATE `pdz_usr` SET `status`='1' WHERE `arr`='".$pdz_kom['id']."' and `status`='0'");
mysql_query("UPDATE `pdz_kom` SET `status`='2', `yr`='".$kyr."' WHERE `id`='".$pdz_kom['id']."'");
}
header('location: ?');exit;
}
$enemy_us=mysql_num_rows(mysql_query("SELECT * FROM `pdz_mob` WHERE `id`='".$bt['enemy']."'"));
if($bt['enemy']==0 or $enemy_us==0)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `pdz_mob` WHERE `arr`='".$pdz_kom['id']."'"));
if($enemy!=0){
$bts1=mysql_fetch_array(mysql_query("SELECT * FROM `pdz_mob` WHERE `arr`='".$pdz_kom['id']."' ORDER BY `id` ASC"));
$bts2=mysql_fetch_array(mysql_query("SELECT * FROM `pdz_mob` WHERE `arr`='".$pdz_kom['id']."' ORDER BY `id` DESC"));
$r=rand($bts1['id'],$bts2['id']);
$bts_en=mysql_fetch_array(mysql_query("SELECT * FROM `pdz_mob` WHERE `arr`='".$pdz_kom['id']."' and `id`='".$r."' ORDER BY `id` ASC"));
mysql_query("UPDATE `pdz_usr` SET `enemy`='".$bts_en['id']."' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
}
if(isset($_GET['enemy']))
{
$id=mysql_real_escape_string($_GET['enemy']);
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `pdz_mob` WHERE `id`='".$id."' and `arr`='".$pdz_kom['id']."'"));
if($enemy!=0)
{
mysql_query("UPDATE `pdz_usr` SET `enemy`='".$id."' WHERE `id`='".$bt['id']."'");
}
header('location: ?');exit;
}
include('pdz_bt2.php');
if(isset($_GET['leave']))
{
if($bt['status']==1 or $bt['status']==2)
{
if($bt['status']==1)
{
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['pdz_exp']+1;
mysql_query("UPDATE `users_dost` SET `pdz_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
}
if($udata['kv_d']==25 and $bt['status']==1)
{
$kol=$udata['kv_d_n']+1;
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($udata['kv_d']==26)
{
$kol=$udata['kv_d_n']+$bt['yr'];
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($udata['kv_d']==35 and $bt['status']==1 and $pdz_kom['lvl']>=25)
{
$kol=$udata['kv_d_n']+1;
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($udata['kv_d']==38 and $bt['status']==1 and $pdz_kom['lvl']>=40)
{
$kol=$udata['kv_d_n']+1;
mysql_query("UPDATE `users` SET `kv_d_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
mysql_query("DELETE FROM `log_pdz` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `pdz_usr` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `pdz_syndyk` WHERE `usr`='".$udata['id']."'");
if($udata['id']==$pdz_kom['lider'])
{
$kgg=mysql_fetch_array(mysql_query("SELECT * FROM `pdz_usr` WHERE `arr`='".$pdz_kom['id']."'"));
$kggf=mysql_num_rows(mysql_query("SELECT * FROM `pdz_usr` WHERE `arr`='".$pdz_kom['id']."' and `usr`!='".$udata['id']."'"));
if($kggf==0){
mysql_query("DELETE FROM `pdz_kom` WHERE `id`='".$pdz_kom['id']."'");
mysql_query("DELETE FROM `pdz_mob` WHERE `arr`='".$pdz_kom['id']."'");
}
else
{
mysql_query("UPDATE `pdz_kom` SET `lider`='".$kgg['usr']."' WHERE `id`='".$pdz_kom['id']."'");
}
}
}
header('location: ?');exit;
}
if(isset($_GET['s']))
{
if($bt['status']==1)
{
$s=mysql_real_escape_string($_GET['s']);
$sk=mysql_query("SELECT * FROM `pdz_syndyk` WHERE `usr`='".$udata['id']."' and `id`='".$s."' and `status`='0'");
$num=mysql_num_rows($sk);
if($num!=0)
{
$sn=mysql_fetch_array($sk);
$synd2=mysql_num_rows(mysql_query("SELECT * FROM `pdz_syndyk` WHERE `usr`='".$udata['id']."' and `status`='1'"));
if($synd2==0){$m=0;$d=0;}
elseif($synd2==1){$m=$pdz_kom['lvl']*2;$d=0;}
elseif($synd2==2){$m=$pdz_kom['lvl']*5;$d=0;}
elseif($synd2==3){$d=1;$m=0;}
elseif($synd2==4){$d=3;$m=0;}
if($udata['money']>=$m and $udata['jem']>=$d)
{
$mon=0;
$mif=0;
$jet=0;
$alm=0;
$tok=0;
$bez=0;
if($pdz_kom['sl']==1){$sl=2;}
elseif($pdz_kom['sl']==2){$sl=2.5;}
elseif($pdz_kom['sl']==3){$sl=3.5;}
elseif($pdz_kom['sl']==4){$sl=5;}
elseif($pdz_kom['sl']==5){$sl=10;}
if($sn['tip']=='money')
{
$mon=floor(($pdz_kom['lvl']+$pdz_kom['voln_max'])*$sl);
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#0f0>Открыв сундук вы получаете: <img src=img/main/p5.png>".$mon."</font>',
`pdz`='".$pdz_kom['id']."'
");
}
elseif($sn['tip']=='mifril')
{
$mif=floor((($pdz_kom['lvl']+$pdz_kom['voln_max'])/3)*$sl);
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#0f0>Открыв сундук вы получаете: <img src=img/main/m1.png>".$mif."</font>',
`pdz`='".$pdz_kom['id']."'
");
}
elseif($sn['tip']=='token')
{
$tok=floor((($pdz_kom['lvl']+$pdz_kom['voln_max'])/3)*$sl);
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#0f0>Открыв сундук вы получаете: <img src=img/main/f23.png>".$tok."</font>',
`pdz`='".$pdz_kom['id']."'
");
}
elseif($sn['tip']=='jet')
{
$jet=floor((($pdz_kom['lvl']+$pdz_kom['voln_max'])/3)*$sl);
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#0f0>Открыв сундук вы получаете: <img src=img/main/r21.png>".$jet."</font>',
`pdz`='".$pdz_kom['id']."'
");
}
elseif($sn['tip']=='bez')
{
$bez=floor((($pdz_kom['lvl']+$pdz_kom['voln_max'])/5)*$sl);
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#0f0>Открыв сундук вы получаете: <img src=img/main/rt.png>".$bez."</font>',
`pdz`='".$pdz_kom['id']."'
");
}
elseif($sn['tip']=='almaz')
{
$alm=floor((($pdz_kom['lvl']+$pdz_kom['voln_max'])/5)*$sl);
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#0f0>Открыв сундук вы получаете: <img src=img/main/23f.png>".$alm."</font>',
`pdz`='".$pdz_kom['id']."'
");
}
elseif($sn['tip']=='item')
{
if($pdz_kom['sl']==1){$sl=2;$rang=0;}
elseif($pdz_kom['sl']==2){$sl=2.2;$rang=5;}
elseif($pdz_kom['sl']==3){$sl=2.4;$rang=10;}
elseif($pdz_kom['sl']==4){$sl=2.7;$rang=15;}
elseif($pdz_kom['sl']==5){$sl=3;$rang=20;}
$statas=floor($pdz_kom['lvl']*$sl);
$slot=rand(1,5);
if($slot==1){$tip='amylet';$img=rand(1,14);$name='Амулет ';}
elseif($slot==2){$tip='golova';$img=rand(1,14);$name='Шлем ';}
elseif($slot==3){$tip='telo';$img=rand(1,14);$name='Нагрудник ';}
elseif($slot==4){$tip='wearop';$img=rand(1,14);$name='Оружие ';}
elseif($slot==5){$tip='boots';$img=rand(1,14);$name='Боты ';}
$it_hp=rand(1,$statas);
$it_sila=rand(0,$statas-$it_hp);
$it_arm=rand(0,$statas-$it_hp-$it_sila);
$statasz=$statas-$it_hp-$it_arm-$it_sila;
if($statasz>10)
{
$it_krit=rand(0,round($statasz/10));
}
else{$it_krit=0;}
$statasz=$statas-$it_hp-$it_arm-$it_sila-$it_krit*10;
if($statasz>10)
{
$it_blok=rand(0,round($statasz/10));
}else{$it_blok=0;}
$statasz=$statas-$it_hp-$it_arm-$it_sila-$it_krit*10-$it_blok*10;
$it_hp=$it_hp+$statasz;
$nw=rand(1,15);
if($nw==1){$new='Гиены';}
if($nw==2){$new='Ветерана';}
if($nw==3){$new='Волкодава';}
if($nw==4){$new='Отшельника';}
if($nw==5){$new='Потрошителя';}
if($nw==6){$new='Смотрителя';}
if($nw==7){$new='Оракула';}
if($nw==8){$new='Сказителя';}
if($nw==9){$new='Берсерка';}
if($nw==10){$new='Послушника';}
if($nw==11){$new='Менестреля';}
if($nw==12){$new='Эрудита';}
if($nw==13){$new='Монаха';}
if($nw==14){$new='Бойца';}
if($nw==15){$new='Наемника';}
$name='<font color=#f22>'.$name.''.$new.'</font>';
$cena=$statas;
mysql_query("INSERT INTO `item` SET
`id`='',
`usr`='".$udata['id']."',
`name`='".$name."',
`cena`='".$cena."',
`pr`='100',
`img`='".$img."',
`lvl`='".$pdz_kom['lvl']."',
`rang`='".$rang."',
`hp`='".$it_hp."',
`sila`='".$it_sila."',
`arm`='".$it_arm."',
`tip`='".$tip."',
`status`='off',
`klass`='1',
`krit`='".$it_krit."',
`blok`='".$it_blok."'
");
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#0f0>Открыв сундук вы получаете:".$name."</font>',
`pdz`='".$pdz_kom['id']."'
");
}
$mon=$udata['money']-$m+$mon;
$mif=$udata['mifril']+$mif;
$jet=$udata['jet']+$jet;
$tok=$udata['token']+$tok;
$alm=$udata['tank']+$alm;
$bez=$udata['bez']+$bez;
$kris=$udata['jem']-$d;
mysql_query("UPDATE `users` SET `money`='".$mon."', `jem`='".$kris."', `mifril`='".$mif."', `jet`='".$jet."', `token`='".$tok."', `tank`='".$alm."', `bez`='".$bez."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `pdz_syndyk` SET `status`='1' WHERE `id`='".$sn['id']."'");
}
}
}
header('location: ?');exit;
}
include($path.'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><br>
<font color=#0099ff>Волн до босса:</font> '.$pdz_kom['voln'].'
</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="bat rr rt rl p">'.$giza['gorn'].'<br>
<img src=img/main/e55.png><a href=clan.php?gorn_def>Закрыть</a>
</div>';
}
echo '<div class="line m bts brs bls b p v12">Битва</div><div class="box bts brs bls bbs p t2">';
if($bt['status']==0)
{
if($bts_num!=0)
{
$hpp=$bts['hp_max']/100;
$hpp=$bts['hp']/$hpp;
echo '<table>
<tr>
<td><i>'.$en_name.'</i><br>
<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>
</td>
</tr>
</table></div>';
}
else
{
echo '<table>
<tr>
<td><img src=img/mob/0.jpg></td>
<td> -<i>Нет противника.</i></td>
</tr>
</table></div>';
}
echo '<div class="bat p bts bbs brs bls">';
if($bt['time_us']<time())
{
echo'<a href=pdz_bt_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=pdz_bt_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=pdz_bt_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=pdz_bt_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=pdz_bt_elic.php?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="v8"><div class="line m bbs bts brs bls b p v12">Твой противник:</div>';
echo '<div class="bat bts brs bls bbs p t2">';
$gr=mysql_query("SELECT * FROM `pdz_mob` WHERE `arr`='".$pdz_kom['id']."'");
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'].', ';
}
}
elseif($bt['status']==1)
{
echo '<font color=#00ff00>Подземелье пройдено! Выберите свою награду:</font><br>';
$synd=mysql_query("SELECT * FROM `pdz_syndyk` WHERE `usr`='".$udata['id']."'");
while($sd=mysql_fetch_array($synd))
{
if($sd['status']==0)
{
echo '<a href=?s='.$sd['id'].'><img src=img/main/pn.png></a> ';
}
else
{
echo '<a href=#><img src=img/main/pn.png style="opacity:0.3"></a> ';
}
}
echo '<div align=left><img src=img/main/1.png> Стоимость попытки: ';
$synd2=mysql_num_rows(mysql_query("SELECT * FROM `pdz_syndyk` WHERE `usr`='".$udata['id']."' and `status`='1'"));
if($synd2==0){echo '<font color=#ff9900>бесплатно</font>';}
elseif($synd2==1){$cena=$pdz_kom['lvl']*2; echo '<font color=#ff9900><img src=img/main/p5.png>'.$cena.'</font>';}
elseif($synd2==2){$cena=$pdz_kom['lvl']*5; echo '<font color=#ff9900><img src=img/main/p5.png>'.$cena.'</font>';}
elseif($synd2==3){$cena=1; echo '<font color=#ff9900><img src=img/main/p13.png>'.$cena.'</font>';}
elseif($synd2==4){$cena=3; echo '<font color=#ff9900><img src=img/main/p13.png>'.$cena.'</font>';}
echo '<br>';
echo '<img src=img/main/p5.png>'.$udata['money'].' ';
echo '<img src=img/main/p13.png>'.$udata['jem'].'';
echo'</div>';
echo '<img src=img/main/p11.png> <a href=?leave>Покинуть бой</a>';
}
elseif($bt['status']==2)
{
echo '<div align=center><i><b><font color=#00ff99>Вы погибли в этом бою.</font></b></i></div>';
echo '<img src=img/main/p11.png> <a href=?leave>Покинуть бой</a>';
}
echo '</div></div>';
$mobs=mysql_query("SELECT * FROM `log_pdz` 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 bbs m bts brs bls b p v12">Лог игроков:</div><div class="bat bts brs bls bbs p t2">';
$mobsq=mysql_query("SELECT * FROM `pdz_usr` WHERE `arr`='".$pdz_kom['id']."' and `status`!='2' and `tip`!='pit' ORDER BY `yr` 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['yr'].']<br>';
}
echo '</div>';
include('files/dwn.php');
?>