Файл: b_av_mag.php
Строк: 887
<?
define('PROTECTOR', 1);
$textl='Битва';
include('files/db.php');
include($path.'files/auth.php');
include($path.'files/syst.php');
if ($user_id==0){
header('location: index.php');exit;
}
$bat=mysql_query("SELECT * FROM `avan_usr` WHERE `usr`='".$udata['id']."'");
$bt=mysql_fetch_array($bat);
$av=mysql_fetch_array(mysql_query("SELECT * FROM `avan` WHERE `id`='".$bt['arr']."'"));
$bts=mysql_fetch_array(mysql_query("SELECT * FROM `avan_mob` WHERE `id`='".$bt['enemy']."'"));
$bts_n=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `id`='".$bt['enemy']."'"));
$bts_num=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."'"));
$us_num=mysql_num_rows(mysql_query("SELECT * FROM `avan_usr` WHERE `arr`='".$av['id']."' and `status`='0' and `tip`='usr'"));
$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($skill['mag']==1)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."' and `id`='".$bt['enemy']."'"));
if($enemy==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>Противник не найден.</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
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=40;}
if($skill['lvl']==8)
{$sila=45;}
if($skill['lvl']==9)
{$sila=50;}
if($skill['lvl']==10)
{$sila=55;}
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
if($bts['tip']==2)
{
$sila=round($sila/2);
}
if($bts['tip']==3)
{
$sila=round($sila*2);
}
if($bts['tip']==4)
{
$sila=0;
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал</font> заклинание удара
<font color=#009900>(</font>'.$bts['name'].' <font color=#009900>-'.$sila.')</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$lg2='<img src=img/main/b17.png><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#ff0000>
сокрушает '.$bts['name'].'</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."', `arr`='".$av['id']."'
");
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='306' and $dc<='320')
{
if($udata['pol']==1){$rand=rand(1,10);}
elseif($udata['pol']==2){$rand=rand(1,7);}
if($rand==1)
{
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/23f.png>1</font>',
`arr`='".$av['id']."'
");
$god=$udata['tank']+1;
mysql_query("UPDATE `users` SET `tank`='".$god."' WHERE `id`='".$udata['id']."'");
}
}$nai=$udata['reit_oh']+1;
if($udata['lvl']>$udata['rang'])
{
$rang=3;
}
else
{
$rang=0;
}
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$ssb['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$rang=$rang*2;
}
$rang=$udata['exp_rang']+$rang;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `exp_rang`='".$rang."' 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']."'");
$ra=rand(1,3);
if($ra==1)
{
$kl=$udata['kl']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
if($ra==2)
{
$kl=$udata['kl']+1;
$fm=$udata['fm']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1 <img src=img/main/r17.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
mysql_query("DELETE FROM `avan_mob` WHERE `id`='".$bts['id']."'");
$exp=$bts['hp'];
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
mysql_query("UPDATE `avan_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
$exp=$sila;
}
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']."'");
$ur=$bt['ur']+$sila;
mysql_query("UPDATE `avan_usr` SET `att`='".$sila."', `ur`='".$ur."' WHERE `id`='".$bt['id']."'");
$tm=time()+5;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='1' and `usr`='".$udata['id']."'");
}
}
if($skill['mag']==2)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."' and `id`='".$bt['enemy']."'"));
if($enemy==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>Противник не найден.</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
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);}
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
if($bts['tip']==2)
{
$sila=round($sila/2);
}
if($bts['tip']==3)
{
$sila=round($sila*2);
}
if($bts['tip']==4)
{
$sila=0;
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал</font> заклинание случайности
<font color=#009900>(</font>'.$bts['name'].' <font color=#009900>-'.$sila.')</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$lg2='<img src=img/main/b17.png><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#ff0000>
сокрушает '.$bts['name'].'</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."', `arr`='".$av['id']."'
");
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='306' and $dc<='320')
{
if($udata['pol']==1){$rand=rand(1,10);}
elseif($udata['pol']==2){$rand=rand(1,7);}
if($rand==1)
{
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/23f.png>1</font>',
`arr`='".$av['id']."'
");
$god=$udata['tank']+1;
mysql_query("UPDATE `users` SET `tank`='".$god."' WHERE `id`='".$udata['id']."'");
}
}
$nai=$udata['reit_oh']+1;
if($udata['lvl']>$udata['rang'])
{
$rang=3;
}
else
{
$rang=0;
}
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$ssb['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$rang=$rang*2;
}
$rang=$udata['exp_rang']+$rang;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `exp_rang`='".$rang."' 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']."'");
$ra=rand(1,3);
if($ra==1)
{
$kl=$udata['kl']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
if($ra==2)
{
$kl=$udata['kl']+1;
$fm=$udata['fm']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1 <img src=img/main/r17.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
mysql_query("DELETE FROM `avan_mob` WHERE `id`='".$bts['id']."'");
$exp=$bts['hp'];
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
mysql_query("UPDATE `avan_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
$exp=$sila;
}
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']."'");
$ur=$bt['ur']+$sila;
mysql_query("UPDATE `avan_usr` SET `att`='".$sila."', `ur`='".$ur."' WHERE `id`='".$bt['id']."'");
$tm=time()+50;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='2' and `usr`='".$udata['id']."'");
}
}
if($skill['mag']==5)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."' and `id`='".$bt['enemy']."'"));
if($enemy==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>Противник не найден.</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
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;}
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
if($bts['tip']==2)
{
$sila=round($sila/2);
}
if($bts['tip']==3)
{
$sila=round($sila*2);
}
if($bts['tip']==4)
{
$sila=0;
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал</font> заклинание стана
<font color=#009900>(</font>'.$bts['name'].' <font color=#009900>-'.$sila.'. '.$bts['name'].' оглушен на '.$t.'сек.)</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$lg2='<img src=img/main/b17.png><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#ff0000>
сокрушает '.$bts['name'].'</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."', `arr`='".$av['id']."'
");
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='306' and $dc<='320')
{
if($udata['pol']==1){$rand=rand(1,10);}
elseif($udata['pol']==2){$rand=rand(1,7);}
if($rand==1)
{
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/23f.png>1</font>',
`arr`='".$av['id']."'
");
$god=$udata['tank']+1;
mysql_query("UPDATE `users` SET `tank`='".$god."' WHERE `id`='".$udata['id']."'");
}
}
$nai=$udata['reit_oh']+1;
if($udata['lvl']>$udata['rang'])
{
$rang=3;
}
else
{
$rang=0;
}
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$ssb['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$rang=$rang*2;
}
$rang=$udata['exp_rang']+$rang;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `exp_rang`='".$rang."' 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']."'");
$ra=rand(1,3);
if($ra==1)
{
$kl=$udata['kl']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
if($ra==2)
{
$kl=$udata['kl']+1;
$fm=$udata['fm']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1 <img src=img/main/r17.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
mysql_query("DELETE FROM `avan_mob` WHERE `id`='".$bts['id']."'");
$exp=$bts['hp'];
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
$ts=time()+$t;
mysql_query("UPDATE `avan_mob` SET `hp`='".$hp."', `sfer_so`='".$ts."' WHERE `id`='".$bts['id']."'");
$exp=$sila;
}
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']."'");
$ur=$bt['ur']+$sila;
mysql_query("UPDATE `avan_usr` SET `att`='".$sila."', `ur`='".$ur."' WHERE `id`='".$bt['id']."'");
$tm=time()+60;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='5' and `usr`='".$udata['id']."'");
}
}
if($skill['mag']==7)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."' and `id`='".$bt['enemy']."'"));
if($enemy==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>Противник не найден.</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
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;
}
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
if($bts['tip']==2)
{
$sila=round($sila/2);
}
if($bts['tip']==3)
{
$sila=round($sila*2);
}
if($bts['tip']==4)
{
$sila=0;
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал</font> заклинание молний
<font color=#009900>(</font>'.$bts['name'].' <font color=#009900>-'.$sila.')</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$lg2='<img src=img/main/b17.png><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#ff0000>
сокрушает '.$bts['name'].'</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."', `arr`='".$av['id']."'
");
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='306' and $dc<='320')
{
if($udata['pol']==1){$rand=rand(1,10);}
elseif($udata['pol']==2){$rand=rand(1,7);}
if($rand==1)
{
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/23f.png>1</font>',
`arr`='".$av['id']."'
");
$god=$udata['tank']+1;
mysql_query("UPDATE `users` SET `tank`='".$god."' WHERE `id`='".$udata['id']."'");
}
}
$nai=$udata['reit_oh']+1;
if($udata['lvl']>$udata['rang'])
{
$rang=3;
}
else
{
$rang=0;
}
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$ssb['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$rang=$rang*2;
}
$rang=$udata['exp_rang']+$rang;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `exp_rang`='".$rang."' WHERE `id`='".$udata['id']."'");
$ra=rand(1,3);
if($ra==1)
{
$kl=$udata['kl']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
if($ra==2)
{
$kl=$udata['kl']+1;
$fm=$udata['fm']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1 <img src=img/main/r17.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
mysql_query("DELETE FROM `avan_mob` WHERE `id`='".$bts['id']."'");
$exp=$bts['hp'];
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
mysql_query("UPDATE `avan_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
$exp=$sila;
}
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']."'");
$ur=$bt['ur']+$sila;
mysql_query("UPDATE `avan_usr` SET `att`='".$sila."', `ur`='".$ur."' WHERE `id`='".$bt['id']."'");
$tm=time()+50;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='7' and `usr`='".$udata['id']."'");
}
}
if($skill['mag']==9)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."' and `id`='".$bt['enemy']."'"));
if($enemy==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>Противник не найден.</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($skill['lvl']==1)
{
$sila=40;
}
if($skill['lvl']==2)
{
$sila=80;
}
if($skill['lvl']==3)
{
$sila=120;
}
if($skill['lvl']==4)
{
$sila=160;
}
if($skill['lvl']==5)
{
$sila=200;
}
if($skill['lvl']==6)
{
$sila=240;
}
if($skill['lvl']==7)
{
$sila=280;
}
if($skill['lvl']==8)
{
$sila=320;
}
if($skill['lvl']==9)
{
$sila=360;
}
if($skill['lvl']==10)
{
$sila=400;
}
$sh=$sila/2;
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
if($bts['tip']==2)
{
$sila=round($sila/2);
}
if($bts['tip']==3)
{
$sila=round($sila*2);
}
if($bts['tip']==4)
{
$sila=0;
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал</font> заклинание вампиризма
<font color=#009900>(</font>'.$bts['name'].' <font color=#009900>-'.$sila.', <font color=#ffff00>'.$udata['usr'].'</font> + '.$sh.'хп.)</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$lg2='<img src=img/main/b17.png><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#ff0000>
сокрушает '.$bts['name'].'</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."', `arr`='".$av['id']."'
");
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='306' and $dc<='320')
{
if($udata['pol']==1){$rand=rand(1,10);}
elseif($udata['pol']==2){$rand=rand(1,7);}
if($rand==1)
{
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/23f.png>1</font>',
`arr`='".$av['id']."'
");
$god=$udata['tank']+1;
mysql_query("UPDATE `users` SET `tank`='".$god."' WHERE `id`='".$udata['id']."'");
}
}
$nai=$udata['reit_oh']+1;
if($udata['lvl']>$udata['rang'])
{
$rang=3;
}
else
{
$rang=0;
}
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$ssb['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$rang=$rang*2;
}
$rang=$udata['exp_rang']+$rang;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `exp_rang`='".$rang."' 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']."'");
$ra=rand(1,3);
if($ra==1)
{
$kl=$udata['kl']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
if($ra==2)
{
$kl=$udata['kl']+1;
$fm=$udata['fm']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1 <img src=img/main/r17.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
mysql_query("DELETE FROM `avan_mob` WHERE `id`='".$bts['id']."'");
$exp=$bts['hp'];
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
mysql_query("UPDATE `avan_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
$exp=$sila;
}
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']."'");
$ur=$bt['ur']+$sila;
$hps=$bt['hp']+$sh;
if($hps>$udata['hp'])
{
$hps=$udata['hp'];
}
mysql_query("UPDATE `avan_usr` SET `att`='".$sila."', `ur`='".$ur."', `hp`='".$hps."' WHERE `id`='".$bt['id']."'");
$tm=time()+50;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='9' and `usr`='".$udata['id']."'");
}
}
if($skill['mag']==13)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."' and `id`='".$bt['enemy']."'"));
if($enemy==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>Противник не найден.</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($skill['lvl']==1)
{
$sila=3;
}
if($skill['lvl']==2)
{
$sila=6;
}
if($skill['lvl']==3)
{
$sila=9;
}
if($skill['lvl']==4)
{
$sila=12;
}
if($skill['lvl']==5)
{
$sila=15;
}
if($skill['lvl']==6)
{
$sila=18;
}
if($skill['lvl']==7)
{
$sila=21;
}
if($skill['lvl']==8)
{
$sila=24;
}
if($skill['lvl']==9)
{
$sila=27;
}
if($skill['lvl']==10)
{
$sila=30;
}
$sila=round($bts['hp']/100*$sila);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
if($bts['tip']==2)
{
$sila=round($sila/2);
}
if($bts['tip']==3)
{
$sila=round($sila*2);
}
if($bts['tip']==4)
{
$sila=0;
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал</font> заклинание сингулярности
<font color=#009900>(</font>'.$bts['name'].' <font color=#009900>-'.$sila.')</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$lg2='<img src=img/main/b17.png><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#ff0000>
сокрушает '.$bts['name'].'</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."', `arr`='".$av['id']."'
");
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='306' and $dc<='320')
{
if($udata['pol']==1){$rand=rand(1,10);}
elseif($udata['pol']==2){$rand=rand(1,7);}
if($rand==1)
{
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/23f.png>1</font>',
`arr`='".$av['id']."'
");
$god=$udata['tank']+1;
mysql_query("UPDATE `users` SET `tank`='".$god."' WHERE `id`='".$udata['id']."'");
}
}
$nai=$udata['reit_oh']+1;
if($udata['lvl']>$udata['rang'])
{
$rang=3;
}
else
{
$rang=0;
}
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$ssb['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$rang=$rang*2;
}
$rang=$udata['exp_rang']+$rang;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `exp_rang`='".$rang."' 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']."'");
$ra=rand(1,3);
if($ra==1)
{
$kl=$udata['kl']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
if($ra==2)
{
$kl=$udata['kl']+1;
$fm=$udata['fm']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1 <img src=img/main/r17.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
mysql_query("DELETE FROM `avan_mob` WHERE `id`='".$bts['id']."'");
$exp=$bts['hp'];
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
mysql_query("UPDATE `avan_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
$exp=$sila;
}
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']."'");
$ur=$bt['ur']+$sila;
mysql_query("UPDATE `avan_usr` SET `att`='".$sila."', `ur`='".$ur."' WHERE `id`='".$bt['id']."'");
$tm=time()+60;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='13' and `usr`='".$udata['id']."'");
}
}
if($skill['mag']==14)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."' and `id`='".$bt['enemy']."'"));
if($enemy==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>Противник не найден.</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($skill['lvl']==1)
{
$sila=50;
}
if($skill['lvl']==2)
{
$sila=100;
}
if($skill['lvl']==3)
{
$sila=150;
}
if($skill['lvl']==4)
{
$sila=200;
}
if($skill['lvl']==5)
{
$sila=250;
}
if($skill['lvl']==6)
{
$sila=300;
}
if($skill['lvl']==7)
{
$sila=350;
}
if($skill['lvl']==8)
{
$sila=400;
}
if($skill['lvl']==9)
{
$sila=450;
}
if($skill['lvl']==10)
{
$sila=500;
}
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
if($bts['tip']==2)
{
$sila=round($sila/2);
}
if($bts['tip']==3)
{
$sila=round($sila*2);
}
if($bts['tip']==4)
{
$sila=0;
}
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал</font> заклинание хаоса
<font color=#009900>(</font>'.$bts['name'].' <font color=#009900>-'.$sila.')</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$lg2='<img src=img/main/b17.png><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#ff0000>
сокрушает '.$bts['name'].'</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."', `arr`='".$av['id']."'
");
$dm=date('m');
$dd=date('d');
$dc=$dm.''.$dd;
if($dc>='306' and $dc<='320')
{
if($udata['pol']==1){$rand=rand(1,10);}
elseif($udata['pol']==2){$rand=rand(1,7);}
if($rand==1)
{
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/23f.png>1</font>',
`arr`='".$av['id']."'
");
$god=$udata['tank']+1;
mysql_query("UPDATE `users` SET `tank`='".$god."' WHERE `id`='".$udata['id']."'");
}
}
$nai=$udata['reit_oh']+1;
if($udata['lvl']>$udata['rang'])
{
$rang=3;
}
else
{
$rang=0;
}
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$ssb['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$rang=$rang*2;
}
$rang=$udata['exp_rang']+$rang;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `exp_rang`='".$rang."' 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']."'");
$ra=rand(1,3);
if($ra==1)
{
$kl=$udata['kl']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
if($ra==2)
{
$kl=$udata['kl']+1;
$fm=$udata['fm']+1;
mysql_query("UPDATE `users` SET `kl`='".$kl."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$lg3='<img src=img/main/p12.png>
<a href=info.php?id='.$udata['id'].'><font color=#ffff00>'.$udata['usr'].'</font></a> <font color=#00ff00>
получает <img src=img/main/r16.png>1 <img src=img/main/r17.png>1</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg3."', `arr`='".$av['id']."'
");
}
mysql_query("DELETE FROM `avan_mob` WHERE `id`='".$bts['id']."'");
$exp=$bts['hp'];
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
mysql_query("UPDATE `avan_mob` SET `hp`='".$hp."' WHERE `id`='".$bts['id']."'");
$exp=$sila;
}
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']."'");
$ur=$bt['ur']+$sila;
mysql_query("UPDATE `avan_usr` SET `att`='".$sila."', `ur`='".$ur."' WHERE `id`='".$bt['id']."'");
$tm=time()+40;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='14' and `usr`='".$udata['id']."'");
}
if($skill['mag']==3)
{
if($skill['lvl']==1)
{
$sila='3%';
}
if($skill['lvl']==2)
{
$sila='6%';
}
if($skill['lvl']==3)
{
$sila='9%';
}
if($skill['lvl']==4)
{
$sila='12%';
}
if($skill['lvl']==5)
{
$sila='15%';
}
if($skill['lvl']==6)
{
$sila='18%';
}
if($skill['lvl']==7)
{
$sila='21%';
}
if($skill['lvl']==8)
{
$sila='24%';
}
if($skill['lvl']==9)
{
$sila='27%';
}
if($skill['lvl']==10)
{
$sila='30%';
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал </font>
заклинание усиления <font color=#009900>(урон +'.$sila.')</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$tm=time()+90;
$ts=time()+60;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='3' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `avan_usr` SET `sfer_m`='".$ts."' WHERE `id`='".$bt['id']."'");
}
if($skill['mag']==4)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."' and `id`='".$bt['enemy']."'"));
if($enemy==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>Противник не найден.</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
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';
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал </font>
заклинание пробивания <font color=#009900>('.$bts['name'].' -'.$sila.'% брони)</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$tm=time()+60;
$ts=time()+40;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='4' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `avan_mob` SET `sfer_d`='".$ts."', `sfer_dp`='".$sila."' WHERE `id`='".$bts['id']."'");
}
}
if($skill['mag']==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';
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал </font>
заклинание обороны <font color=#009900>(+'.$sila.'% защиты от физических атак)</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$tm=time()+90;
$ts=time()+30;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='6' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `avan_usr` SET `sfer_sh`='".$ts."' WHERE `id`='".$bt['id']."'");
}
if($skill['mag']==8)
{
if($skill['lvl']==1)
{
$silaq=80;
}
if($skill['lvl']==2)
{
$silaq=160;
}
if($skill['lvl']==3)
{
$silaq=240;
}
if($skill['lvl']==4)
{
$silaq=320;
}
if($skill['lvl']==5)
{
$silaq=400;
}
if($skill['lvl']==6)
{
$silaq=480;
}
if($skill['lvl']==7)
{
$silaq=560;
}
if($skill['lvl']==8)
{
$silaq=640;
}
if($skill['lvl']==9)
{
$silaq=720;
}
if($skill['lvl']==10)
{
$silaq=800;
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал</font> заклинание исцеления
<font color=#009900>(</font><font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>+'.$silaq.'хп)</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$hp=$bt['hp']+$silaq;
if($hp>$udata['hp'])
{
$hp=$udata['hp'];
}
$tm=time()+40;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='8' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `avan_usr` SET `hp`='".$hp."' WHERE `id`='".$bt['id']."'");
}
if($skill['mag']==10)
{
if($skill['lvl']==1)
{
$sila='5';
}
if($skill['lvl']==2)
{
$sila='10';
}
if($skill['lvl']==3)
{
$sila='15';
}
if($skill['lvl']==4)
{
$sila='20';
}
if($skill['lvl']==5)
{
$sila='25';
}
if($skill['lvl']==6)
{
$sila='30';
}
if($skill['lvl']==7)
{
$sila='35';
}
if($skill['lvl']==8)
{
$sila='40';
}
if($skill['lvl']==9)
{
$sila='45';
}
if($skill['lvl']==10)
{
$sila='50';
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал </font>
заклинание возврата <font color=#009900>(противнику возвращается '.$sila.'% урона)</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$tm=time()+60;
$ts=time()+30;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='10' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `avan_usr` SET `sfer_p`='".$ts."' WHERE `id`='".$bt['id']."'");
}
if($skill['mag']==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';
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал </font>
заклинание барьера <font color=#009900>( +'.$sila.'% защиты от заклинаний)</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$tm=time()+60;
$ts=time()+20;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='12' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `avan_usr` SET `sfer_n`='".$ts."' WHERE `id`='".$bt['id']."'");
}
if($skill['mag']==11)
{
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."' and `id`='".$bt['enemy']."'"));
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `avan_mob` WHERE `arr`='".$bt['arr']."' and `id`='".$bt['enemy']."'"));
if($enemy==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>Противник не найден.</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
mysql_query("UPDATE `avan_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($skill['lvl']==1)
{
$sila='5';
}
if($skill['lvl']==2)
{
$sila='10';
}
if($skill['lvl']==3)
{
$sila='15';
}
if($skill['lvl']==4)
{
$sila='20';
}
if($skill['lvl']==5)
{
$sila='25';
}
if($skill['lvl']==6)
{
$sila='30';
}
if($skill['lvl']==7)
{
$sila='35';
}
if($skill['lvl']==8)
{
$sila='40';
}
if($skill['lvl']==9)
{
$sila='45';
}
if($skill['lvl']==10)
{
$sila='50';
}
$lg='<img src=img/main/b10.png> <font color=#ffff00>'.$udata['usr'].'</font> <font color=#009900>использовал </font>
заклинание ослабления <font color=#009900>('.$bts['name'].' -'.$sila.'% урона)</font>';
mysql_query("INSERT INTO `log_avan` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."', `arr`='".$av['id']."'
");
$tm=time()+30;
$ts=time()+20;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='11' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `avan_mob` SET `sfer_r`='".$ts."', `sfer_rp`='".$sila."' WHERE `id`='".$bts['id']."'");
}
}
}
header('location: b_av.php');exit;
?>