<?
ob_start();
Error_Reporting(E_ALL & ~E_NOTICE);
////////////////////////////////////////////////////////
list($msec,$sec)=explode(chr(32),microtime());
$gtime=$sec+$msec;
////////////////////////////////////////////////////////
include_once("include/sesi.php");
include 'include/antixak.php';
include 'include/ini.php';
include("include/who.php");
include("include/header2.php");
$text = @file("MySql/base123/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
echo'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta forua="true" http-equiv="Cache-Control" content="no-cache,no-store,must-revalidate"/><title>Lineage2</title></head>
<link rel="stylesheet" href="img/style.css" type="text/css" />
';
if (isset($user)) {
switch($go) {
default:
if(!@file("MySql/base123/tmp/$log.dat")){
echo"Вы не в бою"; include 'include/down.php'; exit;
}
$text = @file("MySql/base123/tmp/$log.dat");
$udat = explode(":||:",$text[0]);
$text = @file("MySql/base123/reg/$log.dat");
$udata = explode(":||:",$text[0]);
$mobhp=trim($udat[0]);
$mobhpall=trim($udat[1]);
$atakamob=trim($udat[2]);
$hp=trim($udata[16]);
$allhp=trim($udata[17]);
$ataka=trim($udata[4]);
$mp=trim($udata[29]);
$allmp=trim($udata[30]);
$mob=trim($udat[3]);
$logs=trim($udat[4]);
if($udata[16]<"0"){
header ("Location: lose.php?$sd"); exit;}
if($udat[0]<="0"){
$zzz="$udata[0]:||:$mob:||:";
$fp=fopen("MySql/base123/respaun2/$mob.dat","w");
flock ($fp,LOCK_EX);
fputs($fp,"$zzz\r\n");
flock ($fp,LOCK_UN);
fclose($fp);

$time = time()+"30";
$ttt = "zzzzzzzzzzz^|^$time";
$fp=fopen("MySql/base123/respaun/$mob.dat","w");
flock ($fp,LOCK_EX);
fputs($fp,"$ttt\r\n");
flock ($fp,LOCK_UN);
fclose($fp);

header ("Location: win.php?$sd");
exit;}
echo"Жизни: $hp/$allhp<br/>
Мана: $mp/$allmp<br/>
HP моба: $mobhp/$mobhpall<br/>";
echo"<small><b>Атака оружием</b></small><br/>";
echo"<b><a href=\"udar.php?$sd\">Атаковать</a></b><br/>";
if($udata[27]=="wizard"){
echo"<small><b>Супер удары</b></small><br/>";
}else{
echo"<small><b>Супер удары</b></small><br/>";
}
if(!@file("MySql/base123/mag/$log.dat")){
if($udata[27]=="wizard"){
echo"<small>Магии нет</small>";}else{
echo"<small>Скилов нет</small>";}
}else{
$file = @file("MySql/base123/mag/$log.dat");
$total = count($file);
for ($i = 0; $i < $total; $i++){
$file = @file("MySql/base123/mag/$log.dat");
$data = explode("||",$file[$i]);
if($data[4]=="combat"){
echo"<b><a href=\"udar.php?$sd&name=$data[8]&tip=mag&gorod=$gorod&id=$i\">$data[7]</a></b> - [+$data[0] урона]<br/>";
}}}
echo "<hr><b>Лог боя</b><br/>- - -<br/>$logs<br/>";
echo'<hr/><b>Использовать эликсир</b><br/>';
$filel = file("MySql/base123/item/$log.dat");
$filel = array_reverse($filel);
$totall = count($filel);
for ($il = 0; $il < $totall; $il++){
$datal = explode(":||:",$filel[$il]);

if($datal[2]=="vesh2"){

$datal_0[]=$datal[0];
$datal_1[]=$datal[1];
$datal_2[]=$datal[2];
$datal_3[]=$datal[3];
$datal_4[]=$datal[4];
$datal_id[]=$il;
}}

if(empty($datal_4)){echo"У вас нет эликсиров."; include_once"include/down.php"; exit;}
foreach($datal_0 as $kl=>$vl)
{
$dat_screenl[]="<b><a href=\"tovesh.php?$sd&tip=$datal_2[$kl]&name=$datal_4[$kl]&id=$datal_id[$kl]\">$datal_4[$kl]</a> [$datal_3[$kl]]</b><br/>";
}


$totall = count($dat_screenl);


if (empty($_GET['start'])) $startl = 0;
else $startl = $_GET['start'];
if ($totall < $startl + 10){ $endl = $totall; }
else {$endl = $startl + 10; }
for ($il = $startl; $il < $endl; $il++){

echo"$dat_screenl[$il]";

}
}
}else{echo"<small>Пароль или логин неверен!</small>";}
include_once"include/down.php";
