Вход Регистрация
Файл: www/char.php
Строк: 638
<?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']==&& isset($_GET['id'])){
if (
intval($_GET['id'])==$account['id']){
    
header("Location: /character.php");
    exit;
}
if (
mysql_result(mysql_query("SELECT COUNT(*) FROM `account` WHERE `id`='".intval($_GET['id'])."'"),0)){
    
$acc=mysql_fetch_assoc(mysql_query("SELECT * FROM `account` WHERE `id`='".intval($_GET['id'])."'"));
}else{
    
header('Location: index.php?');
    exit;
}
//Характеристики

/*************Обнуляем характеристики************/
//Сложение
$acc['adding'] = 0;
//Воля
$acc['will'] = 0;
//Реакция
$acc['reaction'] = 0;
//Очки здоровья
$acc['max_hp']=0;
//Очки маны
$acc['max_mp']=0;
//Защита от ударов
$acc['feature_armor_weapon']=0;
//Защита от стрел
$acc['feature_armor_arrow']=0;
//Защита от магии
$acc['feature_armor_magic']=0;
//Урон от ударов
$acc['feature_attack_weapon']=0;
//Урон от стрел
$acc['feature_attack_arrow']=0;
//Урон от магии
$acc['feature_attack_magic']=0;
//Восстановление жизни
$acc['hp_regen']=0;
//Восстановление маны
$acc['mp_regen']=0;
//Минимальный урон(оружие)
$acc['min_damag']=0;
//Максимальный урон(оружие)
$acc['max_damag']=0;

if (
$acc['clan']){
    
$cln=mysql_fetch_assoc(mysql_query("SELECT * FROM `clan` WHERE `id`='".$acc['clan']."'"));
    
$acco['power']=$acc['power']+$cln['power'];
    
$acc['wit']=$acc['wit']+$cln['wit'];
    
$acc['spirit']=$acc['spirit']+$cln['spirit'];
    
$acc['dexterity']=$acc['dexterity']+$cln['dexterity'];
    
$acc['vitality']=$acc['vitality']+$cln['vitality'];
}
/********************************************************************************************************************
****************************************************Баффы!************************************************************
***********************************************************************************************************************/
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `effect` WHERE `baph`='1' AND (`account`='".$acc['id']."' AND (`target_type`='' OR `target_type`='0')) OR (`target_type`='user' AND `target`='".$acc['id']."')"),0)){
    
$qb=mysql_query("SELECT * FROM `effect` WHERE `baph`='1' AND `account`='".$acc['id']."' OR (`target_type`='user' AND `target`='".$acc['id']."')");
    while(
$resultb=mysql_fetch_assoc($qb)){
        if (
time()-$resultb['time']>=$resultb['effect_time']){
            
mysql_query("DELETE FROM `effect` WHERE `id`='".$resultb['id']."'");
            
header("Location: ?");
            exit;
        }
        
//Сложение
        
$acc['adding']+=$resultb['baph_adding'];
        
//Воля
        
$acc['will']+=$resultb['baph_will'];
        
//Реакция
        
$acc['reaction']+=$resultb['baph_reaction'];
        
//Очки здоровья
        
$acc['max_hp']+=$resultb['baph_max_hp'];
        
//Очки маны
        
$acc['max_mp']+=$resultb['baph_max_mp'];
        
//Защита от ударов
        
$acc['feature_armor_weapon']+=$resultb['baph_feature_armor_weapon'];
        
//Защита от стрел
        
$acc['feature_armor_arrow']+=$resultb['baph_feature_armor_arrow'];
        
//Защита от магии
        
$acc['feature_armor_magic']+=$resultb['baph_feature_armor_magic'];
        
//Урон от ударов
        
$acc['feature_attack_weapon']+=$resultb['baph_feature_attack_weapon'];
        
//Урон от стрел
        
$acc['feature_attack_arrow']+=$resultb['baph_feature_attack_arrow'];
        
//Урон от магии
        
$acc['feature_attack_magic']+=$resultb['baph_feature_attack_magic'];
        
//Восстановление жизни
        
$acc['hp_regen']+=$resultb['baph_hp_regen'];
        
//Восстановление маны
        
$acc['mp_regen']+=$resultb['baph_mp_regen'];
        
//Power
        
$acc['power']+=$resultb['baph_power'];
        
//Wit
        
$acc['wit']+=$resultb['baph_wit'];
        
//Dexterity
        
$acc['dexterity']+=$resultb['baph_dexterity'];
        
//Vitality
        
$acc['vitality']+=$resultb['baph_vitality'];
        
//Spirit
        
$acc['spirit']+=$resultb['baph_spirit'];
    }
}
/**********************************************************************************************************************
*******************************************Бонусы характеристик от вещей************************************************
*************************************************************************************************************************/

if(!empty($acc['armor_head'])){ //Шлем
            
$head=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_head']."'"));
            if (
$head['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$head['feature_power'];
            }
            if (
$head['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$head['feature_vitality'];
            }
            if (
$head['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$head['feature_dexterity'];
            }
            if (
$head['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$head['feature_wit'];
            }
            if (
$head['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$head['feature_spirit'];
            }
            if (
$head['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$head['feature_armor_arrow']*1.25;
            }
            if (
$head['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$head['feature_armor_weapon']*1.25;
            }
            if (
$head['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$head['feature_armor_magic']*1.25;
            }
            if (
$head['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$head['feature_attack_arrow']*1.50;
            }
            if (
$head['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$head['feature_attack_weapon']*1.50;
            }
            if (
$head['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$head['feature_attack_magic']*1.50;
            }
            if (
$head['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$head['feature_hp_regen'];
            }
            if (
$head['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$head['feature_mp_regen'];
            }    
}

if(!empty(
$acc['armor_body'])){ //Нагрудник
            
$body=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_body']."'"));
            if (
$body['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$body['feature_power'];
            }
            if (
$body['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$body['feature_vitality'];
            }
            if (
$body['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$body['feature_dexterity'];
            }
            if (
$body['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$body['feature_wit'];
            }
            if (
$body['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$body['feature_spirit'];
            }
            if (
$body['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$body['feature_armor_arrow']*1.25;
            }
            if (
$body['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$body['feature_armor_weapon']*1.25;
            }
            if (
$body['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$body['feature_armor_magic']*1.25;
            }
            if (
$body['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$body['feature_attack_arrow']*1.50;
            }
            if (
$body['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$body['feature_attack_weapon']*1.50;
            }
            if (
$body['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$body['feature_attack_magic']*1.50;
            }
            if (
$body['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$body['feature_hp_regen'];
            }
            if (
$body['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$body['feature_mp_regen'];
            }    
}
if(!empty(
$acc['armor_pants'])){ //Набедреник
            
$pants=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_pants']."'"));
            if (
$pants['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$pants['feature_power'];
            }
            if (
$pants['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$pants['feature_vitality'];
            }
            if (
$pants['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$pants['feature_dexterity'];
            }
            if (
$pants['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$pants['feature_wit'];
            }
            if (
$pants['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$pants['feature_spirit'];
            }
            if (
$pants['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$pants['feature_armor_arrow']*1.25;
            }
            if (
$pants['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$pants['feature_armor_weapon']*1.25;
            }
            if (
$pants['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$pants['feature_armor_magic']*1.25;
            }
            if (
$pants['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$pants['feature_attack_arrow']*1.50;
            }
            if (
$pants['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$pants['feature_attack_weapon']*1.50;
            }
            if (
$pants['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$pants['feature_attack_magic']*1.50;
            }
            if (
$pants['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$pants['feature_hp_regen'];
            }
            if (
$pants['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$pants['feature_mp_regen'];
            }    
}
if(!empty(
$acc['armor_gloves'])){ //Набедреник
            
$gloves=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_gloves']."'"));
            if (
$gloves['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$gloves['feature_power'];
            }
            if (
$gloves['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$gloves['feature_vitality'];
            }
            if (
$gloves['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$gloves['feature_dexterity'];
            }
            if (
$gloves['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$gloves['feature_wit'];
            }
            if (
$gloves['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$gloves['feature_spirit'];
            }
            if (
$gloves['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$gloves['feature_armor_arrow']*1.25;
            }
            if (
$gloves['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$gloves['feature_armor_weapon']*1.25;
            }
            if (
$gloves['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$gloves['feature_armor_magic']*1.25;
            }
            if (
$gloves['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$gloves['feature_attack_arrow']*1.50;
            }
            if (
$gloves['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$gloves['feature_attack_weapon']*1.50;
            }
            if (
$gloves['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$gloves['feature_attack_magic']*1.50;
            }
            if (
$gloves['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$gloves['feature_hp_regen'];
            }
            if (
$gloves['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$gloves['feature_mp_regen'];
            }    
}

if(!empty(
$acc['armor_belt'])){ //Пояс
            
$belt=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_belt']."'"));
            if (
$belt['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$belt['feature_power'];
            }
            if (
$belt['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$belt['feature_vitality'];
            }
            if (
$belt['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$belt['feature_dexterity'];
            }
            if (
$belt['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$belt['feature_wit'];
            }
            if (
$belt['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$belt['feature_spirit'];
            }
            if (
$belt['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$belt['feature_armor_arrow']*1.25;
            }
            if (
$belt['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$belt['feature_armor_weapon']*1.25;
            }
            if (
$belt['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$belt['feature_armor_magic']*1.25;
            }
            if (
$belt['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$belt['feature_attack_arrow']*1.50;
            }
            if (
$belt['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$belt['feature_attack_weapon']*1.50;
            }
            if (
$belt['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$belt['feature_attack_magic']*1.50;
            }
            if (
$belt['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$belt['feature_hp_regen'];
            }
            if (
$belt['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$belt['feature_mp_regen'];
            }    
}
if(!empty(
$acc['armor_ring'])){ //Кольцо
            
$ring=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_ring']."'"));
            if (
$ring['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$ring['feature_power'];
            }
            if (
$ring['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$ring['feature_vitality'];
            }
            if (
$ring['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$ring['feature_dexterity'];
            }
            if (
$ring['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$ring['feature_wit'];
            }
            if (
$ring['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$ring['feature_spirit'];
            }
            if (
$ring['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$ring['feature_armor_arrow']*1.25;
            }
            if (
$ring['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$ring['feature_armor_weapon']*1.25;
            }
            if (
$ring['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$ring['feature_armor_magic']*1.25;
            }
            if (
$ring['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$ring['feature_attack_arrow']*1.50;
            }
            if (
$ring['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$ring['feature_attack_weapon']*1.50;
            }
            if (
$ring['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$ring['feature_attack_magic']*1.50;
            }
            if (
$ring['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$ring['feature_hp_regen'];
            }
            if (
$ring['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$ring['feature_mp_regen'];
            }    
}
if(!empty(
$acc['armor_neckleace'])){ //Ожерелье
            
$neckleace=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_neckleace']."'"));
            if (
$neckleace['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$neckleace['feature_power'];
            }
            if (
$neckleace['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$neckleace['feature_vitality'];
            }
            if (
$neckleace['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$neckleace['feature_dexterity'];
            }
            if (
$neckleace['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$neckleace['feature_wit'];
            }
            if (
$neckleace['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$neckleace['feature_spirit'];
            }
            if (
$neckleace['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$neckleace['feature_armor_arrow']*1.25;
            }
            if (
$neckleace['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$neckleace['feature_armor_weapon']*1.25;
            }
            if (
$neckleace['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$neckleace['feature_armor_magic']*1.25;
            }
            if (
$neckleace['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$neckleace['feature_attack_arrow']*1.50;
            }
            if (
$neckleace['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$neckleace['feature_attack_weapon']*1.50;
            }
            if (
$neckleace['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$neckleace['feature_attack_magic']*1.50;
            }
            if (
$neckleace['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$neckleace['feature_hp_regen'];
            }
            if (
$neckleace['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$neckleace['feature_mp_regen'];
            }    
}


if(!empty(
$acc['armor_earring'])){ //Серьги
            
$earring=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_earring']."'"));
            if (
$earring['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$earring['feature_power'];
            }
            if (
$earring['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$earring['feature_vitality'];
            }
            if (
$earring['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$earring['feature_dexterity'];
            }
            if (
$earring['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$earring['feature_wit'];
            }
            if (
$earring['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$earring['feature_spirit'];
            }
            if (
$earring['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$earring['feature_armor_arrow']*1.25;
            }
            if (
$earring['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$earring['feature_armor_weapon']*1.25;
            }
            if (
$earring['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$earring['feature_armor_magic']*1.25;
            }
            if (
$earring['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$earring['feature_attack_arrow']*1.50;
            }
            if (
$earring['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$earring['feature_attack_weapon']*1.50;
            }
            if (
$earring['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$earring['feature_attack_magic']*1.50;
            }
            if (
$earring['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$earring['feature_hp_regen'];
            }
            if (
$earring['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$earring['feature_mp_regen'];
            }    
}
if(!empty(
$acc['armor_shoulder'])){ //Ожерелье
            
$shoulder=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_shoulder']."'"));
            if (
$shoulder['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$shoulder['feature_power'];
            }
            if (
$shoulder['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$shoulder['feature_vitality'];
            }
            if (
$shoulder['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$shoulder['feature_dexterity'];
            }
            if (
$shoulder['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$shoulder['feature_wit'];
            }
            if (
$shoulder['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$shoulder['feature_spirit'];
            }
            if (
$shoulder['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$shoulder['feature_armor_arrow']*1.25;
            }
            if (
$shoulder['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$shoulder['feature_armor_weapon']*1.25;
            }
            if (
$shoulder['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$shoulder['feature_armor_magic']*1.25;
            }
            if (
$shoulder['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$shoulder['feature_attack_arrow']*1.50;
            }
            if (
$shoulder['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$shoulder['feature_attack_weapon']*1.50;
            }
            if (
$shoulder['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$shoulder['feature_attack_magic']*1.50;
            }
            if (
$shoulder['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$shoulder['feature_hp_regen'];
            }
            if (
$shoulder['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$shoulder['feature_mp_regen'];
            }    
}
if(!empty(
$acc['weapon_right'])){ //Левая рука(оружие)
            
$weaponright=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['weapon_right']."'"));
            if (
$weaponright['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$weaponright['feature_power'];
            }
            if (
$weaponright['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$weaponright['feature_vitality'];
            }
            if (
$weaponright['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$weaponright['feature_dexterity'];
            }
            if (
$weaponright['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$weaponright['feature_wit'];
            }
            if (
$weaponright['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$weaponright['feature_spirit'];
            }
            if (
$weaponright['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$weaponright['feature_armor_arrow']*1.25;
            }
            if (
$weaponright['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$weaponright['feature_armor_weapon']*1.25;
            }
            if (
$weaponright['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$weaponright['feature_armor_magic']*1.25;
            }
            if (
$weaponright['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$weaponright['feature_attack_arrow']*1.50;
            }
            if (
$weaponright['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$weaponright['feature_attack_weapon']*1.50;
            }
            if (
$weaponright['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$weaponright['feature_attack_magic']*1.50;
            }
            if (
$weaponright['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$weaponright['feature_hp_regen'];
            }
            if (
$weaponright['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$weaponright['feature_mp_regen'];
            }
            if (
$weaponright['attack_min_damag']!=NULL && $weaponright['attack_max_damag']!=NULL){
                
$acc['min_damag']=$acc['min_damag']+$weaponright['attack_min_damag'];
                
$acc['max_damag']=$acc['max_damag']+$weaponright['attack_max_damag'];
            }
}
if(!empty(
$acc['weaponshield_left'])){ //Левая рука(оружие или щит)
            
$weaponshieldleft=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['weaponshield_left']."'"));
            if (
$weaponshieldleft['feature_pover']!=NULL){
                
$acc['power']=$acc['power']+$weaponshieldleft['feature_power'];
            }
            if (
$weaponshieldleft['feature_vitality']!=NULL){
                
$acc['vitality']=$acc['vitality']+$weaponshieldleft['feature_vitality'];
            }
            if (
$weaponshieldleft['feature_dexterity']!=NULL){
                
$acc['dexterity']=$acc['dexterity']+$weaponshieldleft['feature_dexterity'];
            }
            if (
$weaponshieldleft['feature_wit']!=NULL){
                
$acc['wit']=$acc['wit']+$weaponshieldleft['feature_wit'];
            }
            if (
$weaponshieldleft['feature_spirit']!=NULL){
                
$acc['spirit']=$acc['spirit']+$weaponshieldleft['feature_spirit'];
            }
            if (
$weaponshieldleft['feature_armor_arrow']!=NULL){
                
$acc['feature_armor_arrow']=$acc['feature_armor_arrow']+$weaponshieldleft['feature_armor_arrow']*1.25;
            }
            if (
$weaponshieldleft['feature_armor_weapon']!=NULL){
                
$acc['feature_armor_weapon']=$acc['feature_armor_weapon']+$weaponshieldleft['feature_armor_weapon']*1.25;
            }
            if (
$weaponshieldleft['feature_armor_magic']!=NULL){
                
$acc['feature_armor_magic']=$acc['feature_armor_magic']+$weaponshieldleft['feature_armor_magic']*1.25;
            }
            if (
$weaponshieldleft['feature_attack_arrow']!=NULL){
                
$acc['feature_attack_arrow']=$acc['feature_attack_arrow']+$weaponshieldleft['feature_attack_arrow']*1.50;
            }
            if (
$weaponshieldleft['feature_attack_weapon']!=NULL){
                
$acc['feature_attack_weapon']=$acc['feature_attack_weapon']+$weaponshieldleft['feature_attack_weapon']*1.50;
            }
            if (
$weaponshieldleft['feature_attack_magic']!=NULL){
                
$acc['feature_attack_magic']=$acc['feature_attack_magic']+$weaponshieldleft['feature_attack_magic']*1.50;
            }
            if (
$weaponshieldleft['feature_hp_regen']!=NULL){
                
$acc['hp_regen']=$acc['hp_regen']+$weaponshieldleft['feature_hp_regen'];
            }
            if (
$weaponshieldleft['feature_mp_regen']!=NULL){
                
$acc['mp_regen']=$acc['mp_regen']+$weaponshieldleft['feature_mp_regen'];
            }
            if (
$weaponshieldleft['attack_min_damag']!=NULL && $weaponshieldleft['attack_max_damag']!=NULL){
                
$acc['min_damag']=$acc['min_damag']+$weaponshieldleft['attack_min_damag'];
                
$acc['max_damag']=$acc['max_damag']+$weaponshieldleft['attack_max_damag'];
            }            
}
/************************************************************************************
****************************************Эффекты****************************************
****************************************************************************************/

/*************************************************************************************
************************Характеристики*************************************************
****************************************************************************************/
//Сложение
$addingmin=0.02*$acc['power'];
$acc['adding'] += round($acc['power']-$addingmin);
//Воля
$willmin=0.02*$acc['wit'];
$acc['will'] += round($acc['wit']-$willmin);
//Реакция
$reactionmin=0.02*$acc['dexterity'];
$acc['reaction'] += round($acc['dexterity']-$reactionmin);
//Очки здоровья
$acc['max_hp']+=100+(($acc['vitality'] - 5)*11);
//Очки маны
$acc['max_mp']+=100+(($acc['wit'] - 5)*7);
//Защита от ударов
$armorweaponmin=floor($acc['power']/2)*0.01;
$acc['feature_armor_weapon']+=($acc['power']*0.55)-$armorweaponmin;
//Защита от стрел
$armorarrowmin=floor($acc['dexterity']/2)*0.01;
$acc['feature_armor_arrow']+=($acc['dexterity']*0.55)-$armorarrowmin;
//Защита от магии
$armormagicmin=floor($acc['wit']/2)*0.01;
$acc['feature_armor_magic']+=($acc['wit']*0.55)-$armormagicmin;
//Урон от ударов
$acc['feature_attack_weapon']+=floor($acc['power']/2)*1;
//Урон от стрел
$acc['feature_attack_arrow']+=floor($acc['dexterity']/2)*1;
//Урон от магии
$acc['feature_attack_magic']+=floor($acc['wit']/2)*1;
//Восстановление жизни
$acc['hp_regen']+=round(0.1+($acc['power']*0.1));
//Восстановление маны
$acc['mp_regen']+=round(0.1+($acc['spirit']*0.1));
///

///
@$hp['width'] = 100/($acc['max_hp']/$acc['hp']);

@
$mp['width'] = 100/($acc['max_mp']/$acc['mp']);

echo 
'

<div class="title">

'
.$acc['name'].' '.$acc['lvl'].' ур. ';
if (
$acc['race']=='ork' OR $acc['race']=='work'){
    echo 
'Орк,';
}else{
    echo 
'Человек,';
}
if (
$acc['class']=='warrior'){
    echo 
' Воин';
}elseif (
$acc['class']=='mage'){
    echo 
' Маг';
}if (
$acc['class']=='rogue'){
    echo 
' Разбойник';
}
echo 
' '.mysql_result(mysql_query("SELECT `name` FROM `location` WHERE `x`='".$acc['x']."' AND `y`='".$acc['y']."'"),0);
if (
$acc['clan']){
    echo 
'<br />';
    echo 
'<a href="/clane.php?id='.$acc['clan'].'">'.mysql_result(mysql_query("SELECT `name` FROM `clan` WHERE `id`='".$acc['clan']."'"),0).'</a>,';
    if (
$acc['clan_status']=='clan_gm'){
        echo 
' Лидер клана';
    }elseif(
$acc['clan_status']=='gm'){
        echo 
' Генерал';
    }elseif(
$acc['clan_status']=='moder'){
        echo 
' Офицер';
    }elseif(
$acc['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`='".$acc['armor_head']."'"));
$body=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_body']."'"));
$pants=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_pants']."'"));
$gloves=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_gloves']."'"));
$belt=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_belt']."'"));
$ring=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_ring']."'"));
$neckleace=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_neckleace']."'"));
$earring=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_earring']."'"));
$shoulder=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['armor_shoulder']."'"));
$weaponright=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['weapon_right']."'"));
$boots=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['weapon_boots']."'"));
$weaponshieldleft=mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id`='".$acc['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/'
.$acc['class'].'/'.$acc['race'].'_'.$acc['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>';
echo 
'<a class="link" href="/mail.php?act=mesg&user='.$acc['id'].'">Отправить письмо</a>';

if (!
mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user`='".$account['id']."' AND `friend`='".$acc['id']."'"),0))
echo 
'<a class="link" href="/friends.php?add='.$acc['id'].'">Добавить в друзья</a>';
echo (!
$acc['party']?(!mysql_result(mysql_query("SELECT COUNT(*) FROM `party_add` WHERE `user`='".$acc['id']."'"),0)?
(!
$account['party']?'<a class="link" href="/party.php?get_add='.$acc['id'].'">Пригласить в отряд</a>':
    (
mysql_result(mysql_query("SELECT `account` FROM `party` WHERE `id`='".$account['party']."'"),0) == $account['id']?
    (
mysql_result(mysql_query("SELECT COUNT(*) FROM `account` WHERE `party`='".$account['party']."'"),0)<5?
    
'<a class="link" href="/party.php?get_add='.$acc['id'].'">Пригласить в отряд</a>':null):null)):null):null);
echo 
'
<div class="title">

Основное </div><div class="help">'
;

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">

'
.$acc['power'].''
echo 
'<br>'.$acc['wit'];
 echo 
'<br />'.$acc['dexterity'];
echo 
'<br>'.$acc['vitality'];
 echo 
'<br>'.$acc['spirit'];
echo 
'</td>

<td valign="top" >

<span style="color:gray">

Сложение

<br>

Воля

<br>

Реакция

<br />

Очки жизни

<br />

Очки маны

</span>

</td>

<td width="20%" align="center">

'
.$acc['adding'].'%<br>'.$acc['will'].'%<br>'.$acc['reaction'].'%<br />'.$acc['max_hp'].'<br />'.$acc['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>

'
.$acc['feature_armor_weapon'].'%

</td>

<td>

<font color="gray">Мощн. удара</font>

</td>

<td>

'
.ceil(100+$acc['feature_attack_weapon']).'%

</td>

</tr>

<tr>

<td width="39%">

<font color="gray">Защита от стрел</font>

</td>

<td>

'
.$acc['feature_armor_arrow'].'%

</td>
<td>

<font color="gray">Мощн. стрел</font>

</td>

<td>

'
.ceil(100+$acc['feature_attack_arrow']).'%

</td>

</tr>

<tr>

<td width="39%">

<font color="gray">Защита от магии</font>

</td>

<td>

'
.$acc['feature_armor_magic'].'%

</td>

<td>

<font color="gray">Мощн. магии</font>

</td>

<td>

'
.ceil(100+$acc['feature_attack_magic']).'%

</td>

</tr>

</table>

</div>
'
;

}else{

header ("Location: /?"); exit;

}

down();

?>
Онлайн: 1
Реклама