Файл: l2ps_v5/okrestnosti.php
Строк: 994
<?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'");
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]*0.3);
$exp=round($tm[uron]*0.4);
$sp=round($exp/0.5);
}else
if($mob0=="Guard"){
$aden=0;
$exp=0;
$sp=0;
}else{
$aden=round($tm[uron]*0.6);
$exp=round($tm[uron]*0.9);
$sp=round($exp/1.1);}
}else
if($udata9>"40"){
if($mob8=="RaidBoss"){
$aden=round($tm[uron]*0.3);
$exp=round($tm[uron]*0.4);
$sp=round($exp/0.5);
}else
if($mob0=="Guard"){
$aden=0;
$exp=0;
$sp=0;
}else{
$aden=round($tm[uron]*0.6);
$exp=round($tm[uron]*0.9);
$sp=round($exp/1.1);}
}
$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/1;
$exp1=$exp/1;
$sp1=$sp/1;
}else
if(mysql_num_rows($paty)==2){
$aden1=$aden/2;
$exp1=$exp/2;
$sp1=$sp/2;
}else
if(mysql_num_rows($paty)==3){
$aden1=$aden/3;
$exp1=$exp/3;
$sp1=$sp/3;
}else
if(mysql_num_rows($paty)==4){
$aden1=$aden/4;
$exp1=$exp/4;
$sp1=$sp/4;
}else
if(mysql_num_rows($paty)==5){
$aden1=$aden/5;
$exp1=$exp/5;
$sp1=$sp/5;
}else
if(mysql_num_rows($paty)==6){
$aden1=$aden/6;
$exp1=$exp/6;
$sp1=$sp/6;
}else
if(mysql_num_rows($paty)==7){
$aden1=$aden/7;
$exp1=$exp/7;
$sp1=$sp/7;
}
$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"Игрок $p[paty1] получил Аден: <img src='l2pic/money/aden.gif' alt='pic'/> $aden1, Опыта: $exp1, SP: <img src='l2pic/money/sp.png' alt='pic'/> $sp1<br> ";
}
}
}
//////////////////////////
$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/1;
$exp1=$exp/1;
$sp1=$sp/1;
}else
if(mysql_num_rows($paty1)==2){
$aden1=$aden/2;
$exp1=$exp/2;
$sp1=$sp/2;
}else
if(mysql_num_rows($paty1)==3){
$aden1=$aden/3;
$exp1=$exp/3;
$sp1=$sp/3;
}else
if(mysql_num_rows($paty1)==4){
$aden1=$aden/4;
$exp1=$exp/4;
$sp1=$sp/4;
}else
if(mysql_num_rows($paty1)==5){
$aden1=$aden/5;
$exp1=$exp/5;
$sp1=$sp/5;
}else
if(mysql_num_rows($paty1)==6){
$aden1=$aden/6;
$exp1=$exp/6;
$sp1=$sp/6;
}else
if(mysql_num_rows($paty1)==7){
$aden1=$aden/7;
$exp1=$exp/7;
$sp1=$sp/7;
}
$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"Игрок $p[paty0] получил Аден: <img src='l2pic/money/aden.gif' alt='pic'/> $aden1, Опыта: $exp1, SP: <img src='l2pic/money/sp.png' alt='pic'/> $sp1<br> ";
}
}
}
////////////////////////////////////////////////////////////////////////
$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*0.9;
$exp=$exp*1.3;
$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*1.2;
$exp=$exp*1.8;
$sp=$sp*2.2;}
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='gold'and `nick`='$log' LIMIT 1");
if(mysql_num_rows($elita)==1){
$aden=$aden*1.5;
$exp=$exp*2.2;
$sp=$sp*2.7;}
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='premium'and `nick`='$log' LIMIT 1");
if(mysql_num_rows($elita)==1){
$aden=$aden*1.8;
$exp=$exp*2.7;
$sp=$sp*3.2;}
$elita=mysql_query("SELECT * FROM `table_vip` WHERE `tip`='santipk'and `nick`='$log' LIMIT 1");
if(mysql_num_rows($elita)==1){
$aden=$aden*1.2;
$exp=$exp*1.8;
$sp=$sp*2.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,100);
$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/4;
$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/5;
$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/1;
$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"$pi[name] получил $rexp опыта<br>";
}
}
$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 `npc` SET `mob4`='$okrrand[name]' WHERE `id`='".abs(intval($id))."'");
}
if($mob8=="L2RaidBoss" or $type=="L2GrandBoss"){
$raid=rand(10,70);
$udata51a=$udata51+$raid;
mysql_query("UPDATE `users` SET `udata51`='$udata51' WHERE `udata0`='$log'");
echo "Получено: <img src='l2pic/money/reid.gif' alt='pic'/> <i> $raid</i> рейдовых очёк</br><br>";
$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(21,33);}
if($random_drop==2 or $random_drop==3){
$qi = mysql_query("SELECT * from `droplist` WHERE `mobId`='$n[drop_id]' and `chance`<='$shans_inv' and `itemId`!='57' ORDER BY RAND() LIMIT 3");
$none=mysql_num_rows($qi);
if($none>=1){
$row=mysql_fetch_array($qi);
while($row=mysql_fetch_array($qi)){
$armor = mysql_query("SELECT * from `l2pirates_armor` WHERE `item_id`='$row[itemId]' LIMIT 3");
if(mysql_num_rows($armor)==1){
$arm=mysql_fetch_array($armor);
$arm[p_def]==$arm[p_def]+20;
$arm[m_def]==$arm[m_def]+20;
mysql_query("INSERT INTO`armor_item` SET`login` = '$log',`item_id` = '$arm[item_id]',`name` = '".mysql_real_escape_string($arm[name])."',`bodypart` = '$arm[bodypart]',`crystallizable` = '$arm[crystallizable]',`armor_type` = '$arm[armor_type]',`material` = '$arm[material]',`crystal_type` = '$arm[crystal_type]',`p_def` = '$arm[p_def]',`m_def` = '$arm[m_def]',`mp_bonus` = '$arm[mp_bonus]',`price` = '$arm[price]',`pic`='".mysql_real_escape_string($arm[pic])."'");
echo"Выпало: <b>$arm[name]</b>.<br>";
}
$weapon = mysql_query("SELECT * from `l2pirates_weapon` WHERE `item_id`='$row[itemId]' LIMIT 3");
if(mysql_num_rows($weapon)==1){
$w=mysql_fetch_array($weapon);
$w[dam]==$w[dam]+20;
$w[dam]==$w[dam]+20;
mysql_query("INSERT INTO `weapon_item` (`id`, `login`, `item_id`, `name`, `bodypart`, `crystallizable`, `soulshots`, `spiritshots`, `material`, `crystal_type`, `p_dam`, `weaponType`, `critical`, `atk_speed`, `m_dam`, `price`, `crystal_count`, `dropable`,`pic`) VALUES ('', '$log', '$w[item_id]', '".mysql_real_escape_string($w[name])."', '$w[bodypart]', '$w[crystallizable]', '$w[soulshots]', '$w[spiritshots]', '$w[material]', '$w[crystal_type]', '$w[p_dam]', '$w[weaponType]', '$w[critical]', '$w[atk_speed]', '$w[m_dam]', '$w[price]', '$w[crystal_count]', '$w[dropable]' '$w[dropable]','".mysql_real_escape_string($w[pic])."');");
echo"Выпало: <b>$w[name]</b>.<br>";
}
}
}
}
/*$req = mysql_query("SELECT * FROM `armor` WHERE `id`='$st' ");
$drop = mysql_fetch_array($req);
mysql_query("INSERT INTO `armor_item` VALUES ('', '$drop[name]', '$drop[bodypart]', '$drop[crystallizable]' , '$drop[weight]' , '$drop[material]' , '$drop[crystal_type]' , '$drop[p_def]' , '$drop[m_def]' , '$drop[mp_bonus]' , '$drop[kartinka]' , '$drop[price]' , '".$log."' )") or die(mysql_error());
if($drop[name]>""){
echo "Выпала вторая вещь: <b>$drop[name]</b></br>";}*/
$date=date("d.m.y");
$time=date("H:i");
mysql_query("INSERT INTO `zametki` VALUES ('', 'Выпала вещь $drop[name].', 'Система', '".$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 "Вы получили: $vesh[vesh7] <u> $vesh[vesh4]</u><br />";
}
$randres=rand(1,5000);
$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,3000);
$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"Спойл: <b>$randkol $drop[spoil1]</b><br>";
}
}
include_once("files/okrquest.php");
///////////////////////////////квест на пета////////////////////////////////////////
$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"Выпала: <i>Сухая роза</i><br>";
}
}
$aden=number_format($aden);
$exp=number_format($exp);
$sp=number_format($sp);
echo "Выпало: Аден: <img src='l2pic/money/aden.gif' alt='pic'/> $aden, Опыта: $exp, SP: <img src='l2pic/money/sp.png' alt='pic'/> $sp<br>";
$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'");
$aglava=mysql_query("SELECT * FROM `clan` WHERE `clan0`='$udata23' ");
$arrs= mysql_fetch_array($aglava);
$ggg1=$arrs['clan11'];
$ggg11=$ggg1+1500;
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='$time1 - Клан захватил город $udata20 и зароботал 1500 очков репутации'");
$aglava=mysql_query("SELECT * FROM `clan` WHERE `clan0`='$pkinfo[udata23]' ");
$arrs= mysql_fetch_array($aglava);
$ggg11=$arrs['clan11'];
$ggg111=$ggg11-1500;
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='$udata23',msg='$time1 - Клан не смог защитить свой замок и потнрял 1,500 очков репутации'");
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"){
//if($udata20=="$udata20 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 `nalog`='0' WHERE `money`='$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:
$req = mysql_query("SELECT * FROM `l2pirates_config` WHERE `okrestnosti` = '1' LIMIT 1");
////////////////////////////
if (mysql_num_rows($req)==1){echo"Идут технические роботы! Извените за неудобство!";
include ("files/down.php");
exit;
}
############################# 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"Вы выиграли! Вам выпало $dd аден.<br />";}else{echo'Вы выиграли!<br />';}
$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>Вы нанесли '.$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"Вы выиграли! Вам выпало $dd аден.<br />";}else{echo'Вы выиграли!<br />';}
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'Вы ненапали на монстра.<br/>';}
if (isset($antipk)){echo'Игрок зашишён АНТИ-ПК аккаунтом<br/>';}
if (isset($izmer)){echo'В измерении PK и PVP не работают.<br/>';}
if (isset($lvlmy)){echo'PK можно только по достижении 20 уровня.<br/>';}
if (isset($dead)){echo'Игрок мертв.<br/>';}
if (isset($user)){echo'Такого игрока не сушествует.<br/>';}
if (isset($okr)){echo'Игрок Offline или вышел из окрестности.<br/>';}
if (isset($okrerr)){echo'Игрок Offline или вышел из окрестности.<br/>';}
if (isset($lvl)){echo'У игрока слишком низкий уровень.<br/>';}
$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"Задание: собрать 5 сухих роз с монстров! - Выполнено (для продолжния квеста нажмите на имя Кристина снизу страницы)</br>Дополнительно: собрать 20 сухих роз с монстров!</br>";}
$req = mysql_query("SELECT * FROM `item` WHERE `uda7` = '$log' and `uda4` = 'Сухая роза'");
$res=mysql_fetch_array($req);
if($res[uda3]=="20" and $udata37=="Beehive"){echo"Дополнительно: собрать 20 сухих роз с монстров! - Выполнено (для продолжния квеста нажмите на имя Кристина снизу страницы)</br>";}
$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"Задание: собрать 5 сухих роз с монстров!</br>Дополнительно: собрать 20 сухих роз с монстров!</br>";}
$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/down.php");exit();
}
$qi = mysql_query("SELECT * from `okrestnosti` where `mob4`='".$udata37."' and `mob7`<('".time()."'-'300') ORDER by `mob7` LIMIT $startan,$num_msgs_an;;; ");
while($row=mysql_fetch_array($qi))
{
if($row['mob8']!=="RaidBoss"){
echo '[<a href="okrestnosti.php?&go=info&id='.$row['id'].'">?</a>] <a href="ok.php?&id='.$row['id'].'&startan='.$startan.'">'.$row['mob0'].'</a>['.$row['mob1'].'] <br/>';}else
if($row['mob8']=="RaidBoss"){
echo '[<a href="okrestnosti.php?&go=info&id='.$row['id'].'">?</a>] <a href="ok.php?&id='.$row['id'].'&startan='.$startan.'"><i><b><font color=yellow>'.$row['mob0'].'</font></b></i></a>['.$row['mob1'].'] <br/>';}else
if($row['mob0']=="UFUS"){
echo '[<a href="okrestnosti.php?&go=info&id='.$row['id'].'">?</a>] <a href="ok.php?&id='.$row['id'].'&startan='.$startan.'"><i><b><font color=#FF0000>'.$row['mob0'].'</font></b></i></a>['.$row['mob1'].'] <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]";
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':
$npc = mysql_query("SELECT * from `okrestnosti` WHERE `id`='".abs(intval($_GET[id]))."' LIMIT 1 ");
$n=mysql_fetch_array($npc);
$none=mysql_num_rows($npc);
if($none==0){echo"Неверный ID монстра.";include('files/d_one.php');exit;}
if($n[aggro]=="yes"){$aggro="<font color=red>Агрессивный</font>";}else{$aggro="Пассивный";}
echo"<b>$n[mob0]</b><br>---<br><center><b>Основные характеристики:</b></center><br>$aggro<br>---<br>Уровень : $n[mob1]<br>HP : $n[mob2]/$n[mob3]<br>MP : $n[mp]/$n[allmp]<br>P.att : $n[mob5]<br>M.att : $n[mob11]<br>P.def : $n[mob6]<br>M.def : $n[mob12]<br>---<br>";
echo"<br>Аден (1 - $n[mob3])<br>";
echo"Exp: ".round($n[mob3]*3)." <br> SP: ".round($n[mob3]/5)."<br>---<br><br>";
echo"<center><b>Дроп:</b></center><br>";
$qi = mysql_query("SELECT * from `droplist` WHERE `mobId`='$n[drop_id]' and `itemId`!='57'");
$none=mysql_num_rows($qi);
if($none==0){
echo"Ничего не выпадает:(<br />";
}
while($row=mysql_fetch_array($qi))
{
$qi1a = mysql_query("SELECT * from `armor` WHERE `item_id`='$row[itemId]' ");
while($row1a=mysql_fetch_array($qi1a))
{
$shans = round(($row[chance]/10000),4);
if($row[max]>1){$max = ", $row[min] - $row[max])<br>";}else{$max = ")<br>";}
echo"<b>$row1a[name]</b> ($shans % $max";
}
$qi1w = mysql_query("SELECT * from `weapon` WHERE `item_id`='$row[itemId]' ");
while($row1w=mysql_fetch_array($qi1w))
{
$shans = round(($row[chance]/10000),4);
if($row[max]>1){$max = ", $row[min] - $row[max])<br>";}else{$max = ")<br>";}
echo"<b>$row1w[name]</b> ($shans % $max";
}
$qi1 = mysql_query("SELECT * from `etcitem` WHERE `item_id`='$row[itemId]' ");
while($row1=mysql_fetch_array($qi1))
{
$shans = round(($row[chance]/10000),4);
if($row[max]>1){$max = ", $row[min] - $row[max])<br>";}else{$max = ")<br>";}
echo"<b>$row1[name]</b> ($shans % $max";
}}
if($n[time]>=time()){
echo"<br><hr>Восстановится через:";
$rtime = $n[time] - time();
$gtime = gtime($rtime);
echo''. $gtime.'<br>';
}
$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);
$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/>";//имя, mob4- лока
echo"Уровень: $mob1<br/>";
echo"HP: $mob2/$mob3<br/>";
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/down.php";
?>