<?php
include"files/zag.php";
include_once("files/ini.php");
include_once("files/data.php");
include_once("files/gzip.php");
$ref=rand(1,3);
$ref2=rand(1,3);
$qi = mysql_query("select * from `okrestnosti` WHERE `mob4`='".$udata37."' and `mob7`<('".time()."'-'300') and `id`='".$id."' ");
if (mysql_affected_rows()==0)
{
echo"Ошибка!";
include_once"files/down.php";exit;
}
if($udata37==""){include_once("files/zag.php");echo'Вы находитесь не в окрестностях!';include_once'files/down.php';exit;}
if($udata16<="0"){ header ("Location: gk.php?go=lose"); exit; }
$a = @mysql_query("select * from `okrestnosti` WHERE `id`='$id' ");
while($arr=mysql_fetch_array($a)){
$hp=trim($udata16);
$allhp=trim($udata17);
$mob0=$arr['mob0'];
$mob1=$arr['mob1'];
$mob2=$arr['mob2'];
$mob3=$arr['mob3'];
$mob5=$arr['mob5'];
$mob0=$arr['mob0'];
$mob6=$arr['mob6'];
$mob7=$arr['mob7'];
$mob8=$arr['mob8'];
$id=$arr['id'];
if($mob8=="RaidBoss"){
$dp2=$udata9+10;
$dm2=$udata9-10;
if($dp2<$mob1){include_once("sys/zag.php");echo"Разница уровней больше или меньше 10";
include_once'files/down1.php';exit;}
if($dm2>$mob1){include_once("sys/zag.php");echo"Разница уровней больше или меньше 10";
include_once'files/down1.php';exit;}
}
$allhp2=trim($mob3);
$die=trim($udat[5]);
$hp2=trim($mob2);
if($hp2<="0"){
header ("Location: okrestnosti.php?&go=win&gorod=$gorod&id=$id&startan=$startan&");
}
if($udata16<="0"){ header ("Location: gk.php?&go=lose"); }
$_title = 'Бой';
//////////////////////////////////
$procent=round($hp2*100/$allhp2);
echo"<b><font color=\"red\">$mob0:</font></b> <font color=\"yellow\">[$hp2/$allhp2]/[$procent%]</font><br/>";
if($udata27=="wizard"){
echo"<a href=\"udar.php?tip=weapon&id=$id&startan=$startan&\">Атаковать оружием</a><br/>";
echo"Атака магией<br/>";
$arr = mysql_query("SELECT * from `mag` WHERE `mag10`='$log' ");
$qi = mysql_query("SELECT * from `mag` WHERE `mag10`='$log'");
if (mysql_affected_rows()==0)
{
echo "Магии нет<br>";
}
else
{
while($rows=mysql_fetch_array($qi))
{
$startan = $_GET['startan'];
echo '<a href="udar.php?&name='.$rows[id].'&tip=mag&&id='.$id.'&&idm='.$i.'&startan='.$startan.'&">'.$rows[mag8].'</a></b> (Сила:'.$rows[mag0].' |'.$rows[mag1].' MP)<br/>';
}
}
}else{
echo"<a href=\"udar.php?tip=weapon&id=$id&startan=$startan&\">Атаковать оружием</a><br/>";
echo"<br/>Атака магией<br>";
$arr = mysql_query("SELECT * from `mag` WHERE `mag10`='$log' ");
$qi = mysql_query("SELECT * from `mag` WHERE `mag10`='$log'");
if (mysql_affected_rows()==0)
{
echo "Магии нет<br>";
}
else
{
while($rows=mysql_fetch_array($qi))
{
$startan = $_GET['startan'];
echo '<a href="udar.php?&name='.$rows[id].'&tip=mag&&id='.$id.'&&idm='.$i.'&startan='.$startan.'&">'.$rows[mag8].'</a></b> (Сила:'.$rows[mag0].' |'.$rows[mag1].' MP)<br/>';
}
}
}
echo'<b>Лог боя:</b><br>- - -';
if(empty($startan)) $startan = 0;
$startan=intval($startan);
if($startan<0) $startan=0; $num_msgs_an=5;
$arr = mysql_query("SELECT * from `battle_log`");
$qi = mysql_query("SELECT * from `battle_log` WHERE `blog1`='$log' ORDER by `iu` DESC LIMIT 5");
if (mysql_affected_rows()==0)
{
echo "<br>Лог Боя пуст";
}
else
{
while($row=mysql_fetch_array($qi))
{
echo '<br>'.$row[blog0].' ';
}
}
echo"<br>- - -</br>";
$startan = $_GET['startan'];
if(empty($startan)) $startan = 0;
$startan=intval($startan);
if($startan<0) $startan=0; $num_msgs_an=5;
$arr = mysql_query("SELECT * from `res` WHERE `uda7`='".$log."' ");
$qi = mysql_query("SELECT * from `res` WHERE `uda7`='".$log."' AND `uda2`='vesh2' and `uda4`!='Soulshot' and `uda4`!='Scroll: Weapon' and `uda4`!='Scroll: Armor' ");
if (mysql_affected_rows()==0)
{
echo "Лекарств нет!";
}
else
{
while($row=mysql_fetch_array($qi))
{
echo '<a href="tovesh.php?&tip='.$row['uda2'].'&id='.$row['id'].'&name='.$row['uda4'].'&tip='.$row['uda2'].'&startan='.$startan.'&">'.$row['uda4'].'</a>['.$row['uda3'].']<br/>';
}
}
if(empty($data_544)){echo""; include_once"files/down1.php"; exit;}
}
include_once"files/down1.php";
?>