<?include"engine/scripts/l2p_Scripts.php"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><title><?echo "$title"?></title>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=windows-1251" />
<link rel="icon" href="L2ua.ru.ico" type="image/x-icon" />
<link rel='stylesheet' type='text/css' href='gameplay.css' />
<script type="text/javascript" src="libs/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="libs/dvi-clickOpen.js"></script>
<script language="JavaScript" src="libs/refrash_timer.js"></script>
<script language="JavaScript" src="libs/chat.js"></script>
<script language='javascript1.2' src="libs/no-copy-text.js"></script>
<body>

<!-- Меню -->
<div id="button_menu" style="display: none">
<p>
<table border="0" align=right>
<tr>
<td align="center"><font face="verdana" size="2" color="#FFFFFF">Настройки</font></td>
<td align="center"><a href="#" onclick="config('#config'); return false" type='button' class="button_settings"></a></td>
</tr>
<tr>
<td align="center"><font face="verdana" size="2" color="#FFFFFF">Статистика</font></td>
<td align="center"><a href="#" onclick="button_stat('#button_stat'); return false" type='button' class="button_stat"></a></td>
</tr>
<tr>
<td align="center"><font face="verdana" size="2" color="#FFFFFF">Выход</font></td>
<td align="center"><a href="logout.php" type='button' class="button_exit"></a></td>
</tr>
</table>
</p>
</div>

<div id="button_stat" style="display: none"><p><center><?include"engine/scripts/statistics.php"?></center></p></div>

<!-- Окно кнопок -->
<div class="panel">
<p>
<table border="1" bgcolor="#000000" align=center>
<tr>
<td align="center"><a href="#" onclick="button_char('#button_char'); return false" type='button' class="button_char"></a></td>
<td align="center"><a href="#" onclick="button_inventory('#button_inventory'); return false" type='button' class="button_inventory"></a></td>
<td align="center"><a href="#" onclick="button_maps('#button_maps'); return false" type='button' class="button_maps"></a></td>
<td align="center"><a href="#" onclick="button_menu('#button_menu'); return false" type='button' class="button_menu"></a></td>
</tr>
</table>
</p>
</div>

<!-- Окно статуса чара -->
<div id="button_char" style="display: none">
<p>
<table width="240" align="center" border="1">
<tr>
<td align=center><font color=#FFFFFF>Имя: </font><font color=yellow><?=$user['name'];?></font></td>
<td align=center><font color=#FFFFFF>Уровень: </font><font color=yellow><?=$user['level'];?></font></td>
</tr>
</table>
<br>
<table width="240" align="center" border="1">
<tr>
<td align=center><font color=#FFFFFF>Класс: </font><font color=yellow><?=GetClassName($user['class']);?></font></td>
<td align=center><font color=#FFFFFF>Раса: </font><font color=yellow><?=GetRaceName($user['race']);?></font></td>
<td align=center><font color=#FFFFFF>Пол: </font><font color=yellow><?=GetSexName($user['sex']);?></font></td>
</tr>
</table>
<br>
<table width="240" align="center" border="1">
<tr>
<td align=center><font color=#FFFFFF>Победы: <font color=yellow><?=$user['victory_count'];?></font></td>
<td align=center><font color=#FFFFFF>Смертей: <font color=yellow><?=($user['battle_count'] - $user['victory_count']);?></font></td>
<td align=center><font color=#FFFFFF>Всего боев: <font color=yellow><?=$user['battle_count'];?></font></td>
</tr>
</table>
</p>
</div>

<!-- Инвентарь -->
<div id="button_inventory" style="display: none">
<p>
<table border=0 align=center>
<tr>
<td id=weapon align="center"><?if($user['weapon'] != '') {?><?=$user['weapon'];?><?}?></td>
</tr>
</table>
</p>
</div>

<!-- Настройки -->
<div id="config" style="display: none">
<p>
<table border="1" align=center width="300" bgcolor="yellow">
<tr>
<td align="center" bgcolor="gray"><font color="#00FF00">Настройки</font></td>
</tr>
<tr>
<td align="center" bgcolor="gray"><font color="#FFFFFF">Настройки находится в разработке, вполне возможно что в версии 4.0 они появятся.</font></td>
</tr>
</table>
<br>
<table border="1" align=center width="300" bgcolor="yellow">
<tr>
<td align="center" bgcolor=black><font color="yellow">Всё уже настроено, настраивать нечего.</font></td>
</tr>
</table>
</p>
</div>

<!-- Статус обновления -->
<div class="status_UpDate">
<table width="250" bgcolor="#bfb488" border="1" align="center">
<tr>
<td align=center>
<font size="-1">
<center>
Зарегистрировано <b><?=$reg_users_count;?></b> персонажей. <br>
Из них <b><?=(sizeof($userlist));?></b> <font color="green"><b>онлайн</b></font>
<div id="refrash_timer"></div></center>
</font>
</td>
</tr>
</table>
<table width="250" bgcolor="#bfb488" border="1" align="center">
<tr>
<td align=center>
<b> Эвент </b>
</td>
</tr>
</table>
<table width="250" bgcolor="#bfb488" border="1" align="center">
<tr>
<td align=center>
<?if($user['quest'] != 0) {?>Убейте <?=$user['quest_name'];?> и вы получите в двое больше опыта.<?}?>
</td>
</tr>
</table>
</div>

<!-- статус hp, exp -->
<div class="status_HP_EXP"><p>
<table width="200" align="left" border="1" bgcolor="black"><tr><td align=center bgcolor="black" width="32" height=0><font color=#FFFFFF><b><?=$user['level'];?></b></font></td><td align=center bgcolor="black" height=0><font color=#FFFFFF><b><?=$user['name'];?></b></font></td></tr></table>
<table width="200" align="left" border="1" bgcolor="black"><tr><td align=center bgcolor="red" width="32" height=0><font color=#000000 size="-2"><b>HP:</b></font></td><td align=center bgcolor="red" height=0><b><?=$user['hp'];?><font color=yellow> / </font> <font color=#FFFFFF><?=GetHP($user['level']);?></b></font></td></tr></table>
<table width="200" align="left" border="1" bgcolor="black"><tr><td align=center bgcolor="gray" width="32" height=0><font color=#000000 size="-2"><b>EXP:</b></font></td><td align=center bgcolor="gray" height=0><font color=#000000><b><?=$user['exp'];?></b></font></td></tr></table>
</p></div>


<!-- Чат отображение событий -->
<div id="Chat_echo">
<table width="334" align="center">
<tr><td align="center"><b>Чат</b></font></td></tr>
<br>
<tr><td align="left"><ul><?if(isset($fast_msg)) {?><li><?=$fast_msg;?></li><?}?><?for($i = 0; $i < sizeof($msg); $i++){?>
<li><?=$msg[$i]['message'];?><font size="-1" color="#CCCCCC">(<?=date("H:i:s", $msg[$i]['date']);?>)</font></li><?}?></ul></td></tr>
</table>
</div>

<!-- Чат ввода текста -->
<div id="Chat_cend">
<table width="100" align="center">
<tr>
<form name="chat" action="l2.php" method="POST">
<td align="center"><input name="chat_msg" type="text" value="" style="width: 300px;"></td>
<td align="center"><input name="chat_submit" type="submit" value="Сказать"></td>
</form>
</tr>
</table>
</div>

<!-- Карта -->
<div id="button_maps" style="display: none">
<p>
<? include "engine/scripts/maps.php" ?>
</p>
</div>

<!-- Список игроков и монстров -->
<div id="List_Users" style="display: none">
<table align="center" border="1">
<tr>
<td align="center"><font color="blue">Имя</font></td>
<td align="center"><font color="#FFFFFF">Уровень</font></td>
<td align="center"><font color="Red">Жизни</font></td>
<td align="center"><font color="#00ff00">Оружие</font></td>
</tr>
</table>
<br>
<table align="center" border="1">
<tr>
<?for($i = 0; $i < sizeof($userlist)-1; $i++) {?>
<?if(!$battle_bool AND $userlist[$i]['battle'] == false AND $user['hp'] > 0 AND ( $userlist[$i]['hp'] == GetHP($userlist[$i]['level']) OR $userlist[$i]['type'] == 'm' )) {?>
<td align="center"><a href="l2.php?action=battle_begin&enemy=<?=$userlist[$i]['id'];?>&<?=rand(0, 10000000);?>"><font color="blue"><?=$userlist[$i]['name'];?></a></font>
</td>
<td align="center"><font color="#FFFFFF"><?=$userlist[$i]['level'];?></font></td>
<td align="center"><font color="red"><br><?=$userlist[$i]['hp'];?></font></td>
<td align="center"><font color="00ff00"><?=$userlist[$i]['weapon'];?></font></td>
<?} else {?><?if(isset($enemy) AND $enemy['id'] == $userlist[$i]['id']) {?>
</tr>
</table>
</div>

<!-- Окно процесса атаки -->
<div id="attack_Users">

<table align="right" border="1" bgcolor="gray">
<tr><td><font color="blue"><?=$enemy['name'];?></font> </td></tr>
<tr><td><font color="#FFFFFF"><?=$enemy['level'];?></font> Уровень</td></tr>
<tr><td><font color="#00ff00"><?=$userlist[$i]['weapon'];?></font></td></tr>
</table>
<table width="190" align="right" border="1" bgcolor="black">
<tr>
<td align=center bgcolor="red" width="32" height=0><font color=#000000 size="-2"><b>HP:</b></font></td>
<td align=center bgcolor="red" height=0><b><?=$enemy['hp'];?><font color=yellow> / </font> <font color=#FFFFFF><?=GetHP($enemy['level']);?></b></font></td>
</tr>
</table>
<table align="left" border="1" bgcolor="green">
<tr><td><font color="blue"><?=$user['name'];?></font> </td></tr>
<tr><td><font color="#FFFFFF"><?=$user['level'];?></font> Уровень</td></tr>
<tr><td><font color="#00ff00"><?if($user['weapon'] != '') {?><?=$user['weapon'];?><?}?></font></td></tr>
</table>
<table width="190" align="left" border="1" bgcolor="black">
<tr>
<td align=center bgcolor="red" width="32" height=0><font color=#000000 size="-2"><b>HP:</b></font></td>
<td align=center bgcolor="red" height=0><b><?=$user['hp'];?><font color=yellow> / </font> <font color=#FFFFFF><?=GetHP($user['level']);?></b></font></td>
</tr>
</table>

<!-- Игрок против противника -->
<div id="Users_vs_Users">
<table width="640" align="center" border="1" bgcolor="black">
<tr>
<td align="center">
<font size="5" color="green"><b><?=$user['name'];?></b></font> <font color="#FFFFFF"><b>vs</b></font> <font size="5" color="red"><b><?=$enemy['name'];?></b></font>
<?} else {?>
<?}?><?}?><?}?>
</td>
</tr>
</table>
</div>
</div>

<!-- Панель скилов -->
<div class="panel_skills"></div>
<div class="skills">
<table border="1" align="left">
<tr>
<td align="center"><a href="l2.php" type='button' class="button_refrash"></a></td>
<?if($battle_bool != false) {?>
<td align="center"><form name="battle" action="l2.php" method="POST">
<div id="battle_timer"><b><?$td = ($BATTLE_SECOND - $time_delta); if($td <= 0) $td = $BATTLE_SECOND; echo $td;?></b></div></form></td>
</tr>
</table>
</div>

<script>
var timeBattle = <?=$time_delta;?>;
window.setTimeout('battleTimer()', 1);
function battleTimer() {timeBattle++;
if(timeBattle > <?=$BATTLE_SECOND;?>) {
document.getElementById('battle_timer').innerHTML = '<input type="submit" name="battle_submit" value=" " id="skill_attack"/>';return;}
document.getElementById('battle_timer').innerHTML = '<a href="#" type="button" id="skill_attack"><font color="red"><b>' + (<?=$BATTLE_SECOND;?> - timeBattle + 1) + '</font></b></a>';
window.setTimeout('battleTimer()', 1000);}
</script><?}?>

</body>
</head>
</html>