Вход Регистрация
Файл: survival/forgotten-cave/fight.php
Строк: 429
<?
require_once'../../core/system.php';
$header='Забытая пещера';
require_once
'../../core/head.php';

$req mysql_query("SELECT * from `ban` where `id_us` = '".$user['id']."'  and `time`>'".$_SERVER['REQUEST_TIME']."'");
$ban mysql_fetch_array($req);

if(
$ban['ban'] == 3){

    
header('Location: /moduls/ban');

}

if(
$ban['ban'] == 2){
header('Location: /');
$_SESSION['err'] = "Вы находитесь в бане!";
exit;
}

if(!isset(
$user['id'])) header('Location: /');

if(
$user['mesto']!='Бой'mysql_query("UPDATE `user` set `mesto` = 'Бой' where `id` = '".$user['id']."'");

$reqm mysql_query("SELECT * FROM `survival` WHERE `usr`='".$user['id']."' and `what`='1'");
$avtno mysql_num_rows($reqm);
$gde mysql_fetch_array($reqm);
$h=$gde['wave']*0.06*$user['max_health'];
$z=$gde['wave']*0.06*$user['zashit'];
$sik=$gde['wave']*0.06*$user['sila'];
if(
$avtno==0){
mysql_query("INSERT INTO `survival` SET `usr`='".$user['id']."', `what`='1', `time`='".$_SERVER['REQUEST_TIME']."'+'86400', `wave`='1'");
header ("Location: ?");exit;}

$timer=$_SERVER['REQUEST_TIME']+300;
$req mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `s`='1'");
$avto mysql_num_rows($req);
$reqn mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `s`='1' and `status`='no'");
$avtod mysql_num_rows($reqn);
if(
$avtod>and $user['health']>0){
mysql_query("DELETE FROM `battle` WHERE `usr`='".$user['nick']."'");
mysql_query("DELETE FROM `duellog` WHERE `usr`='".$user['nick']."'");
mysql_query("DELETE FROM `link` WHERE `usr`='".$user['id']."'");
mysql_query("UPDATE `survival` SET `time`='".$_SERVER['REQUEST_TIME']."'+'86400', `exp`='',`wins`='', `wave`='1' WHERE `usr`='".$user['id']."'");
header ("Location: ?");exit;}
if(
$user['battle']==and $user['health']>0){ 
mysql_query("DELETE FROM `battle` WHERE `usr`='".$user['nick']."'");
mysql_query("DELETE FROM `duellog` WHERE `usr`='".$user['nick']."'");
mysql_query("DELETE FROM `link` WHERE `usr`='".$user['id']."'");
mysql_query("UPDATE `survival` SET `time`='".$_SERVER['REQUEST_TIME']."'+'86400', `exp`='',`wins`='', `wave`='1' WHERE `usr`='".$user['id']."'");
}
if(
$avto==and $user['health']>0){
$t=$_SERVER['REQUEST_TIME']+3600;
$nextudar=rand(3,12);
$nextud=$_SERVER['REQUEST_TIME']+$nextudar;
$nextudd=$_SERVER['REQUEST_TIME']+$nextudar+2;

mysql_query("INSERT INTO `link` SET `usr`='".$user['id']."',`timer`='".$_SERVER['REQUEST_TIME']."'+'3600', `link`='$_SERVER[PHP_SELF]'");
mysql_query("INSERT INTO `battle` SET `usr`='".$user['nick']."', `name`='Ядовитый паук', `status`='', `s`='1', `hpmax`='$h', `hp`='$h', `sila`='$sik', `prot`='$z', `time`='$t', `nextud`='$nextud'");
mysql_query("INSERT INTO `battle` SET `usr`='".$user['nick']."', `name`='Огромный паук', `status`='', `s`='1', `hpmax`='$h', `hp`='$h', `sila`='$sik', `prot`='$z', `time`='$t', `nextud`='$nextudd'");
mysql_query("UPDATE `user` SET `battle`='1' WHERE `id`='".$user['id']."'");
mysql_query("DELETE FROM `duellog` WHERE `usr`='".$user['nick']."'");
header ("Location: ?");exit;}

if(
$user['battle']==0){
$_SESSION['err'] = ' Ошибка';
header ("Location: /");exit;}

$kols mysql_result(mysql_query("SELECT  COUNT(*)  FROM `battle` WHERE `usr`='".$user['nick']."' and `s`='1' and `status`=''"),0);
if(
$kols==and $user['health']>0){
$t=$_SERVER['REQUEST_TIME']+3600;
$nextudar=rand(3,12);
$nextudd=$_SERVER['REQUEST_TIME']+$nextudar+2;
$nextuddd=$_SERVER['REQUEST_TIME']+$nextudar;
$mbb=rand(1,3); 
if(
$mbb==1){mysql_query("INSERT INTO `battle` SET `usr`='".$user['nick']."', `name`='Скелет', `status`='', `s`='1', `hpmax`='$h', `hp`='$h', `sila`='$sik', `prot`='$z', `time`='$t', `nextud`='$nextuddd', `boss`='0'");}
if(
$mbb==2){mysql_query("INSERT INTO `battle` SET `usr`='".$user['nick']."', `name`='Ядовитый паук', `status`='', `s`='1', `hpmax`='$h', `hp`='$h', `sila`='$sik', `prot`='$z', `time`='$t', `nextud`='$nextudd', `boss`='0'");
mysql_query("INSERT INTO `battle` SET `usr`='".$user['nick']."', `name`='Огромный паук', `status`='', `s`='1', `hpmax`='$h', `hp`='$h', `sila`='$sik', `prot`='$z', `time`='$t', `nextud`='$nextuddd', `boss`='0'");}
if(
$mbb==3){
mysql_query("INSERT INTO `battle` SET `usr`='".$user['nick']."', `name`='Голодная крыса', `status`='', `s`='1', `hpmax`='$h', `hp`='$h', `sila`='$sik', `prot`='$z', `time`='$t', `nextud`='$nextudd', `boss`='0'");
mysql_query("INSERT INTO `battle` SET `usr`='".$user['nick']."', `name`='Голодная крыса', `status`='', `s`='1', `hpmax`='$h', `hp`='$h', `sila`='$sik', `prot`='$z', `time`='$t', `nextud`='$nextuddd', `boss`='0'");
mysql_query("INSERT INTO `battle` SET `usr`='".$user['nick']."', `name`='Тарантул', `status`='', `s`='1', `hpmax`='$h', `hp`='$h', `sila`='$sik', `prot`='$z', `time`='$t', `nextud`='$nextudd', `boss`='0'");}
}

if(isset(
$_GET['healing'])){
$reqx mysql_query("SELECT * FROM `umen` WHERE `usr` = '".$user['id']."' and `img`='healing'");
$healing mysql_fetch_array($reqx);
$vrem $_SERVER['REQUEST_TIME']+$healing['time'];
if(
$healing['timer']>''.$_SERVER['REQUEST_TIME'].'' or $user['health']<=0){$_SESSION['err']="Промах";
header ("Location: ?");exit;}
if(
$user['health']>=$user['max_health']){$_SESSION['err']="Лечение не требуется";
header ("Location: ?");exit;}else{
$u=rand($user['sila']-$user['sila']/8,$user['sila']);
$kolhp=$u*$healing['sila'];
$kolhp=round($kolhp,0);
mysql_query("UPDATE `umen` SET `timer` = '$vrem' WHERE `usr`='".$user['id']."' and `img`='healing'");
$xphe=$user['health']+$kolhp;
$um mysql_num_rows(mysql_query("SELECT * FROM `bonus` WHERE `usr`='".$user['id']."' and `typ`='3'"));
if(
$um>0){$kolexp=$kolhp*2;}else{$kolexp=$kolhp;}
if(
$setgame['exp']==1)$kolexp=$kolexp*2;
if(
$xphe<=$user['max_health']){mysql_query("UPDATE `user` SET `health` = `health`+'$kolhp', `exp` = `exp`+'$kolexp' WHERE `id`='".$user['id']."'");}else{
mysql_query("UPDATE `user` SET `health` = '$user[max_health]', `exp` = `exp`+'$kolhp' WHERE `id`='".$user['id']."'");}
$_SESSION['message']="Вы использовали <img src=/images/umen/healing.png height=16 width=16> <font color=#FFBF00>Исцеление</font> <img src=/images/icon/stat/hp.png>+".$kolhp."";
header ("Location: ?");exit;
}}
if(isset(
$_GET['gift_of_the_Gods'])){
$reqxs mysql_query("SELECT * FROM `umen` WHERE `usr` = '".$user['id']."' and `img`='gift_of_the_Gods'");
$gift mysql_fetch_array($reqxs);
$vrem $_SERVER['REQUEST_TIME']+$gift['time']+30;
if(
$gift['timer']>''.$_SERVER['REQUEST_TIME'].''){$_SESSION['err']="Промах";
header ("Location: ?");exit;}
$umen mysql_fetch_array(mysql_query("SELECT * FROM `umen` WHERE `usr`='".$user['id']."' and `img`='gift_of_the_Gods'"));
$dar=100*$umen['sila'];
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Дар Богов',`kol`='$dar',`param`='sila', `time` = '$vrem'-'$gift[time]', `bonus`='+$dar% к урону', `image`='14',`typ`='0'");
mysql_query("UPDATE `umen` SET `timer` = '$vrem' WHERE `usr`='".$user['id']."' and `img`='gift_of_the_Gods'");
$_SESSION['message']="Вы использовали <img src='/images/umen/gift_of_the_Gods.png' height='16px' width='16px'> <font color='#3B9CF6'>Дар Богов</font> +".$dar."% к урону";
header ("Location: ?");
exit;}
if(isset(
$_GET['udar'])){
$ureq mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `s`='1' and `id`='$id'");
$mobc mysql_fetch_array($ureq);
if(empty(
$id)){$_SESSION['err']="Не выбран противник";
header ("Location: ?");exit;}
if(
$mobc['hp']<=or $user['health']<=0){$_SESSION['err']="Промах";
header ("Location: ?");exit;}
$req mysql_query("SELECT * FROM `umen` WHERE `usr` = '".$user['id']."' and `img`='whack'");
$umen mysql_fetch_array($req);
$summastat $mobc['hpmax']+$mobc['sila']+$mobc['prot'];
$p=$mobc['prot']/$summastat;
$y=1-$p;
$u=rand($user['sila']-$user['sila']/8,$user['sila']);
$udar=$u*$y;
if(isset(
$_GET['whack'])){$udar=$udar*$umen['sila'];}else{$udar=$u*$y;}
$udar=round($udar,0);
$dar mysql_query("SELECT * FROM `bonus` WHERE `usr`='".$user['id']."' and `time`>'$tm' and `name`='Дар Богов'");
$adar=mysql_num_rows($dar);
$kdar=mysql_fetch_array($dar);
if(
$adar>0){
$kolik=$kdar['kol']/100;
$udar=floor($udar+($udar*$kolik));}
$uron=$mobc['hp']-$udar;

$ool=$user['online']+300;
$sec=$timer-$ool;
if(
$sec<1){$_SESSION['err']="Промах";
header ("Location: ?");exit;}

if(
$udar>$user['max_uron']){mysql_query("UPDATE `user` SET `max_uron` = '$udar' WHERE `id`='".$user['id']."' LIMIT 1");}
$ttur=rand(1,4); 
if(
$ttur==1){$ttur='ударили'; }
if(
$ttur==2){$ttur='поразили';}
if(
$ttur==3){$ttur='сразили';}
if(
$ttur==4){$ttur='зацепили';}

$sms="$ttur $mobc[name]";
if(
$uron<=0){
$ttud=rand(1,5);
if(
$ttud==1){$ttud='убили';}
if(
$ttud==2){$ttud='уничтожили';}
if(
$ttud==3){$ttud='разгромили';}
if(
$ttud==4){$ttud='сокрушили';}
if(
$ttud==5){$ttud='победили';}
$whack mysql_num_rows(mysql_query("SELECT * FROM `task` WHERE `usr`='".$user['id']."' and `status`='2' and `task`='25'"));
if(
$whack>0){mysql_query("UPDATE `task` SET `min` = `min`+'1'  WHERE `usr`='".$user['id']."' and `status`='2' and `task`='25'");}
 

mysql_query("UPDATE `battle` SET `status` = 'off', `hp` = '0'  WHERE `usr`='".$user['nick']."' and `s`='1' and `id`='$id'");
$kos mysql_result(mysql_query("SELECT  COUNT(*)  FROM `battle` WHERE `usr`='".$user['nick']."' and `s`='1'  and `status`=''"),0);
if(
$kos==0){
mysql_query("UPDATE `survival` SET `wave` = `wave`+'1' WHERE `usr`='".$user['id']."'");}
mysql_query("UPDATE `user` SET `mob`='0', `wins`=`wins`+'1' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `survival` SET `wins` = '$gde[wins]'+'1' WHERE `usr`='".$user['id']."' and `what`='1'");

if(isset(
$_GET['whack'])){
$vrem $_SERVER['REQUEST_TIME']+$umen['time'];
if(
$umen['timer']>''.$_SERVER['REQUEST_TIME'].''){
$_SESSION['err']="Промах";
header ("Location: ?");exit;}
mysql_query("UPDATE `umen` SET `timer` = '$vrem' WHERE `usr`='".$user['id']."' and `img`='whack'");
$_SESSION['light']="Вы использовали <img src='/images/umen/whack.png' height='16px' width='16px'> <font color='#FFBF00'>Сильный Удар</font> против ".$mobc['name']." <img src='/images/icon/stat/hp.png'><font color='#F5E17E'>-".$udar."</font>";
}else{
$_SESSION['light']="Вы <img src='/images/icon/fight.png'>".$sms." <img src='/images/icon/stat/hp.png'><font color='#F5E17E'>-".$udar."</font>";
}
$_SESSION['light']="Вы  <img src='/images/icon/dead.png'>".$ttud." ".$mobc['name']." <img src='/images/icon/stat/hp.png'><font color='#F5E17E'>-".$udar."</font>";
$ud mysql_num_rows(mysql_query("SELECT * FROM `bonus` WHERE `usr`='".$user['id']."' and `typ`='3'"));
if(
$ud>0){$udar=$udar*2;}else{$udar=$udar;}
if(
$setgame['exp']==1)$udar=$udar*2;
mysql_query("UPDATE `user` SET `exp` = '$user[exp]'+'$udar', `mob`='$id' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `survival` SET `exp` = '$gde[exp]'+'$udar' WHERE `usr`='".$user['id']."'  and `what`='1'");
if(
$gde['exp']>$gde['max_exp']){mysql_query("UPDATE `survival` SET `max_exp` = '$gde[max_exp]'+'$udar' WHERE `usr`='".$user['id']."'  and `what`='1'");}
if(
$gde['wins']>$gde['max_wins']){mysql_query("UPDATE `survival` SET `max_wins` = '$gde[max_wins]'+'1' WHERE `usr`='".$user['id']."'  and `what`='1'");}
header ("Location: ?");exit;}else{
if(isset(
$_GET['whack'])){
$vrem $_SERVER['REQUEST_TIME']+$umen['time'];
if(
$umen['timer']>''.$_SERVER['REQUEST_TIME'].''){
$_SESSION['err']="Промах";
header ("Location: ?");exit;}
mysql_query("UPDATE `umen` SET `timer` = '$vrem' WHERE `usr`='".$user['id']."' and `img`='whack'");
$_SESSION['light']="Вы использовали <img src='/images/umen/whack.png' height='16px' width='16px'> <font color='#FFBF00'>Сильный Удар</font> против ".$mobc['name']." <img src='/images/icon/stat/hp.png'><font color='#F5E17E'>-".$udar."</font>";
}else{
$_SESSION['light']="Вы <img src='/images/icon/stat/sila.png'>".$sms." <img src='/images/icon/stat/hp.png'><font color=#F5E17E>-".$udar."</font>";
}
mysql_query("UPDATE `battle` SET `hp` = '$uron' WHERE `usr`='".$user['nick']."' and `id`='$id'");
$ud mysql_num_rows(mysql_query("SELECT * FROM `bonus` WHERE `usr`='".$user['id']."' and `typ`='3'"));
if(
$ud>0){$udar=$udar*2;}else{$udar=$udar;}
mysql_query("UPDATE `user` SET `exp` = '$user[exp]'+'$udar', `mob`='$id' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `survival` SET `exp` = '$gde[exp]'+'$udar' WHERE `usr`='".$user['id']."'  and `what`='1'");
if(
$gde['exp']>$gde['max_exp']){mysql_query("UPDATE `survival` SET `max_exp` = '$gde[max_exp]'+'$udar' WHERE `usr`='".$user['id']."'  and `what`='1'");}
header ("Location: ?");exit;}

}
if(
$user['health']<=0){
echo
"</div><div  class='but-list'>
<a href="
?"> <img src='/images/icon/reload.png'> Обновить </a></font>
<a href="
/"> <img src='/images/icon/error.png'> Покинуть бой </a></div></div>";
}else{
$ureq mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `s`='1' and `id`='$user[mob]'");
$umob mysql_fetch_array($ureq);
$avt mysql_num_rows($ureq);
if(
$avt>0){
echo
'<div class="foot"><table  width="100%">
<tbody>
<td class="center"><div class="empty2"></div>'
;
 if(
$umob['boss']=='1'){echo"<font color='orange'>$umob[name]</font>";}
if(
$umob['boss']!='1'){echo"$umob[name]";}
 echo
'<div class="empty2"></div>';
$kol70=$umob['hpmax']*0.70;
$kol30=$umob['hpmax']*0.30;
if(
$umob['hp']>=$kol70){$health="green";}
if(
$umob['hp']>=$kol30 and $umob['hp']<$kol70){$health="orange";}
if(
$umob['hp']<$kol30){$health="red";}
echo
"<div class='hp'>
<div class='
$health' style='width:".floor(100/($umob['hpmax']/$umob['hp']))."%'></div>
</div>"
;
echo
'<div class="empty2"></div><div class="empty2"></div><font color="#CDC9C9"> ('.$umob['hp'].'/'.$umob['hpmax'].')</font></td>
</tbody></table></div><hr>
'
;}
echo
"<div class='head'><table  width='100%' border='0' cellpadding='5px' cellspacing='0' style='padding-top: 5px;'>
<tbody>"
;

$randomob mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `s`='1' and `status`='' ORDER BY RAND() LIMIT 1"),0);
 
if(
$kols==0){echo'<td width="45%"><a class="fight center" href="?">  Обновить  </a></div></td>';}
if(
$kols==and $umob['hp']>0){echo' <td width="45%"><a class="fight center" href="?udar&id='.$umob['id'].'">  Атаковать  </a></div></td>';}
if(
$kols==and $umob['hp']<=0){echo' <td width="45%"><a class="fight center" href="?udar&id='.$randomob['id'].'">  Атаковать  </a></div></td>';}
if(
$kols>1){
if(
$user['mob']>and $umob['hp']>0){echo' <td width="45%"><a class="fight center" href="?udar&id='.$umob['id'].'">  Атаковать  </a></div></td>';}
echo
' <td width="45%"><a class="fight center" href="?udar&id='.$randomob['id'].'">  Бить любого  </a></div></td>';}
echo
"</tbody></table><table  width='100%' border='0' cellpadding='1px' cellspacing='0' style='padding-top: 5px;'>
<tbody>"
;
$req mysql_query("SELECT timer FROM `umen` WHERE `usr` = '".$user['id']."' and `img`='whack' LIMIT 1");
$umen mysql_fetch_array($req);
$avto mysql_num_rows($req);
if(
$avto == 0){
echo
"<td width='30%'><div class='big-but'><div class='imgwrap'><img src='/images/umen/whack_grey.png' height='20' width='20'></div><div class='empty'></div>Недоступно</td></div>"
}
if(
$avto 0){
if(
$umen['timer']<= $_SERVER['REQUEST_TIME']){
if(
$umob['hp'] > 0){
echo
"<td width='30%'>
<a class='big-but' href="
?udar&whack&id=".$umob['id']."">
<div class='imgwrap'><img src='/images/umen/whack.png' height='35' width='35'>
</div> 
<div class='empty'></div> 
</a>
</td>
</div>"
;
}
if(
$umob['hp'] <= 0){    
echo
"<td width='30%'>
<a class='big-but' href="
?udar&whack&id=".$randomob['id'].""><div class='imgwrap'><img src='/images/umen/whack.png' height='35' width='35'>
</div> 
<div class='empty'>    </div> 
</a>
</td>
</div>"
;

} else {
$recharge $umen['timer'] - $_SERVER['REQUEST_TIME'];
echo
"<td width='30%'><div class='big-but'><div class='imgwrap'><img src='/images/umen/whack_grey.png' height='20' width='20'></div>
<div class='empty'></div>"
.$recharge." сек</td>
</div>"
;
}
}
$req mysql_query("SELECT timer FROM `umen` WHERE `usr` = '".$user['id']."' and `img`='healing'");
$umen mysql_fetch_array($req);
$avto mysql_num_rows($req);
if(
$avto==0){
echo
'<td width="30%"><div class="big-but"><div class="imgwrap"><img src="/images/umen/healing_grey.png" height="20" width="20"></div><div class="empty"></div>Недоступно</td></div>'
} else {
if(
$umen['timer'] <= $_SERVER['REQUEST_TIME']){
echo
'<td width="30%"><a class="big-but" href='?healing'><div class="imgwrap"><img src="/images/umen/healing.png" height="35" width="35"></div><div class="empty"></div></a></td></div>'
} else {
$recharge=$umen['timer']-$_SERVER['REQUEST_TIME'];
echo
' <td width="30%"><div class="big-but"><div class="imgwrap"><img src="/images/umen/healing_grey.png" height="20" width="20"></div>
<div class="empty"></div>'
.$recharge.' сек</td>
</div>'
;
}
}
$req mysql_query("SELECT timer FROM `umen` WHERE `usr` = '".$user['id']."' and `img`='gift_of_the_Gods'");
$umen mysql_fetch_array($req);
$avto mysql_num_rows($req);
if(
$avto==0){
echo
'<td width="30%"><div class="big-but"><div class="imgwrap"><img src="/images/umen/gift_of_the_Gods_grey.png" height="20" width="20"></div><div class="empty"></div>Недоступно</td></div>'
} else {
if(
$umen['timer'] <= $_SERVER['REQUEST_TIME']){
echo
'<td width="30%"><a class="big-but" href='?gift_of_the_Gods'><div class="imgwrap"><img src="/images/umen/gift_of_the_Gods.png" height="35" width="35"></div><div class="empty"></div></a></td></div>'
} else {
$recharge=$umen['timer']-$_SERVER['REQUEST_TIME'];
echo
'<td width="30%"><div class="big-but"><div class="imgwrap"><img src="/images/umen/gift_of_the_Gods_grey.png" height="20" width="20"></div>
<div class="empty"></div>'
.$recharge.' сек</td>
</div>'
;
}
}

echo
'</td></tbody></table></tbody>
</table>'
;
}



$requ mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `s`='1' and `status`=''  ");
$avto mysql_num_rows($requ);
if(
$avto>0){
echo
"<hr><div class='foot foot'><div class='center'>Противники</br><div class='empty2'></div></div>";
$req mysql_query("SELECT DISTINCT `name` FROM `battle` WHERE `usr`='".$user['nick']."' and `s`='1' and `status`='' ");
while(
$mob mysql_fetch_array($req)){
$randomobu mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `name`='$mob[name]' and `s`='1' and `status`='' ORDER BY RAND() LIMIT 1"),0);
if(
$randomobu['hp']>=$kol70){$health="green";$hp="<font color='green'>$randomobu[hp]</font>";}
if(
$randomobu['hp']>=$kol30 and $randomobu['hp']<$kol70){$health="orange";$hp="<font color='orange'>$randomobu[hp]</font>";}
if(
$randomobu['hp']<$kol30){$health="red";$hp="<font color='red'>$randomobu[hp]</font>";}
$koll mysql_result(mysql_query("SELECT  COUNT(*)  FROM `battle` WHERE `name`='$mob[name]' and `s`='1' and `usr`='".$user['nick']."' and `status`=''"),0);
if(
$koll>1){
echo
"<a class='fight' href='?udar&id=$randomobu[id]'>$mob[name] <font color='#CDC9C9'>($koll)</font></a>";}else{
if(
$randomobu['boss']=='1'){echo"<a class='fight' href='?udar&id=$randomobu[id]'><font color='orange'>$mob[name]</font> ($hp)</a>";}
if(
$randomobu['boss']!='1'){echo"<a class='fight' href='?udar&id=$randomobu[id]'>$mob[name] ($hp)</a>";}}
}echo
"</div>";}
$req mysql_query("SELECT * FROM `duellog` WHERE `opon` = '".$user['nick']."' or `usr` = '".$user['nick']."' and `timer`>='".$_SERVER['REQUEST_TIME']."' ORDER BY `id` DESC LIMIT 9");
$avto mysql_num_rows($req);

if(
$avto>=1){
echo
"<hr><div class='foot foot'><div class='center'>Журнал боя</br><div class='empty2'></div></div>";
While(
$ilok mysql_fetch_array($req)){
$timeudar=$_SERVER['REQUEST_TIME']-$ilok['timer']+300;
if(
$timeudar<60){
$timeudar="$timeudar сек.";
}else{
$timeudar=round($timeudar/60);
$timeudar="$timeudar мин.";
}

if(
$ilok['kogo'] > 0){
if(
$user['plem']=='ogn'){$plem='0';}
if(
$user['plem']=='mol'){$plem='1';}
if(
$ilok['dead']==1){echo '<img src="/images/icon/dead.png" height="16" width="16">
<font color="#AAAAAA"> '
.$ilok['text'].' <img src=/images/icon/race/'.$plem.'.png><a href="/user/'.$user['id'].'/"><font color="'.$user['font'].'">'.$user['nick'].'</font></a></font><span class="mit">'.$timeudar.'</span>  <div class="empty"></div>';
} else {
echo
'<font color="#AAAAAA"> '.$ilok['text'].' <img src=/images/icon/race/'.$plem.'.png><a href="/user/'.$user['id'].'/"><font color="'.$user['font'].'">'.$user['nick'].'</font></a> на <font color="F5E17E">'.$ilok['uron'].'</font> урона</font><span class="mit">'.$timeudar.'</span>  <div class="empty"></div>';
}
}
}
}
echo
'</div><hr>
<div class="but-list-light">
<a href="?">
<img src="/images/icon/level.png"> '
.$gde['wave'].' волна 
<span class="float-right">
<img src="/images/icon/wins.png" width="16" height="16"> '
.$gde['wins'].' <img src="/images/icon/exp.png" width="16" height="16"> '.$gde['exp'].'</a></div>';
require_once
'../../core/foot.php';
?>
Онлайн: 1
Реклама