<?php
include 'system/bd.php';
include 'system/cook.php';
include ("system/gzip.php");
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
include 'system/head.php';
include 'system/head1.php';

echo '' ;
$b = mysql_query("SELECT * FROM `user` WHERE `id` = '$user[id]'");
$b = mysql_fetch_array($b);

switch($_GET[id]){
default:

echo"<div class='title'>Умения казна</div>";

echo'    <div class="block_link light_bottom">
        <a href="spells.php?id=1">
            <table>
                <tbody><tr>
                    <td class="b66px">
                        <img src="/web/img/orden_spells/1.png" class="bord">
                    </td>
                    <td>
                        <span class="white"><b>Огневой удар</b></span>
                        <div class="progress-black bord" style="width: 50%;">
                            <div class="progress-green" style="width:45%;"></div>
                        </div>
                                                   <span class="gray"> Уровень';
echo" $user[spells1] ";
echo'</span> 
                                                                                                                                            </td>
                </tr>
            </tbody></table>
        </a>
    </div>';

echo'    <div class="block_link light_bottom">
   <a href="spells.php?id=2">
<table><tbody><tr>
<td class="b66px">
<img src="/web/img/orden_spells/1.png" class="bord">
</td><td>
<span class="white">
<b> Алтарь</b></span>
<div class="progress-black bord" style="width: 50%;">
<div class="progress-green" style="width:45%;"></div>
</div>
<span class="gray"> Бонус к каждому параметру игрока 
</span> <span class="lime"> 0 
</span>                                                                                                                        </td></tr>
</tbody></table>
</a> </div>';
break;

case'1':

if($user[spells1]=="0"){
$attack_1=0;
$sec_1=0; }
if($user[spells1]=="1"){
$attack_1=5; 
$sec_1=46; }
if($user[spells1]=="2"){
$attack_1=12;
$sec_1=41; }
if($user[spells1]=="3"){
$attack_1=19; 
$sec_1=36; }
if($user[spells1]=="4"){
$attack_1=27; 
$sec_1=32; }
if($user[spells1]=="5"){
$attack_1=36; 
$sec_1=29; }
if($user[spells1]=="6"){
$attack_1=42;
$sec_1=25; }
if($user[spells1]=="7"){
$attack_1=54; 
$sec_1=22; }
if($user[spells1]=="8"){
$attack_1=66;
$sec_1=19; }
if($user[spells1]=="9"){
$attack_1=75; 
$sec_1=17; }
if($user[spells1]=="10"){
$attack_1=80; 
$sec_1=15; }

if (('chat_clear') && isset($_GET['act']) && $_GET['act']=='1')
{
$req = mysql_query("SELECT * FROM `user` WHERE `id` = '$user[id]'");
////////////////////////////

header("Location: ?");



if($user[gold]<$cena){
echo "<img src='/pic/main/nou.png' alt='*'/> Маловато золота в общаке!<hr>";

}else{
mysql_query("UPDATE `user` SET
`spells`=`spells` - '1',
`spells1`=`spells1` + '1'
 WHERE `id`='$user[id]' LIMIT 1 ");

header ("Location: ?id=1"); exit;
}
}
echo' <div class="title">Умения</div>
<div class="bor1"><div class="bor2"><div class="bor3"><div class="bor4"><div class="bor_bg item_center">Очки умений <span class="white">';
echo"$user[spells]";
echo'</span></div></div></div></div></div>
<div class="block">
    <table>
        <tbody><tr>
            <td style="width: 55px;"><img src="/web/img/spells/5.png" class="bord"></td>
            <td>
                <span class="c2"><b>Огневой удар</b></span><br>Наносит противнику мощный удар огнем<br>Уровень <span class="white">';
echo" $user[spells1] ";
echo'</span> из <span class="white">10</span><br>Время восстановления <span class="white">';
echo" $sec_1 сек </span>";
echo'<br> Повышает урон на <span class="white">';echo"$attack_1";
echo'%</span>
                                                                                                                                                                </td>
        </tr>
    </tbody></table>';
echo"</div> ";

if($user[spells1] <= '10' and $user[spells] >'0'){
echo' <div class="link_center">';
echo" <a href='?id=1&act=1'> Улучшить</a></div>";
}else{
echo'';}

echo' <div class="block_link">';
echo"<a href='spells.php'> <img src ='../img/images/arrow.png'> Вернуться</a></div>";
break;
             //////////

}
//////////////////

}else{
header ("Location: index.php"); exit;
}
include 'system/foot.php';
?>
