Файл: okrestnosti.php
Строк: 912
<?php
include_once("files/zag.php");
include_once("files/ini.php");
$polz=mysql_query("SELECT * FROM `users` WHERE `udata0`='$log' AND `udata1`='$pas' LIMIT 1");
if(mysql_num_rows($polz)==0){
header ("Location: index.php?error");
echo'<div class="p">Ошибка! Пользователь с таким логином и паролем не зарегистрирован, или пароль/логин неверен! <a href="index.php">На главную</a><br>';exit;
}else{
if($udata37!=""){
switch(@$go) {
case 'win':
mysql_query("DELETE FROM `battle_log` WHERE `blog1`='$log'");
mysql_query("DELETE FROM `tmp_battle` WHERE `id_monstr`='".abs(intval($_GET[id]))."' and `monstr_dead`='yes' and `user`='$log' and `nagrada`='yes'");
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."' and `nagrada`='no'");
if (mysql_affected_rows()==0)
{header ("Location: okrestnosti.php?monstr"); exit;}
while($tm=mysql_fetch_array($tmp))
{
$a = @mysql_query("select * from `okrestnosti` WHERE `id`='".abs(intval($_GET[id]))."' ");
while($arr=mysql_fetch_array($a)){
$hp=trim($udata16);
$allhp=trim($udata17);
$mobid=$arr['id'];
$mob1=$arr['mob1'];
$mob0=$arr['mob0'];
$mob2=$arr['mob2'];
$mob3=$arr['mob3'];
$mob5=$arr['mob5'];
$mob0=$arr['mob0'];
$mob6=$arr['mob6'];
$mob7=$arr['mob7'];
$mob8=$arr['mob8'];
$mob10=$arr['mob10'];
$mob11=$arr['mob11'];
$mob12=$arr['mob12'];
$id=$arr['id'];
echo'<div class="feedback">';
mysql_query("UPDATE `tmp_battle` SET `nagrada`='yes' WHERE `user`='$log' and `id_monstr`='".abs(intval($id))."' ");
mysql_query("UPDATE `tmp_battle` SET `monstr_dead`='yes' WHERE `id_monstr`='".abs(intval($id))."' ");
if($udata71>="1"){
$refin=rand(1,3);
if($refin==1){
$udata72=$udata72+1; echo "<small>Посев взощёл успешно</small><br>";}else{echo"<small>Посев не взошёл</small><br>";}}
if($udata71>"0"){
$udata71=$udata71-1;}
mysql_query("UPDATE `users` SET `udata72`='$udata72' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata71`='$udata71' WHERE `udata0`='$log'");
unlink ("data/tmp/$log.dat");
if($udata37!=="$udata20 Castle"){
if($mob8=="RaidBoss" and $mob0!=="Стена" and $mob0!=="Кристал"){
$rtime=rand(72000,108000);
$time=time()+$rtime;
mysql_query("UPDATE `okrestnosti` SET `mob7`='$time' WHERE `id`='".abs(intval($id))."'");
$okrand = mysql_query("SELECT * FROM `getekeeper` WHERE `gk`='combat' or `name`!='Town or Gludio Castle' or `name`!='Town of Aden Castle' or `name`!='Rune Township Castle' or `name`!='Town of Dion Castle' or `name`!='Town of Giran Castle' or `name`!='Town of Schuttgart Castle' or `name`!='Town of Goddard Castle' or `name`!='Town of Oren Castle' or `name`!='Heine Castle' or `name`!='Talking Island Village Castle' or `name`!='Dark Elven Village Castle' or `name`!='Elven Village Castle' or `name`!='Orc Village Castle' or `name`!='Dwarven Village Castle' or `name`!='Gludin Village Castle' or `name`!='Hunters Village Castle' ORDER BY RAND() ");
$okrrand = mysql_fetch_array($okrand);
mysql_query("UPDATE `okrestnosti` SET `mob4`='$okrrand[name]' WHERE `id`='".abs(intval($id))."'");
mysql_query("UPDATE `okrestnosti` SET `mob2`='$mob3' WHERE `id`='".abs(intval($id))."'");
}else{
mysql_query("UPDATE `okrestnosti` SET `mob2`='$mob3' WHERE `id`='".abs(intval($id))."'");
$time=time()+300;
mysql_query("UPDATE `okrestnosti` SET `mob7`='$time' WHERE `id`='".abs(intval($id))."'");}
}else{
$time=time()+285000;
mysql_query("UPDATE `okrestnosti` SET `mob7`='$time' WHERE `id`='".abs(intval($id))."'");
mysql_query("UPDATE `okrestnosti` SET `mob2`='$mob3' WHERE `id`='".abs(intval($id))."'");
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($udata9<="40"){
if($mob8=="RaidBoss"){
$aden=round($tm[uron]);
$exp=round($tm[uron]);
$sp=round($exp/2);
}else
if($mob0=="Guard"){
$aden=0;
$exp=0;
$sp=0;
}else{
$aden=round($tm[uron]);
$exp=round($tm[uron]);
$sp=round($exp/2);}
}else
if($udata9>"40"){
if($mob8=="RaidBoss"){
$aden=round($tm[uron]);
$exp=round($tm[uron]/2);
$sp=round($exp/4);
}else
if($mob0=="Guard"){
$aden=0;
$exp=0;
$sp=0;
}else{
$aden=round($tm[uron]);
$exp=round($tm[uron]/2);
$sp=round($exp/4);}
}
$paty = @mysql_query("select * from `paty` WHERE `paty0`='$log' and `paty2`='ok'");
while($p=mysql_fetch_array($paty)){
if(mysql_num_rows($paty)!==0){
$a = @mysql_query("select * from `users` WHERE `udata0`='$p[paty1]' ");
while($arr=mysql_fetch_array($a)){
if(mysql_num_rows($paty)==1){
$aden1=$aden/2;
$exp1=$exp/2;
$sp1=$sp/2;
}else
if(mysql_num_rows($paty)==2){
$aden1=$aden/3;
$exp1=$exp/3;
$sp1=$sp/3;
}else
if(mysql_num_rows($paty)==3){
$aden1=$aden/4;
$exp1=$exp/4;
$sp1=$sp/4;
}else
if(mysql_num_rows($paty)==4){
$aden1=$aden/5;
$exp1=$exp/5;
$sp1=$sp/5;
}else
if(mysql_num_rows($paty)==5){
$aden1=$aden/6;
$exp1=$exp/6;
$sp1=$sp/6;
}else
if(mysql_num_rows($paty)==6){
$aden1=$aden/7;
$exp1=$exp/7;
$sp1=$sp/7;
}else
if(mysql_num_rows($paty)==7){
$aden1=$aden/8;
$exp1=$exp/8;
$sp1=$sp/8;
}
$udatap19=$arr['udata19'];
$udatap8=$arr['udata8'];
$udatap31=$arr['udata31'];
$money=mysql_fetch_row(mysql_query('SELECT SUM(`lvl`) FROM `achieve` WHERE `log`="'.$log.'" '));
$achiexp=(int)$money[0];
$exp1=round($exp1*$achiexp/100+$exp1);
$udatap19=$udatap19+$exp1;
$udatap8=$udatap8+$aden1;
$udatap31=$udatap31+$sp1;
mysql_query("UPDATE `users` SET `udata19`='$udatap19' WHERE `udata0`='$p[paty1]'");
mysql_query("UPDATE `users` SET `udata8`='$udatap8' WHERE `udata0`='$p[paty1]'");
mysql_query("UPDATE `users` SET `udata31`='$udatap31' WHERE `udata0`='$p[paty1]'");
$aden1=number_format($aden1);
$exp1=number_format($exp1);
$sp1=number_format($sp1);
echo"<div class="title block_2 s">Игрок $p[paty1] получил Аден: $aden1, Опыта: $exp1, SP: $sp1</div> ";
}
}
}
//////////////////////////
$paty1 = @mysql_query("select * from `paty` WHERE `paty1`='$log' and `paty2`='ok'");
while($p1=mysql_fetch_array($paty1)){
if(mysql_num_rows($paty1)!==0){
$a = @mysql_query("select * from `users` WHERE `udata0`='$p1[paty0]' ");
while($arr=mysql_fetch_array($a)){
if(mysql_num_rows($paty1)==1){
$aden1=$aden/2;
$exp1=$exp/2;
$sp1=$sp/2;
}else
if(mysql_num_rows($paty1)==2){
$aden1=$aden/3;
$exp1=$exp/3;
$sp1=$sp/3;
}else
if(mysql_num_rows($paty1)==3){
$aden1=$aden/4;
$exp1=$exp/4;
$sp1=$sp/4;
}else
if(mysql_num_rows($paty1)==4){
$aden1=$aden/5;
$exp1=$exp/5;
$sp1=$sp/5;
}else
if(mysql_num_rows($paty1)==5){
$aden1=$aden/6;
$exp1=$exp/6;
$sp1=$sp/6;
}else
if(mysql_num_rows($paty1)==6){
$aden1=$aden/7;
$exp1=$exp/7;
$sp1=$sp/7;
}else
if(mysql_num_rows($paty1)==7){
$aden1=$aden/8;
$exp1=$exp/8;
$sp1=$sp/8;
}
$udatap19=$arr['udata19'];
$udatap8=$arr['udata8'];
$udatap31=$arr['udata31'];
$money=mysql_fetch_row(mysql_query('SELECT SUM(`lvl`) FROM `achieve` WHERE `log`="'.$log.'" '));
$achiexp=(int)$money[0];
$exp1=round($exp1*$achiexp/100+$exp1);
$udatap19=$udatap19+$exp1;
$udatap8=$udatap8+$aden1;
$udatap31=$udatap31+$sp1;
mysql_query("UPDATE `users` SET `udata19`='$udatap19' WHERE `udata0`='$p1[paty0]'");
mysql_query("UPDATE `users` SET `udata8`='$udatap8' WHERE `udata0`='$p1[paty0]'");
mysql_query("UPDATE `users` SET `udata31`='$udatap31' WHERE `udata0`='$p1[paty0]'");
$aden1=number_format($aden1);
$exp1=number_format($exp1);
$sp1=number_format($sp1);
echo"<div class="title block_2 s">Игрок $p[paty0] получил Аден: $aden1, Опыта: $exp1, SP: $sp1</div> ";
}
}
}
////////////////////////////////////////////////////////////////////////
$paty = @mysql_query("select * from `paty` WHERE `paty0`='$log'");
$pt = mysql_num_rows($paty);
if(mysql_num_rows($paty)!==0){
$pu=$pt;
$aden=$aden/$pu;
$exp=$exp/$pu;
$sp=$sp/$pu;
}
///////////////////////////////////////////////////////////////////////////
$paty1 = @mysql_query("select * from `paty` WHERE `paty1`='$log'");
$pt1 = mysql_num_rows($paty1);
if(mysql_num_rows($paty1)!==0){
$pu=$pt1;
$aden=$aden/$pu;
$exp=$exp/$pu;
$sp=$sp/$pu;
}
////////////////////////////////////////////////////////////////////////////
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='bronza'and `nick`='$log' LIMIT 1");
if(mysql_num_rows($elita)==1){
$aden=$aden*1.5;
$exp=$exp*1.5;
$sp=$sp*1.5;}
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='serebro'and `nick`='$log' LIMIT 1");
if(mysql_num_rows($elita)==1){
$aden=$aden*2;
$exp=$exp*2;
$sp=$sp*2;}
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='gold'and `nick`='$log' LIMIT 1");
if(mysql_num_rows($elita)==1){
$aden=$aden*2.5;
$exp=$exp*2.5;
$sp=$sp*2.5;}
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='premium'and `nick`='$log' LIMIT 1");
if(mysql_num_rows($elita)==1){
$aden=$aden*3;
$exp=$exp*3;
$sp=$sp*3;}
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='santipk'and `nick`='$log' LIMIT 1");
if(mysql_num_rows($elita)==1){
$aden=$aden*2;
$exp=$exp*2;
$sp=$sp*2;}
$udata6=$udata6+1;
$udata8=$udata8+$aden;
$udata31=round($udata31+$sp);
$money=mysql_fetch_row(mysql_query('SELECT SUM(`lvl`) FROM `achieve` WHERE `log`="'.$log.'" '));
$achiexp=(int)$money[0];
$exp=round($exp*$achiexp/100+$exp);
$udatao19=$udata19+$exp;
if($udata86>=1){
if($udata86<$mob1){$udata86=0;}else{
$udata86=$udata86-$mob1;}
mysql_query("UPDATE `users` SET `udata86`='$udata86' WHERE `udata0`='$log'");}
mysql_query("UPDATE `users` SET `udata19`='$udatao19' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata6`='$udata6' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata8`='$udata8' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata31`='$udata31' WHERE `udata0`='$log'");
if($udata23!==""){
$aglava=mysql_query("SELECT * FROM `clan` WHERE `clan0`='$udata23' ");
$arrs= mysql_fetch_array($aglava);
$ggg1=$arrs['clan8'];
$pt = mysql_query("SELECT * FROM `clan_people` where `clan_people1`='$arrs[clan1]' ;");
$pts = mysql_num_rows($pt);
$rd=rand(1,70);
$expclan=($exp/$rd);
$ggg11=$ggg1+$expclan;
mysql_query("UPDATE `clan` SET `clan8`='$ggg11' WHERE `clan0`='$udata23'");
$em=mysql_query("SELECT * FROM `clan_people` WHERE `clan_people0`='$log' ");
$s= mysql_fetch_array($em);
$hhh=$s['clan_people4'];
$re=$hhh+$expclan;
mysql_query("UPDATE `clan_people` SET `clan_people4`='$re' WHERE `clan_people0`='$log'");
$aglava=mysql_query("SELECT * FROM `clan` WHERE `clan0`='$udata23' ");
$arrs= mysql_fetch_array($aglava);
$ggg1=$arrs['clan4'];
$adenc=$aden/10;
$ggg1=$ggg1+$adenc;
mysql_query("UPDATE `clan` SET `clan4`='$ggg1' WHERE `clan0`='$udata23'");
$aglava=mysql_query("SELECT * FROM `users` WHERE `udata23`='$udata23' order by rand() limit 1 ");
$arrs= mysql_fetch_array($aglava);
$ggg1=$arrs['udata19'];
$ggg8=$arrs['udata0'];
$expc=$exp/10;
$ggg1=$ggg1+$expc;
mysql_query("UPDATE `users` SET `udata19`='$ggg1' WHERE `udata0`='$ggg8'");
}
$pit = mysql_query("SELECT * from `pit` WHERE `usr`='".$log."' and `active`='yes' LIMIT 1");
if (mysql_affected_rows()==0)
{
}
else
{
while($pi=mysql_fetch_array($pit))
{
$exppit=$exp/4;
$rexp=$exppit;
$exppit=$pi[pitexp]+$exppit;
mysql_query("UPDATE `pit` SET `pitexp`='$exppit' WHERE `name`='$pi[name]' and `active`='yes' and `usr`='$log'");
$rexp=number_format($rexp);
if($pi[name]=="Dragon Flate"){$pi[name]="Дракон";}
if($pi[name]=="Wolf Flate"){$pi[name]="Волк";}
Echo"<div class="title block_2 s">$pi[name] получил $rexp опыта<b/divr>";
}
}
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `id_monstr`='".abs(intval($id))."' and `uron`>'0' and `monstr_dead`='yes' ORDER by `uron` DESC Limit 1");
$tm=mysql_fetch_array($tmp);
if($tm[user]=="$log"){
if($mob0=="UFUS"){
$date=date("d.m.y");
$time=date("H:i");
$ok2 = mysql_query("SELECT * FROM `ufus` WHERE `log`='$log' LIMIT 1");
$o2 = mysql_fetch_array($ok2);
$kol=$o2[kol]+1;
mysql_query("INSERT INTO `zametki` VALUES ('', 'UFUS убит.', 'Система', '".$time."/".$date."', '".$log."')");
mysql_query("UPDATE `ufus` SET `kol`='$kol' WHERE `log`='$log'");
$okrand = mysql_query("SELECT * FROM `getekeeper` WHERE `gk`='combat' or `name`!='Town or Gludio Castle' or `name`!='Town of Aden Castle' or `name`!='Rune Township Castle' or `name`!='Town of Dion Castle' or `name`!='Town of Giran Castle' or `name`!='Town of Schuttgart Castle' or `name`!='Town of Goddard Castle' or `name`!='Town of Oren Castle' or `name`!='Heine Castle' or `name`!='Talking Island Village Castle' or `name`!='Dark Elven Village Castle' or `name`!='Elven Village Castle' or `name`!='Orc Village Castle' or `name`!='Dwarven Village Castle' or `name`!='Gludin Village Castle' or `name`!='Hunters Village Castle' ORDER BY RAND() ");
$okrrand = mysql_fetch_array($okrand);
mysql_query("UPDATE `okrestnosti` SET `mob4`='$okrrand[name]' WHERE `id`='".abs(intval($id))."'");
}
if($mob8=="RaidBoss"){
$raid=rand(10,70);
$udata51a=$udata51+$raid;
mysql_query("UPDATE `users` SET `udata51`='$udata51a' WHERE `udata0`='$log'");
echo "<div class="title block_2 s">Получено: <i>$raid</i> рейдовых очёк</div>";
$rand1=rand(1,4); $udacha="1";
if($rand1==$udacha){
if($udata9<20){
$st=rand(1,167);}
elseif($udata9>=20 and $udata9<40){
$st=rand(168,317);}
elseif($udata9>=40 and $udata9<52){
$st=rand(318,483);}
elseif($udata9>=52 and $udata9<62){
$st=rand(484,584);}
elseif($udata9>=62 and $udata9<76){
$st=rand(585,646);}
elseif($udata9>=76){
$st=rand(647,697);}
$req = mysql_query("SELECT * FROM `shop` WHERE `id`='".abs(intval($st))."' ");
$drop = mysql_fetch_array($req);
mysql_query("INSERT INTO `item` VALUES ('', '$drop[shop0]', '$drop[shop1]', '$drop[shop2]' , '$drop[shop3]' , '$drop[shop4]' , '$drop[shop5]' , '$drop[shop6]' , '".$log."' )") or die(mysql_error());
if($drop[shop4]>""){
echo "<div class="title block_2 s">Выпала вторая вещь: <b>$drop[shop4]</b></div>";}
$date=date("d.m.y");
$time=date("H:i");
mysql_query("INSERT INTO `zametki` VALUES ('', 'Выпала вещь $drop[shop4].', 'Система', '".$time."/".$date."', '".$log."')");
}}
$dropvr=rand(1,50);
if($dropvr=="5"){
//////////////////////////////////////////////////////
$dropv=rand(1,6);
$drop_vesh = mysql_query("SELECT * FROM `drop_vesh` WHERE `vesh4`!='Soulshot' ORDER BY RAND() LIMIT 1");
$vesh = mysql_fetch_array($drop_vesh);
$qi = mysql_query("SELECT * from `item` WHERE `uda7`='".$log."' and `uda4`='$vesh[vesh4]' ");
if (mysql_affected_rows()==0)
{
mysql_query("INSERT INTO `item` VALUES ('', '".$vesh[vesh0]."', '".$vesh[vesh1]."', '".$vesh[vesh2]."' , '".$vesh[vesh3]."' , '".$vesh[vesh4]."' , '".$vesh[vesh5]."' , '".$vesh[vesh6]."' , '".$log."' )") or die(mysql_error());
}
else
{
while($row=mysql_fetch_array($qi))
{
$dt[3]=$row['uda3']+1;
mysql_query("UPDATE `item` SET `uda3`='$dt[3]' WHERE `uda7`='$log' and `uda4`='$vesh[vesh4]' LIMIT 1");
}
}
echo "<div class="title block_2 s">Вы получили: <u>$vesh[vesh4]</u></div>";
}
$randres=rand(1,10000);
$req = mysql_query("SELECT * FROM `drops` WHERE `mob` = '$mob0' AND `drop3`>'$randres' AND `drop13`='$udata37' ORDER BY drop3 ASC LIMIT 1");
$avto=mysql_num_rows($req);
if($avto==1){
$drop = mysql_fetch_array($req);
$req = mysql_query("SELECT * FROM `item` WHERE `uda7` = '$log' and `uda4` = '$drop[drop1]'");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
$randkol=rand($drop[drop8],$drop[drop9]);
if($drop[drop4]=="vesh"){
if($res==0){
mysql_query("INSERT INTO `item` VALUES ('', '$drop[drop10]', '$drop[drop6]', '$drop[drop4]' , '".$randkol."' , '$drop[drop1]' , '$drop[drop1].gif' , '' , '".$log."' )") or die(mysql_error());
}else{
$randkol=rand($drop[drop8],$drop[drop9]);
$nk=$rs[uda3]+$randkol;
mysql_query("UPDATE `item` SET `uda3` = '$nk' WHERE `uda7` = '$log' and `uda4` = '$drop[drop1]'");
}}
else{
mysql_query("INSERT INTO `item` VALUES ('', '$drop[drop10]', '$drop[drop6]', '$drop[drop4]' , '$drop[drop7]' , '$drop[drop1]' , '$drop[drop1].gif' , '$drop[drop5]' , '".$log."' )") or die(mysql_error());}
echo"Выпало: <b>$randkol $drop[drop1]</b><br>";
}
$a1 = mysql_query("select * from `spoilact` WHERE `idmob`='$mobid' LIMIT 1 ");
$b=mysql_num_rows($a1);
if($udata33=="Собиратель" or $udata33=="Охотник за Наградой" or $udata33=="Кладоискатель" and $b=="1"){
$randres=rand(1,10000);
$req = mysql_query("SELECT * FROM `spoil` WHERE `mob` = '$mob0' AND `spoil3`>'$randres' ORDER BY spoil3 ASC LIMIT 1");
$avto=mysql_num_rows($req);
if($avto==1){
$drop = mysql_fetch_array($req);
$req = mysql_query("SELECT * FROM `item` WHERE `uda7` = '$log' and `uda4` = '$drop[spoil1]'");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
$randkol=rand($drop[spoil8],$drop[spoil9]);
if($drop[spoil4]=="vesh"){
if($res==0){
mysql_query("INSERT INTO `item` VALUES ('', '$drop[spoil10]', '$drop[spoil6]', '$drop[spoil4]' , '".$randkol."' , '$drop[spoil1]' , '$drop[spoil1].gif' , '' , '".$log."' )") or die(mysql_error());
}else{
$randkol=rand($drop[spoil8],$drop[spoil9]);
$nk=$rs[uda3]+$randkol;
mysql_query("UPDATE `item` SET `uda3` = '$nk' WHERE `uda7` = '$log' and `uda4` = '$drop[spoil1]'");
}}
else{
mysql_query("INSERT INTO `item` VALUES ('', '$drop[spoil10]', '$drop[spoil6]', '$drop[spoil4]' , '$drop[spoil7]' , '$drop[spoil1]' , '$drop[spoil1].gif' , '$drop[spoil5]' , '".$log."' )") or die(mysql_error());}
mysql_query ("Delete FROM `spoilact` where `mobid` = '".$mobid."'");
echo"<div class="title block_2 s">Спойл: <b>$randkol $drop[spoil1]</b></div>";
}
}
/////////////////////////////////Частицы////////////////////////////////
if($udata37=="Catacomb of the Heretic" and $mob0=="Mandragora Sprout"){
$chast=rand(1,100);
if($chast>"98"){
$req = mysql_query("SELECT * FROM `item` WHERE `uda7` = '$log' and `uda4` = 'Частица измерения'");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
if($res==0){
mysql_query("INSERT INTO `item` VALUES ('', '0', '500', 'vesh' , '1' , 'Частица измерения' , 'Частица измерения.gif' , '' , '".$log."' )") or die(mysql_error());
}else{
$nk=$rs[uda3]+1;
mysql_query("UPDATE `item` SET `uda3` = '$nk' WHERE `uda7` = '$log' and `uda4` = 'Частица измерения'");
}
echo"<div class="title block_2 s">Выпала: <i>Частица измерения</i></div>";
}
}
///////////////////////////////квест на пета////////////////////////////////////////
$thread1 = mysql_query("SELECT * from `questpet` WHERE `login`='".$log."' and `statys`='res' LIMIT 1");
$avto1=mysql_num_rows($thread1);
if($avto1==1 and $udata37=="Beehive"){
$req = mysql_query("SELECT * FROM `item` WHERE `uda7` = '$log' and `uda4` = 'Сухая роза'");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
if($res==0){
mysql_query("INSERT INTO `item` VALUES ('', '0', '0', 'vesh' , '1' , 'Сухая роза' , '' , '' , '".$log."' )") or die(mysql_error());
}else{
$nk=$rs[uda3]+1;
mysql_query("UPDATE `item` SET `uda3` = '$nk' WHERE `uda7` = '$log' and `uda4` = 'Сухая роза'");
}
echo"<div class="title block_2 s">Выпала: <i>Сухая роза</i></div>";
}
/////////////////////////////////Медали////////////////////////////////
$chast=rand(1,100);
if($chast>"98"){
$req = mysql_query("SELECT * FROM `olimpiada` WHERE `usr` = '$log' ");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
if($res==0){
mysql_query("INSERT INTO
`olimpiada` SET
`usr` = '$log',
`kol` = '1'");
}else{
$nk=$rs[kol]+1;
mysql_query("UPDATE `olimpiada` SET `kol` = '$nk' WHERE `usr` = '$log' ");
}
echo"<div class="title block_2 s">Выпала: <i>Olimpiad Medal</i></div>";
}
/////////////////////////////////////////////////////////////////////////
$time=date("H:i");
if($time>="22:00" && $time<="07:00"){
$rand=rand(1,10000);
}else{
$rand=rand(1,20000);
}
$udacha="1";
if($rand==$udacha){
$udata38=$udata38+1;
mysql_query("UPDATE `users` SET `udata38`='$udata38' WHERE `udata0`='$log'");
$date=date("d.m.y");
$time=date("H:i");
mysql_query("INSERT INTO `zametki` VALUES ('', 'Вам выпало 1 Coin of Luck ', 'Система', '".$time."/".$date."', '".$log."')");
}
if($rand==$udacha){
echo "<div class="title block_2 s">Из монстра выпал <u>1 Coin of Luck</u></div>";}
}
$aden=number_format($aden);
$exp=number_format($exp);
$sp=number_format($sp);
echo "<div class="title block_2 s">Выпало: Аден: $aden, Опыта: $exp, SP: $sp</div>";
$req = mysql_query("SELECT * FROM `peklo` WHERE `usr` = '$log' and `ok` = 'mob'");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
if($res==0){
mysql_query("INSERT INTO
`peklo` SET
`usr` = '$log',
`kol` = '1',
`ok` = 'mob'");
}else{
$nk=$rs[kol]+1;
mysql_query("UPDATE `peklo` SET `kol` = '$nk' WHERE `usr` = '$log' and `ok` = 'mob'");
}
echo'</div>';
if($tm[user]=="$log"){
If($udata37=="$udata20 Castle" and $mob0=="Кристал"){
if($udata23!==""){
$arrr = mysql_query("SELECT * from `okrestnosti` where `mob4`='".$udata37."' and `mob7`<('".time()."'-'300') ");
if (mysql_affected_rows() == 0)
{
$a=mysql_query("SELECT * FROM `clan` WHERE `clan0`='$udata23' ");
$arr= mysql_fetch_array($a);
mysql_query("UPDATE `clan` SET `clan5`='' WHERE `clan5`='$udata20'");
mysql_query("UPDATE `clan` SET `clan5`='$udata20' WHERE `clan0`='$udata23'");
$dataf[1]=$arr['clan1'];
$time=time();
mysql_query("UPDATE `zamok` SET `clan` = '$udata23', `gclan` = '$dataf[1]',`gtime` = '$time' WHERE `name`='$udata20'");
if($udata20=="Talking Island Village" or $udata20=="Dark Elven Village" or $udata20=="Elven Village" or $udata20=="Orc Village" or $udata20=="Dwarven Village" or $udata20=="Gludin Village" or $udata20=="" or $udata20=="Hunters Village"){
$aglava=mysql_query("SELECT * FROM `vilage` WHERE `name`='$udata20' ");
$arrs= mysql_fetch_array($aglava);
$ggad=$arrs['money'];
$aglavaf=mysql_query("SELECT * FROM `clan` WHERE `clan0`='$udata23' ");
$arrsf= mysql_fetch_array($aglavaf);
$gga=$arrsf['clan4'];
$gga=$gga+$ggad;
mysql_query("UPDATE `clan` SET `clan4`='$gga' WHERE `clan0`='$udata23'");
$ggad=number_format($ggad);
$time1 = date("H:i:s/d.m.y");
mysql_query("INSERT INTO clanlog SET clan='$udata23',msg='$time1 - Клан захватил деревню $udata20 и получен налог $ggad аден' ");
mysql_query("UPDATE `vilage` SET `money`='0' WHERE `name`='$udata20'");
}
$a = @mysql_query("select * from `okrestnosti` WHERE `mob4`='$udata20 Castle' ");
while($arr=mysql_fetch_array($a)){
$time1=3000;
mysql_query("UPDATE `okrestnosti` SET `mob7`='$time1' WHERE `id`='$arr[id]'");
mysql_query("UPDATE `okrestnosti` SET `mob2`='$arr[mob3]' WHERE `id`='$arr[id]'");
}
header ("Location: gorod");
}
}
}
}
echo"<br>";
}
}
default:
############################# PK ####################
if (isset($war)){
$pk=mysql_query("SELECT * FROM `users` WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."' LIMIT 1");
$pkinfo= mysql_fetch_array($pk);
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='santipk'and `nick`='$pkinfo[udata0]' LIMIT 1");
if(mysql_num_rows($elita)==1){echo'Игрок зашишён АНТИ-ПК аккаунтом';header ("Location: okrestnosti.php?antipk");}
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='antipk'and `nick`='$pkinfo[udata0]' LIMIT 1");
if(mysql_num_rows($elita)==1){echo'Игрок зашишён АНТИ-ПК аккаунтом';header ("Location: okrestnosti.php?antipk");}
if($udata37=="TWI"){header ("Location: okrestnosti.php?izmer");}
if ($udata9<20){header ("Location: okrestnosti.php?lvlmy");}
if($nick==$log){echo'Вы не можете напасть на самого себя!<br /><a href="okrestnosti.php?log='.$log.'&pas='.$pas.'">назад</a>';include_once"files/down.php";exit;}
if($data<0){header ("Location: okrestnosti.php?dead");}
if($udata37!=="$pkinfo[udata37]"){header ("Location: okrestnosti.php?okr");exit;}
if($udata69=="$pkinfo[udata69]"){echo'Вы пойманы на накрутке PVP боёв!';include_once"files/down.php";exit;}
$polzs=mysql_query("SELECT * FROM `users` WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."' LIMIT 1");
if(mysql_num_rows($polzs)==0){echo"<small>Такой игрок не существует!</small>"; include_once"files/down.php"; exit; }
if ($pkinfo[udata9]<="40"){header ("Location: okrestnosti.php?lvl");}
if($pkinfo['udata55']!=="$udata55"){
header ("Location: okrestnosti.php?okrerr");
}
if($udata37!==$pkinfo['udata37'] && $pkinfo['udata55']!=="/okrestnosti.php" && $udata55!=="/okrestnosti.php"){
header ("Location: okrestnosti.php?okrerr");
}
$datpk48=$pkinfo['udata48'];
if($pkinfo['udata48'] == "dead"){
header ("Location: okrestnosti.php?dead");}
$elita=mysql_query("SELECT * FROM `peklowin` WHERE `usr`='$log' and `ok`='ataka' LIMIT 1");
if(mysql_num_rows($elita)==1){
$udata4=$udata4*1.15;}else{$udata4=$udata4;}
$elita=mysql_query("SELECT * FROM `peklowin` WHERE `usr`='$log' and `ok`='lov' LIMIT 1");
if(mysql_num_rows($elita)==1){
$udata3=$udata3*1.15;}else{$udata3=$udata3;}
$elita=mysql_query("SELECT * FROM `peklowin` WHERE `usr`='$log' and `ok`='pvp' LIMIT 1");
if(mysql_num_rows($elita)==1){
$udata4=$udata4*1.15;}else{$udata4=$udata4;}
$elita=mysql_query("SELECT * FROM `peklowin` WHERE `usr`='$log' and `ok`='pvpc' LIMIT 1");
if(mysql_num_rows($elita)==1){
$udata4=$udata4*1.15;}else{$udata4=$udata4;}
$elita=mysql_query("SELECT * FROM `clanwar` WHERE `war`='$udata23' and `war1`='$pkinfo[udata23]' or `war1`='$udata23' and `war`='$pkinfo[udata23]' ");
if(mysql_num_rows($elita)==1){
$dat16=$pkinfo['udata16'];
$met=$udata4;
if($met>$pkinfo['udata3']){
$dataa16 = $pkinfo['udata16'];
$uron = $met-$pkinfo['udata3'];
$dataa16 = $dataa16-$uron;
}else{
$uron=rand(1,6);
$dataa16=$pkinfo['udata16'];
$dataa16 = $dataa16-$uron;
}
mysql_query("UPDATE `users` SET `udata16`='$dataa16' WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."'");
$uron=number_format($uron);
echo'<br>Вы нанесли '.$uron.' игроку '.$nick.' - <br />';
if($dataa16<="0"){
if($pkinfo['udata86']>=1){
$dd=$pkinfo['udata8']/10;
$udata8=$udata8+$dd;
$udata88=$pkinfo['udata8']-$dd;
mysql_query("UPDATE `users` SET `udata8`='$udata8' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata8`='$udata88' WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."'");
$dd=number_format($dd);
echo"<div class="title block_2 s">Вы выиграли! Вам выпало $dd аден.<br />";}else{echo'Вы выиграли!</div>';}
$udata85=$udata85+1;
mysql_query("UPDATE `users` SET `udata85`='$udata85' WHERE `udata0`='$log'");
$aglava=mysql_query("SELECT * FROM `clan` WHERE `clan0`='$udata23' ");
$arrs= mysql_fetch_array($aglava);
$ggg1=$arrs['clan11'];
$ggg11=$ggg1+1;
mysql_query("UPDATE `clan` SET `clan11`='$ggg11' WHERE `clan0`='$udata23'");
$time1 = date("H:i:s/d.m.y");
mysql_query("INSERT INTO clanlog SET clan='$udata23',msg='Игрок <a href="search.php?&nick=$log&go=go">$log</a> заработал очко репутации'");
$aglava=mysql_query("SELECT * FROM `clan` WHERE `clan0`='$pkinfo[udata23]' ");
$arrs= mysql_fetch_array($aglava);
$ggg11=$arrs['clan11'];
$ggg111=$ggg11-1;
mysql_query("UPDATE `clan` SET `clan11`='$ggg111' WHERE `clan0`='$pkinfo[udata23]'");
$time1 = date("H:i:s/d.m.y");
mysql_query("INSERT INTO clanlog SET clan='$pkinfo[udata23]',msg='Игрок <a href="search.php?&nick=$log&go=go">$nick</a> потерял очко репутации'");
$req = mysql_query("SELECT * FROM `peklo` WHERE `usr` = '$log' and `ok` = 'pk'");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
$req = mysql_query("SELECT * FROM `peklo` WHERE `usr` = '$log' and `ok` = 'pvpc'");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
if($res==0){
mysql_query("INSERT INTO
`peklo` SET
`usr` = '$log',
`kol` = '1',
`ok` = 'pvpc'");
}else{
$nk=$rs[kol]+1;
mysql_query("UPDATE `peklo` SET `kol` = '$nk' WHERE `usr` = '$log' and `ok` = 'pvpc'");}
$udata48=dead;
$udata49=$log;
mysql_query("UPDATE `users` SET `udata48`='$udata48' WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."'");
mysql_query("UPDATE `users` SET `udata49`='$udata49' WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."'");
}
}
}
if (isset($pk)){
$pk=mysql_query("SELECT * FROM `users` WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."' LIMIT 1");
$pkinfo= mysql_fetch_array($pk);
$elita=mysql_query("SELECT * FROM `clanwar` WHERE `war`='$udata23' and `war1`='$pkinfo[udata23]' or `war1`='$udata23' and `war`='$pkinfo[udata23]' ");
if(mysql_num_rows($elita)==0){
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='santipk'and `nick`='$pkinfo[udata0]' LIMIT 1");
if(mysql_num_rows($elita)==1){echo'Игрок зашишён АНТИ-ПК аккаунтом';header ("Location: okrestnosti.php?antipk");exit;}
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='antipk'and `nick`='$pkinfo[udata0]' LIMIT 1");
if(mysql_num_rows($elita)==1){echo'Игрок зашишён АНТИ-ПК аккаунтом';header ("Location: okrestnosti.php?antipk");exit;}
if($udata37=="TWI"){header ("Location: okrestnosti.php?izmer");exit;}
if ($udata9<20){header ("Location: okrestnosti.php?lvlmy");exit;}
if($nick==$log){echo'Вы не можете напасть на самого себя!<br /><a href="okrestnosti.php?log='.$log.'&pas='.$pas.'">назад</a>';include_once"files/down.php";exit;}
if($data<0){header ("Location: okrestnosti.php?dead");exit;}
if($udata37!=="$pkinfo[udata37]"){header ("Location: okrestnosti.php?okr");exit;}
$polzs=mysql_query("SELECT * FROM `users` WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."' LIMIT 1");
if(mysql_num_rows($polzs)==0){header ("Location: okrestnosti.php?user"); exit; }
if ($pkinfo[udata9]<"40"){header ("Location: okrestnosti.php?lvl");exit;}
if($pkinfo['udata55']!=="$udata55"){
header ("Location: okrestnosti.php?okrerr");
}
if($udata37!==$pkinfo['udata37'] && $pkinfo['udata55']!=="/okrestnosti.php" && $udata55!=="/okrestnosti.php"){
header ("Location: okrestnosti.php?okrerr");
}
$datpk48=$pkinfo['udata48'];
if($pkinfo['udata48'] == "dead"){
header ("Location: okrestnosti.php?dead");exit;}
$elita=mysql_query("SELECT * FROM `peklowin` WHERE `usr`='$log' and `ok`='ataka' LIMIT 1");
if(mysql_num_rows($elita)==1){
$udata4=$udata4*1.15;}else{$udata4=$udata4;}
$elita=mysql_query("SELECT * FROM `peklowin` WHERE `usr`='$log' and `ok`='lov' LIMIT 1");
if(mysql_num_rows($elita)==1){
$udata3=$udata3*1.15;}else{$udata3=$udata3;}
$elita=mysql_query("SELECT * FROM `peklowin` WHERE `usr`='$log' and `ok`='pvp' LIMIT 1");
if(mysql_num_rows($elita)==1){
$udata4=$udata4*1.15;}else{$udata4=$udata4;}
$elita=mysql_query("SELECT * FROM `peklowin` WHERE `usr`='$log' and `ok`='pvpc' LIMIT 1");
if(mysql_num_rows($elita)==1){
$udata4=$udata4*1.15;}else{$udata4=$udata4;}
$dat16=$pkinfo['udata16'];
$met=$udata4;
if($met>$pkinfo['udata3']){
$dataa16 = $pkinfo['udata16'];
$uron = $met-$pkinfo['udata3'];
$dataa16 = $dataa16-$uron;
}else{
$uron=rand(1,6);
$dataa16=$pkinfo['udata16'];
$dataa16 = $dataa16-$uron;
}
mysql_query("UPDATE `users` SET `udata16`='$dataa16' WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."'");
$uron=number_format($uron);
echo'<br><div class="title block_2 s">Вы нанесли '.$uron.' игроку '.$nick.'</div>';
if($dataa16<="0"){
if($pkinfo['udata86']>=1){
$dd=$pkinfo['udata8']/10;
$udata8=$udata8+$dd;
$udata88=$pkinfo['udata8']-$dd;
mysql_query("UPDATE `users` SET `udata8`='$udata8' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata8`='$udata88' WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."'");
$dd=number_format($dd);
echo"<div class="title block_2 s">Вы выиграли! Вам выпало $dd аден.</div>";}else{echo'<div class="title block_2 s">Вы выиграли!</div>';}
if($udata37!=="$udata20 Castle"){
if($pkinfo['udata86']<=0){
$udata86=$udata86+100;
mysql_query("UPDATE `users` SET `udata86`='$udata86' WHERE `udata0`='$log'");
$udata61=$udata61+1;
mysql_query("UPDATE `users` SET `udata61`='$udata61' WHERE `udata0`='$log'");
$req = mysql_query("SELECT * FROM `peklo` WHERE `usr` = '$log' and `ok` = 'pk'");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
if($res==0){
mysql_query("INSERT INTO
`peklo` SET
`usr` = '$log',
`kol` = '1',
`ok` = 'pk'");
}else{
$nk=$rs[kol]+1;
mysql_query("UPDATE `peklo` SET `kol` = '$nk' WHERE `usr` = '$log' and `ok` = 'pk'");
}}else
if($pkinfo['udata86']>=1){
$req = mysql_query("SELECT * FROM `peklo` WHERE `usr` = '$log' and `ok` = 'pvp'");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
if($res==0){
mysql_query("INSERT INTO
`peklo` SET
`usr` = '$log',
`kol` = '1',
`ok` = 'pvp'");
}else{
$nk=$rs[kol]+1;
mysql_query("UPDATE `peklo` SET `kol` = '$nk' WHERE `usr` = '$log' and `ok` = 'pvp'");}
$udata85=$udata85+1;
mysql_query("UPDATE `users` SET `udata85`='$udata85' WHERE `udata0`='$log'");
}
}else{
$udata85=$udata85+1;
mysql_query("UPDATE `users` SET `udata85`='$udata85' WHERE `udata0`='$log'");
if($pkinfo['udata23']!=="" and $pkinfo['udata23']!=="$udata23"){
$aglava=mysql_query("SELECT * FROM `clan` WHERE `clan0`='$udata23' ");
$arrs= mysql_fetch_array($aglava);
$ggg1=$arrs['clan11'];
$ggg11=$ggg1+1;
mysql_query("UPDATE `clan` SET `clan11`='$ggg11' WHERE `clan0`='$udata23'");
$time1 = date("H:i:s/d.m.y");
mysql_query("INSERT INTO clanlog SET clan='$udata23',msg='Игрок <a href="search.php?&nick=$log&go=go">$log</a> заработал очко репутации'");
$aglava=mysql_query("SELECT * FROM `clan` WHERE `clan0`='$pkinfo[udata23]' ");
$arrs= mysql_fetch_array($aglava);
$ggg11=$arrs['clan11'];
$ggg111=$ggg11-1;
mysql_query("UPDATE `clan` SET `clan11`='$ggg111' WHERE `clan0`='$pkinfo[udata23]'");
$time1 = date("H:i:s/d.m.y");
mysql_query("INSERT INTO clanlog SET clan='$pkinfo[udata23]',msg='Игрок <a href="search.php?&nick=$log&go=go">$nick</a> потерял очко репутации'");
}
$req = mysql_query("SELECT * FROM `peklo` WHERE `usr` = '$log' and `ok` = 'pvpc'");
$res=mysql_num_rows($req);
$rs = mysql_fetch_array($req);
if($res==0){
mysql_query("INSERT INTO
`peklo` SET
`usr` = '$log',
`kol` = '1',
`ok` = 'pvpc'");
}else{
$nk=$rs[kol]+1;
mysql_query("UPDATE `peklo` SET `kol` = '$nk' WHERE `usr` = '$log' and `ok` = 'pvpc'");
}
}
$udata48=dead;
$udata49=$log;
mysql_query("UPDATE `users` SET `udata48`='$udata48' WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."'");
mysql_query("UPDATE `users` SET `udata49`='$udata49' WHERE `udata0`='".mysql_real_escape_string($_GET[nick])."'");
}
}
}
############################
if (isset($monstr)){echo'<div class="warning s">Вы ненапали на монстра.</div>';}
if (isset($antipk)){echo'<div class="warning s">Игрок зашишён АНТИ-ПК аккаунтом</div>';}
if (isset($izmer)){echo'<div class="warning s">В измерении PK и PVP не работают.</div>';}
if (isset($lvlmy)){echo'<div class="warning s">PK можно только по достижении 20 уровня.</div>';}
if (isset($dead)){echo'<div class="warning s">Игрок мертв.</div>';}
if (isset($user)){echo'<div class="warning s">Такого игрока не сушествует.</div>';}
if (isset($okr)){echo'<div class="warning s">Игрок Offline или вышел из окрестности.</div>';}
if (isset($okrerr)){echo'<div class="warning s">Игрок Offline или вышел из окрестности.</div>';}
if (isset($lvl)){echo'<div class="warning s">У игрока слишком низкий уровень.</div>';}
$thread5 = mysql_query("SELECT * from `questpet` WHERE `login`='".$log."' and `statys`!='complete' and `statys`!='failed' LIMIT 1");
$avto5=mysql_num_rows($thread5);
if($avto5==1){
$req = mysql_query("SELECT * FROM `item` WHERE `uda7` = '$log' and `uda4` = 'Сухая роза'");
$res=mysql_fetch_array($req);
if($res[uda3]=="5" and $udata37=="Beehive"){echo"<div class="warning s">Задание: собрать 5 сухих роз с монстров! - Выполнено (для продолжния квеста нажмите на имя Кристина снизу страницы)</br>Дополнительно: собрать 20 сухих роз с монстров!</div>";}
$req = mysql_query("SELECT * FROM `item` WHERE `uda7` = '$log' and `uda4` = 'Сухая роза'");
$res=mysql_fetch_array($req);
if($res[uda3]=="20" and $udata37=="Beehive"){echo"<div class="warning s">Дополнительно: собрать 20 сухих роз с монстров! - Выполнено (для продолжния квеста нажмите на имя Кристина снизу страницы)</div>";}
$thread1 = mysql_query("SELECT * from `questpet` WHERE `login`='".$log."' and `statys`='kristina' LIMIT 1");
$avto1=mysql_num_rows($thread1);
if($avto1==1 and $udata37=="Beehive"){
mysql_query("UPDATE `questpet` SET `statys` = 'res' WHERE `login`='$log' LIMIT 1");
echo"<div class="warning s">Задание: собрать 5 сухих роз с монстров!</br>Дополнительно: собрать 20 сухих роз с монстров!</div>";}
$thread = mysql_query("SELECT * from `questpet` WHERE `login`='".$log."' and `statys`='prinyal' LIMIT 1");
$avto=mysql_num_rows($thread);
if($udata37=="Beehive" and $avto==1){ header ("Location: lizaquest.php?");}
}
if(empty($startan)) $startan = 0;
$startan=intval($startan);
if($startan<0) $startan=0; $num_msgs_an=10;
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `monstr_dead`='yes' and `uron`>'0' and `nagrada`='no'");
while($tm=mysql_fetch_array($tmp))
{
echo '<a href="okrestnosti.php?&go=win&id='.$tm[id_monstr].'&startan=0&">Собрать награду с '.$tm[monstr].'</a><br/>';}
mysql_query("DELETE FROM `tmp_battle` WHERE `monstr_dead`='yes' and `nagrada`='yes'");
$arrr = mysql_query("SELECT * from `okrestnosti` where `mob4`='".$udata37."' and `mob7`<('".time()."'-'300') ");
if (mysql_affected_rows() == 0)
{
echo"<br>Монстров нет!";
include_once("files/down1.php");exit();
}
$qi = mysql_query("SELECT * from `okrestnosti` where `mob4`='".$udata37."' and `mob7`<('".time()."'-'300') ORDER by `mob1` LIMIT $startan,$num_msgs_an;;; ");
while($row=mysql_fetch_array($qi))
{
$hp = round($row['mob2']*100/$row['mob3']);
if($row['mob8']!=="RaidBoss"){
echo '<a href="okrestnosti.php?&go=info&id='.$row['id'].'"><b>'.$row['mob0'].'</b></a> (<font color=red>Уровень: '.$row['mob1'].', Жизнь: '.$hp.' %</font>)<br /><img src="img/online.png" alt="pic"/><a href="ok.php?&id='.$row['id'].'&startan='.$startan.'">Атаковать</a><br/>';}else
if($row['mob8']=="RaidBoss"){
echo '<a href="okrestnosti.php?&go=info&id='.$row['id'].'"><i><font color=yellow><b>'.$row['mob0'].'</b></font></i></a> (<font color=red>Уровень: '.$row['mob1'].', Жизнь: '.$hp.' %</font>)<br /><img src="img/online.png" alt="pic"/><a href="ok.php?&id='.$row['id'].'&startan='.$startan.'">Атаковать</a><br/>';}else
if($row['mob0']=="UFUS"){
echo '<a href="okrestnosti.php?&go=info&id='.$row['id'].'"><i><font color=#FF0000><b>'.$row['mob0'].'</b></font></i></a> (<font color=red>Уровень: '.$row['mob1'].', Жизнь: '.$hp.' %</font>)<br /><img src="img/online.png" alt="pic"/><a href="ok.php?&id='.$row['id'].'&startan='.$startan.'">Атаковать</a><br/>';
}
}
$startan = $_GET['startan'];
if(empty($startan)) $startan = 0;
$startan=intval($startan);
if($startan<0) $startan=0; $num_msgs_an=10;
$arr = mysql_query("SELECT * from `okrestnosti` where `mob4`='".$udata37."' and `mob7`<('".time()."'-'300') ");
$i = mysql_num_rows($arr);
if ($i > $startan + 10) {echo '<br><small><a href="okrestnosti.php?startan='.($startan + 10).'&">Пройти вперед</a></small>';}
if ($startan != 0) {echo '<small></small><br/><small><a href="okrestnosti.php?startan='.($startan - 10).'&">Пройти назад</a></small><br>';}else{echo'<small></small><br/>';}
////////////////////
$num = mysql_fetch_array(mysql_query("select count(id) as num from `okrestnosti` where `mob4`='".$udata37."' and mob7<('".time()."'-'300') "));
echo"<br>- - -<br>Здесь монстров: $num[0]";
echo"<br>- - -<br><a href="lake.php?">Озеро</a>";
if($udata37=="Beehive"){
$req = mysql_query("SELECT * FROM `item` WHERE `uda7` = '$log' and `uda4` = 'Сухая роза'");
$res=mysql_fetch_array($req);
if($res[uda3]>="5" or $res[uda3]>="20"){
echo"<br>- - -<br><a href="lizaquest.php?&type=complete">Кристина</a>";
}}
break;
case 'info':
$id = htmlspecialchars(stripslashes($id));
$mobinfo=mysql_query("SELECT * FROM `okrestnosti` WHERE `id`='".abs(intval($id))."' LIMIT 1");
$mobinfo= mysql_fetch_array($mobinfo);
$id=$mobinfo['id'];
$mob0=$mobinfo['mob0'];
$mob1=$mobinfo['mob1'];
$mob2=$mobinfo['mob2'];
$mob3=$mobinfo['mob3'];
$mob4=$mobinfo['mob4'];
$mob5=$mobinfo['mob5'];
$mob8=$mobinfo['mob8'];
$mob9=$mobinfo['mob9'];
$mob10=$mobinfo['mob10'];
$mob11=$mobinfo['mob11'];
$mob12=$mobinfo['mob12'];
$mob6=$mobinfo['mob6'];
$mob11 = number_format($mob11);
$mob12 = number_format($mob12);
$file = @file("data/monstrs/$udata37/$id.dat");
$data = explode("||",$file[0]);
$mob5=$mob5;
$mobs2=$mob3;
$mobs3=$mob3/4;
$mobs4=$mob3;
$mobs2=number_format($mobs2);
$mobs3=number_format($mobs3);
$mobs4=number_format($mobs4);
echo"<b>$mob0</b><br/>";
echo"Уровень: $mob1<br/>";
echo"HP: $mob2/$mob3<br/>";
if($mob8!=="RaidBoss"){echo"Защита: $mob6<br/>";}
echo"Физическая атака: $mob5";
if($mob8=="RaidBoss"){echo" - $mob6";}
echo"</br>Магическая атака: $mob11";
if($mob8=="RaidBoss"){echo" - $mob12";}
if($mob8=="RaidBoss"){
echo"</br>Урон наносимый рб: $mob5";
echo" - $mob6";}
echo"<br><br><b>Базовый дроп</b><br>";
echo"Опыт: $mobs2<br>
Аден: $mobs4<br>
SP: $mobs3
";
echo "</br><b>Дроп ресурсов:</b></br>";
$req = mysql_query("SELECT * FROM `drops` WHERE `mob` = '$mob0' AND `drop13`='$udata37' ");
while($avto = mysql_fetch_array($req)){
$shans=$avto[drop3]/100;
echo "$avto[drop1] - $shans% ($avto[drop8] - $avto[drop9])</br>";
}
echo "</br><b>Спойл ресурсов:</b></br>";
$req = mysql_query("SELECT * FROM `spoil` WHERE `mob` = '$mob0' ");
while($avto = mysql_fetch_array($req)){
$shans=$avto[spoil3]/100;
echo "$avto[spoil1] - $shans% ($avto[spoil8] - $avto[spoil9])</br>";
}
echo"<br><br/><a href="javascript:history-back(1)">Назад</a><br>";
break;
}
}else{echo'Вы находитесь не в окрестностях!';include_once'files/down.php';exit;
}
}
include_once"files/down1.php";
?>