Файл: b_bz_mag.php
Строк: 751
<?
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 `arena_usr` WHERE `usr`='".$udata['id']."' and `tip`!='pit'");
$bt=mysql_fetch_array($bat);
$bts=mysql_fetch_array(mysql_query("SELECT * FROM `arena_usr` WHERE `id`='".$bt['enemy']."'"));
if($bts['tip']=='usr')
{
$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=#ff9900>'.$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>';
}
}
$m=mysql_real_escape_string($_GET['mag']);
$tn=time();
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='".$m."' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows!=0)
{
$skill=mysql_fetch_array($mobs);
if($bt['sfer_5_time']>=time())
{$baf_5=$bt['sfer_5_time']-time();}else{$baf_5=0;}//стан
if($baf_5!=0)
{
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b1.png><font color=#999999>Вы оглушены еще ".$baf_5."сек.</font>'
");
header('location: b_bz.php');exit;
}
if($m==3)
{
$sila=3*$skill['lvl'];
$tm=time()+90;
$ts=time()+60;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='3' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `arena_usr` SET `sfer_3_time`='".$ts."', `sfer_3_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание усиления</font>, физические атаки +".$sila."% урона.</font>'
");
$enus=mysql_query("SELECT * FROM `arena_usr` WHERE `enemy`='".$bt['id']."'");
$n_enus=mysql_num_rows($enus);
if($n_enus!=0)
{
while($eb=mysql_fetch_array($enus))
{
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$eb['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание усиления</font>, физические атаки +".$sila."% урона.</font>'
");
}
}
}
if($m==4)
{
if($bt['status']==0 and $bt['time_kill']<time() and $bts['time_kill']<time() and $bt['enemy']!=0)
{
if($skill['lvl']==1)
{$sila=10;}
if($skill['lvl']==2)
{$sila=15;}
if($skill['lvl']==3)
{$sila=20;}
if($skill['lvl']==4)
{$sila=25;}
if($skill['lvl']==5)
{$sila=30;}
if($skill['lvl']==6)
{$sila=35;}
if($skill['lvl']==7)
{$sila=45;}
if($skill['lvl']==8)
{$sila=55;}
if($skill['lvl']==9)
{$sila=65;}
if($skill['lvl']==10)
{$sila=75;}
$tm=time()+60;
$ts=time()+40;
mysql_query("UPDATE `mag` SET`time`='".$tm."' WHERE `mag`='4' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `arena_usr` SET `sfer_4_time`='".$ts."', `sfer_4_ef`='".$sila."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание пробивания</font>, ".$en_name." -".$sila."% брони.</font>'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание пробивания</font>, ваша броня -".$sila."%.</font>'
");
}
}
if($m==6)
{
if($skill['lvl']==1)
{$sila=10;}
if($skill['lvl']==2)
{$sila=15;}
if($skill['lvl']==3)
{$sila=20;}
if($skill['lvl']==4)
{$sila=25;}
if($skill['lvl']==5)
{$sila=30;}
if($skill['lvl']==6)
{$sila=35;}
if($skill['lvl']==7)
{$sila=45;}
if($skill['lvl']==8)
{$sila=55;}
if($skill['lvl']==9)
{$sila=65;}
if($skill['lvl']==10)
{$sila=75;}
$tm=time()+90;
$ts=time()+30;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='6' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `arena_usr` SET `sfer_6_time`='".$ts."', `sfer_6_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание обороны</font>, +".$sila."% защиты от физических атак.</font>'
");
$enus=mysql_query("SELECT * FROM `arena_usr` WHERE `enemy`='".$bt['id']."'");
$n_enus=mysql_num_rows($enus);
if($n_enus!=0)
{
while($eb=mysql_fetch_array($enus))
{
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$eb['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание обороны</font>, +".$sila."% от физических атак.</font>'
");
}
}
}
if($m==10)
{
$sila=5*$skill['lvl'];
$tm=time()+60;
$ts=time()+30;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='10' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `arena_usr` SET `sfer_10_time`='".$ts."', `sfer_10_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание возврата</font>, ".$sila."% урона возвращается противнику.</font>'
");
$enus=mysql_query("SELECT * FROM `arena_usr` WHERE `enemy`='".$bt['id']."'");
$n_enus=mysql_num_rows($enus);
if($n_enus!=0)
{
while($eb=mysql_fetch_array($enus))
{
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$eb['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание возврата</font>, ".$sila."% возвращается противнику.</font>'
");
}
}
}
if($m==11)
{
if($bt['status']==0 and $bt['time_kill']<time() and $bts['time_kill']<time() and $bt['enemy']!=0)
{
$sila=5*$skill['lvl'];
$tm=time()+30;
$ts=time()+20;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='11' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `arena_usr` SET `sfer_11_time`='".$ts."', `sfer_11_ef`='".$sila."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание ослабления</font>, ".$en_name." -".$sila."% урона.</font>'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание ослабления</font>, ваш урон -".$sila."%.</font>'
");
}
}
if($m==12)
{
if($skill['lvl']==1)
{$sila=7;}
if($skill['lvl']==2)
{$sila=15;}
if($skill['lvl']==3)
{$sila=22;}
if($skill['lvl']==4)
{$sila=30;}
if($skill['lvl']==5)
{$sila=37;}
if($skill['lvl']==6)
{$sila=45;}
if($skill['lvl']==7)
{$sila=52;}
if($skill['lvl']==8)
{$sila=60;}
if($skill['lvl']==9)
{$sila=67;}
if($skill['lvl']==10)
{$sila=75;}
$tm=time()+60;
$ts=time()+20;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='12' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `arena_usr` SET `sfer_12_time`='".$ts."', `sfer_12_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание барьера</font>, +".$sila."% защиты от заклинаний.</font>'
");
$enus=mysql_query("SELECT * FROM `arena_usr` WHERE `enemy`='".$bt['id']."'");
$n_enus=mysql_num_rows($enus);
if($n_enus!=0)
{
while($eb=mysql_fetch_array($enus))
{
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$eb['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание барьера</font>, +".$sila."% защиты от заклинаний.</font>'
");
}
}
}
if($m==1)
{
if($bt['status']==0 and $bt['time_kill']<time() and $bts['time_kill']<time() and $bt['enemy']!=0)
{
if($bt['sfer_12_time']>=time())
{$baf_12=$bt['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=5*$skill['lvl']+5;
$sila=round($sila-$sila/100*$baf_12);
$tm=time()+5;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='1' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание атаки</font>, ".$en_name." -".$sila."хп.</font>'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание атаки</font> -".$sila."хп.</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='1225' or $dd<='5')
{
$el=rand(3,10);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/el3.png> <font color=#00ffff>Получено подарок: ".$el."</font>',
`pdz`='".$pdz_kom['id']."'
");
$god=$udata['gaika']+$el;
mysql_query("UPDATE `users` SET `gaika`='".$god."' WHERE `id`='".$udata['id']."'");
}
$exp=$bts['hp'];
$kill=$bt['kil']+1;
$time_kill=time()+15;
$hp=$ussb['hp'];
$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='.$us1['id'].'>'.$us2['usr'].'</a>('.$ss2.')<br>'.$us2['ip'].'';
mysql_query("INSERT INTO `adm_res` SET
`id`='',
`usr`='".$bt['arr']."',
`tip`='bz',
`text`='".$lgf."',
`time`='".time()."'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
mysql_query("INSERT INTO `log_bz` 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>'
");
$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;
$rd=rand(1,3);
if($rd==1)
{
$kol=rand(1,3);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#00ff00>Вы получаете <img src=img/main/r16.png>".$kol."</font>'
");
$kl=$udata['kl']+$kol;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
}}
else
{
$exp=$sila;
$kill=$bt['kil']+0;
$time_kill=time()-1;
$hp=$hp;
}
mysql_query("UPDATE `arena_usr` SET `hp`='".$hp."', `time_kill`='".$time_kill."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `arena_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `arena_usr` SET `kil`='".$kill."' 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']."'");
}
}
if($m==2)
{
if($bt['status']==0 and $bt['time_kill']<time() and $bts['time_kill']<time() and $bt['enemy']!=0)
{
if($bt['sfer_12_time']>=time())
{$baf_12=$bt['sfer_12_ef'];}else{$baf_12=0;}//барьер
if($skill['lvl']==1)
{$sila=rand(10,100);}
if($skill['lvl']==2)
{$sila=rand(30,200);}
if($skill['lvl']==3)
{$sila=rand(50,300);}
if($skill['lvl']==4)
{$sila=rand(70,400);}
if($skill['lvl']==5)
{$sila=rand(90,500);}
if($skill['lvl']==6)
{$sila=rand(110,600);}
if($skill['lvl']==7)
{$sila=rand(130,700);}
if($skill['lvl']==8)
{$sila=rand(150,800);}
if($skill['lvl']==9)
{$sila=rand(170,900);}
if($skill['lvl']==10)
{$sila=rand(190,1000);}
$sila=round($sila-$sila/100*$baf_12);
$tm=time()+50;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='2' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание случайности</font>, ".$en_name." -".$sila."хп.</font>'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание случайности</font> -".$sila."хп.</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='1225' or $dd<='5')
{
$el=rand(3,10);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/el3.png> <font color=#00ffff>Получено подарок: ".$el."</font>',
`pdz`='".$pdz_kom['id']."'
");
$god=$udata['gaika']+$el;
mysql_query("UPDATE `users` SET `gaika`='".$god."' WHERE `id`='".$udata['id']."'");
}
$exp=$bts['hp'];
$kill=$bt['kil']+1;
$time_kill=time()+15;
$hp=$ussb['hp'];
$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='.$us1['id'].'>'.$us2['usr'].'</a>('.$ss2.')<br>'.$us2['ip'].'';
mysql_query("INSERT INTO `adm_res` SET
`id`='',
`usr`='".$bt['arr']."',
`tip`='bz',
`text`='".$lgf."',
`time`='".time()."'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
mysql_query("INSERT INTO `log_bz` 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>'
");
$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']."'");
$rd=rand(1,3);
if($rd==1)
{
$kol=rand(1,3);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#00ff00>Вы получаете <img src=img/main/r16.png>".$kol."</font>'
");
$kl=$udata['kl']+$kol;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
}}
else
{
$exp=$sila;
$kill=$bt['kil']+0;
$time_kill=time()-1;
$hp=$hp;
}
mysql_query("UPDATE `arena_usr` SET `hp`='".$hp."', `time_kill`='".$time_kill."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `arena_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `arena_usr` SET `kil`='".$kill."' 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']."'");
}
}
if($m==13)
{
if($bt['status']==0 and $bt['time_kill']<time() and $bts['time_kill']<time() and $bt['enemy']!=0)
{
if($bt['sfer_12_time']>=time())
{$baf_12=$bt['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=3*$skill['lvl'];
$sila=round($bts['hp']/100*$sila);
$sila=round($sila-$sila/100*$baf_12);
$tm=time()+60;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='13' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание сингулярности</font>, ".$en_name." -".$sila."хп.</font>'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание сингулярности</font> -".$sila."хп.</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='1225' or $dd<='5')
{
$el=rand(3,10);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/el3.png> <font color=#00ffff>Получено подарок: ".$el."</font>',
`pdz`='".$pdz_kom['id']."'
");
$god=$udata['gaika']+$el;
mysql_query("UPDATE `users` SET `gaika`='".$god."' WHERE `id`='".$udata['id']."'");
}
$exp=$bts['hp'];
$kill=$bt['kil']+1;
$time_kill=time()+15;
$hp=$ussb['hp'];
$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='.$us1['id'].'>'.$us2['usr'].'</a>('.$ss2.')<br>'.$us2['ip'].'';
mysql_query("INSERT INTO `adm_res` SET
`id`='',
`usr`='".$bt['arr']."',
`tip`='bz',
`text`='".$lgf."',
`time`='".time()."'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
mysql_query("INSERT INTO `log_bz` 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>'
");
$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;
$rd=rand(1,3);
if($rd==1)
{
$kol=rand(1,3);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#00ff00>Вы получаете <img src=img/main/r16.png>".$kol."</font>'
");
$kl=$udata['kl']+$kol;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
}}
else
{
$exp=$sila;
$kill=$bt['kil']+0;
$time_kill=time()-1;
$hp=$hp;
}
mysql_query("UPDATE `arena_usr` SET `hp`='".$hp."', `time_kill`='".$time_kill."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `arena_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `arena_usr` SET `kil`='".$kill."' 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']."'");
}
}
if($m==14)
{
if($bt['status']==0 and $bt['time_kill']<time() and $bts['time_kill']<time() and $bt['enemy']!=0)
{
if($bt['sfer_12_time']>=time())
{$baf_12=$bt['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=50*$skill['lvl'];
$sila=round($sila-$sila/100*$baf_12);
$tm=time()+40;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='14' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание хаоса</font>, ".$en_name." -".$sila."хп.</font>'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание хаоса</font> -".$sila."хп.</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='1225' or $dd<='5')
{
$el=rand(3,10);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/el3.png> <font color=#00ffff>Получено подарок: ".$el."</font>',
`pdz`='".$pdz_kom['id']."'
");
$god=$udata['gaika']+$el;
mysql_query("UPDATE `users` SET `gaika`='".$god."' WHERE `id`='".$udata['id']."'");
}
$exp=$bts['hp'];
$kill=$bt['kil']+1;
$time_kill=time()+15;
$hp=$ussb['hp'];
$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='.$us1['id'].'>'.$us2['usr'].'</a>('.$ss2.')<br>'.$us2['ip'].'';
mysql_query("INSERT INTO `adm_res` SET
`id`='',
`usr`='".$bt['arr']."',
`tip`='bz',
`text`='".$lgf."',
`time`='".time()."'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
mysql_query("INSERT INTO `log_bz` 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>'
");
$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']."'");
$rd=rand(1,3);
if($rd==1)
{
$kol=rand(1,3);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#00ff00>Вы получаете <img src=img/main/r16.png>".$kol."</font>'
");
$kl=$udata['kl']+$kol;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
}}
else
{
$exp=$sila;
$kill=$bt['kil']+0;
$time_kill=time()-1;
$hp=$hp;
}
mysql_query("UPDATE `arena_usr` SET `hp`='".$hp."', `time_kill`='".$time_kill."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `arena_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `arena_usr` SET `kil`='".$kill."' 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']."'");
}
}
if($m==7)
{
if($bt['status']==0 and $bt['time_kill']<time() and $bts['time_kill']<time() and $bt['enemy']!=0)
{
if($bt['sfer_12_time']>=time())
{$baf_12=$bt['sfer_12_ef'];}else{$baf_12=0;}//барьер
if($skill['lvl']==1)
{$sila=70;}
if($skill['lvl']==2)
{$sila=140;}
if($skill['lvl']==3)
{$sila=210;}
if($skill['lvl']==4)
{$sila=280;}
if($skill['lvl']==5)
{$sila=350;}
if($skill['lvl']==6)
{$sila=420;}
if($skill['lvl']==7)
{$sila=500;}
if($skill['lvl']==8)
{$sila=600;}
if($skill['lvl']==9)
{$sila=700;}
if($skill['lvl']==10)
{$sila=800;}
$sila=round($sila-$sila/100*$baf_12);
$tm=time()+50;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='7' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание молнии</font>, ".$en_name." -".$sila."хп.</font>'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание молнии</font>, -".$sila."хп.</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='1225' or $dd<='5')
{
$el=rand(3,10);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/el3.png> <font color=#00ffff>Получено подарок: ".$el."</font>',
`pdz`='".$pdz_kom['id']."'
");
$god=$udata['gaika']+$el;
mysql_query("UPDATE `users` SET `gaika`='".$god."' WHERE `id`='".$udata['id']."'");
}
$exp=$bts['hp'];
$kill=$bt['kil']+1;
$time_kill=time()+15;
$hp=$ussb['hp'];
$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='.$us1['id'].'>'.$us2['usr'].'</a>('.$ss2.')<br>'.$us2['ip'].'';
mysql_query("INSERT INTO `adm_res` SET
`id`='',
`usr`='".$bt['arr']."',
`tip`='bz',
`text`='".$lgf."',
`time`='".time()."'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
mysql_query("INSERT INTO `log_bz` 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>'
");
$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']."'");
$rd=rand(1,3);
if($rd==1)
{
$kol=rand(1,3);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#00ff00>Вы получаете <img src=img/main/r16.png>".$kol."</font>'
");
$kl=$udata['kl']+$kol;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
}}
else
{
$exp=$sila;
$kill=$bt['kil']+0;
$time_kill=time()-1;
$hp=$hp;
}
mysql_query("UPDATE `arena_usr` SET `hp`='".$hp."', `time_kill`='".$time_kill."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `arena_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `arena_usr` SET `kil`='".$kill."' 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']."'");
}
}
if($m==9)
{
if($bt['status']==0 and $bt['time_kill']<time() and $bts['time_kill']<time() and $bt['enemy']!=0)
{
if($bt['sfer_12_time']>=time())
{$baf_12=$bt['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=40*$skill['lvl'];
$sh=$sila/2;
$sila=round($sila-$sila/100*$baf_12);
$tm=time()+30;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='9' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание вампира</font>, ".$en_name." -".$sila."хп, ваше хп + ".$sh."</font>'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание вампира</font>, -".$sila."хп, востановив свое хп + ".$sh."</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='1225' or $dd<='5')
{
$el=rand(3,10);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/el3.png> <font color=#00ffff>Получено подарок: ".$el."</font>',
`pdz`='".$pdz_kom['id']."'
");
$god=$udata['gaika']+$el;
mysql_query("UPDATE `users` SET `gaika`='".$god."' WHERE `id`='".$udata['id']."'");
}
$exp=$bts['hp'];
$kill=$bt['kil']+1;
$time_kill=time()+15;
$hp=$ussb['hp'];
$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='.$us1['id'].'>'.$us2['usr'].'</a>('.$ss2.')<br>'.$us2['ip'].'';
mysql_query("INSERT INTO `adm_res` SET
`id`='',
`usr`='".$bt['arr']."',
`tip`='bz',
`text`='".$lgf."',
`time`='".time()."'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
mysql_query("INSERT INTO `log_bz` 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>'
");
$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']."'");
$rd=rand(1,3);
if($rd==1)
{
$kol=rand(1,3);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#00ff00>Вы получаете <img src=img/main/r16.png>".$kol."</font>'
");
$kl=$udata['kl']+$kol;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
}}
else
{
$exp=$sila;
$kill=$bt['kil']+0;
$time_kill=time()-1;
$hp=$hp;
}
mysql_query("UPDATE `arena_usr` SET `hp`='".$hp."', `time_kill`='".$time_kill."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
$hps=$bt['hp']+$sh;
if($hps>$udata['hp'])
{
$hps=$udata['hp'];
}
mysql_query("UPDATE `arena_usr` SET `att`='".$att."', `hp`='".$hps."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `arena_usr` SET `kil`='".$kill."' 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']."'");
}
}
if($m==8)
{
$sila=80*$skill['lvl'];
$tm=time()+40;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='8' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание исциления</font> ваше хп + ".$sila."</font>'
");
$hps=$bt['hp']+$sila;
if($hps>$udata['hp'])
{
$hps=$udata['hp'];
}
mysql_query("UPDATE `arena_usr` SET `hp`='".$hps."' WHERE `id`='".$bt['id']."'");
}
if($m==5)
{
if($bt['status']==0 and $bt['time_kill']<time() and $bts['time_kill']<time() and $bt['enemy']!=0)
{
if($bt['sfer_12_time']>=time())
{$baf_12=$bt['sfer_12_ef'];}else{$baf_12=0;}//барьер
if($skill['lvl']==1)
{$sila=15;$t=5;}
if($skill['lvl']==2)
{$sila=30;$t=6;}
if($skill['lvl']==3)
{$sila=45;$t=7;}
if($skill['lvl']==4)
{$sila=60;$t=8;}
if($skill['lvl']==5)
{$sila=75;$t=9;}
if($skill['lvl']==6)
{$sila=90;$t=10;}
if($skill['lvl']==7)
{$sila=105;$t=11;}
if($skill['lvl']==8)
{$sila=120;$t=12;}
if($skill['lvl']==9)
{$sila=135;$t=14;}
if($skill['lvl']==10)
{$sila=150;$t=15;}
$sila=round($sila-$sila/100*$baf_12);
$tm=time()+60;
$ts=time()+$t;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='5' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `arena_usr` SET `sfer_5_time`='".$ts."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание стана</font>, ".$en_name." -".$sila."хп, +".$t."сек. оглушение</font>'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.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 color=#0099ff>Заклинание стана</font>, -".$sila."хп, +".$t."сек. оглушения</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='1225' or $dd<='5')
{
$el=rand(3,10);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/el3.png> <font color=#00ffff>Получено подарок: ".$el."</font>',
`pdz`='".$pdz_kom['id']."'
");
$god=$udata['gaika']+$el;
mysql_query("UPDATE `users` SET `gaika`='".$god."' WHERE `id`='".$udata['id']."'");
}
$exp=$bts['hp'];
$kill=$bt['kil']+1;
$time_kill=time()+15;
$hp=$ussb['hp'];
$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='.$us1['id'].'>'.$us2['usr'].'</a>('.$ss2.')<br>'.$us2['ip'].'';
mysql_query("INSERT INTO `adm_res` SET
`id`='',
`usr`='".$bt['arr']."',
`tip`='bz',
`text`='".$lgf."',
`time`='".time()."'
");
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
mysql_query("INSERT INTO `log_bz` 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>'
");
$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']."'");
$rd=rand(1,3);
if($rd==1)
{
$kol=rand(1,3);
mysql_query("INSERT INTO `log_bz` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e9.png><font color=#00ff00>Вы получаете <img src=img/main/r16.png>".$kol."</font>'
");
$kl=$udata['kl']+$kol;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
}}
else
{
$exp=$sila;
$kill=$bt['kil']+0;
$time_kill=time()-1;
$hp=$hp;
}
mysql_query("UPDATE `arena_usr` SET `hp`='".$hp."', `time_kill`='".$time_kill."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `arena_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `arena_usr` SET `kil`='".$kill."' 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']."'");
}
}
}
header('location: b_bz.php');exit;
?>