Файл: ar_m_mag.php
Строк: 298
<?
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_m_usr` WHERE `usr`='".$udata['id']."' and `tip`='usr'");
$bt=mysql_fetch_array($bat);
$bts_mob=mysql_query("SELECT * FROM `arena_m_mob` WHERE `usr`='".$udata['id']."'");
$bts=mysql_fetch_array($bts_mob);
$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($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_m_usr` SET `sfer_3_time`='".$ts."', `sfer_3_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание усиления</font>, физические атаки +".$sila."% урона.</font>'
");
}
if($m==4)
{
if($bt['status']==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_m_mob` SET `sfer_4_time`='".$ts."', `sfer_4_ef`='".$sila."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание пробивания</font>, ".$bts['name']." -".$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_m_usr` SET `sfer_6_time`='".$ts."', `sfer_6_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <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_m_usr` SET `sfer_10_time`='".$ts."', `sfer_10_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание возврата</font>, ".$sila."% урона возвращается противнику.</font>'
");
}
if($m==11)
{
if($bt['status']==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_m_mob` SET `sfer_11_time`='".$ts."', `sfer_11_ef`='".$sila."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание ослабления</font>, ".$bts['name']." -".$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_m_usr` SET `sfer_12_time`='".$ts."', `sfer_12_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание барьера</font>, +".$sila."% защиты от заклинаний.</font>'
");
}
if($m==1)
{
if($bt['status']==0)
{
$sila=5*$skill['lvl']+5;
$tm=time()+5;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='1' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание атаки</font>, ".$bts['name']." -".$sila."хп.</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$exp=$bts['hp'];
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$bts['name']."</font>'
");
$nai=$udata['reit_oh']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."' WHERE `id`='".$udata['id']."'");
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['hunter_exp']+1;
mysql_query("UPDATE `users_dost` SET `hunter_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
mysql_query("DELETE FROM `arena_m_mob` WHERE `id`='".$bts['id']."'");
}
else
{
$exp=$sila;
mysql_query("UPDATE `arena_m_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
}
mysql_query("UPDATE `arena_m_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)
{
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);}
$tm=time()+50;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='2' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание случайности</font>, ".$bts['name']." -".$sila."хп.</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$exp=$bts['hp'];
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$bts['name']."</font>'
");
$nai=$udata['reit_oh']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."' WHERE `id`='".$udata['id']."'");
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['hunter_exp']+1;
mysql_query("UPDATE `users_dost` SET `hunter_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
mysql_query("DELETE FROM `arena_m_mob` WHERE `id`='".$bts['id']."'");
}
else
{
$exp=$sila;
mysql_query("UPDATE `arena_m_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
}
mysql_query("UPDATE `arena_m_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==13)
{
if($bt['status']==0)
{
$sila=3*$skill['lvl'];
$sila=round($bts['hp']/100*$sila);
$tm=time()+60;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='13' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание сингулярности</font>, ".$bts['name']." -".$sila."хп.</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$exp=$bts['hp'];
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$bts['name']."</font>'
");
$nai=$udata['reit_oh']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."' WHERE `id`='".$udata['id']."'");
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['hunter_exp']+1;
mysql_query("UPDATE `users_dost` SET `hunter_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
mysql_query("DELETE FROM `arena_m_mob` WHERE `id`='".$bts['id']."'");
}
else
{
$exp=$sila;
mysql_query("UPDATE `arena_m_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
}
mysql_query("UPDATE `arena_m_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==14)
{
if($bt['status']==0)
{
$sila=50*$skill['lvl'];
$tm=time()+40;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='14' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание хаоса</font>, ".$bts['name']." -".$sila."хп.</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$exp=$bts['hp'];
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$bts['name']."</font>'
");
$nai=$udata['reit_oh']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."' WHERE `id`='".$udata['id']."'");
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['hunter_exp']+1;
mysql_query("UPDATE `users_dost` SET `hunter_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
mysql_query("DELETE FROM `arena_m_mob` WHERE `id`='".$bts['id']."'");
}
else
{
$exp=$sila;
mysql_query("UPDATE `arena_m_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
}
mysql_query("UPDATE `arena_m_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==7)
{
if($bt['status']==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;}
$tm=time()+50;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='7' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание молнии</font>, ".$bts['name']." -".$sila."хп.</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$exp=$bts['hp'];
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$bts['name']."</font>'
");
$nai=$udata['reit_oh']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."' WHERE `id`='".$udata['id']."'");
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['hunter_exp']+1;
mysql_query("UPDATE `users_dost` SET `hunter_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
mysql_query("DELETE FROM `arena_m_mob` WHERE `id`='".$bts['id']."'");
}
else
{
$exp=$sila;
mysql_query("UPDATE `arena_m_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
}
mysql_query("UPDATE `arena_m_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==9)
{
if($bt['status']==0)
{
$sila=40*$skill['lvl'];
$sh=$sila/2;
$tm=time()+30;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='9' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание вампира</font>, ".$bts['name']." -".$sila."хп, ваше хп + ".$sh."</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$exp=$bts['hp'];
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$bts['name']."</font>'
");
$nai=$udata['reit_oh']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."' WHERE `id`='".$udata['id']."'");
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['hunter_exp']+1;
mysql_query("UPDATE `users_dost` SET `hunter_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
mysql_query("DELETE FROM `arena_m_mob` WHERE `id`='".$bts['id']."'");
}
else
{
$exp=$sila;
mysql_query("UPDATE `arena_m_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
}
$hps=$bt['hp']+$sh;
if($hps>$udata['hp'])
{
$hps=$udata['hp'];
}
mysql_query("UPDATE `arena_m_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;
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_arena_m` 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_m_usr` SET `hp`='".$hps."' WHERE `id`='".$bt['id']."'");
}
if($m==5)
{
if($bt['status']==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;}
$tm=time()+60;
$ts=time()+$t;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='5' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `arena__m_mob` SET `sfer_5_time`='".$ts."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание стана</font>, ".$bts['name']." -".$sila."хп, +".$t."сек. оглушение</font>'
");
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$exp=$bts['hp'];
mysql_query("INSERT INTO `log_arena_m` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$bts['name']."</font>'
");
$nai=$udata['reit_oh']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."' WHERE `id`='".$udata['id']."'");
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['hunter_exp']+1;
mysql_query("UPDATE `users_dost` SET `hunter_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
mysql_query("DELETE FROM `arena_m_mob` WHERE `id`='".$bts['id']."'");
}
else
{
$exp=$sila;
mysql_query("UPDATE `arena_m_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
}
mysql_query("UPDATE `arena_m_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']."'");
}
}
}
header('location: ar_m_b.php');exit;
?>