Файл: test21.php
Строк: 168
<?
$trd=mysql_query("SELECT * FROM `ohota` WHERE `status`='0' and `tip`='ohot'");
while($rde=mysql_fetch_array($trd))
{
$m=mysql_query("SELECT * FROM `ohota_mob` WHERE `usr`='".$rde['usr']."'");
$mn=mysql_num_rows($m);
if($mn!=0)
{
while($mobas=mysql_fetch_array($m))
{
if($mobas['time']<time())
{
$urs=mysql_query("SELECT * FROM `users` WHERE `id`='".$rde['usr']."'");
$urr=mysql_fetch_array($urs);
$upiz=mysql_query("SELECT * FROM `ohota` WHERE `usr`='".$rde['usr']."' and `tip`='pit'");
$nupiz=mysql_num_rows($upiz);
if($nupiz!=0)
{
$pri=mysql_fetch_array($upiz);
$trrrs=mysql_query("SELECT * FROM `pit` WHERE `id`='".$pri['pit']."' and `usr`='".$rde['usr']."'");
$trrr=mysql_fetch_array($trrrs);
$r=rand(1,2);
if($r==2)
{
if($pri['mag_ney_time']>time())
{
$lke='<img src=img/main/b1.png> <font color=#ff9900>'.$trrr['name'].'</font> уклонился от атаки '.$mobas['name'].'';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$rde['usr']."',
`text`='".$lke."'
");
$tt=time()+10;
mysql_query("UPDATE `ohota_mob` SET `time`='".$tt."' WHERE `id`='".$mobas['id']."'");
}
else
{
$sln=$mobas['sila'];
if($mobas['sfer_r']>=time())
{
$sln=$sln-$sln/100*$mobas['sfer_rp'];
}
if($mobas['mag_pr_time']>=time())
{
$sln=round($sln-$sln/100*$mobas['mag_pr']);
}
$ars=$pri['arm'];
$at=round($sln-$ars);
if($at<$mobas['sila']/100*10)
{
$at=round($mobas['sila']/100*10);
}
$ds=date('d');
if($ds==5)
{
$at=round($at-$at/100*10);
}
$hgf=$pri['hp']-$at;
$lke2='<img src=img/main/b1.png> <font color=#ff0000>'.$mobas['name'].' наносит удар </font><font color=#ff9900>'.$trrr['name'].'</font> <font color=#ff0000>-'.$at.'</font>';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$rde['usr']."',
`text`='".$lke2."'
");
if($hgf<=0)
{
$lke3='<img src=img/main/b7.png> <font color=#ff0000>'.$mobas['name'].' сокрушил </font><font color=#ff9900>'.$trrr['name'].'</font>';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$rde['usr']."',
`text`='".$lke3."'
");
mysql_query("DELETE FROM `ohota` WHERE `id`='".$pri['id']."'");
}
else
{
mysql_query("UPDATE `ohota` SET `hp`='".$hgf."' WHERE `id`='".$pri['id']."'");
}
$tt=time()+10;
mysql_query("UPDATE `ohota_mob` SET `time`='".$tt."' WHERE `id`='".$mobas['id']."'");
}
}
else
{
$bg=rand(1,100);
if($bg<=$urr['blok'])
{
$lke='<img src=img/main/b1.png> <font color=#ff0000>Вы заблокировали атаку '.$mobas['name'].'</font>';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$rde['usr']."',
`text`='".$lke."'
");
$tt=time()+10;
mysql_query("UPDATE `ohota_mob` SET `time`='".$tt."' WHERE `id`='".$mobas['id']."'");
}
else
{
$sln=$mobas['sila'];
if($mobas['sfer_r']>=time())
{
$sln=$sln-$sln/100*$mobas['sfer_rp'];
}
if($mobas['mag_pr_time']>=time())
{
$sln=round($sln-$sln/100*$mobas['mag_pr']);
}
$ars=$rde['arm'];
if($rde['sfer_sh']>=time())
{
$mobss=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$rde['usr']."' and `mag`='6' and `status`='on'");
$skills=mysql_fetch_array($mobss);
if($skills['lvl']==1)
{
$sks=10;
}
if($skills['lvl']==2)
{
$sks=15;
}
if($skills['lvl']==3)
{
$sks=20;
}
if($skills['lvl']==4)
{
$sks=25;
}
if($skills['lvl']==5)
{
$sks=30;
}
if($skills['lvl']==6)
{
$sks=35;
}
if($skills['lvl']==7)
{
$sks=45;
}
if($skills['lvl']==8)
{
$sks=55;
}
if($skills['lvl']==9)
{
$sks=65;
}
if($skills['lvl']==10)
{
$sks=75;
}
$ars=$ars+$urr['arm']/100*$sks;
}
$at=round($sln-$ars);
if($at<$mobas['sila']/100*10)
{
$at=round($mobas['sila']/100*10);
}
$at=round($silaw-$arm);
if($at<$mobas['sila']/100*10)
{
$at=round($mobas['sila']/100*10);
}
$ds=date('d');
if($ds==5)
{
$at=round($at-$at/100*10);
}
$hpwe=$rde['hp']-$at;
$lke2='<img src=img/main/b1.png> <font color=#ff0000>'.$mobas['name'].' наносит удар </font><a href=info.php?id='.$urr['id'].'>'.$urr['usr'].'</a> <font color=#ff0000>-'.$at.'</font>';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$rde['usr']."',
`text`='".$lke2."'
");
if($hpwe<=0)
{
$lke3='<img src=img/main/b7.png> <font color=#ff0000>'.$mobas['name'].' сокрушил </font><a href=info.php?id='.$urr['id'].'>'.$urr['usr'].'</a>';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$urr['id']."',
`text`='".$lke3."'
");
mysql_query("UPDATE `ohota` SET `status`='2', `hp`='0' WHERE `id`='".$rde['id']."'");
}
else
{
mysql_query("UPDATE `ohota` SET `hp`='".$hpwe."' WHERE `id`='".$rde['id']."'");
if($rde['sfer_p']>=time())
{
$mobss=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$rde['usr']."' and `mag`='10' and `status`='on'");
$skills=mysql_fetch_array($mobss);
if($skills['lvl']==1)
{
$sks=5;
}
if($skills['lvl']==2)
{
$sks=10;
}
if($skills['lvl']==3)
{
$sks=15;
}
if($skills['lvl']==4)
{
$sks=20;
}
if($skills['lvl']==5)
{
$sks=25;
}
if($skills['lvl']==6)
{
$sks=30;
}
if($skills['lvl']==7)
{
$sks=35;
}
if($skills['lvl']==8)
{
$sks=40;
}
if($skills['lvl']==9)
{
$sks=45;
}
if($skills['lvl']==10)
{
$sks=50;
}
$yrs=round($at/100*$sks);
$hpq=$mobas['hp']-$yrs;
$lgz='<img src=img/main/b10.png> <font color=#00ff00>заклинание возврата обожгла
<font color=#999999>'.$mobas['name'].'</font> -'.$yrs.'</font>';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$urr['id']."',
`text`='".$lgz."'
");
if($hpq<=0)
{
$nai=$urr['reit_oh']+1;
$ds=$urr['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$urr['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$urr['usr'].'</a> убил '.$mobas['name'].'';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$urr['id']."',
`text`='".$lg2."'
");
if($urr['lvl']<16)
{
$vr=5;
}
if($urr['lvl']>15 and $urr['lvl']<31)
{
$vr=4;
}
if($urr['lvl']>30 and $urr['lvl']<39)
{
$vr=2;
}
if($urr['lvl']>38)
{
$vr=1;
}
$exp=$mobas['hp']*$vr;
mysql_query("DELETE FROM `ohota_mob` WHERE `id`='".$mobas['id']."'");
}
else
{
if($urr['lvl']<16)
{
$vr=5;
}
if($urr['lvl']>15 and $urr['lvl']<31)
{
$vr=4;
}
if($urr['lvl']>30 and $urr['lvl']<39)
{
$vr=2;
}
if($urr['lvl']>38)
{
$vr=1;
}
$exp=$yrs*$vr;
mysql_query("UPDATE `ohota_mob` SET `hp`='".$hpq."' WHERE `id`='".$mobas['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$urr['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$urr['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$urr['id']."'");
}
}
$tt=time()+10;
mysql_query("UPDATE `ohota_mob` SET `time`='".$tt."' WHERE `id`='".$mobas['id']."'");
}
}
}
else
{
$bg=rand(1,100);
if($bg<=$urr['blok'])
{
$lke='<img src=img/main/b1.png> <font color=#ff0000>Вы заблокировали атаку '.$mobas['name'].'</font>';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$rde['usr']."',
`text`='".$lke."'
");
$tt=time()+10;
mysql_query("UPDATE `ohota_mob` SET `time`='".$tt."' WHERE `id`='".$mobas['id']."'");
}
else
{
$sln=$mobas['sila'];
if($mobas['sfer_r']>=time())
{
$sln=$sln-$sln/100*$mobas['sfer_rp'];
}
if($mobas['mag_pr_time']>=time())
{
$sln=round($sln-$sln/100*$mobas['mag_pr']);
}
$ars=$rde['arm'];
if($rde['sfer_sh']>=time())
{
$mobss=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$rde['usr']."' and `mag`='6' and `status`='on'");
$skills=mysql_fetch_array($mobss);
if($skills['lvl']==1)
{
$sks=10;
}
if($skills['lvl']==2)
{
$sks=15;
}
if($skills['lvl']==3)
{
$sks=20;
}
if($skills['lvl']==4)
{
$sks=25;
}
if($skills['lvl']==5)
{
$sks=30;
}
if($skills['lvl']==6)
{
$sks=35;
}
if($skills['lvl']==7)
{
$sks=45;
}
if($skills['lvl']==8)
{
$sks=55;
}
if($skills['lvl']==9)
{
$sks=65;
}
if($skills['lvl']==10)
{
$sks=75;
}
$ars=$ars+$urr['arm']/100*$sks;
}
$at=round($sln-$ars);
if($at<$mobas['sila']/100*10)
{
$at=round($mobas['sila']/100*10);
}
$at=round($silaw-$arm);
if($at<$mobas['sila']/100*10)
{
$at=round($mobas['sila']/100*10);
}
$ds=date('d');
if($ds==5)
{
$at=round($at-$at/100*10);
}
$hpwe=$rde['hp']-$at;
$lke2='<img src=img/main/b1.png> <font color=#ff0000>'.$mobas['name'].' наносит удар </font><a href=info.php?id='.$urr['id'].'>'.$urr['usr'].'</a> <font color=#ff0000>-'.$at.'</font>';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$rde['usr']."',
`text`='".$lke2."'
");
if($hpwe<=0)
{
$lke3='<img src=img/main/b7.png> <font color=#ff0000>'.$mobas['name'].' сокрушил </font><a href=info.php?id='.$urr['id'].'>'.$urr['usr'].'</a>';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$urr['id']."',
`text`='".$lke3."'
");
mysql_query("UPDATE `ohota` SET `status`='2', `hp`='0' WHERE `id`='".$rde['id']."'");
}
else
{
mysql_query("UPDATE `ohota` SET `hp`='".$hpwe."' WHERE `id`='".$rde['id']."'");
if($rde['sfer_p']>=time())
{
$mobss=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$rde['usr']."' and `mag`='10' and `status`='on'");
$skills=mysql_fetch_array($mobss);
if($skills['lvl']==1)
{
$sks=5;
}
if($skills['lvl']==2)
{
$sks=10;
}
if($skills['lvl']==3)
{
$sks=15;
}
if($skills['lvl']==4)
{
$sks=20;
}
if($skills['lvl']==5)
{
$sks=25;
}
if($skills['lvl']==6)
{
$sks=30;
}
if($skills['lvl']==7)
{
$sks=35;
}
if($skills['lvl']==8)
{
$sks=40;
}
if($skills['lvl']==9)
{
$sks=45;
}
if($skills['lvl']==10)
{
$sks=50;
}
$yrs=round($at/100*$sks);
$hpq=$mobas['hp']-$yrs;
$lgz='<img src=img/main/b10.png> <font color=#00ff00>заклинание возврата обожгла
<font color=#999999>'.$mobas['name'].'</font> -'.$yrs.'</font>';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$urr['id']."',
`text`='".$lgz."'
");
if($hpq<=0)
{
$nai=$urr['reit_oh']+1;
$ds=$urr['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$urr['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$urr['usr'].'</a> убил '.$mobas['name'].'';
mysql_query("INSERT INTO `log_ohota` SET
`id`='',
`usr`='".$urr['id']."',
`text`='".$lg2."'
");
if($urr['lvl']<16)
{
$vr=5;
}
if($urr['lvl']>15 and $urr['lvl']<31)
{
$vr=4;
}
if($urr['lvl']>30 and $urr['lvl']<39)
{
$vr=2;
}
if($urr['lvl']>38)
{
$vr=1;
}
$exp=$mobas['hp']*$vr;
mysql_query("DELETE FROM `ohota_mob` WHERE `id`='".$mobas['id']."'");
}
else
{
if($urr['lvl']<16)
{
$vr=5;
}
if($urr['lvl']>15 and $urr['lvl']<31)
{
$vr=4;
}
if($urr['lvl']>30 and $urr['lvl']<39)
{
$vr=2;
}
if($urr['lvl']>38)
{
$vr=1;
}
$exp=$yrs*$vr;
mysql_query("UPDATE `ohota_mob` SET `hp`='".$hpq."' WHERE `id`='".$mobas['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$urr['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$urr['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$urr['id']."'");
}
}
$tt=time()+10;
mysql_query("UPDATE `ohota_mob` SET `time`='".$tt."' WHERE `id`='".$mobas['id']."'");
}
}
}
}
}
else
{
}
}
?>