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

include 'system/head1.php';
include 'system/user.php';



switch($_GET[go]){
default:  

if($user[save] >= '1'){
header ("Location:?go=step_$user[save]");
}else{
header ("Location: main.php");
}


case 'step_1':
if($user[save]=='1'){
echo'';
}else{
header ("Location:?go=step_$user[save]");
}

echo' <div class="title">Первый шаг</div>
<div class="block_zero center"></div><center>';

echo' <div class="empty_block item_center bottom">
Виберите пол
</div>';

echo ' <table width="100%" border="0" cellpadding="0" cellspacing="0" style="color:#E5CBB7">
<tbody>
<tr>
<td align="center"><a href="?go=man">
<img  class="img_start" src="/img/user/avatar/man_war_dark.png"><br>Мужчина</a></td> 

<td align="center"><a href="?go=woman">
<img class="img_start" src="/img/user/avatar/woman_war_light.png">
<br>Женщина</a></td></tr></tbody></table></div>';

break;
//////////// 
case 'step_2':
if($user[save]=='2'){
echo'';
}else{
header ("Location:?go=step_$user[save]");
}


echo' <div class="title">Второй шаг</div>
<div class="block_zero center"></div><center>';

echo' <div class="empty_block item_center bottom">
Две империи, Красные и Синие , сражаются за
контроль над землями. На чьей ты
стороне ?
</div>';

echo ' <table width="100%" border="0" cellpadding="0" cellspacing="0" style="color:#E5CBB7">
<tbody>
<tr>
   <td align="center"><a href="?go=dark">
<img  class="img_start" src="/img/user/avatar/'.$user[sex].'_war_dark.png">
<br>Красные</a></td> 

   <td align="center"><a href="?go=light">
<img class="img_start" src="/img/user/avatar/'.$user[sex].'_war_light.png">
<br>Синие</a></td></tr></tbody></table></div>';

break;
///////////



case 'step_3':
if($user[save]=='3'){
echo'';
}else{
header ("Location:?go=step_$user[save]");
}
echo' <div class="title">Третий шаг</div>
<div class="block_zero center"></div><center>';

echo' <div class="empty_block item_center bottom">
Виберите расу
</div>';

echo ' <table width="100%" border="0" cellpadding="0" cellspacing="0" style="color:#E5CBB7">
<tbody>
<tr>
<td align="center"><a href="?go=war">
<img  class="img_start" src="/img/user/avatar/'.$user[sex].'_war_'.$user[storona].'.png"><br>воин</a></td> 

<td align="center"><a href="?go=mage">
<img  class="img_start" src="/img/user/avatar/'.$user[sex].'_mage_'.$user[storona].'.png">
<br>маг</a></td>

<td align="center"><a href="?go=monk">
<img  class="img_start" src="/img/user/avatar/'.$user[sex].'_monk_'.$user[storona].'.png">
<br>монах</a></td>
</tr></tbody></table></div>';

break;
//
 case'step_4':
if($user[save]=='4'){
echo'';
}else{
header ("Location:?go=step_$user[save]");
}
echo' 
<div class="title">Подземелье</div>
<div class="block">
    <table>
        <tbody><tr>
            <td class="b66px"><img src="/web/img/mon_1.png" class="bord"></td>
            <td>
                <div class="bor1">
                    <div class="bor2">
                        <div class="bor3">
                            <div class="bor4">
                                <div class="bor_bg">
                                    <span class="white">Стражник</span><br>Уйди с моего пути пока я тебя не раздавил!
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
    </tbody></table>
    <div class="link_center"><a href="?go=step_4.1">Напасть</a></div>
</div>';
break;
// 
case'step_4.1':

echo' <div class="title">Одолейте стражника</div>
<div class="block">
    <table>
        <tbody><tr>
            <td class="item_right" style="width:33%;">
                <span class="white">Стражник</span><br>
                <span class="red" style="float:left;"></span>
                20 <img src="/web/img/health.png">
                <div class="progress-black bord"><div class="progress-green" style="width: 100%;"><div class="progress-red" style="width: 0%;"></div></div></div>
            </td>
            <td class="item_right b66px"><img src="/web/img/mon_1.png" class="bord"></td>
            <td class="item_left b66px"><img src="/img/i.png" class="bord"></td>
            <td style="width:33%;">
                <span class="white">Мертвый</span><br><img src="/web/img/health.png"> 25                                <span class="red float_r"></span>                <div class="progress-black bord"><div class="progress-green" style="width: 100%;"><div class="progress-red" style="width: 0%;"></div></div></div>
            </td>
        </tr>
    </tbody></table>
</div>
<div class="empty_block top item_center">
   <a href="?go=step_4.2"><div class="spell_container attack bord"></div></a> </div> ';
break;
//
case'step_4.2':

echo' <div class="title">Одолейте стражника</div>
<div class="block">
    <table>
        <tbody><tr>
            <td class="item_right" style="width:33%;">
                <span class="white">Стражник</span><br>
                <span class="red" style="float:left;">-7</span>
                13 <img src="/web/img/health.png">
                <div class="progress-black bord"><div class="progress-green" style="width: 100%;"><div class="progress-red" style="width: 33%;"></div></div></div>
            </td>
            <td class="item_right b66px"><img src="/web/img/mon_1.png" class="bord"></td>
            <td class="item_left b66px"><img src="/img/i.png" class="bord"></td>
            <td style="width:33%;">
                <span class="white">Мертвый</span><br><img src="/web/img/health.png"> 19                              <span class="red float_r">-6</span>                <div class="progress-black bord"><div class="progress-green" style="width: 100%;"><div class="progress-red" style="width: 24%;"></div></div></div>
            </td>
        </tr>
    </tbody></table>
</div>
<div class="empty_block top item_center">
    <a href="?go=step_4.3"><div class="spell_container attack bord"></div></a> </div>
    <div class="block">
                    <div><span class="white">Стражник</span> нанес вам <span class="role2">7 урона</span></div>
                    <div><span class="white">Вы</span> нанесли <span class="white">6 урона</span></div>
            </div>';
break;
//
case'step_4.3':

echo' <div class="title">Одолейте стражника</div>
<div class="block">
    <table>
        <tbody><tr>
            <td class="item_right" style="width:33%;">
                <span class="white">Стражник</span><br>
                <span class="red" style="float:left;">-7</span>
                6 <img src="/web/img/health.png">
                <div class="progress-black bord"><div class="progress-green" style="width: 66%;"><div class="progress-red" style="width: 50%;"></div></div></div>
            </td>
            <td class="item_right b66px"><img src="/web/img/mon_1.png" class="bord"></td>
            <td class="item_left b66px"><img src="/img/i.png" class="bord"></td>
            <td style="width:33%;">
                <span class="white">Мертвый</span><br><img src="/web/img/health.png"> 12                          <span class="red float_r">-7</span>                <div class="progress-black bord"><div class="progress-green" style="width: 80%;"><div class="progress-red" style="width: 40%;"></div></div></div>
            </td>
        </tr>
    </tbody></table>
</div>
<div class="empty_block top item_center">
    <a href="?go=step_5"><div class="spell_container attack bord"></div></a></div>
    <div class="block">
                    <div><span class="white">Стражник</span> нанес вам <span class="role2">7 урона</span></div>
                    <div><span class="white">Вы</span> нанесли <span class="white">7 урона</span>
</br>
<span class="white">Стражник</span> нанес вам <span class="role2">7 урона</span></div>
                    <div><span class="white">Вы</span> нанесли <span class="white">6 урона</span>
</div>
            </div>';

mysql_query("UPDATE `user` SET 
`save` = '5'
 WHERE `id` = '$user[id]'");
break;
//
case 'step_5':
if($user[save]=='5'){
echo'';
}else{
header ("Location:?go=step_$user[save]");
}
echo" <div class='title'> Победа 
</div>
<div class='empty_block item_center bottom'> Стражник повержен </div> ";
echo" <div class='chat'> Ты получил в награду комплект 
</br> 
<img src='img/items/head/0.png'> Шлем
</br> 
<img src='img/items/shoulder/0.png'> Плечи
 </br>
<img src='img/items/body/0.png'> Тело
 </br> 
<img src='img/items/weapon/0.png'> Оружие 
 </br>
<img src='img/items/shield/0.png'> Щит </br>
<center>
<a href='?go=rest'>
<div class='button'> 
<b>Забрать</b> 
</div> </a> </center>
</div>";
break;

////////
case 'man':
mysql_query("UPDATE `user` SET `sex` = 'man',
`save` = '2'
 WHERE `id` = '$user[id]'");
header ("Location: ?go=step_2");exit;
break;

case 'woman':
mysql_query("UPDATE `user` SET `sex` = 'woman',
`seve` = '2'
 WHERE `id` = '$user[id]'");
header ("Location: ?go=step_2");exit;
break;

case 'dark':
mysql_query("UPDATE `user` SET `storona` = 'dark',
`save` = '3'
 WHERE `id` = '$user[id]'");
header ("Location: ?go=step_3");exit;
break;

case 'light':
mysql_query("UPDATE `user` SET `storona` = 'light',
`save` = '3'
 WHERE `id` = '$user[id]'");
header ("Location: ?go=step_3");exit;
break;

case 'war':
mysql_query("UPDATE `user` SET `rasa` = 'war',
`save` = '4'
 WHERE `id` = '$user[id]'");
header ("Location: ?go=step_4");exit;
break;

case 'mage':
mysql_query("UPDATE `user` SET `rasa` = 'mage',
`save` = '4'
 WHERE `id` = '$user[id]'");
header ("Location: ?go=step_4");exit;
break;

case 'monk':
mysql_query("UPDATE `user` SET `rasa` = 'monk',
`save` = '4'
 WHERE `id` = '$user[id]'");
header ("Location: ?go=step_4");
exit;
break;

case'rest':
mysql_query("UPDATE `user` SET 
`save` = '0'
 WHERE `id` = '$user[id]'");
header ("Location: main.php");
exit;
break;





}
}else{
header ("Location: index.php"); exit;
}
/////////////////

$faq = mysql_query("SELECT * FROM `config`");
$conf = mysql_fetch_array($faq);
if(empty($_POST[name])){

echo '</div>
<div class="top empty_block item_center"> '.$conf[cop].',
'.$times = date("H:i:s").' , В игре <span class="white"> '.mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE '".time()."' - `online` < '7000'"),0).'
 </span>
</br>';
}
$arbuz = explode("/",$_SERVER['HTTP_USER_AGENT']);
$arbuz = htmlspecialchars($arbuz[0]);
echo' <a href="exit.php">Выйти</a>';
?>
