Файл: b_nebes.php
Строк: 1072
<?
define('PROTECTOR', 1);
$textl='Битва';
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$lv=time();
$last=date('d.m.Y - H:i:s');
mysql_query("UPDATE `users` SET
`lv`='".$lv."',
`last`='".$last."',
`mesto`='".$textl."'
WHERE `id`='".$udata['id']."'");
$mobs=mysql_query("SELECT * FROM `craft` WHERE `usr`='".$udata['id']."'");
$rows=mysql_num_rows($mobs);
if($rows!=0)
{
header('location: work.php');exit;
}
$mobs1=mysql_query("SELECT * FROM `arena_usr` WHERE `usr`='".$udata['id']."'");
$rows1=mysql_num_rows($mobs1);
if($rows1!=0)
{
header('location: arena.php');exit;
}
$mobs2=mysql_query("SELECT * FROM `avan_usr` WHERE `usr`='".$udata['id']."'");
$rows2=mysql_num_rows($mobs2);
if($rows2!=0)
{
header('location: avan.php');exit;
}
$mobs3=mysql_query("SELECT * FROM `battle` WHERE `usr`='".$udata['id']."'");
$rows3=mysql_num_rows($mobs3);
if($rows3!=0)
{
header('location: battle.php');exit;
}
$mobs5=mysql_query("SELECT * FROM `okr_usr` WHERE `usr`='".$udata['id']."'");
$rows5=mysql_num_rows($mobs5);
if($rows5!=0)
{
header('location: b_okr.php');exit;
}
$mobs6=mysql_query("SELECT * FROM `str_usr` WHERE `usr`='".$udata['id']."'");
$rows6=mysql_num_rows($mobs6);
if($rows6!=0)
{
header('location: b_str.php');exit;
}
$mobs7=mysql_query("SELECT * FROM `terr_usr` WHERE `usr`='".$udata['id']."'");
$rows7=mysql_num_rows($mobs7);
if($rows7!=0)
{
header('location: terr_b.php');exit;
}
$mobs8=mysql_query("SELECT * FROM `ohota` WHERE `usr`='".$udata['id']."'");
$rows8=mysql_num_rows($mobs8);
if($rows8!=0)
{
header('location: b_oh.php');exit;
}
$bat=mysql_query("SELECT * FROM `nebes_mob` WHERE `usr`='".$udata['id']."'");
$num=mysql_num_rows($bat);
if($num==0)
{
header('location: game.php');exit;
}
else
{
$bt=mysql_fetch_array($bat);
$mob=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `tip`!='usr' and `id`='".$bt['enemy']."' and `etaz`='".$bt['etaz']."'"));
$mobz2=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `tip`!='usr' and `etaz`='".$bt['etaz']."'"));
if($mobz2==0 and $bt['status']==0)
{
mysql_query("UPDATE `nebes_mob` SET `status`='1' WHERE `status`='0' and `etaz`='".$bt['etaz']."'");
header('location: ?');
}
$mobz=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `tip`!='usr' and `id`='".$bt['enemy']."' and `etaz`='".$bt['etaz']."'"));
if($mobz==0)
{
$num=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`!='usr'"));
if($num>0)
{
if($num==1)
{
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`!='usr'"));
}
elseif($num==2)
{
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob'"));
}
else
{
$ra=rand(1,$num);
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob' ORDER BY `id` LIMIT ".$ra.",1"));
}
mysql_query("UPDATE `nebes_mob` SET `enemy`='".$ene['id']."' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
}
if($bt['status']==0 and $bt['enemy']==0)
{
$num=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`!='usr'"));
if($num>0)
{
if($num==1)
{
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`!='usr'"));
}
elseif($num==2)
{
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob'"));
}
else
{
$ra=rand(1,$num);
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob' ORDER BY `id` LIMIT ".$ra.",1"));
}
mysql_query("UPDATE `nebes_mob` SET `enemy`='".$ene['id']."' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
}
$lvl=$udata['lvl']+1;
$exzn=mysql_num_rows(mysql_query("SELECT * FROM `lvl` WHERE `lvl`='".$lvl."'"));
if($exzn!=0)
{
$ex=mysql_fetch_array(mysql_query("SELECT * FROM `lvl` WHERE `lvl`='".$lvl."'"));
if($udata['exp']>=$ex['exp'])
{
$kl=$udata['lvl']+1;
if($udata['klass']==1)
{
$hp=$udata['hp1']+2;
$sila=$udata['sila1']+3;
$arm=$udata['arm1']+1;
}
if($udata['klass']==2)
{
$hp=$udata['hp1']+3;
$sila=$udata['sila1']+1;
$arm=$udata['arm1']+2;
}
if($udata['klass']==3)
{
$hp=$udata['hp1']+1;
$sila=$udata['sila1']+2;
$arm=$udata['arm1']+3;
}
mysql_query("UPDATE `users` SET `lvl`='".$kl."', `hp1`='".$hp."', `sila1`='".$sila."', `arm1`='".$arm."' WHERE `id`='".$udata['id']."'");
if($udata['ref']!=0)
{
$refer=mysql_query("SELECT * FROM `users` WHERE `id`='".$udata['ref']."'");
$ref=mysql_fetch_array($refer);
if($kl==30)
{
$ref_m=$ref['money']+100;
mysql_query("UPDATE `users` SET `money`='".$ref_m."' WHERE `id`='".$ref['id']."'");
$rows211=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$ref['id']."' and `usr2`='0'"));
if($rows211==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$ref['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$ref['id']."'");
}
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
$text='<font color=#cccccc>Ваш реферал '.$udata['usr'].' прокачался до 30 уровня. За это вы получаете <img src=img/main/p5.png>100.</font>
';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows21['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$ref['id']."'
");
}
if($kl==40)
{
$ref_m=$ref['jem']+5;
mysql_query("UPDATE `users` SET `jem`='".$ref_m."' WHERE `id`='".$ref['id']."'");
$rows211=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$ref['id']."' and `usr2`='0'"));
if($rows211==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$ref['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$ref['id']."'");
}
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
$text='<font color=#cccccc>Ваш реферал '.$udata['usr'].' прокачался до 40 уровня. За это вы получаете <img src=img/main/p13.png>5.</font>
';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows21['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$ref['id']."'
");
}
if($kl==45)
{
$ref_m=$ref['jem']+15;
mysql_query("UPDATE `users` SET `jem`='".$ref_m."' WHERE `id`='".$ref['id']."'");
$rows211=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$ref['id']."' and `usr2`='0'"));
if($rows211==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$ref['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$ref['id']."'");
}
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
$text='<font color=#cccccc>Ваш реферал '.$udata['usr'].' прокачался до 45 уровня. За это вы получаете <img src=img/main/p13.png>15.</font>
';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows21['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$ref['id']."'
");
}
if($kl==50)
{
$ref_m=$ref['jem']+30;
mysql_query("UPDATE `users` SET `jem`='".$ref_m."' WHERE `id`='".$ref['id']."'");
$rows211=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$ref['id']."' and `usr2`='0'"));
if($rows211==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$ref['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$ref['id']."'");
}
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
$text='<font color=#cccccc>Ваш реферал '.$udata['usr'].' прокачался до 50 уровня. За это вы получаете <img src=img/main/p13.png>30.</font>
';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows21['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$ref['id']."'
");
}
}
mysql_query("UPDATE `nebes_mob` SET `hp`='".$udata['hp']."', `arm`='".$udata['arm']."', `sila`='".$udata['sila']."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='Ваш уровень повысился до ".$lvl."!'
");
header('location: ?');exit;
}
}
if(isset($_GET['kick']))
{
if($bt['status']==1 or $bt['status']==2)
{
header('location: ?');exit;
}
if($mobz==0)
{
$num=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`!='usr'"));
if($num>0)
{
if($num==1)
{
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`!='usr'"));
}
elseif($num==2)
{
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob'"));
}
else
{
$ra=rand(1,$num);
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob' ORDER BY `id` LIMIT ".$ra.",1"));
}
mysql_query("UPDATE `nebes_mob` SET `enemy`='".$ene['id']."' WHERE `id`='".$bt['id']."'");
header('location: ?kick');exit;
}
}
if($bt['time']>time())
{
$rp=$bt['time']-time();
if($rp>=5)
{
$lg='<img src=img/main/b1.png> <font color=#999999>Промах</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
$tim=time()+7;
mysql_query("UPDATE `nebes_mob` SET `time`='".$tim."' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
$re=rand($bt['sila']/100*10,$bt['sila']/100*25);
if($bt['sfer_m']>=time())
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='3' and `status`='on'");
$skill=mysql_fetch_array($mobs);
if($skill['lvl']==1)
{
$sk=3;
}
if($skill['lvl']==2)
{
$sk=6;
}
if($skill['lvl']==3)
{
$sk=9;
}
if($skill['lvl']==4)
{
$sk=12;
}
if($skill['lvl']==5)
{
$sk=15;
}
if($skill['lvl']==6)
{
$sk=18;
}
if($skill['lvl']==7)
{
$sk=21;
}
if($skill['lvl']==8)
{
$sk=24;
}
if($skill['lvl']==9)
{
$sk=27;
}
if($skill['lvl']==10)
{
$sk=30;
}
if($mob['sfer_d']>=time())
{
$mob['arm']=$mob['arm']-$mob['arm']/100*$mob['sfer_dp'];
}
if($mob['mag_sr_time']>=time())
{
$mob['arm']=$mob['arm']-$mob['arm']/100*$mob['mag_sr'];
}
$sila=round(($re+$re/100*$sk)-$mob['arm']);
}
else
{
if($mob['sfer_d']>=time())
{
$mob['arm']=$mob['arm']-$mob['arm']/100*$mob['sfer_dp'];
}
if($mob['mag_sr_time']>=time())
{
$mob['arm']=$mob['arm']-$mob['arm']/100*$mob['mag_sr'];
}
$sila=round($re-$mob['arm']);
}
if($sila<$udata['sila']/100*10)
{
$sila=round($udata['sila']/100*10);
}
if($sila<1)
{
$sila=1;
}
$rk=rand(1,3);
if($rk==1)
{
$k='ударил';
}
if($rk==2)
{
$k='пронзил';
}
if($rk==3)
{
$k='двинул';
}
$r=rand(1,100);
if($r<=$udata['krit'])
{
$sila=round($sila*2+$mob['arm']);
$lg='<img src=img/main/b2.png> <a href=>'.$udata['usr'].'</a> <font color=#ff0000> наносит сокрушительный удар '.$mob['name'].' -'.$sila.'</font>';
}
else
{
$lg='<img src=img/main/b1.png> <a href=>'.$udata['usr'].'</a> '.$k.' '.$mob['name'].' -'.$sila.'';
}
$hp=$mob['hp']-$sila;
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
if($hp<=0)
{
$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$udata['usr'].'</a> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."'
");
$r=rand(1,10);
if($r==1)
{
$mif=$udata['mifril']+1;
mysql_query("UPDATE `users` SET `mifril`='".$mif."' WHERE `id`='".$udata['id']."'");
$lg2s='<img src=img/main/e9.png> <font color=#00ff00>Вы выбили <img src=img/main/m1.png>1</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2s."'
");
}
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$mob['hp']*$vr;
if($mob['tip']=='boss')
{
$mob2=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
$t=time()+5400;
mysql_query("UPDATE `nebes` SET `time`='".$t."' WHERE `id`='".$mob2['id']."'");
mysql_query("UPDATE `nebes_mob` SET `status`='1' WHERE `etaz`='".$bt['etaz']."' and `status`='0'");
}
mysql_query("DELETE FROM `nebes_mob` WHERE `id`='".$mob['id']."'");
mysql_query("UPDATE `nebes_mob` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$sila*$vr;
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hp."' WHERE `id`='".$mob['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$udata['exp']+$exp;
$tim=time()+7;
mysql_query("UPDATE `nebes_mob` SET `time`='".$tim."', `att`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
else
{
if($bt['sfer_m']>=time())
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='3' and `status`='on'");
$skill=mysql_fetch_array($mobs);
if($skill['lvl']==1)
{
$sk=3;
}
if($skill['lvl']==2)
{
$sk=6;
}
if($skill['lvl']==3)
{
$sk=9;
}
if($skill['lvl']==4)
{
$sk=12;
}
if($skill['lvl']==5)
{
$sk=15;
}
if($skill['lvl']==6)
{
$sk=18;
}
if($skill['lvl']==7)
{
$sk=21;
}
if($skill['lvl']==8)
{
$sk=24;
}
if($skill['lvl']==9)
{
$sk=27;
}
if($skill['lvl']==10)
{
$sk=30;
}
if($mob['sfer_d']>=time())
{
$mob['arm']=$mob['arm']-$mob['arm']/100*$mob['sfer_dp'];
}
if($mob['mag_sr_time']>=time())
{
$mob['arm']=$mob['arm']-$mob['arm']/100*$mob['mag_sr'];
}
$sila=round(($bt['sila']+$bt['sila']/100*$sk)-$mob['arm']);
}
else
{
if($mob['sfer_d']>=time())
{
$mob['arm']=$mob['arm']-$mob['arm']/100*$mob['sfer_dp'];
}
if($mob['mag_sr_time']>=time())
{
$mob['arm']=$mob['arm']-$mob['arm']/100*$mob['mag_sr'];
}
$sila=round($bt['sila']-$mob['arm']);
}
if($sila<$udata['sila']/100*10)
{
$sila=round($udata['sila']/100*10);
}
if($sila<1)
{
$sila=1;
}
$rk=rand(1,3);
if($rk==1)
{
$k='ударил';
}
if($rk==2)
{
$k='пронзил';
}
if($rk==3)
{
$k='двинул';
}
$r=rand(1,100);
if($r<=$udata['krit'])
{
$sila=round($sila*2+$mob['arm']);
$lg='<img src=img/main/b2.png> <a href=>'.$udata['usr'].'</a> <font color=#ff0000> наносит сокрушительный удар '.$mob['name'].' -'.$sila.'</font>';
}
else
{
$lg='<img src=img/main/b1.png> <a href=>'.$udata['usr'].'</a> '.$k.' '.$mob['name'].' -'.$sila.'';
}
$hp=$mob['hp']-$sila;
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
if($hp<=0)
{
$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$udata['usr'].'</a> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."'
");
$r=rand(1,10);
if($r==1)
{
$mif=$udata['mifril']+1;
mysql_query("UPDATE `users` SET `mifril`='".$mif."' WHERE `id`='".$udata['id']."'");
$lg2s='<img src=img/main/e9.png> <font color=#00ff00>Вы выбили <img src=img/main/m1.png>1</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2s."'
");
}
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$mob['hp']*$vr;
if($mob['tip']=='boss')
{
$mob2=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
$t=time()+5400;
mysql_query("UPDATE `nebes` SET `time`='".$t."' WHERE `id`='".$mob2['id']."'");
mysql_query("UPDATE `nebes_mob` SET `status`='1' WHERE `etaz`='".$bt['etaz']."' and `status`='0'");
}
mysql_query("DELETE FROM `nebes_mob` WHERE `id`='".$mob['id']."'");
mysql_query("UPDATE `nebes_mob` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$sila*$vr;
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hp."' WHERE `id`='".$mob['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$udata['exp']+$exp;
$tim=time()+7;
mysql_query("UPDATE `nebes_mob` SET `time`='".$tim."', `att`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
}
if(isset($_GET['mag']))
{
if($bt['status']==1 or $bt['status']==2)
{
header('location: ?');exit;
}
if($mobz==0)
{
$num=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`!='usr'"));
if($num>0)
{
if($num==1)
{
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`!='usr'"));
}
elseif($num==2)
{
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob'"));
}
else
{
$ra=rand(1,$num);
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob' ORDER BY `id` LIMIT ".$ra.",1"));
}
mysql_query("UPDATE `nebes_mob` SET `enemy`='".$ene['id']."' WHERE `id`='".$bt['id']."'");
header('location: ?mag&nin='.$_GET['nin'].'');exit;
}
}
$tn=time();
if($_GET['nin']==1)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='1' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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']);
}
$hp=$mob['hp']-$sila;
$lg='<img src=img/main/b10.png> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал</font> заклинание удара
<font color=#009900>(</font><font color=#999999>'.$mob['name'].'</font> <font color=#009900>-'.$sila.')</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
if($hp<=0)
{$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$udata['usr'].'</a> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."'
");
$r=rand(1,10);
if($r==1)
{
$mif=$udata['mifril']+1;
mysql_query("UPDATE `users` SET `mifril`='".$mif."' WHERE `id`='".$udata['id']."'");
$lg2s='<img src=img/main/e9.png> <font color=#00ff00>Вы выбили <img src=img/main/m1.png>1</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2s."'
");
}
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$mob['hp']*$vr;
if($mob['tip']=='boss')
{
$mob2=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
$t=time()+5400;
mysql_query("UPDATE `nebes` SET `time`='".$t."' WHERE `id`='".$mob2['id']."'");
mysql_query("UPDATE `nebes_mob` SET `status`='1' WHERE `etaz`='".$bt['etaz']."' and `status`='0'");
}
mysql_query("DELETE FROM `nebes_mob` WHERE `id`='".$mob['id']."'");
mysql_query("UPDATE `nebes_mob` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$sila*$vr;
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hp."' WHERE `id`='".$mob['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$udata['exp']+$exp;
$tm=time()+5;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='1' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `att`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==2)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='2' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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']);
}
$ds=date('d');
if($ds==6)
{
$sila=round($sila-$sila/100*10);
}
$hp=$mob['hp']-$sila;
$lg='<img src=img/main/b10.png> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал</font> заклинание случайности
<font color=#009900>(</font><font color=#999999>'.$mob['name'].'</font> <font color=#009900>-'.$sila.')</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
if($hp<=0)
{$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$udata['usr'].'</a> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."'
");
$r=rand(1,10);
if($r==1)
{
$mif=$udata['mifril']+1;
mysql_query("UPDATE `users` SET `mifril`='".$mif."' WHERE `id`='".$udata['id']."'");
$lg2s='<img src=img/main/e9.png> <font color=#00ff00>Вы выбили <img src=img/main/m1.png>1</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2s."'
");
}
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$mob['hp']*$vr;
if($mob['tip']=='boss')
{
$mob2=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
$t=time()+5400;
mysql_query("UPDATE `nebes` SET `time`='".$t."' WHERE `id`='".$mob2['id']."'");
mysql_query("UPDATE `nebes_mob` SET `status`='1' WHERE `etaz`='".$bt['etaz']."' and `status`='0'");
}
mysql_query("DELETE FROM `nebes_mob` WHERE `id`='".$mob['id']."'");
mysql_query("UPDATE `nebes_mob` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$sila*$vr;
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hp."' WHERE `id`='".$mob['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$udata['exp']+$exp;
$tm=time()+50;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='2' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `att`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==3)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='3' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал </font>
заклинание усиления <font color=#009900>(урон +'.$sila.')</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
$tm=time()+90;
$ts=time()+60;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='3' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `sfer_m`='".$ts."' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==4)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='4' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал </font>
заклинание пробивания <font color=#009900>('.$mob['name'].' -'.$sila.'% брони)</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
$tm=time()+60;
$ts=time()+40;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='4' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `sfer_d`='".$ts."', `sfer_dp`='".$sila."' WHERE `id`='".$mob['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==5)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='5' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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']);
}
$hp=$mob['hp']-$sila;
$lg='<img src=img/main/b10.png> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал</font> заклинание стана
<font color=#009900>(</font><font color=#999999>'.$mob['name'].'</font> <font color=#009900>-'.$sila.', <font color=#999999>'.$mob['name'].'</font> оглушен на '.$t.'сек.)</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
if($hp<=0)
{$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$udata['usr'].'</a> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."'
");
$r=rand(1,10);
if($r==1)
{
$mif=$udata['mifril']+1;
mysql_query("UPDATE `users` SET `mifril`='".$mif."' WHERE `id`='".$udata['id']."'");
$lg2s='<img src=img/main/e9.png> <font color=#00ff00>Вы выбили <img src=img/main/m1.png>1</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2s."'
");
}
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$mob['hp']*$vr;
if($mob['tip']=='boss')
{
$mob2=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
$t=time()+5400;
mysql_query("UPDATE `nebes` SET `time`='".$t."' WHERE `id`='".$mob2['id']."'");
mysql_query("UPDATE `nebes_mob` SET `status`='1' WHERE `etaz`='".$bt['etaz']."' and `status`='0'");
}
mysql_query("DELETE FROM `nebes_mob` WHERE `id`='".$mob['id']."'");
mysql_query("UPDATE `nebes_mob` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$sila*$vr;
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hp."', `sfer_so`='".$ts."' WHERE `id`='".$mob['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$udata['exp']+$exp;
$tm=time()+60;
$ts=time()+$t;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='5' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `att`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==6)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='6' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал </font>
заклинание обороны <font color=#009900>(+'.$sila.'% брони)</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
$tm=time()+90;
$ts=time()+30;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='6' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `sfer_sh`='".$ts."' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==7)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='7' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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']);
}
$hp=$mob['hp']-$sila;
$lg='<img src=img/main/b10.png> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал</font> заклинание молний
<font color=#009900>(</font><font color=#999999>'.$mob['name'].'</font> <font color=#009900>-'.$sila.')</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
if($hp<=0)
{$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$udata['usr'].'</a> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."'
");
$r=rand(1,10);
if($r==1)
{
$mif=$udata['mifril']+1;
mysql_query("UPDATE `users` SET `mifril`='".$mif."' WHERE `id`='".$udata['id']."'");
$lg2s='<img src=img/main/e9.png> <font color=#00ff00>Вы выбили <img src=img/main/m1.png>1</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2s."'
");
}
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$mob['hp']*$vr;
if($mob['tip']=='boss')
{
$mob2=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
$t=time()+5400;
mysql_query("UPDATE `nebes` SET `time`='".$t."' WHERE `id`='".$mob2['id']."'");
mysql_query("UPDATE `nebes_mob` SET `status`='1' WHERE `etaz`='".$bt['etaz']."' and `status`='0'");
}
mysql_query("DELETE FROM `nebes_mob` WHERE `id`='".$mob['id']."'");
mysql_query("UPDATE `nebes_mob` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$sila*$vr;
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hp."' WHERE `id`='".$mob['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$udata['exp']+$exp;
$tm=time()+50;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='7' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `att`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==8)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='8' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
if($skill['lvl']==1)
{
$sila=80;
}
if($skill['lvl']==2)
{
$sila=160;
}
if($skill['lvl']==3)
{
$sila=240;
}
if($skill['lvl']==4)
{
$sila=320;
}
if($skill['lvl']==5)
{
$sila=400;
}
if($skill['lvl']==6)
{
$sila=480;
}
if($skill['lvl']==7)
{
$sila=560;
}
if($skill['lvl']==8)
{
$sila=640;
}
if($skill['lvl']==9)
{
$sila=720;
}
if($skill['lvl']==10)
{
$sila=800;
}
$lg='<img src=img/main/b10.png> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал</font> заклинание исцеления
<font color=#009900>(</font><font color=#999999>'.$udata['usr'].'</font> <font color=#009900>+'.$sila.'хп)</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
$hp=$bt['hp']+$sila;
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 `nebes_mob` SET `hp`='".$hp."' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==9)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='9' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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']);
}
$hp=$mob['hp']-$sila;
$lg='<img src=img/main/b10.png> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал</font> заклинание вампира
<font color=#009900>(</font><font color=#999999>'.$mob['name'].'</font> <font color=#009900>-'.$sila.', <font color=#999999>'.$udata['usr'].'</font> +'.$sh.'хп)</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
if($hp<=0)
{$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$udata['usr'].'</a> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."'
");
$r=rand(1,10);
if($r==1)
{
$mif=$udata['mifril']+1;
mysql_query("UPDATE `users` SET `mifril`='".$mif."' WHERE `id`='".$udata['id']."'");
$lg2s='<img src=img/main/e9.png> <font color=#00ff00>Вы выбили <img src=img/main/m1.png>1</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2s."'
");
}
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$mob['hp']*$vr;
if($mob['tip']=='boss')
{
$mob2=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
$t=time()+5400;
mysql_query("UPDATE `nebes` SET `time`='".$t."' WHERE `id`='".$mob2['id']."'");
mysql_query("UPDATE `nebes_mob` SET `status`='1' WHERE `etaz`='".$bt['etaz']."' and `status`='0'");
}
mysql_query("DELETE FROM `nebes_mob` WHERE `id`='".$mob['id']."'");
mysql_query("UPDATE `nebes_mob` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$sila*$vr;
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hp."' WHERE `id`='".$mob['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$udata['exp']+$exp;
$hps=$bt['hp']+$sh;
if($hps>$udata['hp'])
{
$hps=$udata['hp'];
}
$tm=time()+30;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='9' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `att`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hps."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==10)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='10' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал </font>
заклинание возврата <font color=#009900>(противнику возвращается '.$sila.'% урона)</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
$tm=time()+60;
$ts=time()+30;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='10' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `sfer_p`='".$ts."' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==11)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='11' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал </font>
заклинание ослабления <font color=#009900>( <font color=#999999>'.$mob['name'].'</font> -'.$sila.'% урона)</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
$tm=time()+30;
$ts=time()+20;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='11' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `sfer_r`='".$ts."', `sfer_rp`='".$sila."' WHERE `id`='".$mob['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==12)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='12' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал </font>
заклинание барьера <font color=#009900>( <font color=#999999>'.$udata['usr'].'</font> +'.$sila.'% защиты от сфер)</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
$tm=time()+60;
$ts=time()+20;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='12' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `sfer_n`='".$ts."' WHERE `id`='".$bt['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==13)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='13' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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($mob['hp']/100*$sila);
if($bt['mag_mast_time']>=time())
{
$sila=round($sila+$sila/100*$bt['mag_mast']);
}
$hp=$mob['hp']-$sila;
$lg='<img src=img/main/b10.png> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал</font> заклинание сингулярности
<font color=#009900>(</font><font color=#999999>'.$mob['name'].'</font> <font color=#009900>-'.$sila.')</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
if($hp<=0)
{$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$udata['usr'].'</a> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."'
");
$r=rand(1,10);
if($r==1)
{
$mif=$udata['mifril']+1;
mysql_query("UPDATE `users` SET `mifril`='".$mif."' WHERE `id`='".$udata['id']."'");
$lg2s='<img src=img/main/e9.png> <font color=#00ff00>Вы выбили <img src=img/main/m1.png>1</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2s."'
");
}
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$mob['hp']*$vr;
if($mob['tip']=='boss')
{
$mob2=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
$t=time()+5400;
mysql_query("UPDATE `nebes` SET `time`='".$t."' WHERE `id`='".$mob2['id']."'");
mysql_query("UPDATE `nebes_mob` SET `status`='1' WHERE `etaz`='".$bt['etaz']."' and `status`='0'");
}
mysql_query("DELETE FROM `nebes_mob` WHERE `id`='".$mob['id']."'");
mysql_query("UPDATE `nebes_mob` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$sila*$vr;
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hp."' WHERE `id`='".$mob['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$udata['exp']+$exp;
$tm=time()+60;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='13' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `att`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
}
if($_GET['nin']==14)
{
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='14' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
header('location: ?');exit;
}
else
{
$skill=mysql_fetch_array($mobs);
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']);
}
$hp=$mob['hp']-$sila;
$lg='<img src=img/main/b10.png> <a href=>'.$udata['usr'].'</a> <font color=#009900>использовал</font> заклинание хаоса
<font color=#009900>(</font><font color=#999999>'.$mob['name'].'</font> <font color=#009900>-'.$sila.')</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
if($hp<=0)
{$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
$hp=0;
$lg2='<img src=img/main/b7.png> <a href=>'.$udata['usr'].'</a> убил '.$mob['name'].'';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2."'
");
$r=rand(1,10);
if($r==1)
{
$mif=$udata['mifril']+1;
mysql_query("UPDATE `users` SET `mifril`='".$mif."' WHERE `id`='".$udata['id']."'");
$lg2s='<img src=img/main/e9.png> <font color=#00ff00>Вы выбили <img src=img/main/m1.png>1</font>';
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg2s."'
");
}
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$mob['hp']*$vr;
if($mob['tip']=='boss')
{
$mob2=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
$t=time()+5400;
mysql_query("UPDATE `nebes` SET `time`='".$t."' WHERE `id`='".$mob2['id']."'");
mysql_query("UPDATE `nebes_mob` SET `status`='1' WHERE `etaz`='".$bt['etaz']."' and `status`='0'");
}
mysql_query("DELETE FROM `nebes_mob` WHERE `id`='".$mob['id']."'");
mysql_query("UPDATE `nebes_mob` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
}
else
{
if($udata['lvl']<16)
{
$vr=5;
}
if($udata['lvl']>15 and $udata['lvl']<31)
{
$vr=4;
}
if($udata['lvl']>30 and $udata['lvl']<39)
{
$vr=2;
}
if($udata['lvl']>38)
{
$vr=1;
}
$exp=$sila*$vr;
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hp."' WHERE `id`='".$mob['id']."'");
}
$vips=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvip=mysql_num_rows($vips);
if($nvip!=0)
{
$exp=$exp+$exp/100*30;
}
$exp=$udata['exp']+$exp;
$tm=time()+40;
mysql_query("UPDATE `mag` SET
`time`='".$tm."'
WHERE `mag`='14' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `nebes_mob` SET `att`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
}
}
if(isset($_GET['leav']))
{
mysql_query("UPDATE `mag` SET
`time`='0' WHERE `usr`='".$udata['id']."'");
if($bt['status']!=1)
{
$tin=time()+3600;
mysql_query("UPDATE `users` SET `nab`='".$tin."' WHERE `id`='".$udata['id']."'");
}
mysql_query("DELETE FROM `nebes_mob` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `log_nebes` WHERE `usr`='".$udata['id']."'");
header('location: nebes.php');
}
if(isset($_GET['elic']))
{
if($bt['status']==1 or $bt['status']==2)
{
header('location: ?');exit;
}
$elic=mysql_query("SELECT * FROM `elic` WHERE `id`='".$_GET['ef']."' and `usr`='".$udata['id']."' and `status`='on'");
$cd=mysql_num_rows($elic);
if($cd==0)
{
header('location: ?');
}
else
{
$el=mysql_fetch_array($elic);
if($el['tip']=='hp')
{
if($el['time']>time())
{
header('location: ?');exit;
}
else
{
if($bt['hp']==$udata['hp'] or $bt['hp']==0)
{
header('location: ?');exit;
}
$hp=$bt['hp']+$el['ef'];
if($hp>$udata['hp'])
{
$hp=$udata['hp'];
}
mysql_query("UPDATE `nebes_mob` SET `hp`='".$hp."' WHERE `id`='".$bt['id']."'");
$elk=$el['kol']-1;
if($elk==0)
{
mysql_query("DELETE FROM `elic` WHERE `id`='".$el['id']."'");
}
else
{
$ds=date('d');
if($ds==8)
{
$el['rest']=round($el['rest']-$el['rest']/100*10);
}
$time=time()+$el['rest'];
mysql_query("UPDATE `elic` SET `kol`='".$elk."', `time`='".$time."' WHERE `id`='".$el['id']."'");
}
if($el['ef']!=20000)
{
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/p21.png> <font color=#009900>Ты испил зелья и исцелился +".$el['ef']." <img src=img/main/p6.png></font>'
");
}
else
{
mysql_query("INSERT INTO `log_nebes` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/p21.png> <font color=#009900>Ты испил зелья и ваше здоровье востановилось <img src=img/main/p6.png></font>'
");
}
$ds=$udata['dost3a']+1;
mysql_query("UPDATE `users` SET `dost3a`='".$ds."' WHERE `id`='".$udata['id']."'");
}
}
}
header('location: ?');
}
if(isset($_GET['rand']))
{
$num=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`!='usr'"));
if($num>0)
{
if($num==1)
{
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`!='usr'"));
}
elseif($num==2)
{
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob'"));
}
else
{
$ra=rand(1,$num);
$ene=mysql_fetch_array(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob' ORDER BY `id` LIMIT ".$ra.",1"));
}
mysql_query("UPDATE `nebes_mob` SET `enemy`='".$ene['id']."' WHERE `id`='".$bt['id']."'");
header('location: ?kick');exit;
}
}
include('bnn.php');
include($path.'files/head.php');
echo '
<div class="v2 brs bls v8 bts bbs p v12"><font color=#00ccff>
<img src=img/main/p6.png>'.$bt['hp'].' |
<font color=#ff0000>'.$bt['att'].'</font> | <font color=#ff0000>'.$bt['att2'].'</font>
| '.$mob['name'].' <img src=img/main/p6.png>'.$mob['hp'].'';
$q = mysql_query("SELECT COUNT(*) FROM `msg_kont` WHERE `usr1` = '".$udata['id']."' AND `read` = '1';");
$new_mail = mysql_result($q, 0);
if($new_mail > 0)
{
echo"
<a href="mail.php"><img src=img/main/e1.png></a>";
}
if($udata['clan']!=0)
{
$fridaa=mysql_query("SELECT * FROM `sectors` WHERE `clan`='".$udata['clan']."' and `att_clan`!='0'");
$fra=mysql_num_rows($fridaa);
if($fra!=0)
{
echo'<a href=clan.php?gi=ter><img src=img/main/st.png></a>';
}
}
echo'<br>
Состояние:
</font>
</div>';
$giza=mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id`='".$udata['clan']."'"));
if($giza['gorn_time']>time() and $udata['gorn']==1)
{
echo '<div class="v6 rr rt rl p">'.$giza['gorn'].'<br>
<img src=img/main/e55.png><a href=clan.php?gorn_def>Закрыть</a>
</div>';
}
echo '<div class="v3 bts brs bls b p v12">Битва</div><div class="v2 bts brs bls bbs p t2">';
if($bt['status']==0)
{
echo '<img src=img/nebes/'.$mob['tip'].'/'.$mob['img'].'.jpg><br>
<a href=?kick><div class="v2s p"><img src=img/main/b17.png> <font color=#ffff00>бить '.$mob['name'].'</font> <font color=#ffffff>['.$mob['hp'].']</font></div></a>
';
$tn=time();
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `status`='on' ORDER BY `id`");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
}
else
{
while($mag=mysql_fetch_array($mobs))
{
if($mag['mag']==1)
{
$name='заклинание удара';
}
if($mag['mag']==2)
{
$name='заклинание случайности';
}
if($mag['mag']==3)
{
$name='заклинание усиления';
}
if($mag['mag']==4)
{
$name='заклинание пробивания';
}
if($mag['mag']==5)
{
$name='заклинание стана';
}
if($mag['mag']==6)
{
$name='заклинание обороны';
}
if($mag['mag']==7)
{
$name='заклинание молний';
}
if($mag['mag']==8)
{
$name='заклинание исцеления';
}
if($mag['mag']==9)
{
$name='заклинание вампира';
}
if($mag['mag']==10)
{
$name='заклинание возврата';
}
if($mag['mag']==11)
{
$name='заклинание ослабления';
}
if($mag['mag']==12)
{
$name='заклинание барьера';
}
if($mag['mag']==13)
{
$name='заклинание сингулярности';
}
if($mag['mag']==14)
{
$name='заклинание хаоса';
}
if($mag['time']<=$tn)
{
echo '<a href=?mag&nin='.$mag['mag'].'>
<div class="v2s p"><img src=img/main/b10.png> <font color=#ffff00>'.$name.'</font></div></a>';
}
else
{
$mag['time']=$mag['time']-time();
$mag['time']=$mag['time']." с.";
echo '<a href=?mag&nin='.$mag['mag'].'>
<div class="v2s p"><img src=img/main/b10.png> <font color=#555500>'.$name.'</font><font color=#ffffff> ['.$mag['time'].']</font></div></a>';
}
}
}
echo '<a href=?rand><div class="v2s p"><img src=img/main/b8.png> <font color=#ffff00>бить любого</font></div></a>';
$eq=mysql_query("SELECT * FROM `elic` WHERE `usr`='".$udata['id']."' and `tip`='hp' and `status`='on'");
$rowse=mysql_num_rows($eq);
if($rowse==0)
{
}
else
{
while($el=mysql_fetch_array($eq))
{
if($el['time']<=$tn)
{
echo '<img src=img/elic/'.$el['tip'].''.$el['ef'].'.png> <a href=?elic&ef='.$el['id'].'>пить</a> ';
}
else
{
$el['time']=$el['time']-time();
if($el['time']<60){
$el['time']=$el['time']." с.</font>";
}
echo '<img src=img/elic/'.$el['tip'].''.$el['ef'].'.png> '.$el['time'].' ';
}
}
}
$kol=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='usr' and `status`='0'"));
echo '<br><br><a href=?leav><img src=img/main/p21.png> Покинуть бой</a><br>
<font color=#cccccc>Отряд зачистки:</font> <font color=#00cc00>'.$kol.' игроков</font>
';
echo '</div>';
echo '<div class="v8"><div class="v3 bts brs bls b p v12">Твой противник:</div>';
echo '<div class="v2 bts brs bls bbs p t2">';
$neb_mob1=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob'"));
$neb_mob2=mysql_num_rows(mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
$mob1=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='mob'"));
$mob2=mysql_fetch_array(mysql_query("SELECT * FROM `nebes` WHERE `etaz`='".$bt['etaz']."' and `tip`='boss'"));
echo '<font color=#cccccc>'.$mob1['name'].' ['.$neb_mob1.']</font> <br>';
echo '<font color=#cccccc>'.$mob2['name'].' ['.$neb_mob2.']</font> <br>';
echo '</div></div>';
}
elseif($bt['status']==1)
{
echo '<div align=center><img src=img/inter/win.jpg></div>
<img src=img/main/b18.png> Вы победили! Бой завершен!<br>
<a href=?leav><img src=img/main/p21.png> Покинуть бой</a>
</div><div class="v8">
';
}
elseif($bt['status']==2)
{
echo '<div align=center><img src=img/inter/lose.jpg></div>
<img src=img/main/b18.png> Вы проиграли! Бой завершен!<br>
<a href=?leav><img src=img/main/p21.png> Покинуть бой</a>
</div><div class="v8">
';
}
$mobs=mysql_query("SELECT * FROM `log_nebes` WHERE `usr`='".$udata['id']."' ORDER BY `id` DESC LIMIT 10");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
}
else
{
echo '<div class="v3 bts brs bls b p v12">Лог боя:</div><div class="v2 bts brs bls bbs p t2">';
while($log=mysql_fetch_array($mobs))
{
echo $log['text'].'<br>';
}
}
}
echo '</div>';
echo '<div class="v8"><div class="v3 bts brs bls b p v12">Отряд зачастки:</div>';
echo '<div class="v2 bts brs bls bbs p t2">';
$aq=mysql_query("SELECT * FROM `nebes_mob` WHERE `etaz`='".$bt['etaz']."' and `tip`='usr' and `status`='0'");
while($arrs=mysql_fetch_array($aq))
{
$usrz=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$arrs['usr']."'"));
echo '<img src=img/main/c'.$usrz['klass'].'.png> <img src=img/main/r'.$usrz['rasa'].'.png>
<a href=info.php?id='.$usrz['id'].'>'.$usrz['usr'].'</a> <img src=img/main/p3.png> ['.$arrs['hp'].'],';
}
echo '</div></div>';
include('files/dwn.php');
?>