Файл: b_str_kick.php
Строк: 296
<?
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 `stt_usr` WHERE `usr`='".$udata['id']."' and `tip`!='pit'");
$bt=mysql_fetch_array($bat);
$bts=mysql_fetch_array(mysql_query("SELECT * FROM `stt_usr` WHERE `id`='".$bt['enemy']."'"));
if($bts['tip']=='str')
{
$ussb=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$bts['usr']."'"));
$en_name=' <img src=img/main/c'.$ussb['klass'].'.png> <img src=img/main/r'.$ussb['rasa'].'.png><font color=#ff0000>'.$ussb['usr'].'</font>';
if($ussb['ava']==0)
{
$img='<img src=img/pers/'.$ussb['klass'].''.$ussb['pol'].'.png>
';
}
else
{
$img='<img src=img/pers/ava/'.$ussb['ava'].'.png>';
}
}
if($bts['tip']=='pit')
{
$ussb=mysql_fetch_array(mysql_query("SELECT * FROM `pit` WHERE `id`='".$bts['pit']."' and `usr`='".$bts['usr']."'"));
$en_name=' <font color=#ff9900>'.$ussb['name'].'</font>';
$img='<img src=img/pit/'.$ussb['tip'].'/'.$ussb['img'].'.jpg width=90px>';
}
if($bts['tip']=='mob')
{
$en_name=' <font color=#00ff99>'.$bts['name'].'</font>';
$img='<img src=img/mob/'.$bts['img'].'.jpg>';
}
if($bt['status']==0 and $bt['enemy']!=0)
{
$max_sila=$bt['sila'];
$min_sila=round($max_sila/100*10);if($min_sila<1){$min_sila=1;}
$blok=$ussb['blok'];
$vital_light=mysql_num_rows(mysql_query("SELECT * FROM `item` WHERE `usr`='".$udata['id']."' and `tip`='vital' and `status`='on' and `img`='4'"));
if($vital_light!=0)
{
$blok=$blok-15;
if($blok<0){$blok=0;}
}
$krit=$udata['krit'];
$vital_haos=mysql_num_rows(mysql_query("SELECT * FROM `item` WHERE `usr`='".$ussb['id']."' and `tip`='vital' and `status`='on' and `img`='5'"));
if($vital_haos!=0)
{
$krit=$krit-15;
if($krit<0){$krit=0;}
}
$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_5_time']>=time())
{$baf_5=$bt['sfer_5_time']-time();}else{$baf_5=0;}//стан
if($bts['sfer_6_time']>=time())
{$baf_6=$bts['sfer_6_ef'];}else{$baf_6=0;}//оборона
if($bts['sfer_10_time']>=time())
{$baf_10=$bts['sfer_10_ef'];}else{$baf_10=0;}//пламя
if($bt['sfer_11_time']>=time())
{$baf_11=$bt['sfer_11_ef'];}else{$baf_11=0;}//ослабление
if($bt['sfer_12_time']>=time())
{$baf_12=$bt['sfer_12_ef'];}else{$baf_12=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($baf_5!=0)
{
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b1.png><font color=#999999>Вы оглушены еще ".$baf_5."сек.</font>'
");
}
else
{
if($prom==1)
{
mysql_query("INSERT INTO `log_str` 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);
$arm=round($arm-$arm/100*$baf_4);
$sila=$sila-$arm;
if($sila<$min_sila){$sila=round($min_sila-$min_sila/100*$baf_11);}
$sila=round($sila-$sila/100*$baf_6);
if($sila<1){$sila=1;}
$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;}
$sila=round($sila-$sila/100*$baf_11);
if($blok_us==1)
{
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b23.png>".$en_name."<font color=#990000> заблокировал вашу атаку</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$ussb['id']."',
`text`='<img src=img/main/b23.png><font color=#cccccc>Вы заблокировали атаку <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font></font>'
");
}
$att=0;
$att2=0;
}
else
{
$vital_moln=mysql_num_rows(mysql_query("SELECT * FROM `item` WHERE `usr`='".$udata['id']."' and `tip`='vital' and `status`='on' 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 `stt_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 `stt_usr` SET `sfer_5_time`='".$ogl."' WHERE `id`='".$bts['id']."'");
}
else
{
$lo='';
}
}
else
{
$lo='';
}
if($k_sila==1)
{
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вы наносите критический удар ".$en_name." <b>-".$sila."</b>".$lm."".$ll."".$lo."</font>'
");
if($bts['tip']!="mob")
{
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$ussb['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> наносит вам критический удар <b>-".$sila."</b>".$lm."".$lo."</font>'
");
}
}
else
{
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#00ff99>Вы наносите удар ".$k." ".$en_name." -".$sila."".$lm."".$ll."".$lo."</font>'
");
if($bts['tip']!="mob")
{
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$ussb['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> наносит вам удар -".$sila."".$lm."".$lo."</font>'
");
}
}
$att=$sila+$moln;
$att2=$sila+$moln;
$hp=$bts['hp']-$sila-$moln;
if($hp<=0)
{
$yrs=$bts['hp'];
$exp=$bts['hp'];
$hp=0;
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b7.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> сокрушает вас</font>'
");
}
if($udata['kv']==30 and $udata['kv_s']==2)
{
$kol=$udata['kv_s_n']+1;
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 1</font>'
");
mysql_query("UPDATE `users` SET `kv_s_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
if($udata['kv']==30 and $udata['kv_s']==17)
{
$kol=$udata['kv_s_n']+1;
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 27</font>'
");
mysql_query("UPDATE `users` SET `kv_s_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
$exps=$bts['hp'];
if($bts['tip']=='pit' or $bts['usr']==1)
{
mysql_query("DELETE FROM `stt_usr` WHERE `id`='".$bts['id']."'");
}
else
{
if($udata['kv']==30 and $udata['kv_s']==14)
{
$kol=$udata['kv_s_n']+1;
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png> Статус: <font color=#ffffff>".$kol." из 1</font>'
");
mysql_query("UPDATE `users` SET `kv_s_n`='".$kol."' WHERE `id`='".$udata['id']."'");
}
}
if($bts['tip']=="str")
{
$us1=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$bts['usr']."'"));
$us2=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$bt['usr']."'"));
$us1['hp1']=$us1['hp1']+$us1['hp2'];
$us1['sila1']=$us1['sila1']+$us1['sila2'];
$us1['arm1']=$us1['arm1']+$us1['arm2'];
$ss1=$us1['hp1']+$us1['sila1']+$us1['arm1'];
$us2['hp1']=$us2['hp1']+$us2['hp2'];
$us2['sila1']=$us2['sila1']+$us2['sila2'];
$us2['arm1']=$us2['arm1']+$us2['arm2'];
$ss2=$us2['hp1']+$us2['sila1']+$us2['arm1'];
$lgf='<a href=info.php?id='.$us1['id'].'>'.$us1['usr'].'</a>('.$ss1.')<br>'.$us1['ip'].'</td><td align=center colspan=1><-</td><td colspan=2><a href=info.php?id='.$us2['id'].'>'.$us2['usr'].'</a>('.$ss2.')<br>'.$us2['ip'].'';
mysql_query("INSERT INTO `adm_res` SET
`id`='',
`tip`='str',
`text`='".$lgf."',
`time`='".time()."'
");
$nai=$udata['reit_nai']+1;
$ds=$udata['dost1a']+1;
mysql_query("UPDATE `users` SET `reit_nai`='".$nai."', `dost1a`='".$ds."' WHERE `id`='".$udata['id']."'");
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['killer_exp']+1;
mysql_query("UPDATE `users_dost` SET `killer_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
mysql_query("UPDATE `stt_usr` SET `status`='2' WHERE `id`='".$bts['id']."'");
$kd=$udata['kd']+1;
$mon=$udata['money']+2;
mysql_query("UPDATE `users` SET `money`='".$mon."', `kd`='".$kd."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>2 <img src=img/main/r18.png>1</font>'
");
if($udata['clan']!=0)
{
$clan=mysql_fetch_array(mysql_query("SELECT * FROM `clan_users` WHERE `usr`='".$udata['id']."'"));
$rand=rand(1,100);
if($clan['mesto']==1){$rt=10;}
elseif($clan['mesto']==2){$rt=7;}
elseif($clan['mesto']==3){$rt=5;}
else{$rt=0;}
if($rand<=$rt)
{
$res=rand(1,3);
if($res==1)
{
$e=$udata['wood']+1;
mysql_query("UPDATE `users` SET `wood`='".$e."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/cr1.png><font color=#ffffff>Вы получили ресурс гильдии. Дерево.</font>'
");
}
if($res==2)
{
$e=$udata['steel']+1;
mysql_query("UPDATE `users` SET `steel`='".$e."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/cr1.png><font color=#ffffff>Вы получили ресурс гильдии. Железо.</font>'
");
}
if($res==3)
{
$gi=mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id`='".$udata['clan']."'"));
$en1=$gi['energy']+3;
$en2=$clan['energy']+3;
$reit=$clan['reit']+3;
mysql_query("UPDATE `clan` SET `energy`='".$en1."' WHERE `id`='".$gi['id']."'");
mysql_query("UPDATE `clan_users` SET `energy`='".$en2."', `reit`='".$reit."' WHERE `id`='".$clan['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/cr1.png><font color=#ffffff>Вы получили ресурс гильдии. Энергия*3.</font>'
");
}
}
}
}
else
{
$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 `stt_usr` WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+1;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>1</font>'
");
}
}
else
{
$yrs=$sila;
$exp=$sila;
$hp=$hp;
if($baf_10!=0)
{
$yr=round($sila/100*$baf_10);
$yr=round($yr-$yr/100*$baf_12);
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вас обожгло заклинание возврата -".$yr."</font>'
");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b8.png><font color=#00ff00>заклинание возврата обожгло <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> -".$yr."</font>'
");
$hps=$bt['hp']-$yr;
if($hps<1){$hps=1;}
mysql_query("UPDATE `stt_usr` SET `hp`='".$hps."', `att2`='".$yr."' WHERE `id`='".$bt['id']."'");
}
}
$yrs=$bt['ur']+$yrs;
mysql_query("UPDATE `stt_usr` SET `ur`='".$yrs."', `att`='".$att."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `stt_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['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 `stt_usr` SET `time_us`='".$t."', `att`='".$att."' WHERE `id`='".$bt['id']."'");
}
}
header('location: b_str.php');exit;
?>