<?
include_once '../system/common.php';
    
include_once '../system/functions.php';
        
include_once '../system/user.php';

$title = 'Бой с Боссом ';

include_once '../system/h.php';
    
if(!$user) {

  header('location: /');
    
exit;

}
$health = 50;
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `boss` WHERE `id` = '".intval($_GET['id'])."'"),0) == true){
$boss = mysql_fetch_assoc(mysql_query("SELECT * FROM `boss` WHERE `id`  = '".intval($_GET['id'])."'"));
}else{
echo "<div class='h'>Босс не найден</div>";
}
if($user['level'] < $boss[lvl]){
echo "<div class='menu_link2'><div class='jour' style='text-align:center;border-radius:3px;padding:3px'><div style='font-size:14px;color:white'>
Вы еще молоды </br> <div class='separ2'></div><a href='/boss/' class='menu_link'> к боссам</a> </div></div></div>";
}else{
if($user['hp'] < 20){
echo "<Div class='content'>Для нападения нужно 20 Здоровья</div>";

}
if($user['mp'] < 25){

?>



  



<div align='center'><a href='/lab/wiz/?potion=true&referal=/boss/' class='button'>Взять и вернуться назад</a><br/><br/>
  <font color='#909090'>Цена: <img src='/images/icon/gold.png' alt='*'/> 20 золота</font>
</div>


<?

}else{
include_once '../system/h.php';  
$bos_param = $boss['sila'] + $boss['health'] + $boss['lovk'] + $boss['zashit'];
$boss_param = $bos_param;

$user_param = $user['str'] + $user['vit'] + $user['agi'] + $user['def'] ;
if($boss_param > $user_param){

mysql_query("update `users` set `hp` = '".($user['hp']-$health)."',`mp`='".($user['mp']-25)."' where (`id` = '".$user['id']."')");

echo "<font color='red'> Поражение</font>";

}else{

mysql_query("update `users` set `exp` = '".($user['exp']+$boss['exp'])."',`g` = '".($user['g']+$boss['gold'])."',`hp` = '".($user['hp']-$health)."',`mp`='".($user['mp']-25)."' where (`id` = '".$user['id']."')");

echo "<div class='menu_link2'><div class='jour' style='text-align:center;border-radius:3px;padding:3px'><div style='font-size:14px;color:white'><center></center> <div style='color:khaki;font-size:13px'><br>Победа <img src='http://213.239.195.28/xaos/style2/money.png' alt=''/> ".$boss[gold]." золота <img src='http://213.239.195.28/xaos/icons/exp2.png' alt='' style='width:16px'/> ".$boss[exp]." опыта</div></div></div></div></div>";

echo "<div class='title-top'>Бой с Боссом</div><div class='separ2'></div><div class='menu_link2'><table><tr><td style='width:52px;padding:4px;padding-top:6px'><img src='http://213.239.195.28/xaos/heroes/1.jpg' alt='' style='border:1px solid #131313;border-radius:2px;height:50px;width:50px'/></td><td style='padding:2px;font-size:12px;color:#a5a5a5'><table><tr><td><div style='color:khaki;font-size:16px'>$boss[name]</div></td></tr></table><img src='http://213.239.195.28/xaos/style2/force.png' alt=''/> $boss[sila] <img src='http://213.239.195.28/xaos/style/heart.png' alt=''/> $boss[health] <img src='http://213.239.195.28/xaos/style2/shield1.png' alt=''/> $boss[zashit]<div style='padding:5px;padding-left:0px;padding-bottom:0'><div style='border:1px solid #131313;background:#232323;border-radius:3px;background-image:url(http://xaos.mobi/style2/exp5.png);background-position:center center;'><div style='border-radius:3px;height:8px;background:#009a00;width:100%;border-right:1px solid #191919;background-image:url(http://xaos.mobi/style/exp5.png);background-position:center center;'></div></div></div></td></tr></table></div><div class='separ2'></div><div style='text-align:center;padding-bottom:0;padding-top:0 class='menu_link3'><div style='padding:6px;text-align:center'><a href='/boss/ataka.php?id=$boss[id]&referal=/boss/' class='mybutt_att'><img src='http://213.239.195.28/xaos/16x16/sword.png' alt=''/> Aтaкoвaть <img src='http://213.239.195.28/xaos/style/energy.png' alt=''/> 5</a></div></div><div class='separ3'></div><div class='menu_link2'><table><tr><td style='width:52px;padding:4px;padding-top:6px'><img src='http://213.239.195.28/xaos/style2/prf_1.jpg' alt='' style='border:1px solid #131313;border-radius:2px;height:50px;width:50px'/></td><td style='padding:2px;font-size:12px;color:#a5a5a5'><table><tr><td><div style='color:khaki;font-size:16px'>$user[login] <span style='color:#a5a5a5;font-size:12px'></span></div></td></tr></table><img src='http://213.239.195.28/xaos/style2/force.png' alt=''/> $user[str] <img src='http://213.239.195.28/xaos/style/heart.png' alt=''/>  $user[vit]<img src='http://213.239.195.28/xaos/style2/shield1.png' alt=''/> $user[def]<div style='padding:5px;padding-left:0px;padding-bottom:0'><div style='border:1px solid #131313;background:#232323;border-radius:3px;background-image:url(http://xaos.mobi/style2/exp5.png);background-position:center center;'><div style='border-radius:3px;height:8px;background:#009a00;width:100%;border-right:1px solid #191919;background-image:url(http://xaos.mobi/style/exp5.png);background-position:left center;'></div></div></div></td></tr></table></div><div style='text-align:left'><div class='separ'></div><a href='' class='menu_link'><img src='http://213.239.195.28/xaos/potion/agil_1_jour.jpg' alt='' style='border:1px solid #131313;border-radius:2px;height:16px;width:16px'/> Энергия +125<span style='color:#a5a5a5'>, 4 шт.</span></a><a href='' class='menu_link'><img src='http://213.239.195.28/xaos/potion/agil_4_jour.jpg' alt='' style='border:1px solid #131313;border-radius:2px;height:16px;width:16px'/> Энергия +500<span style='color:#a5a5a5'>, 5 шт.</span></a><a href='' class='menu_link'><img src='http://213.239.195.28/xaos/potion/pot8_jour.jpg' alt='' style='border:1px solid #131313;border-radius:2px;height:16px;width:16px'/> Урон +20250<span style='color:#a5a5a5'>, 5 шт.</span></a></div><div class='separ3'></div>";  

}
}
}
include_once '../system/f.php';
?>