Файл: www/character.php
Строк: 280
<?php
include 'inc/mysql.php';
include 'inc/check.php';
include 'inc/functions.php';
top();
include 'inc/account.php';
$titlestr='Характеристики';
include 'inc/interface.php';
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
if (isset($_GET['char'])){
if ($account['character_point']){
if ($_GET['char']=='power'){
mysql_query("UPDATE `account` SET `power`=`power`+1,`character_point`='".($account['character_point']-1)."' WHERE `id`='".$account['id']."'");
mysql_query("INSERT INTO `msg_list`(`acount`,`msg`)VALUES('".$account['id']."','<div class="help"><b>Сила</b> повышена</div>')");
}elseif ($_GET['char']=='dexterity'){
mysql_query("UPDATE `account` SET `dexterity`=`dexterity`+1,`character_point`='".($account['character_point']-1)."' WHERE `id`='".$account['id']."'");
mysql_query("INSERT INTO `msg_list`(`acount`,`msg`)VALUES('".$account['id']."','<div class="help"><b>Ловкость</b> повышена</div>')");
}elseif ($_GET['char']=='wit'){
mysql_query("UPDATE `account` SET `wit`=`wit`+1,`character_point`='".($account['character_point']-1)."' WHERE `id`='".$account['id']."'");
mysql_query("INSERT INTO `msg_list`(`acount`,`msg`)VALUES('".$account['id']."','<div class="help"><b>Ум</b> повышен</div>')");
}elseif ($_GET['char']=='spirit'){
mysql_query("UPDATE `account` SET `spirit`=`spirit`+1,`character_point`='".($account['character_point']-1)."' WHERE `id`='".$account['id']."'");
mysql_query("INSERT INTO `msg_list`(`acount`,`msg`)VALUES('".$account['id']."','<div class="help"><b>Дух</b> повышен</div>')");
}elseif ($_GET['char']=='vitality'){
mysql_query("UPDATE `account` SET `vitality`=`vitality`+1,`character_point`='".($account['character_point']-1)."' WHERE `id`='".$account['id']."'");
mysql_query("INSERT INTO `msg_list`(`acount`,`msg`)VALUES('".$account['id']."','<div class="help"><b>Выносливость</b> повышена</div>')");
}else{
header("Location: ?");
exit;
}
header("Location: ?");
exit;
}else{
header("Location: ?");
exit;
}
}
@$hp['width'] = 100/($account['max_hp']/$account['hp']);
@$mp['width'] = 100/($account['max_mp']/$account['mp']);
echo '
<div class="title">
'.$account['name'].' '.$account['lvl'].' ур. ';
if ($account['race']=='ork' OR $account['race']=='work'){
echo 'Орк,';
}else{
echo 'Человек,';
}
if ($account['class']=='warrior'){
echo ' Воин';
}elseif ($account['class']=='mage'){
echo ' Маг';
}if ($account['class']=='rogue'){
echo ' Разбойник';
}
if ($account['clan']){
echo '<br />';
echo '<a href="/clane.php?id='.$account['clan'].'">'.mysql_result(mysql_query("SELECT `name` FROM `clan` WHERE `id`='".$account['clan']."'"),0).'</a>,';
if ($account['clan_status']=='clan_gm'){
echo ' Лидер клана';
}elseif($account['clan_status']=='gm'){
echo ' Генерал';
}elseif($account['clan_status']=='moder'){
echo ' Офицер';
}elseif($account['clan_status']=='wighter'){
echo ' Боец';
}else{
echo ' Новичок';
}
}
echo '
</div>
<div class="border-top"></div>
<div class="help">
<center>
<table align="center">
<tr><td>
';
$head=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['armor_head']."'"));
$body=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['armor_body']."'"));
$pants=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['armor_pants']."'"));
$gloves=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['armor_gloves']."'"));
$belt=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['armor_belt']."'"));
$ring=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['armor_ring']."'"));
$neckleace=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['armor_neckleace']."'"));
$earring=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['armor_earring']."'"));
$shoulder=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['armor_shoulder']."'"));
$weaponright=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['weapon_right']."'"));
$boots=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['weapon_boots']."'"));
$weaponshieldleft=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$account['weaponshield_left']."'"));
if ($head){
echo '<img src="/data/img/items/armor/'.$head['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($head['name'])).'" width="30px" height="30px"><br />';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px"><br />';
}
if ($body){
echo '<img src="/data/img/items/armor/'.$body['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($body['name'])).'" width="30px" height="30px"><br />';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px"><br />';
}
if ($belt){
echo '<img src="/data/img/items/armor/'.$belt['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($belt['name'])).'" width="30px" height="30px"><br />';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px"><br />';
}
if ($pants){
echo '<img src="/data/img/items/armor/'.$pants['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($pants['name'])).'" width="30px" height="30px"><br />';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px"><br />';
}
if ($boots){
echo '<img src="/data/img/items/armor/'.$ring['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($boots['name'])).'" width="30px" height="30px"><br />';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px"><br />';
}
if ($weaponright){
echo '<img src="/data/img/items/weapon/'.$weaponright['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($weaponright['name'])).'" width="30px" height="30px">';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px">';
}
echo '</td><td>
<img src="/data/img/units/'.$account['class'].'/'.$account['race'].'_'.$account['class'].'.png" width="100" height="200" />
</td><td>';
if ($earring){
echo '<img src="/data/img/items/armor/'.$earring['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($earring['name'])).'" width="30px" height="30px"><br />';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px"><br />';
}
if ($neckleace){
echo '<img src="/data/img/items/armor/'.$neckleace['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($neckleace['name'])).'" width="30px" height="30px"><br />';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px"><br />';
}
if ($shoulders){
echo '<img src="/data/img/items/armor/'.$shoulders['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($shoulders['name'])).'" width="30px" height="30px"><br />';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px"><br />';
}
if ($gloves){
echo '<img src="/data/img/items/armor/'.$gloves['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($gloves['name'])).'" width="30px" height="30px"><br />';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px"><br />';
}
if ($ring){
echo '<img src="/data/img/items/armor/'.$ring['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($ring['name'])).'" width="30px" height="30px"><br />';
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px"><br />';
}
if ($weaponshieldleft){
if ($weaponshieldleft=='armor_shield'){
echo '<img src="/data/img/items/armor/'.$weaponshieldleft['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($weaponshieldleft['name'])).'" width="30px" height="30px"><br />';
}
else{
echo '<img src="/data/img/items/weapon/'.$weaponshieldleft['icon'].'.jpg" title="'.htmlspecialchars(stripslashes($weaponshieldleft['name'])).'" width="30px" height="30px">';
}
}else{
echo '<img src="/data/img/items/empty.png" width="30px" title="Пусто" height="30px">';
}
echo '</td></tr>
</table>
</center>';
echo '</div><div class="help">';
echo '<table width="99%">
<tr>
<td valign="top" width="30%">
<span style="color:gray">
Опыт<br>
</span>
</td>
<td width="20%" align="center">
';
if ($account['lvl']<50){
echo $account['exp'].'/'.(mysql_result(mysql_query("SELECT `exp` FROM `lvl` WHERE `id`='".($account['lvl']+1)."'"),0));
}else{
echo $account['exp'];
}
echo '
</td>
<td valign="top" width="30%">
<span style="color:gray">
Золото<br>
</span>
</td>
<td width="20%" align="center">
'.$account['gold'].'
</td>
</tr>
</table>
</div>
<div class="title">
Основное </div><div class="help">';
if ($account['character_point'])echo 'Очки характеристик: <b>'.mysql_result(mysql_query("SELECT `character_point` FROM `account` WHERE `id`='".$account['id']."'"),0).'</b><hr>';
echo '<table width="99%">
<tr>
<td valign="top" width="30%">
<span style="color:gray">
Сила
<br>
Ум
<br>
Ловкость
<br>
Живучесть
<br />
Дух
</span>
</td>
<td valign="top" width="20%" align="center">
'.$account['power'].'';
if ($account['character_point'])echo ' <a href="?char=power">+</a>';
echo '<br>'.$account['wit'];
if ($account['character_point'])echo ' <a href="?char=wit">+</a>';
echo '<br />'.$account['dexterity'];
if ($account['character_point'])echo ' <a href="?char=dexterity">+</a>';
echo '<br>'.$account['vitality'];
if ($account['character_point'])echo ' <a href="?char=vitality">+</a>';
echo '<br>'.$account['spirit'];
if ($account['character_point'])echo ' <a href="?char=spirit">+</a>';
echo '</td>
<td valign="top" >
<span style="color:gray">
Сложение
<br>
Воля
<br>
Реакция
<br />
Очки жизни
<br />
Очки маны
</span>
</td>
<td width="20%" align="center">
'.$account['adding'].'%<br>'.$account['will'].'%<br>'.$account['reaction'].'%<br />'.$account['max_hp'].'<br />'.$account['max_mp'].'
</td>
</tr>
</table>
</div>
<div class="title">
Мастерство</div><div class="help">
<table width="99%">
<tr>
<td width="39%">
<font color="gray">Защита от ударов</font>
</td>
<td>
'.$account['feature_armor_weapon'].'%
</td>
<td>
<font color="gray">Мощн. удара</font>
</td>
<td>
'.ceil(100+$account['feature_attack_weapon']).'%
</td>
</tr>
<tr>
<td width="39%">
<font color="gray">Защита от стрел</font>
</td>
<td>
'.$account['feature_armor_arrow'].'%
</td>
<td>
<font color="gray">Мощн. стрел</font>
</td>
<td>
'.ceil(100+$account['feature_attack_arrow']).'%
</td>
</tr>
<tr>
<td width="39%">
<font color="gray">Защита от магии</font>
</td>
<td>
'.$account['feature_armor_magic'].'%
</td>
<td>
<font color="gray">Мощн. магии</font>
</td>
<td>
'.ceil(100+$account['feature_attack_magic']).'%
</td>
</tr>
</table>
</div>
';
}else{
header ("Location: /?"); exit;
}
down();
?>