Файл: files/zag.php
Строк: 441
<?php
//include_once("files/antidos.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";
if($_SESSION['version'] == ''){
$_SESSION['version'] = 'new';
}
echo '<title>haogame.ru - '.$log.'</title>';
if($_SESSION['version'] == 'new'){
echo '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="stylesheet" type="text/css" href="css/new/style.css?"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta content="noindex, nofollow" name="robots" />';
echo "<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-38152348-1']);
_gaq.push(['_setDomainName', 'haogame.ru']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>";
echo '</head><body><table>
<tr>
<td class="lt1"></td><td class="t1"><div><b>Wap LineAge</b></div></td><td class="rt1"></td>
</tr>
<tr>
<td class="l"></td>
<td class="centertd">';
}elseif($_SESSION['version'] == 'web'){
include_once 'files/web_golova.php';
}
include_once"files/opiti.dat";
include_once"files/opitpit.php";
if($udata16 > $udata17){
mysql_query("UPDATE `users` SET `udata16`='$udata17' WHERE `udata0`='$log'");
}
if($udata29 > $udata30){
mysql_query("UPDATE `users` SET `udata16`='$udata17' WHERE `udata0`='$log'");
}
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 ('', 'Подсказка :<b> $vik[answer]...</b>', 'Система', '".$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("DELETE FROM 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 ('', 'На вопрос никто не ответил.', 'Система', '".$tim."')") or die(mysql_error());
mysql_query("INSERT INTO `viktorina_chat` VALUES ('', 'Следующий вопрос :<b>$vik1[question] ($str букв)</b>', 'Система', '".$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"<small><a href="pers.php?log=$log&pas=$pas">$log - $udata9 уровень. </a></small><br/>";
echo"<img src="hp.php?" alt="HP: $udata16/$udata17"/><br/>";
echo"<img src="mp.php?" alt="MP: $udata29/$udata30"/><br/>";
echo"<img src="exp.php?" alt="EXP: $exp %"/><hr>";
}else{
echo"<small><a href="pers.php?log=$log&pas=$pas">$log - $udata9 уровень. </a></small><br/>";
echo"<img src="hp.php?" alt="HP: $udata16/$udata17"/><br/>";
echo"<img src="mp.php?" alt="MP: $udata29/$udata30"/><br/>";
echo"<img src="exp.php?" alt="EXP: $exp %"/><hr>";
}
/////////////////////БЛОК/////////////////////////////////
$t=time();
$req = mysql_query("SELECT * FROM `ban` WHERE `usr` = '$log' LIMIT 1");
// //////////////////////////
$avto = mysql_num_rows($req);
if ($avto == 1) {
echo "<div class="warning s">";
$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] часов";
}
echo '</div>';
include('files/down.php');exit;
}
}
$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 class="warning s">У вас <big><b><a href="msg.php?">[$new_mail]</a></b></big> новых сообщений</div>";
}
//////////////////////////////ПАТИ//////////////////////////
$a = @mysql_query("select * from paty WHERE `paty0`='$log' and `paty2`='ok' ");
while($arr=mysql_fetch_array($a)){
if($arr['paty0']==$log){
echo'<div class="warning s">Вы в пати с '.$arr[paty1].' <a href=paty.php?go=del&name='.$arr[paty1].'>Отменить</a></div>';
}
}
$a = @mysql_query("select * from paty WHERE `paty1`='$log' and `paty2`='ok' ");
while($arr=mysql_fetch_array($a)){
if($arr['paty1']==$log){
echo'<div class="warning s">Вы в пати с '.$arr[paty0].' <a href=paty.php?go=del&name='.$arr[paty0].'>Отменить</a></div>';
}
}
$a = @mysql_query("select * from paty WHERE `paty1`='$log' and `paty2`='time' ");
while($arr=mysql_fetch_array($a)){
if($arr['paty1']==$log){
echo'<div class="warning s">'.$arr[paty0].' предлагает вам пати вы согласны? <a href=paty.php?go=ok>Да</a> | <a href=paty.php?go=no>Нет</a></div>';
}
}
$a = @mysql_query("select * from paty WHERE `paty0`='$log' and `paty2`='time' ");
while($arr=mysql_fetch_array($a)){
if($arr['paty0']==$log){
echo'<div class="warning s">Вы ожидаете на потверждения пати игрока '.$arr[paty1].' <a href=paty.php?go=del&name='.$arr[paty1].'>Отменить</a></div>';
}
}
$pit = mysql_query("SELECT * from `pit` WHERE `usr`='".$log."' and `active`='yes' LIMIT 1");
$pi=mysql_num_rows($pit);
if($pi==1){
echo"<div class="warning s">$namepit: Уровень $lvlpit<br>
Жизни: $hppit/$allhppit<br>
Атака/Зашита: $attack/$def<br>
EXP: $pitexpp</div>";
}
$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=$use[time]-time();
echo"<div class="warning s"><small>$baff (Сила: $use[kol_sila]| Осталось:".sec2day($ostatok).")</small></div>";
}
}
////////////////////////////////////////////////////////
$us2 = mysql_query("SELECT * FROM `pitmag` WHERE `login`='$log' ");
$user2=mysql_num_rows($us2);
if($user2>0){
echo '<div class="warning s">';
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 '</div>';
}
//////////////////////////////БАФФЫ////////////////////////////////////////
$time=time();
///////
$req = mysql_query("SELECT * FROM `aurs` WHERE `actimer`<='$time' and `usr`='$log' and `name`='Повышеная зашита'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto=='1'){
$req = mysql_query("SELECT * FROM `aurs` WHERE `usr` = '$log'");
$mag = mysql_fetch_assoc($req);
$udata3=$udata3-$mag['sila'];
mysql_query("UPDATE `users` SET `udata3`='$udata3' WHERE `udata0`='$log'");
mysql_query("DELETE FROM `aurs` WHERE `usr` = '$log' and `name`='Повышеная зашита' LIMIT 1");
}
$time=time();
///////
$req = mysql_query("SELECT * FROM `aurs` WHERE `actimer`<='$time' and `usr`='$log'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto=='1'){
$req = mysql_query("SELECT * FROM `aurs` WHERE `usr` = '$log' and `name`='Повышеная атака'");
$mag = mysql_fetch_assoc($req);
$udata4=$udata4-$mag['sila'];
mysql_query("UPDATE `users` SET `udata4`='$udata4' WHERE `udata0`='$log'");
mysql_query("DELETE FROM `aurs` WHERE `usr` = '$log' and `name`='Повышеная атака' LIMIT 1");}
$req = mysql_query("SELECT * FROM `aurs` WHERE `usr` = '$log' and `name`='Повышеная атака'");
$avto=mysql_num_rows($req);
if($avto==1){
echo "<div class="warning s">";
$req = mysql_query("SELECT * FROM `aurs` WHERE `usr`='$log' and `name`='Повышеная атака' ");
////////////////////////////
$avto=mysql_num_rows($req);
$aro = mysql_fetch_array($req);
echo"<div class="image-radius" style="background: url(img/151.png); width: 20px; height: 20px;"></div>$aro[name] (+$aro[sila] | ";
$aro[actimer]=$aro[actimer]-time();
if($aro[actimer]<60){
echo "Осталось: $aro[actimer] сек.)";
}else{
$aro[actimer]=round($aro[actimer]/60);
echo "Осталось: $aro[actimer] мин.)<br>";}
echo '</div>';
}
$req = mysql_query("SELECT * FROM `aurs` WHERE `usr` = '$log' and `name`='Повышеная зашита'");
$avto=mysql_num_rows($req);
if($avto==1){
echo "<div class="warning s">";
$req = mysql_query("SELECT * FROM `aurs` WHERE `usr`='$log' and `name`='Повышеная зашита' ");
////////////////////////////
$avto=mysql_num_rows($req);
$aro = mysql_fetch_array($req);
echo"<div class="image-radius" style="background: url(img/144.png); width: 20px; height: 20px;"></div> $aro[name] (+$aro[sila] | ";
$aro[actimer]=$aro[actimer]-time();
if($aro[actimer]<60){
echo "Осталось: $aro[actimer] сек.)";
}else{
$aro[actimer]=round($aro[actimer]/60);
echo "Осталось: $aro[actimer] мин.)";}
echo '</div>';
}
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");
}
//////////////////////////////////PK////////////////////////////////////////////
if($udata48=="dead"){
echo'<div class="warning s">Вы проиграли вас убил игрок - '.$udata49.'<br>В <a href="gorod.php?">В город</a></div>';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;
}
///////////////////// Закрытие ИГРЫ //////////////////////////
$switch = @file("local/game/switch.dat");
$swi = explode("||", $switch[0]);
$switchdetail = $swi[0];
$switchdate = $swi[1];
$u = explode(".",$login);
if ($switch!==false && $log!=="ByUNNAMED") {
echo "<div class="warning s"><b>Игра временно закрыта</b><br />";
echo'Причина: '.$switchdetail.'<br />Дата закрытия: '.$switchdate.'<br/><a href="index.php">выход</a></div>';
include_once "files/down.php";
exit;}
$req = mysql_query("SELECT * FROM `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 `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="svadba_ok.php?id=$inv[id]"><font color=33FF66>Вам предлогает вступить в брак:</font> </a><a href="search?nick=$inv[clan]&go=go">$inv[clan]</a><br/><br/>";
}}}
////////////////////////////////КЛАНЫ///////////////////////////////////
$clan=mysql_query("SELECT * FROM `tmp_clan` WHERE `user`='$log' LIMIT 1");
if(mysql_num_rows($clan)==1){
$cl= mysql_fetch_array($clan);
echo"<div class="warning s">Лидер клана $cl[glava] предлагает вступить в клан $cl[clan]. Вы согласны?<br/><a href="clan.php?go=ok">Да</a> | <a href="clan.php?go=del">Нет</a></div>";
}
$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"<div class="warning s">Вы продаёте вещи<br><a href="sellruktime.php?">Вернутся</a></div>";
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"<div class="warning s">Вы продаёте вещи<br><a href="sellcoin.php?">Вернутся</a></div>";
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"<div class="warning s">Вы находитесь на арене, вы неможете выйти! <a href="arena.php?">Вернутся</a>.</div>"; include 'files/down.php'; exit;}
////////////////////////////////////////////////////////
if($udata16<=0){
mysql_query("INSERT INTO
`dead` SET
`login` = '$log',
`predl` = '',
`sila` = ''");}
$us3 = mysql_query("SELECT * FROM `dead` WHERE `login`='$log' LIMIT 1 ");
if(mysql_num_rows($us3)==1){
$us3 = mysql_query("SELECT * FROM `dead` WHERE `login`='$log' LIMIT 1 ");
$user3=mysql_num_rows($us3);
if($user3==0){header ("Location: gorod.php?"); exit;}
if($vibor=="yes"){
$us3 = mysql_query("SELECT * FROM `dead` WHERE `login`='$log' and `predl`!='' LIMIT 1 ");
$us3=mysql_fetch_array($us3);
$expn=round($udata19*0.1/100);
$expn1=round($expn*$us[sila]/100);
$expn=round($expn-$expn1);
echo'<u>Вы воскрешены!</u> Потеряно '.$expn.' опыта.<br><br>';
$expn=$udata19-$expn;
$udata16=1;
mysql_query("DELETE FROM `dead` WHERE `login`='$log' ");
mysql_query("UPDATE `users` SET `udata19`='$expn' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata16`='$udata16' WHERE `udata0`='$log'");
header ("Location: okrestnosti.php?"); exit;}elseif($vibor=="no"){
mysql_query("UPDATE `dead` SET `predl`='', `sila`='' WHERE `login`='$log'");
}
$us3 = mysql_query("SELECT * FROM `dead` WHERE `login`='$log' and `predl`!='' LIMIT 1 ");
$user3=mysql_num_rows($us3);
$us3=mysql_fetch_array($us3);
if($user3==1){ echo"$us3[predl] воскрешает вас с востановлением $us3[sila]% опыта.</br><a href="dead.php?&vibor=yes">Да</a> | <a href="dead.php?&vibor=no">Нет</a>"; include 'files/down.php'; exit;}
if($vibor=="gorod"){
$expn=round($udata19*0.1/100);
echo'<u>Вы воскрешены!</u> Потеряно '.$expn.' опыта.<br><br>';
$expn=$udata19-$expn;
$udata16=$udata17;
$udata7=$udata7+1;
mysql_query("DELETE FROM `dead` WHERE `login`='$log' ");
mysql_query("UPDATE `users` SET `udata19`='$expn' WHERE `udata0`='$log'");
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 `udata37`='' WHERE `udata0`='$log'"); header ("Location: gorod.php?"); exit;}
echo"<b>Вы мертвы.</b></br><a href="dead.php?&vibor=gorod">В город</a></br><a href="main.php?">Ждать пока воскресят</a></br>";
//echo"<a href="gorod.php?">Воспользоватся свитком воскрешения</a></br>";
echo"<a href="exit">Выйти из игры</a>" ;
echo '<div class="page"><div class="block_2">';
include_once 'files/down.php';
exit;
}
/////////////////////////////////////////////////////////
$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=$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=$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=$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=$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=$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=$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=$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()."' ");
}
/////////////////////////////////////////////////
/////////////////////////////////Рыбалка/////////////////////
$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()."' ");
mysql_query("DELETE FROM `zamuj` WHERE `time` <= '".time()."'");
echo '<div class="page"><div class="block_2">';
?>