Файл: b_str_mag.php
Строк: 1319
<?
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>';
}
$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_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b1.png><font color=#999999>Вы оглушены еще ".$baf_5."сек.</font>'
");
header('location: ?');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 `stt_usr` SET `sfer_3_time`='".$ts."', `sfer_3_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_str` 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 `stt_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_str` 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['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 `stt_usr` SET `sfer_4_time`='".$ts."', `sfer_4_ef`='".$sila."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание пробивания</font>, ".$en_name." -".$sila."% брони.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` 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 `stt_usr` SET `sfer_6_time`='".$ts."', `sfer_6_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_str` 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 `stt_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_str` 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 `stt_usr` SET `sfer_10_time`='".$ts."', `sfer_10_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_str` 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 `stt_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_str` 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['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 `stt_usr` SET `sfer_11_time`='".$ts."', `sfer_11_ef`='".$sila."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание ослабления</font>, ".$en_name." -".$sila."% урона.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` 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 `stt_usr` SET `sfer_12_time`='".$ts."', `sfer_12_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_str` 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 `stt_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_str` 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['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=5*$skill['lvl']+5;
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+5;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='1' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание атаки</font>, ".$en_name." -".$sila."хп.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` 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)
{
$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']."'");
}
if($bts['tip']=='pit' or $bts['usr']==1)
{
}
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']."'");
}
mysql_query("UPDATE `stt_usr` SET `status`='2', `att2`='".$silazz."' WHERE `id`='".$bts['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='.$us1['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."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `stt_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `stt_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']."'");
}
}
if($m==2)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['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);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+50;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='2' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание случайности</font>, ".$en_name." -".$sila."хп.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` 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)
{
$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='.$us1['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."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `stt_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `stt_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;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
if($m==13)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=3*$skill['lvl'];
$sila=round($bts['hp']/100*$sila);
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+60;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='13' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание сингулярности</font>, ".$en_name." -".$sila."хп.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` 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)
{
$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='.$us1['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."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `stt_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `stt_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;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
if($m==14)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=50*$skill['lvl'];
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+40;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='14' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание хаоса</font>, ".$en_name." -".$sila."хп.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` 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)
{
$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='.$us1['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."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `stt_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `stt_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;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
if($m==7)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['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);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+50;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='7' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание молнии</font>, ".$en_name." -".$sila."хп.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` 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)
{
$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='.$us1['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."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `stt_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `stt_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;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
if($m==9)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=40*$skill['lvl'];
$sh=$sila/2;
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+30;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='9' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание вампира</font>, ".$en_name." -".$sila."хп, ваше хп + ".$sh."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` 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)
{
$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='.$us1['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."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `stt_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
$hps=$bt['hp']+$sh;
if($hps>$udata['hp'])
{
$hps=$udata['hp'];
}
mysql_query("UPDATE `stt_usr` SET `att`='".$att."', `hp`='".$hps."' 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;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$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_str` 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 `stt_usr` SET `hp`='".$hps."' WHERE `id`='".$bt['id']."'");
}
if($m==5)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['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);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+60;
$ts=time()+$t;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='5' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `stt_usr` SET `sfer_5_time`='".$ts."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_str` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание стана</font>, ".$en_name." -".$sila."хп, +".$t."сек. оглушение</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_str` 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)
{
$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='.$us1['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."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `stt_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `stt_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;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
}
header('location: b_str.php');exit;
?>