Файл: b_oh_kick.php
Строк: 131
<?
define('PROTECTOR', 1);
$textl='Битва';
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$bat=mysql_query("SELECT * FROM `labir_usr` WHERE `usr`='".$udata['id']."'");
$bt=mysql_fetch_array($bat);
$lab=mysql_fetch_array(mysql_query("SELECT * FROM `labir` WHERE `id`='".$bt['labir']."'"));
$loka=mysql_fetch_array(mysql_query("SELECT * FROM `labir_loc_usr` WHERE `x`='".$bt['x']."' and `y`='".$bt['y']."' and `usr`='".$udata['id']."'"));
$bts=mysql_fetch_array(mysql_query("SELECT * FROM `local_mob` WHERE `usr`='".$udata['id']."' and `id`='".$bt['enemy']."'"));
if($bt['status']==0 and $bt['enemy']!=0)
{
$max_sila=$udata['sila'];
$min_sila=round($max_sila/100*10);if($min_sila<1){$min_sila=1;}
$blok=0;
$krit=$udata['krit'];
$arm=$bts['arm'];
if($bt['sfer_3_time']>=time())
{$baf_3=$bt['sfer_3_ef'];}else{$baf_3=0;}//усиление
if($bts['sfer_4_time']>=time())
{$baf_4=$bts['sfer_4_ef'];}else{$baf_4=0;}//пробивание
if($bt['sfer_11_time']>=time())
{$baf_11=$bt['sfer_11_ef'];}else{$baf_11=0;}//ослабление
$time=$bt['time_us'];
if($time>time())
{
$sek=$time-time();
if($sek>=5){$prom=1;}
elseif($sek==4){$prom=0;$max_sila=round($max_sila-$max_sila/100*rand(70,80));$min_sila=round($min_sila/4);}
elseif($sek==3){$prom=0;$max_sila=round($max_sila-$max_sila/100*rand(50,70));$min_sila=round($min_sila/3);}
elseif($sek==2 or $sek==1){$prom=0;$max_sila=round($max_sila-$max_sila/100*rand(20,50));$min_sila=round($min_sila/2);}
}
if($prom==1)
{
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b1.png><font color=#999999>Промах!</font>'
");
}
else
{
$sila=$max_sila;
$sila=round($sila+$sila/100*$baf_3);
$sila=round($sila-$sila/100*$baf_11);
$arm=round($arm-$arm/100*$baf_4);
$sila=$sila-$arm;
if($sila<$min_sila){$sila=round($min_sila-$min_sila/100*$baf_11);}
$kr=rand(1,100);if($kr<=$krit){$sila=$sila*2;$k_sila=1;}else{$k_sila=0;}
$bl=rand(1,100);if($bl<=$blok){$blok_us=1;}else{$blok_us=0;}
if($blok_us==1)
{
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b23.png>".$en_name."<font color=#990000> заблокировал вашу атаку</font>'
");
$att=0;
}
else
{
$vital_moln=mysql_num_rows(mysql_query("SELECT * FROM `item` WHERE `tip`='vital' and `status`='on' and `usr`='".$udata['id']."' and `img`='1'"));
if($vital_moln!=0)
{
$moln=round($sila/100*5);
$lm=' <font color=#ff00ff>-'.$moln.'</font>';
}
else
{
$moln=0;
$lm='';
}
$vital_life=mysql_num_rows(mysql_query("SELECT * FROM `item` WHERE `usr`='".$udata['id']."' and `tip`='vital' and `status`='on' and `img`='2'"));
if($vital_life!=0)
{
$live=round($sila/100*5);
$ll='; <font color=#00ff44>+'.$live.'хп</font>';
$bthp=$bt['hp']+$live;
if($bthp>=$udata['hp']){$bthp=$udata['hp'];}
mysql_query("UPDATE `labir_usr` SET `hp`='".$bthp."' WHERE `id`='".$bt['id']."'");
}
else
{
$live=0;
$ll='';
}
$vital_dark=mysql_num_rows(mysql_query("SELECT * FROM `item` WHERE `usr`='".$udata['id']."' and `tip`='vital' and `status`='on' and `img`='3'"));
if($vital_dark!=0)
{
$rog=rand(1,100);
if($rog<=15)
{
$ogl=time()+3;
$lo='; <font color=#999999>+3c. оглушение</font>';
mysql_query("UPDATE `local_mob` SET `sfer_5_time`='".$ogl."' WHERE `id`='".$bts['id']."'");
}
else
{
$lo='';
}
}
else
{
$lo='';
}
if($k_sila==1)
{
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вы наносите критический удар ".$en_name." <b>-".$sila."".$lm."".$ll."".$lo."</b></font>'
");
}
else
{
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#00ff99>Вы наносите удар ".$k." ".$en_name." -".$sila."".$lm."".$ll."".$lo."</font>'
");
}
$att=$sila+$moln;
$att2=$sila+$moln;
$hp=$bts['hp']-$sila-$moln;
if($hp<=0)
{
$exp=$bts['hp'];
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$bts['name']."</font>'
");
$rand=rand(1,7);
if($rand==1){
$soul=$udata['soul_res']+1;
mysql_query("UPDATE `users` SET `soul_res`='".$soul."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы нашли <img src=img/main/i27.png>1</font>'
");
}
if($lab['id']==32)
{
$prr=rand(1,10);
if($prr==1)
{
$pr=$udata['pr']+1;
mysql_query("UPDATE `users` SET `pr`='".$pr."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_labir` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы нашли <img src=img/main/pr.png>1</font>'
");
}
}
$nai=$udata['reit_oh']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."' WHERE `id`='".$udata['id']."'");
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['hunter_exp']+1;
mysql_query("UPDATE `users_dost` SET `hunter_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
mysql_query("DELETE FROM `local_mob` WHERE `id`='".$bts['id']."'");
if($bts['boss']==1){
mysql_query("UPDATE `labir_usr` SET `status`='1' WHERE `id`='".$bt['id']."'");
}
}
else
{
$exp=$sila;
$hp=$hp;
mysql_query("UPDATE `local_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
}
mysql_query("UPDATE `labir_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
if($udata['lvl']<16)
{$vrs=15;}
if($udata['lvl']>15 and $udata['lvl']<31)
{$vrs=4;}
if($udata['lvl']>30 and $udata['lvl']<39)
{$vrs=2;}
if($udata['lvl']>38)
{$vrs=1;}
$exp=$exp*$vrs;
if($udata['vip_exp']>=100 and $udata['vip_exp']<250)
{$vip_lvl=1;}
elseif($udata['vip_exp']>=250 and $udata['vip_exp']<500)
{$vip_lvl=2;}
elseif($udata['vip_exp']>=500 and $udata['vip_exp']<1300)
{$vip_lvl=3;}
elseif($udata['vip_exp']>=1300 and $udata['vip_exp']<2500)
{$vip_lvl=4;}
elseif($udata['vip_exp']>=2500 and $udata['vip_exp']<5000)
{$vip_lvl=5;}
elseif($udata['vip_exp']>=5000){$vip_lvl=6;}
if($vip_lvl==1){$exp=$exp+$exp/100*5;}
if($vip_lvl==2){$exp=$exp+$exp/100*10;}
if($vip_lvl==3){$exp=$exp+$exp/100*15;}
if($vip_lvl==4){$exp=$exp+$exp/100*20;}
if($vip_lvl==5){$exp=$exp+$exp/100*30;}
if($vip_lvl==6){$exp=$exp+$exp/100*50;}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
$ezd=mysql_query("SELECT * FROM `users_ezd` WHERE `usr`='".$udata['id']."'");
$nez=mysql_num_rows($ezd);
if($nez==0)
{
$t=time()+7;
}
else
{
$ez=mysql_fetch_array($ezd);
if($ez['lvl']<20){$t=time()+7;}
elseif($ez['lvl']>=20 and $ez['lvl']<40){$t=time()+6;}
elseif($ez['lvl']>=40){$t=time()+5;}
}
mysql_query("UPDATE `labir_usr` SET `time_us`='".$t."', `att`='".$att."' WHERE `id`='".$bt['id']."'");
}
header('location: b_oh.php');exit;
?>