Файл: l2ps_v5/files/zag.php
Строк: 339
<?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/pit.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";
include_once"files/opitpit.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'");
}
}
$rr = mysql_query("SELECT * FROM `item_shadow` WHERE `time`<='".time()."' and `usr`='$log'");
$av=mysql_num_rows($req);
if($av > 0){
while($sh=mysql_fetch_array($rr)){
if($sh['type'] == 'weapon'){
$req = mysql_query("SELECT * FROM `weapon_item` WHERE `name`='".$sh['id_item']."' and `usr`='$log'");
$w=mysql_fetch_array($req);
$pa = $udata4 - $w['p_dam'];
$ma = $udata83 - $w['m_dam'];
if($udata12 == $sh['name']){
$weapon = 'Пусто';
}else{
$weapon = $udata12;
}
if($udata45 == $sh['name']){
$weapon = 'Пусто';
}else{
$weapon = $udata45;
}
mysql_query("UPDATE `users` SET `udata4`='$pa', `udata83` = '$ma', `udata45` = '$weapon', `udata12` = '$weapon' WHERE `udata0`='$log'");
mysql_query("DELETE FROM `weapon_item` WHERE `login`='".$sh['usr']."' and `name` = '".$sh['id_item']."'");
}elseif($sh['type'] == 'armor'){
$pa = $udata3 - $w['p_def'];
$ma = $udata82 - $w['m_def'];
if($udata10 == $sh['name']){
$armor = 'Пусто';
}else{
$armor = $udata10;
}
if($udata11 == $sh['name']){
$armor = 'Пусто';
}else{
$armor = $udata11;
}
if($udata84 == $sh['name']){
$armor = 'Пусто';
}else{
$armor = $udata84;
}
if($udata46 == $sh['name']){
$armor = 'Пусто';
}else{
$armor = $udata46;
}
if($udata13 == $sh['name']){
$armor = 'Пусто';
}else{
$armor = $udata13;
}
mysql_query("UPDATE `users` SET `udata3`='$pa', `udata82` = '$ma', `udata10` = '$armor', `udata11` = '$armor'
, `udata84` = '$armor', `udata46` = '$armor', `udata13` = '$armor' WHERE `udata0`='$log'");
mysql_query("DELETE FROM `armor_item` WHERE `login`='".$sh['usr']."'");
}
}
mysql_query("DELETE FROM `item_shadow` WHERE `time`<='".time()."' and `usr` = '$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()."' ");
///////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////Викторина////////////////////////////////////////////////
$v=mysql_query("SELECT * FROM `v_question` LIMIT 1");
$vik=mysql_fetch_array($v);
$vik[answer] = mb_substr ($vik[answer], 0, 1, 'UTF-8');
$tim=time();
$time=time()+60;
if($vik[hint]<$tim and $vik[type]=="1"){
mysql_query("INSERT INTO `viktorina_chat` VALUES ('', '<font color=#FFD700>Подсказка :<b> $vik[answer]...</b></font>', 'Умник', '".$tim."')") or die(mysql_error());
mysql_query("UPDATE `v_question` SET `hint`='$time',`type`='2' WHERE `question`='$vik[question]' ");
}
$v1=mysql_query("SELECT * FROM `viktorina` ORDER BY RAND () LIMIT 1");
$vik1=mysql_fetch_array($v1);
$time=time()+60;
$tim=time();
if($vik[hint]<$tim and $vik[type]=="2"){
mysql_query("TRUNCATE TABLE v_question ") or die("Сука не пашет!");
mysql_query("INSERT INTO `v_question` VALUES ('$vik1[question]','$vik1[answer]','$time','1')") or die(mysql_error());
$str = strlen($vik1[answer])/2;
mysql_query("INSERT INTO `viktorina_chat` VALUES ('', '<font color=red>На вопрос никто не ответил.</font>', 'Умник', '".$tim."')") or die(mysql_error());
mysql_query("INSERT INTO `viktorina_chat` VALUES ('', '<font color=green>Следующий вопрос :<b>$vik1[question] ($str букв)</b></font>', 'Умник', '".$tim."')") or die(mysql_error());
}
$v=mysql_query("SELECT * FROM `v_question`");
$asd = mysql_num_rows($v);
if ($asd == 0) {
mysql_query("INSERT INTO `v_question` VALUES ('','','0','2')") or die(mysql_error());
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//Перевод секунд в минуты, часы, дни. Добавил 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><div style='background:#2F4F4F;padding:3px 2px 3px 2px;'><a href="uslugi.php">$log</a></u> $udata9 Уровень<style>
.round {
border-radius: 100px;
box-shadow: 0 0 7px #666;
}
</style>
</div>";
$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'/> <font color=#9999CC>($exp%)</font><br/>";
echo'<div style="background:#666666;height:1px;width:100%;padding:0;margin:6px 0;">
<div style="background:#FFDF8C; height:1px; width:'.$exp.'%;"></div></div>';
}
///почта///
$q = mysql_query("SELECT COUNT(*) FROM `msg_r` WHERE `user_to` = '$log' AND `read` = '1';");
$new_mail = mysql_result($q, 0);
if ($new_mail>0)
{
echo '<div style="background:#363636;padding:3px 2px 3px 2px;"><b><a href=msg.php?>У вас новое сообщение</a></b> + <font color="lime"><b>'.$new_mail.'</b></font></div></a><br/>';
}
/////////
include_once"files/achieve.php";
$g=mysql_query("SELECT * FROM `anketa` WHERE `usr`='$log' LIMIT 1");
if(mysql_num_rows($g)==0){
echo "<li><b>Кристина</b> <font color='red'>(Помощник новичков):</font> У вас не создана Анкета!<br/><li><a href="anketa.php">Создать Анкету</a><br><br>";
}
if($udata9<="20"){
if($udata11=="Пусто" or $udata12=="Пусто"){echo"<br><font color=#43CD80>- Пойди в инвентарь и одень оружие, броню и вещи! </font><br><a href="inventar.php?">Одеть вещи</a><br><br>";}
}
if($udata9<="20"){
$prof = @mysql_query("SELECT * FROM `l2pirates_skills` WHERE `user_id`='$USER_ID' and `active`='yes' LIMIT 50");
echo"<li><b>Кристина</b> <font color='red'>(Помощник новичков):</font><br><a href="baff.php?go=magia">Выучить первую магию</a><br><br>";}
////////////////////////////////КАРТИНКИ///////////////////////////////////
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");
}
//////////////////////////////////PK////////////////////////////////////////////
if($udata48=="dead"){
echo'Вы проиграли вас убил игрок - '.$udata49.'<br>В <a href="gorod.php?">В город</a>';include_once"files/down.php";
$udata16=$udata17;
$udata7=$udata7+1;
mysql_query("UPDATE `users` SET `udata16`='$udata16' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata7`='$udata7' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata49`='' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata48`='' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata37`='' WHERE `udata0`='$log'");
exit;}
/////////////////////БЛОК/////////////////////////////////
$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/>Т.к. нарушены правила игры l2pirates.ru<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;}
///свадьба////
$req = mysql_query("SELECT * FROM `l2pirates_zamuj` WHERE `usr` = '$log'");
$avto=mysql_num_rows($req);
if(empty($_GET[id])){
if($avto>=1){
While($inv = mysql_fetch_array($req)){
$req = mysql_query("SELECT * FROM `l2pirates_zamuj` WHERE `clan` = '$inv[clan]'");
$clan4 = mysql_fetch_array($req);
$nickas = strip_tags($inv[clan]);
$req = mysql_query("SELECT `rasa` FROM `users` WHERE `nick` = '$nickas'");
$pic = mysql_fetch_array($req);
echo"<li> <a href="wedding.php?db=predl&id=$inv[id]"><font color=33FF66>Вам предлогает вступить в брак:</font> </a><a href="search?nick=$inv[clan]&go=go">$inv[clan]</a><br/><br/>";}}}
mysql_query("DELETE FROM `l2pirates_zamuj` WHERE `time` <= '".time()."'");
////////////////////////////////КЛАНЫ///////////////////////////////////
$clan=mysql_query("SELECT * FROM `tmp_clan` WHERE `user`='$log' LIMIT 1");
if(mysql_num_rows($clan)==1){
$cl= mysql_fetch_array($clan);
echo"Лидер клана $cl[glava] предлагает вступить в клан $cl[clan]. Вы согласны?<br/><a href="clan.php?go=ok">Да</a> | <a href="clan.php?go=del">Нет</a><br/><br/>";}
$alliance=mysql_query("SELECT * FROM `tmp_alliance` WHERE `user`='$log' LIMIT 1");
if(mysql_num_rows($alliance)==1){
$al= mysql_fetch_array($alliance);
echo"Лидер альянса $al[glava] предлагает вступить в альянс $al[alliance]. Вы согласны?<br/><a href="alliance.php?action=ok">Да</a> | <a href="alliance.php?action=del">Нет</a><br/><br/>";}
$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;
////////////////////////////////Арена////////////////////////////////////
$us1 = mysql_query("SELECT * FROM `arena` WHERE `login`='$log' LIMIT 1 ");
$user1=mysql_num_rows($us1);
if($user1==1){ echo"Вы находитесь на арене, вы не можете выйти! <a href="arena.php?">Вернуться</a>."; include 'files/down.php'; exit;}
////////////////////////////////////////////////////////
if($udata48=="dead"){
echo'Вы проиграли вас убил игрок - '.$udata49.'<br>В <a href="gorod.php?">В город</a>';include_once"files/down.php";
$udata16=$udata17;
$udata7=$udata7+1;
mysql_query("UPDATE `users` SET `udata16`='$udata16' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata7`='$udata7' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata49`='' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata48`='' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata37`='' WHERE `udata0`='$log'");
exit;
echo'Вы проиграли вас убил игрок - '.$udata49.'<br>В <a href="dead.php?&vibor=gorod">В город</a>';include_once"files/down.php";
$udata16=$udata17;
$udata7=$udata7+1;
mysql_query("UPDATE `users` SET `udata16`='$udata16' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata7`='$udata7' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata49`='' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata48`='' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata37`='' WHERE `udata0`='$log'");
exit;}
if($udata48=="deadmob"){
echo'Вы проиграли вас убил монстр - '.$udata49.'<br>В <a href="dead.php?&vibor=gorod">В город</a>';include_once"files/down.php";
$udata16=$udata17;
$udata7=$udata7+1;
mysql_query("UPDATE `users` SET `udata16`='$udata16' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata7`='$udata7' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata49`='' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata48`='' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata37`='' WHERE `udata0`='$log'");
exit;}
/*if($udata48=deadmob){
mysql_query("INSERT INTO
`dead` SET
`login` = '$log',
`predl` = '',
`sila` = ''");}
$us3 = mysql_query("SELECT * FROM `dead` WHERE `login`='$log' LIMIT 1 ");
$user3=mysql_num_rows($us3);
if($user3==1){ header ("Location: dead.php?"); exit;}*/
////////////////////////////баффы/////////////////////////////
include_once "files/bufer.php";
/////////////////////////////////Рыбалка/////////////////////
$timerr=time()+5;
$t=mysql_query("SELECT * FROM `time` where `time`<'$timerr' ");
$tm=mysql_num_rows($t);
if($tm==1){
$reu = mysql_query("SELECT * FROM `fishlov` WHERE `id_fish`!='' LIMIT 1");
while($avu=mysql_fetch_array($reu)){
$random=rand(1,3);
if($random=="1"){$povedenie="sopr";}
if($random=="2"){$povedenie="no";}
if($random=="3"){$povedenie="xz";}
$hp=$avu[hp]+$avu[hpregen];
if($hp>$avu[hpall]){$hp=$avu[hpall];}
mysql_query("UPDATE `fishlov` SET `hp`='$hp', `povedenie`='$povedenie' WHERE `login`='".$avu[login]."' LIMIT 1");}}
/////////////////////////////////////////////////
$g=mysql_query("select * from `ufus` WHERE `log`='$log' LIMIT 1 ");
$event=mysql_num_rows($g);
$g1=mysql_query("select * from `ufus` LIMIT 1 ");
$event1=mysql_num_rows($g1);
if($event==0 and $event1==1){
include_once "files/event.php";}
mysql_query("DELETE FROM `stanmob` WHERE `time`<'".time()."' ");
mysql_query("DELETE FROM `stan` WHERE `time`<'".time()."' ");
mysql_query("DELETE FROM `yadusers` WHERE `time`<'".time()."' ");
$bonus=mysql_query("SELECT * FROM `l2pirates_bonus` WHERE `log`='$log' LIMIT 1");
if(mysql_num_rows($bonus)==0){
mysql_query("INSERT INTO
`l2pirates_bonus` SET
`log` = '$log'");
echo "<font color=#20B2AA>Бонус за ежедневный вход <font color=#FFD700>+ 50000 аден</font>!Заходи каждый день и получай вознаграждение!</font><br>";
$aden=50000;
$uda8=round($udata8+$aden);
mysql_query("UPDATE `users` SET `udata8`='$uda8' WHERE `udata0`='$log'");
}else{}
?>