2 //==============================================================================
3 // Скрипт предназначен для вывода скилов игрока
4 //==============================================================================
6 function getCharacterSkills($guid_id)
9 return $cDB->select("-- CACHE: 1h
10 SELECT * FROM `character_skills` WHERE `guid` = ?d", $guid_id);
13 function showPlayerSkills($guid)
16 $skill_category = $wDB->select('-- CACHE: 1h
17 SELECT `id` AS ARRAY_KEY, `name`, `order` FROM `wowd_skill_line_category`');
19 // Помещаем данные о скилах в буфер для сотрировки их по классу
22 $skillcount = getCharacterSkills($guid);
24 foreach ($skillcount as $guid)
26 $skillId = $guid['skill']; // skill id
30 $skill = $guid['value']; // skill
31 $maxskill = $guid['max']; // max skill
33 $skillPerm = 0; // Баф с талантов (добавляется и к skill, и к maxSkill(занулил пока)
34 $skillTemp = 0; // Временный баф, влияет только на skill(занулил пока)
36 if ($skillLine = getSkillLine($skillId))
38 $skill = $skill +
$skillPerm;
39 $maxskill = $maxskill +
$skillPerm;
40 $category = $skillLine['Category'];
42 // Категория 12 скрыта
45 $order = $skill_category[$category]['order'];
46 $skill_rev[$order] = $category;
47 $playerSkill[$order][] =
49 'Name'=>$skillLine['Name'],
50 'Category'=>$category,
51 'Description'=>$skillLine['Description'],
52 'icon'=>$skillLine['iconId'],
54 'maxSkill'=>$maxskill,
61 // Выводим данные в таблицу
62 echo '<table class=report cellSpacing=0 cellPadding=0><tbody>';
63 echo '<tr><td class=head colspan=3>'.$lang['player_skills'].'</td></tr>';
64 foreach($playerSkill as $id=>$skill_data)
66 $id = $skill_rev[$id];
67 echo '<tr><td class=skill_category colspan=3> '.$skill_category[$id]['name'].'</td></tr>';
68 foreach($skill_data as $skill)
70 if ($skill['Description']!='')
72 $tip = '<table class=skilltip><tr class=top><td>'.$skill['Name'].'</td></tr><tr><td>'.$skill['Description'].'</td></tr></table>';
73 echo '<tr '.addTooltip($tip,'BORDER, false, STICKY, false').'>';
77 $pct = intval($skill['Skill']/$skill['maxSkill']*100);
78 $text = $skill['Skill'];
79 if ($skill['bonus'] > 0) $text.='<font class=posstat>+'.$skill['bonus'].'</font>';
80 else if ($skill['bonus'] < 0) $text.='<font class=negstat>'.$skill['bonus'].'</font>';
81 $text.=' / '.$skill['maxSkill'];
83 // if ($skill['icon'] > 1)
84 // $ico = '<img src='.getSpellIcon($skill['icon']).'>';
85 // echo '<td class=skill_ico>'.$ico.'</td>';
86 echo '<td class=skill_name><A href="?skill='.$skill['id'].'&guid='.$guid.'">'.$skill['Name'].'</td>';
87 echo '<td class=skill_bar><div class=skill_bar><b class=s1 style="width: '.$pct.'%;"></b><span>'.$text.'</span></div></td>';
91 echo '</tbody></table>';