diff --git a/characterprofile.php b/characterprofile.php index 33a9055..b9143ed 100644 --- a/characterprofile.php +++ b/characterprofile.php @@ -11,36 +11,20 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) { if ($user_id !== false) { $loadOutfits = $config['show_outfits']['characterprofile']; - if ($config['ServerEngine'] == 'TFS_10') { - if (!$loadOutfits) { - $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin'); - } else { // Load outfits - if ($config['client'] < 780) { - $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype'); - } else { - $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons'); - } + if (!$loadOutfits) { + $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin'); + } else { // Load outfits + if ($config['client'] < 780) { + $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype'); + } else { + $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons'); } - $profile_data['online'] = user_is_online_10($user_id); + } + $profile_data['online'] = user_is_online_10($user_id); - if ($config['Ach']) { - $user_id = (int) $user_id; - $achievementPoints = mysql_select_single("SELECT SUM(`value`) AS `sum` FROM `player_storage` WHERE `key` LIKE '30___' AND `player_id`={$user_id} LIMIT 1"); - } - } else { // TFS 0.2, 0.3 - if (!$loadOutfits) { - $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex'); - } else { // Load outfits - if ($config['ServerEngine'] !== 'OTHIRE') { - if ($config['client'] < 780) { - $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype'); - } else { - $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons'); - } - } else { - $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype'); - } - } + if ($config['Ach']) { + $user_id = (int) $user_id; + $achievementPoints = mysql_select_single("SELECT SUM(`value`) AS `sum` FROM `player_storage` WHERE `key` LIKE '30___' AND `player_id`={$user_id} LIMIT 1"); } $profile_znote_data = user_znote_character_data($user_id, 'created', 'hide_char', 'comment'); @@ -82,10 +66,22 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) { - 1): ?> + 1): + $position = mysql_select_single(" + SELECT + `a`.`type` + FROM `players` AS `p` + INNER JOIN `accounts` AS `a` + ON `p`.`account_id` = `a`.`id` + WHERE + `a`.`type` > 1 + AND `p`.`id` = '{$user_id}' + "); + $position = (isset($config['ingame_positions'][$position['type']])) ? $config['ingame_positions'][$position['type']] : "Unknown"; + ?> Position - + @@ -124,31 +120,20 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) { 'townid', - 'TFS_03' => 'town' - // Default: town_id - ); - $column_town_id = (isset($column_town_id[$config['ServerEngine']])) - ? $column_town_id[$config['ServerEngine']] - : 'town_id'; - $houses = mysql_select_multi(" - SELECT `id`, `owner`, `name`, `{$column_town_id}` AS `town_id` - FROM `houses` - WHERE `owner` = {$user_id}; - "); + $houses = mysql_select_multi(" + SELECT `id`, `owner`, `name`, `town_id` AS `town_id` + FROM `houses` + WHERE `owner` = {$user_id}; + "); - if ($houses !== false) { - foreach ($houses as $h): ?> - - House - - - + + House + + + @@ -180,56 +165,30 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) { AND `pid`<'11' "); - $soulStamina = (in_array($config['ServerEngine'], ['TFS_10'])) - ? " `soul`, `stamina`," - : " `p`.`soul`, `p`.`stamina`,"; - + $soulStamina = " `soul`, `stamina`,"; if ($config['client'] < 780) { $soulStamina = " 0 AS `soul`, 0 AS `stamina`,"; } - $player_query = (in_array($config['ServerEngine'], ['TFS_10'])) - ? /* true */ "SELECT - `health`, `healthmax`, - `mana`, `manamax`, - `cap`, - `experience`, `level`, - {$soulStamina} - `maglevel`, - `skill_fist`, - `skill_club`, - `skill_sword`, - `skill_axe`, - `skill_dist`, - `skill_shielding`, - `skill_fishing` - FROM `players` - WHERE `id`={$user_id} - LIMIT 1;" - : /* false */ "SELECT - `p`.`health`, `p`.`healthmax`, - `p`.`mana`, `p`.`manamax`, - `p`.`cap`, - `p`.`experience`, `p`.`level`, - {$soulStamina} - `p`.`maglevel`, - `fist`.`value` AS `skill_fist`, - `club`.`value` AS `skill_club`, - `sword`.`value` AS `skill_sword`, - `axe`.`value` AS `skill_axe`, - `dist`.`value` AS `skill_dist`, - `shield`.`value` AS `skill_shielding`, - `fish`.`value` AS `skill_fishing` - FROM `players` AS `p` - LEFT JOIN `player_skills` AS `fist` ON `p`.`id` = `fist`.`player_id` AND `fist`.`skillid` = 0 - LEFT JOIN `player_skills` AS `club` ON `p`.`id` = `club`.`player_id` AND `club`.`skillid` = 1 - LEFT JOIN `player_skills` AS `sword` ON `p`.`id` = `sword`.`player_id` AND `sword`.`skillid` = 2 - LEFT JOIN `player_skills` AS `axe` ON `p`.`id` = `axe`.`player_id` AND `axe`.`skillid` = 3 - LEFT JOIN `player_skills` AS `dist` ON `p`.`id` = `dist`.`player_id` AND `dist`.`skillid` = 4 - LEFT JOIN `player_skills` AS `shield` ON `p`.`id` = `shield`.`player_id` AND `shield`.`skillid` = 5 - LEFT JOIN `player_skills` AS `fish` ON `p`.`id` = `fish`.`player_id` AND `fish`.`skillid` = 6 - WHERE `p`.`id`= {$user_id} - LIMIT 1;"; + $player_query = " + SELECT + `health`, `healthmax`, + `mana`, `manamax`, + `cap`, + `experience`, `level`, + {$soulStamina} + `maglevel`, + `skill_fist`, + `skill_club`, + `skill_sword`, + `skill_axe`, + `skill_dist`, + `skill_shielding`, + `skill_fishing` + FROM `players` + WHERE `id`={$user_id} + LIMIT 1; + "; $playerstats = mysql_select_single($player_query); $playerstats['experience'] = number_format($playerstats['experience'],0,'',','); @@ -252,9 +211,8 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) { [133,134,143,144,145], [146,151,152,153,154], [251,268,273,278,289], - [325,328,335,367,430], - [432,463,465,472,512], - //516,541,574,577,610,619,633,634,637,665,667,684,695,697,699,725,733,746,750,760,846,853,873,884,899 + [325,328,335,367], + //430,432,463,465,472,512,516,541,574,577,610,619,633,634,637,665,667,684,695,697,699,725,733,746,750,760,846,853,873,884,899 ); $female_outfits = array( @@ -262,9 +220,8 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) { [141,142,147,148,149], [150,155,156,157,158], [252,269,270,279,288], - [324,329,336,366,431], - [433,464,466,471,513], - //514,542,575,578,618,620,632,635,636,664,666,683,694,696,698,724,732,745,749,759,845,852,874,885,900 + [324,329,336,366], + //431,433,464,466,471,513,514,542,575,578,618,620,632,635,636,664,666,683,694,696,698,724,732,745,749,759,845,852,874,885,900 ); $featured_outfits = ($profile_data['sex'] == 1) ? $male_outfits : $female_outfits; @@ -411,11 +368,15 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) { } #piv_flex img { position: absolute; + bottom: 0; + right: 0; } #piv_i .inventory_outfit { position: absolute; top: 130px; left: -24px; + width: 64px; + height: 64px; } #piv_lifebar { position: absolute; @@ -711,121 +672,63 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) { ".$d['killed_by']."" - : $d['killed_by']; + if ($deaths) { + foreach ($deaths as $d) { + $lasthit = ($d['is_player']) + ? "".$d['killed_by']."" + : $d['killed_by']; - ?> - - - - + + + + (unjustified)"; + } + $mostdmg = ($d['mostdamage_by'] !== $d['killed_by']) ? true : false; + if ($mostdmg) { + $mostdmg = ($d['mostdamage_is_player']) + ? "".$d['mostdamage_by']."" + : $d['mostdamage_by']; + + echo "
and by $mostdmg."; + + if ($d['mostdamage_unjustified']) { echo " (unjustified)"; } - $mostdmg = ($d['mostdamage_by'] !== $d['killed_by']) ? true : false; - if ($mostdmg) { - $mostdmg = ($d['mostdamage_is_player']) - ? "".$d['mostdamage_by']."" - : $d['mostdamage_by']; - - echo "
and by $mostdmg."; - - if ($d['mostdamage_unjustified']) { - echo " (unjustified)"; - } - } else { - echo " (soloed)"; - } - ?> - - - - - This player has never died. - - '. $value['killed_by'] .''; - } else { - $value['killed_by'] = 'monster: '. $value['killed_by'] .'.'; - } - ?> - - - - - - - This player has never died. - - = 1) { - $namedata = user_character_data((int)$value[3], 'name'); - if ($namedata !== false) { - $value[3] = $namedata['name']; - $value[3] = 'player: '. $value[3] .''; } else { - $value[3] = 'deleted player.'; + echo " (soloed)"; } - } else { - $value[3] = user_get_killer_m_name(user_get_kid($value['id'])); - if ($value[3] === false) { - $value[3] = 'deleted player.'; - } - } - ?> - - - - - - - This player has never died. + ?> + + + This player has never died. + + @@ -893,14 +796,6 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {