Файл: l2ps_v5/files/zagarena.php
Строк: 220
<?php
include_once"banzz/banzz.php";
include_once"files/ini.php";
include_once"files/data.php";
include_once"files/lvl.php";
include_once"files/lvlclan.php";
include_once"files/regeneration.php";
include_once"files/gzip.php";
include_once"files/l2pirates_Antihack.php";
//echo'<div class = "up" ></div><div class = "body" ><script src="sneg.js"></script><left><br/>';
//echo"<left>";
include_once"files/themes.php";
include_once"files/opiti.php";
/*$pr_q = mysql_query("SELECT * from `config` ");
while($arr = mysql_fetch_array($pr_q)){
$time=time();
$arr[time]=$arr['time']+2592000;
if($time>$arr['time']){
mysql_query("TRUNCATE TABLE battle_log ") or die("Сука не пашет!");
mysql_query("TRUNCATE TABLE gb ") or die("Сука не пашет!");
mysql_query("TRUNCATE TABLE gb1 ") or die("Сука не пашет!");
mysql_query("TRUNCATE TABLE clan_chat ") or die("Сука не пашет!");
mysql_query("TRUNCATE TABLE msg_r ") or die("Сука не пашет!");
mysql_query("TRUNCATE TABLE sell ") or die("Сука не пашет!");
mysql_query("TRUNCATE TABLE l2pirates_hystory ") or die("Сука не пашет!");
mysql_query("TRUNCATE TABLE viktorina_chat ") or die("Сука не пашет!");
mysql_query("TRUNCATE TABLE zametki ") or die("Сука не пашет!");
$t=time();
mysql_query("UPDATE `config` SET `time`='$t' ");
}}*/
if($udata37==TWI){
$kkk=time()-86400;
if($udata52<=$kkk){
mysql_query("UPDATE `users` SET `udata37`='' WHERE `udata0`='$log'");
}
}
$time=time();
///////
$req = mysql_query("SELECT * FROM `table_vip` WHERE `time`<='$time' and `nick`='$log'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto=='1'){
mysql_query("UPDATE `users` SET `udata75`='' WHERE `udata0`='$log'");
mysql_query("DELETE FROM `table_vip` WHERE `nick`='$log' LIMIT 1");
}
////////////////////////////////Рекомендации////////////////////////////////////////////////
mysql_query("DELETE FROM `rec` WHERE `time`<('".time()."'-'54000') ");
///////////////////////////////////////////////////////////////////////////////////////////////////////
//Перевод секунд в минуты, часы, дни. Добавил 20.03.10
function sec2day($sec=NULL)
{
$days = floor($sec/86400);
$hours = floor(($sec/3600)-$days*24);
$minuts = floor(($sec-$hours*3600-$days*86400)/60);
$seconds = $sec-($minuts*60+$hours*3600+$days*86400);
if ($days!=0)$days = $days.' дн. ';
else $days = NULL;
if ($hours!=0)$hours = $hours.' ч. ';
else $hours = NULL;
if ($minuts!=0)$minuts = $minuts.' мин. ';
else $minuts = NULL;
$sectoday = $days.''.$hours.''.$minuts.''.$seconds.' сек.';
return $sectoday;
}
function sec3day($sec1=NULL)
{
$days1 = floor($sec1/86400);
if ($days1!=0)$days1 = $days1.'';
else $days1 = NULL;
$sectoday1 = $days1.'';
return $sectoday1;
}
$dateTotal1 = time();
$dateTotal2 = $dateTotal1 - $udata56;
$fffv=$udata60+$dateTotal2;
if ($dateTotal2 <= 600)mysql_query("UPDATE `users` SET `udata60` = '".$fffv."' WHERE `udata0` = '$log' LIMIT 1");
if($udata34=="0"){
echo "<u><a href="uslugi.php">$log</a></u> $udata9 Уровень<br>";
$cp = round(100/($udata43/$udata42));
$hp = round(100/($udata17/$udata16));
$mp = round(100/($udata30/$udata29));
echo'<div style="width:auto;margin-top:1px;">
<div style="height:20px;background:#4F4F4F;">
<div style="height:20px;padding-left:10px;float:left;font-size:11px;color:#DCD9DC;">CP '.$udata42.'/'.$udata43.'</div>
<div style="height:20px;'.$cp.'%;background:url(l2pic/logo/cp.png);"></div>
</div></div><div style="width:auto;margin-top:1px;">
<div style="height:20px;background:#4F4F4F;">
<div style="height:20px;padding-left:10px;float:left;font-size:11px;color:#DCD9DC;">HP '.$udata16.'/'.$udata17.'</div>
<div style="height:20px;width:'.$hp.'%;background:url(l2pic/logo/hp.png);"></div>
</div></div><div style="width:auto;margin-top:1px;">
<div style="height:20px;background:#4F4F4F;">
<div style="height:20px;padding-left:10px;float:left;font-size:11px;color:#DCD9DC;">MP '.$udata29.'/'.$udata30.'</div>
<div style="height:20px;width:'.$mp.'%;background:url(l2pic/logo/mp.png);"></div>
</div></div><div style="width:auto;margin-top:1px;">
<div style="height:22px;background:#4F4F4F;">
<div style="height:20px;padding-left:10px;float:left;font-size:11px;color:#DCD9DC;">EXP '.$exp.'%</div>
<div style="height:20px;width:'.$exp.'%;background:url(l2pic/logo/exp.png);"></div>
</div></div><hr>
';
}else{
echo "<u><a href="uslugi.php">$log</a></u> $udata9 Уровень<br><img src='l2pic/energy.gif' alt='pic'/> <u><font color=gold>CP: $udata42/$udata43 </font></u><br/><img src='l2pic/life.png' alt='pic'/> <u><font color=red>HP: $udata16/$udata17 </font></u><br/><img src='l2pic/mana.png' alt='pic'/> <u><font color=blue>MP: $udata29/$udata30</font></u><br/>";
echo"
<img src='l2pic/exp.png' alt='pic'/>$udata9 <font color=#9999CC>($exp%)</font>";
echo'<div style="background:#666666;height:1px;width:100%;padding:0;margin:6px 0;">
<div style="background:#FFDF8C; height:1px; width:'.$exp.'%;"></div></div>';
}
include_once"files/up.php";
include_once"files/achieve.php";
////////////////////////////////КАРТИНКИ///////////////////////////////////
if($udata34=="1"){
function img2($image2) {return eregi_replace("((<img src)[-a-zA-Z0-9@:%_+.~#?;&//=)/" >]+)","", $image2);} ob_start("img2");
function img($image) {return eregi_replace("((<img src)[-a-zA-Z0-9@:%_+.~#?;&//=)/" >]+<br/>)","", $image);} ob_start("img");
}
$t=time();
$req = mysql_query("SELECT * FROM `ban` WHERE `usr` = '$log' LIMIT 1");
// //////////////////////////
$avto = mysql_num_rows($req);
if ($avto == 1) {
$ban = mysql_fetch_array($req);
if($ban[ban_time]<$t){
mysql_query("DELETE FROM `ban` WHERE `usr` = '$log'");
}else{
echo"Вы находитесь в блоке!<br> Причина блока: $ban[text]<br> Осталось: ";
$ban[ban_time]=$ban[ban_time]-time();
if($ban[ban_time]<60){
echo "$ban[ban_time] сек.";
}elseif($ban[ban_time]>60 and $ban[ban_time]<3600){
$ban[ban_time]=round($ban[ban_time]/60);
echo "$ban[ban_time] мин.";
}else{
$ban[ban_time]=round($ban[ban_time]/3600);
echo "$ban[ban_time] часов";
}
include('files/down.php');exit;
}
}
///////////////////// Закрытие ИГРЫ //////////////////////////
$switch = @file("local/game/switch.dat");
$swi = explode("||", $switch[0]);
$switchdetail = $swi[0];
$switchdate = $swi[1];
$u = explode(".",$login);
if ($switch!==false && $log!=="Bopo6eu" && $log!=="TheEvil") {
echo "<b>Игра временно закрыта</b><br />";
echo'Причина: '.$switchdetail.'<br />Дата закрытия: '.$switchdate.'<br/><a href="exit.php">выход</a><br />';
include_once "files/down.php";
exit;}
$qi = mysql_query("SELECT * from `sell` WHERE `uda7`='".$log."' ");
while($row=mysql_fetch_array($qi))
if($row['uda7']==$log){
echo"Вы продаёте вещи<br><a href="sellruktime.php?">Вернуться</a><br/>";
include_once "files/down.php";
exit;
}
$qi = mysql_query("SELECT * from `sellcoin` WHERE `coin0`='".$log."' ");
while($row=mysql_fetch_array($qi))
if($row['coin0']==$log){
echo"Вы продаёте вещи<br><a href="sellcoin.php?">Вернуться</a><br/>";
include_once "files/down.php";
exit;
}
////////////////////////////////////////////////////////
list($msec,$sec)=explode(chr(32),microtime());
$gtime=$sec+$msec;
////////////////////////////////////////////////////////
include_once "files/bufer.php";
/////////////////////////////////////////////////////////
/*$us2 = mysql_query("SELECT * FROM `baffs` WHERE `login`='$log' AND `active`='off' ");
$user2=mysql_num_rows($us2);
if($user2>0){
while($user1=mysql_fetch_array($us2)){
if($user1[name]=="baffatk"){
$atk=round($udata4*$user1[sila]/100);
$udata4=$atk+$udata4;
mysql_query("UPDATE `users` SET `udata4`='$udata4' WHERE `udata0`='$log'");
mysql_query("UPDATE `baffs` SET `active`='on', `kol_sila`='$atk' WHERE `login`='$log' AND `name`='baffatk' ");
}
if($user1[name]=="baffarmor"){
$atk=$udata3*$user1[sila]/100;
$udata3=round($atk+$udata3);
mysql_query("UPDATE `users` SET `udata3`='$udata3' WHERE `udata0`='$log'");
mysql_query("UPDATE `baffs` SET `active`='on', `kol_sila`='$atk' WHERE `login`='$log' AND `name`='baffarmor' ");
}
if($user1[name]=="baffmatk"){
$atk=$udata83*$user1[sila]/100;
$udata83=round($atk+$udata83);
mysql_query("UPDATE `users` SET `udata83`='$udata83' WHERE `udata0`='$log'");
mysql_query("UPDATE `baffs` SET `active`='on', `kol_sila`='$atk' WHERE `login`='$log' AND `name`='baffmatk' ");
}
if($user1[name]=="baffmzashita"){
$atk=$udata82*$user1[sila]/100;
$udata82=round($atk+$udata82);
mysql_query("UPDATE `users` SET `udata82`='$udata82' WHERE `udata0`='$log'");
mysql_query("UPDATE `baffs` SET `active`='on', `kol_sila`='$atk' WHERE `login`='$log' AND `name`='baffmzashita' ");
}
}}
$us2 = mysql_query("SELECT * FROM `baffs` WHERE `login`='$log' AND `time`<'".time()."' ");
$user2=mysql_num_rows($us2);
if($user2>0){
while($user1=mysql_fetch_array($us2)){
if($user1[name]=="baffatk"){
$udata4=round($udata4-$user1[kol_sila]);
mysql_query("UPDATE `users` SET `udata4`='$udata4' WHERE `udata0`='$log'");
mysql_query("UPDATE `baffs` SET `active`='on' WHERE `login`='$log' AND `name`='baffatk' ");
}
if($user1[name]=="baffarmor"){
$udata3=round($udata3-$user1[kol_sila]);
mysql_query("UPDATE `users` SET `udata3`='$udata3' WHERE `udata0`='$log'");
mysql_query("UPDATE `baffs` SET `active`='on' WHERE `login`='$log' AND `name`='baffarmor' ");
}
if($user1[name]=="baffmatk"){
$udata83=round($udata83-$user1[kol_sila]);
mysql_query("UPDATE `users` SET `udata83`='$udata83' WHERE `udata0`='$log'");
mysql_query("UPDATE `baffs` SET `active`='on' WHERE `login`='$log' AND `name`='baffmatk' ");
}
if($user1[name]=="baffmzashita"){
$udata82=round($udata82-$user1[kol_sila]);
mysql_query("UPDATE `users` SET `udata82`='$udata82' WHERE `udata0`='$log'");
mysql_query("UPDATE `baffs` SET `active`='on' WHERE `login`='$log' AND `name`='baffmzashita' ");
}
}
mysql_query("DELETE FROM `baffs` WHERE `login`='$log' AND `time`<'".time()."' ");
}
$us3 = mysql_query("SELECT * FROM `baffs` WHERE `login`='$log' ");
$user3=mysql_num_rows($us3);
if($user3>0){
while($use=mysql_fetch_array($us3)){
if($use[name]=="baffatk"){$baff="Бафф на Физ.Атк.";}
if($use[name]=="baffarmor"){$baff="Бафф на Физ.Защ.";}
if($use[name]=="baffmatk"){$baff="Бафф на Маг.Атк.";}
if($use[name]=="baffmzashita"){$baff="Бафф на Маг.Защ.";}
$ostatok=time()-$use['time'];
echo"<b>$baff</b> (Сила: $use[kol_sila]| Осталось:".sec2day($ostatok).")</br>";
}
echo"<hr>";}*/
////////////////////////////////////////////////////////
$us2 = mysql_query("SELECT * FROM `pitmag` WHERE `login`='$log' AND `active`='on' ");
$user2=mysql_num_rows($us2);
if($user2>0){
while($pit=mysql_fetch_array($us2)){
if($pit[vid]=="petatk"){$pom="Атакующий";}
if($pit[vid]=="petmp"){$pom="Дает Доп. Ману";}
echo"<b>$pit[name]</b> - $pom</br><font color=red>$pit[hp]/$pit[allhp] HP</font></br>";
if($pit[vid]=="petatk"){
echo"<font color=blue>$pit[mp]/$pit[allmp] MP</font></br>";
}}
echo"<hr>";
}
/////////////////////////////////////////////////
include_once "files/event.php";
?>