Файл: test31.php
Строк: 402
<?
$upi=mysql_query("SELECT * FROM `ohota` WHERE `tip`='pit'");
while($pri=mysql_fetch_array($upi))
{
$uip=mysql_fetch_array(mysql_query("SELECT * FROM `pit` WHERE `id`='".$pri['pit']."'"));
$ut_oh=mysql_query("SELECT * FROM `ohota` WHERE `volna`<'55' and `status`='0' and `tip`='ohot' and `enemy`!='0' and `usr`='".$pri['usr']."'");
$nupi=mysql_num_rows($ut_oh);
if($nupi!=0)
{
$uoh=mysql_fetch_array($ut_oh);
$uit=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$uoh['usr']."'"));
$mob=mysql_fetch_array(mysql_query("SELECT * FROM `ohota_mob` WHERE `id`='".$uoh['enemy']."'"));
if($pri['time_us']<time())
{
$re=$pri['sila'];
if($pri['mag_yr_time']>=time())
{
$re=$re+$re/100*$pri['mag_yr'];
}
if($pri['mag_kr_time']>=time())
{
$re=$re*2;
}
if($mob['sfer_d']>=time())
{
$mob['arm']=$mob['arm']-$mob['arm']/100*$mob['sfer_dp'];
}
if($mob['mag_sr_time']>=time())
{
$mob['arm']=$mob['arm']-$mob['arm']/100*$mob['mag_sr'];
}
$silaaas=round($re-$mob['arm']);
if($silaaas<=$pri['sila']/100*10)
{
$silaaas=round($pri['sila']/100*10);
}
if($silaaas<1)
{
$silaaas=1;
}
$rk=rand(1,3);
if($rk==1)
{
$k='ударил';
}
if($rk==2)
{
$k='пронзил';
}
if($rk==3)
{
$k='двинул';
}
$lg='<img src=img/main/b1.png> <font color=#ff9900>'.$uip['name'].'</font> '.$k.' '.$mob['name'].' -'.$silaaas.'';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='".$lg."'
");
$hpyt=$mob['hp']-$silaaas;
if($hpyt<=0)
{
$nai=$uit['reit_oh']+1;
$ds=$uit['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$uit['id']."'");
$hpyt=0;
$lg2='<img src=img/main/b7.png> <font color=#ff9900>'.$uip['name'].'</font> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='".$lg2."'
");
$expit=$mob['hp'];
mysql_query("DELETE FROM `ohota_mob` WHERE `id`='".$mob['id']."'");
$nums=mysql_num_rows(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uoh['usr']."'"));
if($nums>0)
{
$new=mysql_fetch_array(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uit['id']."'"));
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
else
{
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
}
else
{
$expit=$silaaas;
mysql_query("UPDATE `ohota_mob` SET `hp`='".$hpyt."' WHERE `id`='".$mob['id']."'");
}
$expit=$uip['exp']+$expit;
if($uip['pred']<=25)
{
$sp=10;
}
elseif($uip['pred']>25 and $uip['sped']<=50)
{
$sp=9;
}
elseif($uip['pred']>50 and $uip['sped']<=75)
{
$sp=8;
}
elseif($uip['pred']>75 and $uip['sped']<=99)
{
$sp=7;
}
elseif($uip['pred']==100)
{
$sp=6;
}
$timh=time()+$sp;
mysql_query("UPDATE `ohota` SET `time_us`='".$timh."' WHERE `id`='".$pri['id']."'");
mysql_query("UPDATE `pit` SET `exp`='".$expit."' WHERE `id`='".$uip['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt."' WHERE `id`!='".$skill['id']."' and `pit`='".$uip['id']."'");
}
else
{
$tn=time();
$retf=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='1' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd=mysql_num_rows($retf);
if($retd==0)
{
}
else
{
$skill=mysql_fetch_array($retf);
$r=rand(1,100);
if($r<=$skill['shans'])
{
$tim=time()+12;
mysql_query("UPDATE `ohota` SET `mag_mast`='".$skill['bonus']."', `mag_mast_time`='".$tim."' WHERE `id`='".$uoh['id']."'");
$ttt=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt."' WHERE `id`='".$skill['id']."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uoh['usr']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill['name']."</font> (".$uit['usr']." +".$skill['bonus']."% урона от сфер)'
");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
}
else
{
$ttt=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt."' WHERE `id`='".$skill['id']."'");
}
}
//////2/////
$retf2=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='3' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd2=mysql_num_rows($retf2);
if($retd2==0)
{
}
else
{
$skill2=mysql_fetch_array($retf2);
$r2=rand(1,100);
if($r2<=$skill2['shans'])
{
$tim2=time()+12;
mysql_query("UPDATE `ohota` SET `mag_ney_time`='".$tim2."' WHERE `id`='".$pri['id']."'");
$ttt2=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt2."' WHERE `id`='".$skill2['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill2['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill2['name']."</font>'
");
}
else
{
$ttt2=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt2."' WHERE `id`='".$skill2['id']."'");
}
}
//////
/////3////
$retf3=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='4' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd3=mysql_num_rows($retf3);
if($retd3==0)
{
}
else
{
$skill3=mysql_fetch_array($retf3);
$r3=rand(1,100);
if($r3<=$skill3['shans'])
{
$ttt3=time()+30;
$silaaas=$skill3['sila'];
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt3."' WHERE `id`='".$skill3['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill3['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill3['name']."</font> (".$mob['name']." -".$silaaas.")'
");
$hpyt=$mob['hp']-$silaaas;
if($hpyt<=0)
{
$nai=$uit['reit_oh']+1;
$ds=$uit['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$uit['id']."'");
$hpyt=0;
$lg2='<img src=img/main/b7.png> <font color=#ff9900>'.$uip['name'].'</font> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='".$lg2."'
");
$expit=$mob['hp'];
mysql_query("DELETE FROM `ohota_mob` WHERE `id`='".$mob['id']."'");
$nums=mysql_num_rows(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uoh['usr']."'"));
if($nums>0)
{
$new=mysql_fetch_array(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uit['id']."'"));
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
else
{
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
}
else
{
$expit=$silaaas;
mysql_query("UPDATE `ohota_mob` SET `hp`='".$hpyt."' WHERE `id`='".$mob['id']."'");
}
$expit=$uip['exp']+$expit;
mysql_query("UPDATE `pit` SET `exp`='".$expit."' WHERE `id`='".$uip['id']."'");
}
else
{
$ttt3=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt3."' WHERE `id`='".$skill3['id']."'");
}
}
///////
/////4////
$retf4=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='5' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd4=mysql_num_rows($retf4);
if($retd4==0)
{
}
else
{
$skill4=mysql_fetch_array($retf4);
$r4=rand(1,100);
if($r4<=$skill4['shans'])
{
$ttt4=time()+30;
$silaaas=$skill4['sila'];
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt4."' WHERE `id`='".$skill4['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill4['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill4['name']."</font> (".$mob['name']." -".$silaaas.")'
");
$hpyt=$mob['hp']-$silaaas;
if($hpyt<=0)
{
$nai=$uit['reit_oh']+1;
$ds=$uit['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$uit['id']."'");
$hpyt=0;
$lg2='<img src=img/main/b7.png> <font color=#ff9900>'.$uip['name'].'</font> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='".$lg2."'
");
$expit=$mob['hp'];
mysql_query("DELETE FROM `ohota_mob` WHERE `id`='".$mob['id']."'");
}
else
{
$expit=$silaaas;
mysql_query("UPDATE `ohota_mob` SET `hp`='".$hpyt."' WHERE `id`='".$mob['id']."'");
}
$expit=$uip['exp']+$expit;
mysql_query("UPDATE `pit` SET `exp`='".$expit."' WHERE `id`='".$uip['id']."'");
$nums=mysql_num_rows(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uoh['usr']."'"));
if($nums>0)
{
$new=mysql_fetch_array(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uit['id']."'"));
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
else
{
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
}
else
{
$ttt4=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt4."' WHERE `id`='".$skill4['id']."'");
}
}
///////
/////5////
$retf5=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='6' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd5=mysql_num_rows($retf5);
if($retd5==0)
{
}
else
{
$skill5=mysql_fetch_array($retf5);
$r5=rand(1,100);
if($r5<=$skill5['shans'])
{
$ttt5=time()+30;
$silaaas=round($pri['sila']/100*$skill5['bonus']);
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt5."' WHERE `id`='".$skill5['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill5['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill5['name']."</font> (".$mob['name']." -".$silaaas." -".$silaaas." -".$silaaas.")'
");
$hpyt=$mob['hp']-$silaaas-$silaaas-$silaaas;
if($hpyt<=0)
{
$nai=$uit['reit_oh']+1;
$ds=$uit['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$uit['id']."'");
$hpyt=0;
$lg2='<img src=img/main/b7.png> <font color=#ff9900>'.$uip['name'].'</font> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='".$lg2."'
");
$expit=$mob['hp'];
mysql_query("DELETE FROM `ohota_mob` WHERE `id`='".$mob['id']."'");
$nums=mysql_num_rows(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uoh['usr']."'"));
if($nums>0)
{
$new=mysql_fetch_array(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uit['id']."'"));
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
else
{
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
}
else
{
$expit=$silaaas;
mysql_query("UPDATE `ohota_mob` SET `hp`='".$hpyt."' WHERE `id`='".$mob['id']."'");
}
$expit=$uip['exp']+$expit;
mysql_query("UPDATE `pit` SET `exp`='".$expit."' WHERE `id`='".$uip['id']."'");
}
else
{
$ttt5=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt5."' WHERE `id`='".$skill5['id']."'");
}
}
///////
/////6///
$retf6=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='7' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd6=mysql_num_rows($retf6);
if($retd6==0)
{
}
else
{
$skill6=mysql_fetch_array($retf6);
$r6=rand(1,100);
if($r6<=$skill6['shans'])
{
$tim6=time()+12;
mysql_query("UPDATE `ohota_mob` SET `mag_pr`='".$skill6['bonus']."', `mag_pr_time`='".$tim6."' WHERE `id`='".$mob['id']."'");
$ttt6=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt6."' WHERE `id`='".$skill6['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill6['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill6['name']."</font> (".$mob['name']." -".$skill6['bonus']."% урона)'
");
}
else
{
$ttt6=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt6."' WHERE `id`='".$skill6['id']."'");
}
}
///
/////7////
$retf7=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='8' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd7=mysql_num_rows($retf7);
if($retd7==0)
{
}
else
{
$skill7=mysql_fetch_array($retf7);
$r7=rand(1,100);
if($r7<=$skill7['shans'])
{
$ttt7=time()+30;
$silaaas=$skill7['sila'];
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt7."' WHERE `id`='".$skill7['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill7['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill4['name']."</font> (".$mob['name']." -".$silaaas." + 2c. оглушение)'
");
$hpyt=$mob['hp']-$silaaas;
if($hpyt<=0)
{
$nai=$uit['reit_oh']+1;
$ds=$uit['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$uit['id']."'");
$hpyt=0;
$lg2='<img src=img/main/b7.png> <font color=#ff9900>'.$uip['name'].'</font> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='".$lg2."'
");
$expit=$mob['hp'];
mysql_query("DELETE FROM `ohota_mob` WHERE `id`='".$mob['id']."'");
$nums=mysql_num_rows(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uoh['usr']."'"));
if($nums>0)
{
$new=mysql_fetch_array(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uit['id']."'"));
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
else
{
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
}
else
{
$expit=$silaaas;
$uip=time()+2;
mysql_query("UPDATE `ohota_mob` SET `hp`='".$hpyt."', `sfer_so`='".$uip."' WHERE `id`='".$mob['id']."'");
}
$expit=$uip['exp']+$expit;
mysql_query("UPDATE `pit` SET `exp`='".$expit."' WHERE `id`='".$uip['id']."'");
}
else
{
$ttt7=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt7."' WHERE `id`='".$skill7['id']."'");
}
}
///////
/////8///
$retf8=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='9' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd8=mysql_num_rows($retf8);
if($retd8==0)
{
}
else
{
$skill8=mysql_fetch_array($retf8);
$r8=rand(1,100);
if($r8<=$skill8['shans'])
{
$ttt8=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt8."' WHERE `id`='".$skill8['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill8['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("UPDATE `mag` SET
`time`='0' WHERE `usr`='".$uit['id']."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill8['name']."</font>'
");
}
else
{
$ttt8=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt8."' WHERE `id`='".$skill8['id']."'");
}
}
///
/////9///
$retf9=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='10' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd9=mysql_num_rows($retf9);
if($retd9==0)
{
}
else
{
$skill9=mysql_fetch_array($retf9);
$r9=rand(1,100);
if($r9<=$skill9['shans'])
{
$ttt9=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt9."' WHERE `id`='".$skill9['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill9['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
$silaaas=round($pri['sila']+$pri['sila']/100*$skill['bonus']);
$hpyt=$uoh['hp']+$silaaas;
if($hpyt>=$uit['hp'])
{
$hpyt=$uit['hp'];
}
mysql_query("UPDATE `ohota` SET `hp`='".$hpyt."' WHERE `id`='".$uoh['id']."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill9['name']."</font> (".$uit['usr']." +".$silaaas."хп)'
");
}
else
{
$ttt9=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt9."' WHERE `id`='".$skill9['id']."'");
}
}
///
/////10///
$retf10=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='11' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd10=mysql_num_rows($retf10);
if($retd10==0)
{
}
else
{
$skill10=mysql_fetch_array($retf10);
$r10=rand(1,100);
if($r10<=$skill10['shans'])
{
$tim10=time()+12;
mysql_query("UPDATE `ohota` SET `mag_za`='".$skill10['bonus']."', `mag_za_time`='".$tim10."' WHERE `id`='".$uoh['id']."'");
$ttt10=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt10."' WHERE `id`='".$skill10['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill10['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill10['name']."</font> (".$uit['usr']." +".$skill10['bonus']."% защита от физического урона)'
");
}
else
{
$ttt10=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt10."' WHERE `id`='".$skill10['id']."'");
}
}
///
/////11////
$retf11=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='12' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd11=mysql_num_rows($retf11);
if($retd11==0)
{
}
else
{
$skill11=mysql_fetch_array($retf11);
$r11=rand(1,100);
if($r11<=$skill11['shans'])
{
$ttt11=time()+30;
$silaaas=$pri['sila'];
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt11."' WHERE `id`='".$skill11['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill11['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill11['name']."</font> (".$mob['name']." -".$silaaas.")'
");
$hpyt=$mob['hp']-$silaaas;
if($hpyt<=0)
{
$nai=$uit['reit_oh']+1;
$ds=$uit['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$uit['id']."'");
$hpyt=0;
$lg2='<img src=img/main/b7.png> <font color=#ff9900>'.$uip['name'].'</font> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='".$lg2."'
");
$expit=$mob['hp'];
mysql_query("DELETE FROM `ohota_mob` WHERE `id`='".$mob['id']."'");
$nums=mysql_num_rows(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uoh['usr']."'"));
if($nums>0)
{
$new=mysql_fetch_array(mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$uit['id']."'"));
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
else
{
mysql_query("UPDATE `ohota` SET `enemy`='".$new['id']."' WHERE `id`='".$uoh['id']."'");
}
}
else
{
$expit=$silaaas;
$uip=time()+2;
mysql_query("UPDATE `ohota_mob` SET `hp`='".$hpyt."' WHERE `id`='".$mob['id']."'");
}
$expit=$uip['exp']+$expit;
mysql_query("UPDATE `pit` SET `exp`='".$expit."' WHERE `id`='".$uip['id']."'");
}
else
{
$ttt11=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt11."' WHERE `id`='".$skill11['id']."'");
}
}
///////
/////12///
$retf12=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='13' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd12=mysql_num_rows($retf12);
if($retd10==0)
{
}
else
{
$skill12=mysql_fetch_array($retf12);
$r12=rand(1,100);
if($r12<=$skill12['shans'])
{
$tim12=time()+12;
mysql_query("UPDATE `ohota_mob` SET `mag_sr`='".$skill10['bonus']."', `mag_sr_time`='".$tim10."' WHERE `id`='".$mob['id']."'");
$ttt10=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt12."' WHERE `id`='".$skill12['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill12['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill12['name']."</font> (".$mob['name']." -".$skill12['bonus']."% защита)'
");
}
else
{
$ttt10=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt10."' WHERE `id`='".$skill12['id']."'");
}
}
///
/////13///
$retf13=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='14' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd13=mysql_num_rows($retf13);
if($retd13==0)
{
}
else
{
$skill13=mysql_fetch_array($retf13);
$r13=rand(1,100);
if($r13<=$skill13['shans'])
{
$tim13=time()+12;
mysql_query("UPDATE `ohota` SET `mag_yr`='".$skill13['bonus']."', `mag_yr_time`='".$tim13."' WHERE `id`='".$pri['id']."'");
$ttt13=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt13."' WHERE `id`='".$skill13['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill12['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill13['name']."</font> (".$uip['name']." +".$skill13['bonus']."% урона)'
");
}
else
{
$ttt13=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt13."' WHERE `id`='".$skill13['id']."'");
}
}
///
/////14///
$retf14=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='15' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd14=mysql_num_rows($retf14);
if($retd14==0)
{
}
else
{
$skill14=mysql_fetch_array($retf14);
$r14=rand(1,100);
if($r14<=$skill14['shans'])
{
$tim14=time()+12;
mysql_query("UPDATE `ohota` SET `mag_kr_time`='".$tim14."' WHERE `id`='".$pri['id']."'");
$ttt14=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt14."' WHERE `id`='".$skill14['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill14['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill14['name']."</font>'
");
}
else
{
$ttt14=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt14."' WHERE `id`='".$skill14['id']."'");
}
}
///
/////15///
$retf15=mysql_query("SELECT * FROM `mag_pit` WHERE `usr`='".$uit['id']."' and `mag`='16' and `otkat`<='".$tn."' and `pit`='".$uip['id']."'");
$retd15=mysql_num_rows($retf15);
if($retd15==0)
{
}
else
{
$skill15=mysql_fetch_array($retf15);
$r15=rand(1,100);
if($r15<=$skill15['shans'])
{
$silaaas=round($pri['sila']+$pri['sila']/100*$skill15['bonus']);
$hpyt=$pri['hp']+$silaaas;
if($hpyt>$uip['hp'])
{
$hpyt=$uip['hp'];
}
mysql_query("UPDATE `ohota` SET `hp`='".$hpyt."' WHERE `id`='".$pri['id']."'");
$ttt15=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt15."' WHERE `id`='".$skill15['id']."'");
$ttts=time()+5;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttts."' WHERE `id`!='".$skill15['id']."' and `pit`='".$uip['id']."' and `otkat`<'".$ttts."'");
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$uit['id']."',
`text`='<img src=img/main/b1.png> <font color=#ff9900>".$uip['name']."</font> использовал навык <font color=#00ffff>".$skill15['name']."</font> (".$uip['name']." +".$silaaas."хп)'
");
}
else
{
$ttt15=time()+30;
mysql_query("UPDATE `mag_pit` SET `otkat`='".$ttt15."' WHERE `id`='".$skill15['id']."'");
}
}
///
}
}
}
?>