Файл: udar.php
Строк: 459
<?php
include("files/ini.php");
include("files/data.php");
$ref=rand(1,3);
$ref2=rand(1,3);
if($udata37==""){include_once("files/zag.php");echo'Вы находитесь не в окрестностях!';include_once'files/down.php';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;}
/////////////////////////////////////////////////
$test = mysql_query("SELECT * FROM `weapon_item` WHERE `login`='$log' and `name`='$udata12' LIMIT 1");
$ts=mysql_fetch_array($test);
if($ts[weaponType]=="dual"){$ts[weaponType]=7;}
if($ts[weaponType]=="sword"){$ts[weaponType]=1;}
if($ts[weaponType]=="bow"){$ts[weaponType]=2;}
if($ts[weaponType]=="blunt"){$ts[weaponType]=3;}
if($ts[weaponType]=="dagger"){$ts[weaponType]=4;}
if($ts[weaponType]=="pole"){$ts[weaponType]=5;}
if($ts[weaponType]=="dualfist"){$ts[weaponType]=6;}
if($ts[weaponType]=="etc"){$ts[weaponType]=10;}
$elita=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='$ts[weaponType]' LIMIT 1 ");
$stats=mysql_fetch_array($elita);
$ts1=mysql_num_rows($elita);
if($ts1==1){
$udata4=$udata4+$stats[kol];}else{$udata4=$udata4;}
/////////////////////////////////////////////////
$test = mysql_query("SELECT * FROM `armor_item` WHERE `login`='$log' and `name`='$udata11' LIMIT 1");
$ts=mysql_fetch_array($test);
$elita=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='$ts[armor_type]' LIMIT 1 ");
$stats=mysql_fetch_array($elita);
$ts1=mysql_num_rows($elita);
if($ts1==1){
$udata3=$udata3+$stats[kol];}else{$udata3=$udata3;}
switch($tip) {
case 'weapon':
if($udata16<="0"){ header ("Location: gk.php?&go=lose"); exit;}
if($id=""){
$a = @mysql_query("select * from `okrestnosti` WHERE `mob4`='$udata37' ORDER BY RAND() DESC LIMIT 1 ");
while($arr=mysql_fetch_array($a)){
$mob0=$arr['mob0'];
$mob2=$arr['mob2'];
$mob3=$arr['mob3'];
$mob5=$arr['mob5'];
$mob6=$arr['mob6'];
$mob7=$arr['mob7'];
$mob8=$arr['mob8'];
$mob9=$arr['mob9'];
$mob10=$arr['mob10'];
$mob11=$arr['mob11'];
$mob12=$arr['mob12'];
$id=$arr['id'];
$brow=htmlspecialchars(stripslashes(getenv('HTTP_USER_AGENT')));
$ip=htmlspecialchars(stripslashes($_SERVER['REMOTE_ADDR']));
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='$id' and `monstr_dead`='no' ");
if (mysql_affected_rows()==0)
{
mysql_query("INSERT INTO `tmp_battle` VALUES ('', '".$log."', 'no','".$mob0."','".$id."','no','0','".$ip."/".$brow."')");}
}}
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `monstr_dead`='no' and `id_monstr`='".abs(intval($_GET[id]))."' ");
if (mysql_affected_rows()==0)
{header ("Location: okrestnosti.php?monstr"); exit;}
$qi = mysql_query("select * from `okrestnosti` WHERE `mob4`='".$udata37."' and `mob7`<('".time()."'-'300') and `id`='".abs(intval($_GET[id]))."' ");
if (mysql_affected_rows()==0)
{
header ("Location: okrestnosti.php?monstr"); exit;}
if($id=""){
$test = mysql_query("SELECT * FROM `okrestnosti` WHERE `mob4`='$udata37' ORDER BY RAND() desc LIMIT 1");
$ts=mysql_fetch_array($test);
$_GET[id]=$ts[id];}
$a = @mysql_query("select * from `okrestnosti` WHERE `mob4`='$udata37' and `mob7`<('".time()."'-'300') and `id`='".abs(intval($_GET[id]))."' ");
if (mysql_affected_rows()==0)
{
header ("Location: okrestnosti.php?monstr"); exit;}
while($arr=mysql_fetch_array($a)){
$time = date("H:i:s");
$hp=trim($udata16);
$allhp=trim($udata17);
$mob1=$arr['mob1'];
$mob2=$arr['mob2'];
$mob3=$arr['mob3'];
$mob5=$arr['mob5'];
$mob0=$arr['mob0'];
$mob6=$arr['mob6'];
$mob7=$arr['mob7'];
$mob8=$arr['mob8'];
$mob9=$arr['mob9'];
$mob10=$arr['mob10'];
$mob11=$arr['mob11'];
$mob12=$arr['mob12'];
$id=$arr['id'];
if($udata16<="0"){
$udata48=deadmob;
mysql_query("UPDATE `users` SET `udata48`='$udata48' WHERE `udata0`='".mysql_real_escape_string($log)."'");
header ("Location: gk.php?&go=lose");
exit;}
if($udata37=="$udata20 Castle"){
if($mob0!="Стена"){
$stena = mysql_query("SELECT * FROM `okrestnosti` WHERE `mob4`='$udata20 Castle' AND `mob7`<('".time()."'-'300') AND `mob0`='Стена' LIMIT 1");
$go = mysql_num_rows($stena);
if($go==1){echo'Сначало нужно разрушить стену!';include_once'files/down.php';exit;}
}
if($mob0!="Guard" AND $mob0!="Стена"){
$stena1 = mysql_query("SELECT * FROM `okrestnosti` WHERE `mob4`='$udata20 Castle' AND `mob7`<('".time()."'-'300') AND `mob0`='Guard'");
$go1 = mysql_num_rows($stena1);
if($go1>=1){echo'Сначало нужно убить всех Guard`ов.';include_once'files/down.php';exit;}
}
}
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."'");
if (mysql_affected_rows()==0)
{header ("Location: okrestnosti.php?monstr"); exit;}
$allhp2=trim($mob3);
$die=trim($udat[5]);
$hp2=trim($mob2);
$pit = mysql_query("SELECT * from `pit` WHERE `usr`='".$log."' and `active`='yes' LIMIT 1");
if (mysql_affected_rows()==0)
{
}else{
$pi=mysql_fetch_array($pit);
if($pi[name]=="Дракон"){
$randpit=rand(1,2); }else
if($pi[name]=="Волк"){
$randpit=rand(1,3); }
if($randpit=="1"){
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."'");
$tm=mysql_fetch_array($tmp);
$udarpit=$pi[attack];
$tm[uron]=$tm[uron]+$udarpit;
mysql_query("UPDATE `tmp_battle` SET `uron`='$tm[uron]' WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] нанес $udarpit урона монстру.', '".$log."')");
$udk1=$mob2-$udarpit;
mysql_query("UPDATE `okrestnosti` SET `mob2`='$udk1' WHERE `id`='".abs(intval($_GET[id]))."'");
}else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] промахнулся', '".$log."')");}
$randdef=rand(1,3);
if($randdef=="1"){
$met=$mob5;
if($mob8=="RaidBoss"){
$udarrr=rand($mob11,$mob12);
}else{$udarrr=$met-$pi[def];}
if($udarrr<"0"){ $udarrr="0";}
$pi[hp]=$pi[hp]-$udarrr;
mysql_query("UPDATE `pit` SET `hp`='$pi[hp]' WHERE `usr`='$log' and `active`='yes' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] не успел увернутся от удара и в него попали. Урон: $udarrr', '".$log."')");
}
if($pi[hp]<=0){
mysql_query("UPDATE `pit` SET `hp`='$pi[allhp]',`active`='no' WHERE `usr`='$log' and `active`='yes' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] умер.', '".$log."')");
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
$pitmag = mysql_query("SELECT * from `pitmag` WHERE `login`='".$log."' AND `vid`='petatk' LIMIT 1");
if (mysql_affected_rows()==0)
{
}else{
$pi=mysql_fetch_array($pitmag);
if($pi[vid]=="petatk"){
$randpit=rand(1,3);
if($randpit=="1" or $randpit=="2"){
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."'");
$tm=mysql_fetch_array($tmp);
$udarpit=$pi[attack];
$tm[uron]=$tm[uron]+$udarpit;
mysql_query("UPDATE `tmp_battle` SET `uron`='$tm[uron]' WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] нанес $udarpit урона монстру.', '".$log."')");
$udk1=$mob2-$udarpit;
mysql_query("UPDATE `okrestnosti` SET `mob2`='$udk1' WHERE `id`='".abs(intval($_GET[id]))."'");
}else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] промахнулся', '".$log."')");}
$randdef=rand(1,2);
if($randdef=="1"){
$met=$mob5;
if($mob8=="RaidBoss"){
$udarrr=rand($mob11,$mob12);
}else{$udarrr=$met-$pi[def];}
if($udarrr<"0"){ $udarrr="0";}
$pi[hp]=$pi[hp]-$udarrr;
mysql_query("UPDATE `pitmag` SET `hp`='$pi[hp]' WHERE `login`='$log' AND `vid`='petatk' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] не успел увернутся от удара и в него попали. Урон: $udarrr', '".$log."')");
}
if($pi[hp]<=0){
mysql_query("DELETE FROM `pitmag` WHERE `login`='$log' AND `vid`='petatk' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] убит.', '".$log."')");
}
}}
if($yad==""){
$ref=rand(1,2);
if($ref=="1"){
$udk=$udata4-$mob6;
if($udk<"0"){ $udk="0";}
if($mob8=="RaidBoss"){
$raiduron=$udata4/2;
$udk=rand($mob5,$mob6);
}
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."'");
$tm=mysql_fetch_array($tmp);
if($udk>=$mob2){$udk=$mob2;}
$tm[uron]=$tm[uron]+$udk;
mysql_query("UPDATE `tmp_battle` SET `uron`='$tm[uron]' WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."' LIMIT 1");
$okudar=rand(1,3);
if($okudar=="1"){
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы решительно ударили во врага. <b>Урон $udk</b>', '".$log."')");
}else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Враг пытался увернутся, но вы сильно ударили во врага. <b>Урон $udk</b>', '".$log."')"); }
$udk=$mob2-$udk;
mysql_query("UPDATE `okrestnosti` SET `mob2`='$udk' WHERE `id`='".abs(intval($_GET[id]))."'");
}else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы засомневались и промахнулись.', '".$log."')");}}else{
$thread = mysql_query("SELECT * from `questkristina_mobs` WHERE `login`='".$log."' and `mob_id`='".$id."' LIMIT 1");
$avto=mysql_num_rows($thread);
if($avto==0){
$random=rand(1,100);
if($random<=80){
$thread = mysql_query("SELECT * from `questkristina` WHERE `login`='".$log."' LIMIT 1");
$avto=mysql_fetch_array($thread);
$kills=$avto[kills]+1;
mysql_query("UPDATE `questkristina` SET `kills`='$kills' WHERE `login`='$log'");
$ostatok=500-$avto[kills]-1;
mysql_query("INSERT INTO `questkristina_mobs` VALUES ('".$log."', '".$id."')");
if($ostatok==0){$ostatok="Все мобы отравлены, задание выполнено, возвращайтесь к Кристине!";
mysql_query("Delete from `questkristina_mobs` WHERE `login`='".$log."' ");}
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы успешно отравили монстра. Осталось отравить: $ostatok.', '".$log."')");
}else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Отравление неудалось.', '".$log."')");
}}else{mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы уже отравили этого монстра.', '".$log."')");}}
$refin=rand(1,3);
if($refin=="1"){
$met=$mob5;
$rtip=rand(1,2);
if($rtip=="1"){
if($mob8=="RaidBoss"){
$udarr=rand($mob5,$mob6);
}else{$udarr=$met-$udata3;}
if($udarr<"0"){ $udarr="0";}
$udata16=$udata16-$udarr;
mysql_query("UPDATE `users` SET `udata16`='$udata16' WHERE `udata0`='$log'");
}else{
if($mob8=="RaidBoss"){
$udarr=rand($mob11,$mob12);
}else{$udarr=$met2-$udata82;}
if($udarr<"0"){ $udarr="0";}
$udata16=$udata16-$udarr;
mysql_query("UPDATE `users` SET `udata16`='$udata16' WHERE `udata0`='$log'");
}
$okpopad=rand(1,3);
if($okpopad=="1"){
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы не успели увернуться от удара. <b>Урон $udarr</b>', '".$log."')");
}else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы засомневались и в вас попали. <b>Урон $udarr</b>', '".$log."')");}
}else{
$okprom=rand(1,3);
if($okprom=="1"){
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы отскочили от удара', '".$log."')"); }else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы пригнулись и монстр промахнулся.', '".$log."')");
}
}
if($udata16<="0"){
$udata48=deadmob;
mysql_query("UPDATE `users` SET `udata48`='$udata48' WHERE `udata0`='".mysql_real_escape_string($log)."'");
header ("Location: gk.php?&go=lose");
exit;}
header ("Location: ataka.php?&startan=$startan&id=$id");
}
break;
case 'mag':
if($udata16<="0"){ header ("Location: gk.php?&go=lose"); exit;}
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `monstr_dead`='no' and `id_monstr`='".abs(intval($_GET[id]))."' ");
if (mysql_affected_rows()==0)
{header ("Location: okrestnosti.php?monstr"); exit;}
$qi = mysql_query("select * from `okrestnosti` WHERE `mob4`='".$udata37."' and `mob7`<('".time()."'-'300') and `id`='".abs(intval($_GET[id]))."' ");
if (mysql_affected_rows()==0)
{
header ("Location: okrestnosti.php?monstr"); exit;}
$a = @mysql_query("select * from `okrestnosti` WHERE `mob4`='$udata37' and `mob7`<('".time()."'-'300') and `id`='".abs(intval($_GET[id]))."' ");
if (mysql_affected_rows()==0)
{
header ("Location: okrestnosti.php?monstr"); exit;}
while($arr=mysql_fetch_array($a)){
$time = date("H:i:s");
$hp=trim($udata16);
$allhp=trim($udata17);
$mob1=$arr['mob1'];
$mob2=$arr['mob2'];
$mob3=$arr['mob3'];
$mob5=$arr['mob5'];
$mob0=$arr['mob0'];
$mob6=$arr['mob6'];
$mob7=$arr['mob7'];
$mob8=$arr['mob8'];
$mob9=$arr['mob9'];
$mob10=$arr['mob10'];
$mob11=$arr['mob11'];
$mob12=$arr['mob12'];
$id=$arr['id'];
if($udata16<="0"){
$udata48=deadmob;
mysql_query("UPDATE `users` SET `udata48`='$udata48' WHERE `udata0`='".mysql_real_escape_string($log)."'");
header ("Location: gk.php?&go=lose");
exit;}
if($udata37=="$udata20 Castle"){
if($mob0!="Стена"){
$stena = mysql_query("SELECT * FROM `okrestnosti` WHERE `mob4`='$udata20 Castle' AND `mob7`<('".time()."'-'300') AND `mob0`='Стена' LIMIT 1");
$go = mysql_num_rows($stena);
if($go==1){echo'Сначало нужно разрушить стену!';include_once'files/down.php';exit;}
}
if($mob0!="Guard" AND $mob0!="Стена"){
$stena1 = mysql_query("SELECT * FROM `okrestnosti` WHERE `mob4`='$udata20 Castle' AND `mob7`<('".time()."'-'300') AND `mob0`='Guard'");
$go1 = mysql_num_rows($stena1);
if($go1>=1){echo'Сначало нужно убить всех Guard`ов.';include_once'files/down.php';exit;}
}
}
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."'");
if (mysql_affected_rows()==0)
{header ("Location: okrestnosti.php?monstr"); exit;}
$allhp2=trim($mob3);
$die=trim($udat[5]);
$hp2=trim($mob2);
$qi = mysql_query("SELECT * from `mag` WHERE `mag10`='".$log."' and `id`='".$name."' ");
if (mysql_affected_rows()==0)
{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - У вас нет такой магии.', '".$log."')"); header ("Location: ataka.php?&id=$id&startan=$startan&"); exit;
}
else
{
while($rowi=mysql_fetch_array($qi))
{
if($udata29<$rowi['mag1']){
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Нехватает МР', '".$log."')"); header ("Location: ataka.php?&id=$id&startan=$startan&"); exit;}
$pit = mysql_query("SELECT * from `pit` WHERE `usr`='".$log."' and `active`='yes' LIMIT 1");
if (mysql_affected_rows()==0)
{
}else{
$pi=mysql_fetch_array($pit);
if($pi[name]=="Дракон"){
$randpit=rand(1,2); }else
if($pi[name]=="Волк"){
$randpit=rand(1,3); }
if($randpit=="1"){
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."'");
$tm=mysql_fetch_array($tmp);
$udarpit=$pi[attack];
$tm[uron]=$tm[uron]+$udarpit;
mysql_query("UPDATE `tmp_battle` SET `uron`='$tm[uron]' WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."' LIMIT 1");
mysql_query("UPDATE `okrestnosti` SET `mob2`=('$mob',`active`='no' WHERE `usr`='$log' and `active`='yes' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] нанес $udarpit урона монстру.', '".$log."')");
$mob2=$mob2-$udarpit;
mysql_query("UPDATE `okrestnosti` SET `mob2`='$udk1' WHERE `id`='".abs(intval($_GET[id]))."'");
}else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] промахнулся', '".$log."')");}
$randdef=rand(1,3);
if($randdef=="1"){
$met=$mob5;
if($mob8=="RaidBoss"){
$udarrr=rand($mob11,$mob12);
}else{$udarrr=$met-$pi[def];}
if($udarrr<"0"){ $udarrr="0";}
$pi[hp]=$pi[hp]-$udarrr;
mysql_query("UPDATE `pit` SET `hp`='$pi[hp]' WHERE `usr`='$log' and `active`='yes' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] не успел увернутся от удара и в него попали. Урон: $udarrr', '".$log."')");
}
if($pi[hp]<=0){
mysql_query("UPDATE `pit` SET `hp`='$pi[allhp]',`active`='no' WHERE `usr`='$log' and `active`='yes' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] умер.', '".$log."')");
}
}
////////////////////////////////////////////Пет магов//////////////////////////////
$pitmag = mysql_query("SELECT * from `pitmag` WHERE `login`='".$log."' AND `vid`='petatk' LIMIT 1");
if (mysql_affected_rows()==0)
{
}else{
$pi=mysql_fetch_array($pitmag);
if($pi[vid]=="petatk"){
$randpit=rand(1,3);
if($randpit=="1" or $randpit=="2"){
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."'");
$tm=mysql_fetch_array($tmp);
$udarpit=$pi[attack];
$tm[uron]=$tm[uron]+$udarpit;
mysql_query("UPDATE `tmp_battle` SET `uron`='$tm[uron]' WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] нанес $udarpit урона монстру.', '".$log."')");
$udk1=$mob2-$udarpit;
mysql_query("UPDATE `okrestnosti` SET `mob2`='$udk1' WHERE `id`='".abs(intval($_GET[id]))."'");
}else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] промахнулся', '".$log."')");}
$randdef=rand(1,2);
if($randdef=="1"){
$met=$mob5;
if($mob8=="RaidBoss"){
$udarrr=rand($mob11,$mob12);
}else{$udarrr=$met-$pi[def];}
if($udarrr<"0"){ $udarrr="0";}
$pi[hp]=$pi[hp]-$udarrr;
mysql_query("UPDATE `pitmag` SET `hp`='$pi[hp]' WHERE `login`='$log' AND `vid`='petatk' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] не успел увернутся от удара и в него попали. Урон: $udarrr', '".$log."')");
}
if($pi[hp]<=0){
mysql_query("DELETE FROM `pitmag` WHERE `login`='$log' AND `vid`='petatk' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - $pi[name] убит.', '".$log."')");
}
}}
if($rowi[mag5]=="stan"){
$random=rand(1,100);
if($random<$rowi[mag0]){
$timer=time()+$rowi[mag17];
mysql_query("INSERT INTO `stanmob` VALUES ('".abs(intval($_GET[id]))."', '$timer')");
$udata29=$udata29-$rowi['mag1'];
mysql_query("UPDATE `users` SET `udata29`='$udata29' WHERE `udata0`='$log'");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Стан прошел успешно.', '".$log."')");
}else{mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Стан не прошел.', '".$log."')");}
header ("Location: ataka.php?&id=$id&startan=$startan&"); exit;}
/////////////////////////////////////////////////////////////////////////////////
if($rowi[mag15]=="on"){
$rand=rand(1,3);
$a = mysql_query("select * from `okrestnosti` WHERE `mob4`='$udata37' LIMIT $rand ");
while($arr=mysql_fetch_array($a)){
$mob2=$mob2-$rowi[mag0];
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='$arr[id]'");
$tm1=mysql_num_rows($tmp);
if($tm1>0){
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы нанесли монстру $arr[mob0] $rowi[mag0], у него осталось $mob2 здоровья.', '".$log."')");
if($rowi[mag0]>=$mob2){$rowi[mag0]=$mob2;}
$tm[uron]=$tm[uron]+$rowi[mag0];
mysql_query("UPDATE `tmp_battle` SET `uron`='$tm[uron]' WHERE `user`='$log' and `id_monstr`='$arr[id]' LIMIT 1");
mysql_query("UPDATE `okrestnosti` SET `mob2`='$mob2' WHERE `mob4`='$udata37' and `id`='$arr[id]' LIMIT 1");
}}}
/////////////////////////////////////////////////////////////////////////////////
if($rowi[mag16]=="on"){
$randoms=rand(1,10);
if($randoms==1){
$udata4=$udata4*2;
}
}
/////////////////////////////////////////////////////////////////////////////////
if($rowi[mag17]!==""){
$random=rand(1,10);
if($random==1){
$timer=time()+$rowi[mag17];
mysql_query("INSERT INTO `stanmob` VALUES ('".abs(intval($_GET[id]))."', '$timer')");
$udata29=$udata29-$rowi['mag1'];
mysql_query("UPDATE `users` SET `udata29`='$udata29' WHERE `udata0`='$log'");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Стан прошел успешно.', '".$log."')");
}}
/////////////////////////////////////////////////////////////////////////////////
if($rowi[mag5]=="takehp"){
$mob2=$mob2-$rowi[mag0];
mysql_query("UPDATE `okrestnosti` SET `mob2`='$mob2' WHERE `id`='".abs(intval($_GET[id]))."' LIMIT 1");
$udata16=$udata16+$rowi[mag0];
if($udata16>$udata17){ $udata16=$udata17;}
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы похитили $rowi[mag0] здоровья у монстра.', '".$log."')");
$udata29=$udata29-$rowi['mag1'];
mysql_query("UPDATE `users` SET `udata29`='$udata29' WHERE `udata0`='$log'");
mysql_query("UPDATE `users` SET `udata16`='$udata16' WHERE `udata0`='$log' LIMIT 1"); header ("Location: ataka.php?&id=$id&startan=$startan&"); exit;}
////////////////////////////////////////////////////////////////////////////////////
if($rowi[mag5]=="yad"){
if($rowi[mag15]=="on"){
$rand=rand(1,3);
$a = mysql_query("select * from `okrestnosti` WHERE `mob4`='$udata37' LIMIT $rand ");
while($arr=mysql_fetch_array($a)){
mysql_query("INSERT INTO `yad` VALUES ('$arr[id]', '$rowi[mag0]', '".$log."')");
}}
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Успешно отравлено.', '".$log."')");
mysql_query("INSERT INTO `yad` VALUES ('$id', '$rowi[mag0]', '".$log."')");
$udata29=$udata29-$rowi['mag1'];
mysql_query("UPDATE `users` SET `udata29`='$udata29' WHERE `udata0`='$log'");
header ("Location: ataka.php?&id=$id&startan=$startan&");
exit;}
////////////////////////////////////////////////////////////////////////////////////
$test = mysql_query("SELECT * FROM `weapon_item` WHERE `login`='$log' and `name`='$udata12' ");
$ts=mysql_fetch_array($test);
if($ts[weaponType]=="dual"){$ts[weaponType]=7;}
if($ts[weaponType]=="sword"){$ts[weaponType]=1;}
if($ts[weaponType]=="bow"){$ts[weaponType]=2;}
if($ts[weaponType]=="blunt"){$ts[weaponType]=3;}
if($ts[weaponType]=="dagger"){$ts[weaponType]=4;}
if($ts[weaponType]=="pole"){$ts[weaponType]=5;}
if($ts[weaponType]=="dualfist"){$ts[weaponType]=6;}
if($ts[weaponType]=="etc"){$ts[weaponType]=10;}
if($ts[weaponType]==$rowi[mag12] or $ts[weaponType]==$rowi[mag13] or $ts[weaponType]==$rowi[mag14] or $rowi[mag12]=="" or $rowi[mag12]=="8" or $rowi[mag12]=="9"){
$udar=round($udata4+$rowi['mag0']);
if($mob8=="RaidBoss"){
$raiduron=$udata4/2;
$udk=rand($mob5,$mob6);
$udar=round($udk);
}
$m=$mob6;
if($mob8=="RaidBoss"){$m="0";}
$udk=$udar-$m;
if($udk<"0"){ $udk="0";}
////////////////////////////////////////////
$tttt = mysql_query("SELECT * FROM `weapon_item` WHERE `login`='$log' and `name`='$udata12' ");
$ts=mysql_fetch_array($tttt);
if($ts[soulshots]!=0){
$test1 = mysql_query("SELECT * from `item` WHERE `uda7`='".$log."' and `uda2`='spiritshots' and `uda3`>'$ts[spiritshots]' and `uda6`='$ts[crystal_type]' LIMIT 1");
$testttt1=mysql_num_rows($test1);
$rowi1=mysql_fetch_array($test1);
$test = mysql_query("SELECT * from `item` WHERE `uda7`='".$log."' and `uda2`='soulshot' and `uda3`>'$ts[soulshots]' and `uda6`='$ts[crystal_type]' LIMIT 1");
$testttt=mysql_num_rows($test);
$rowii=mysql_fetch_array($test);
if($testttt!=0){
$uda3=$rowii[uda3]-$ts[soulshots];
mysql_query("UPDATE `item` SET `uda3`='$uda3' WHERE `uda7`='$log' and `uda2`='soulshot' and `uda6`='$ts[crystal_type]' LIMIT 1");
$udk=$udk*2;}elseif($testttt1!=0){
$uda3=$rowi1[uda3]-$ts[spiritshots];
mysql_query("UPDATE `item` SET `uda3`='$uda3' WHERE `uda7`='$log' and `uda2`='spiritshots' and `uda6`='$ts[crystal_type]' LIMIT 1");
$udk=$udk*2;}
}elseif($ts[spiritshots]!=0){
$test1 = mysql_query("SELECT * from `item` WHERE `uda7`='".$log."' and `uda2`='spiritshots' and `uda3`>'$ts[spiritshots]' and `uda6`='$ts[crystal_type]' LIMIT 1");
$testttt1=mysql_num_rows($test1);
if($testttt1!=0){
$uda3=$rowi1[uda3]-$ts[spiritshots];
mysql_query("UPDATE `item` SET `uda3`='$uda3' WHERE `uda7`='$log' and `uda2`='spiritshots' and `uda6`='$ts[crystal_type]' LIMIT 1");
$udk=$udk*2;}
}
$tmp = @mysql_query("SELECT * FROM `tmp_battle` WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."'");
$tm=mysql_fetch_array($tmp);
if($udk>=$mob2){$udk=$mob2;}
$tm[uron]=$tm[uron]+$udk;
mysql_query("UPDATE `tmp_battle` SET `uron`='$tm[uron]' WHERE `user`='$log' and `id_monstr`='".abs(intval($_GET[id]))."' LIMIT 1");
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы нанесли $udk урона монстру.', '".$log."')");
$udk=$mob2-$udk;
mysql_query("UPDATE `okrestnosti` SET `mob2`='$udk' WHERE `id`='".abs(intval($_GET[id]))."'");
$udata29=$udata29-$rowi['mag1'];
mysql_query("UPDATE `users` SET `udata29`='$udata29' WHERE `udata0`='$log'");
$tmp6 = @mysql_query("SELECT * FROM `stanmob` WHERE `idmob`='$id' and `time`>'".time()."'");
$tm6=mysql_num_rows($tmp6);
if($tm6==0){
$refi=rand(1,2);
if($refi=="1"){
$met=$mob5;
$met2=$mob11;
$rtip=rand(1,2);
if($rtip=="1"){
if($mob8=="RaidBoss"){
$udarr=rand($mob5,$mob6);
}else{$udarr=$met-$udata3;}
if($udarr<"0"){ $udarr="0";}
$udata16=$udata16-$udarr;
mysql_query("UPDATE `users` SET `udata16`='$udata16' WHERE `udata0`='$log'");
}else{
if($mob8=="RaidBoss"){
$udarr=rand($mob11,$mob12);
}else{$udarr=$met2-$udata82;}
if($udarr<"0"){ $udarr="0";}
$udata16=$udata16-$udarr;
mysql_query("UPDATE `users` SET `udata16`='$udata16' WHERE `udata0`='$log'");
}
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы не успели отвернутся от удара, урон $udarr', '".$log."')");
}else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Вы отпрыгнули от удара', '".$log."')");
}
if($udata16<="0"){
$udata48=deadmob;
mysql_query("UPDATE `users` SET `udata48`='$udata48' WHERE `udata0`='".mysql_real_escape_string($log)."'");
header ("Location: gk.php?&go=lose");
exit;}
header ("Location: ataka.php?&id=$id&startan=$startan&");
}else{mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Моб в стане!', '".$log."')"); header ("Location: ataka.php?&id=$id&startan=$startan&");}
}else{
mysql_query("INSERT INTO `battle_log` VALUES ('', '".$time." - Ваш тип оружия неподходит к этому скилу!', '".$log."')"); header ("Location: ataka.php?&id=$id&startan=$startan&");
}
}
}
}
break;
}
include_once"files/down.php";
?>