$skillID = 129; break; case "cooking": $skillID = 185; break; case "fishing": $skillID = 356; break; default: $skillID = 0; break; } } else { $skillID = intval($skill); } $skillline = getSkillLine($skillID); if (!$skillline) { echo 'No found'; } else { $prof_list = array('SKILL_REPORT_LEVEL', 'SKILL_REPORT_ICON', 'SKILL_REPORT_NAME', 'SPELL_REPORT_REAGENTS'); $spell_list = array('SPELL_REPORT_LEVEL', 'SPELL_REPORT_ICON', 'SPELL_REPORT_NAME'); $skill =& new SpellReportGenerator('skill'); $skill->disable_mark = true; if ($skillline['Category'] == 9 or $skillline['Category'] == 11) { $skill->Init($prof_list, $baseLink, 'skillLIST', $config['skill_fade_limit'], 'skill_lvl'); } else { $skill->Init($spell_list, $baseLink, 'skillLIST', $config['skill_fade_limit'], 'level'); } $skill->doSkillList($skillID); $skill->createReport($skillline['Name']); }
function showPlayerSkills($guid) { global $wDB, $lang; $skill_category = $wDB->select('-- CACHE: 1h SELECT `id` AS ARRAY_KEY, `name`, `order` FROM `wowd_skill_line_category`'); $skill_rev = array(); // Put the data on skills in buffer for sotrirovki their class $playerSkill = array(); $skillcount = getCharacterSkills($guid); if ($skillcount) { foreach ($skillcount as $guid) { $skillId = $guid['skill']; // skill id if ($skillId == 0) { continue; } $skill = $guid['value']; // skill $maxskill = $guid['max']; // max skill $skillPerm = 0; // with talent (add and skill, and to maxSkill (zanulil) $skillTemp = 0; // Temporary BNF, affects only the skill (zanulil yet) if ($skillLine = getSkillLine($skillId)) { $skill = $skill + $skillPerm; $maxskill = $maxskill + $skillPerm; $category = $skillLine['Category']; // Category 12 hidden if ($category == 12) { continue; } $order = $skill_category[$category]['order']; $skill_rev[$order] = $category; $playerSkill[$order][] = array('id' => $skillId, 'Name' => $skillLine['Name'], 'Category' => $category, 'Description' => $skillLine['Description'], 'icon' => $skillLine['iconId'], 'Skill' => $skill, 'maxSkill' => $maxskill, 'bonus' => $skillTemp); } } } if ($playerSkill) { ksort($playerSkill); // Output data to a table echo '<table class=report cellSpacing=0 cellPadding=0><TBODY>'; echo '<tr><td class=head colspan=3>' . $lang['player_skills'] . '</td></tr>'; foreach ($playerSkill as $id => $skill_data) { $id = $skill_rev[$id]; echo '<tr><td class=skill_category colspan=3> ' . $skill_category[$id]['name'] . '</td></tr>'; foreach ($skill_data as $skill) { if ($skill['Description'] != '') { $tip = '<table class=skilltip><tr class=top><td>' . $skill['Name'] . '</td></tr><tr><td>' . $skill['Description'] . '</td></tr></table>'; echo '<tr ' . addTooltip($tip, 'BORDER, false, STICKY, false') . '>'; } else { echo '<tr>'; } $pct = intval($skill['Skill'] / $skill['maxSkill'] * 100); $text = $skill['Skill']; if ($skill['bonus'] > 0) { $text .= '<font class=posstat>+' . $skill['bonus'] . '</font>'; } else { if ($skill['bonus'] < 0) { $text .= '<font class=negstat>' . $skill['bonus'] . '</font>'; } } $text .= ' / ' . $skill['maxSkill']; $ico = ''; if ($skill['icon'] > 1) { $ico = '<img src=' . getSpellIcon($skill['icon']) . '>'; } echo '<td class=skill_ico>' . $ico . '</td>'; echo '<td class=skill_name><A href="?skill=' . $skill['id'] . '&guid=' . $guid . '">' . $skill['Name'] . '</td>'; echo '<td class=skill_bar><div class=skill_bar><b class=s1 style="width: ' . $pct . '%;"></b><span>' . $text . '</span></div></td>'; echo '</tr>'; } } echo '</tbody></table>'; } }
function getSkillName($skillId, $as_ref = 1) { $skillLine = getSkillLine($skillId); if ($skillLine) { if ($as_ref) { return "<a href=\"?skill={$skillId}\">" . $skillLine['Name'] . "</a>"; } else { return $skillLine['Name']; } } return ""; }