Коррекция названий флагов существ.
[cswow.git] / module / armory / show_char_equip.php
blob353a2ae1fa40bb6b5b4ac7bcd8783ab351745480
1 <?php
2 include_once("player_info_generator.php");
4 function showPlayerEquip($guid, $char, $char_data, $char_stat)
7 global $lang;
8 $char_name = $char['name'];
9 $genderId = $char['gender'];
10 $class = $char['class'];
11 $race = $char['race'];
12 $money = $char['money'];
13 $level = $char['level'];
14 $health = $char['health'];
15 $maxhealth = $char_stat['maxhealth'];
16 switch ($char['class']):
17 case 1: $powerType = 1; break;
18 case 2:
19 case 3:
20 case 5:
21 case 7:
22 case 8:
23 case 9:
24 case 11: $powerType = 0; break;
25 case 4: $powerType = 3; break;
26 case 6: $powerType = 6; break;
27 endswitch;
28 switch ($powerType):
29 case 0: $power = $char['power1']; $maxpower = $char_stat['maxpower1']; break;
30 case 1: $power = $char['power2']; $maxpower = $char_stat['maxpower2']; break;
31 case 3: $power = $char['power4']; $maxpower = $char_stat['maxpower4']; break;
32 case 6: $power = $char['power7']; $maxpower = $char_stat['maxpower7']; break;
33 endswitch;
34 // Ярость надо делить на 10
35 if ($powerType == POWER_RAGE || $powerType == POWER_RUNIC_POWER)
37 $power = intval($power/10);
38 $maxpower = intval($maxpower/10);
40 echo "<table cellSpacing=0 border=0>";
41 echo "<tr><td>";
43 echo "<table cellSpacing=0 cellPadding=0 border=0px>";
44 echo "<tbody><tr><td width=356px height=468px align=left valign=top>";
45 echo "<div style=\"position: relative; border: 0px; left: 0px; top: 0px;\">";
46 if (getRace($race)) $frame = $genderId."_".$race.".gif";
47 else $frame="TempPortrait.gif";
48 echo "<img src=images/player_info/characterframe/$frame style=\"position: absolute; border: 0px; left: 9px; top: 6px;\">";
49 echo "<img src=images/player_info/characterframe/characterframe.png style=\"position: absolute; border: 0px; left: 0px; top: 0px;\">";
51 echo "<table cellspacing=0 class=playerName style='position: absolute; left: 73px; top: 15px;'>";
52 echo "<tbody>";
53 echo "<tr><td class=name>$char_name - ".getClass($class)." $level lvl</td></tr>";
54 echo "</tbody>";
55 echo "</table>";
57 // Вычисление и генерация переменных $health и $maxhealth для создания изменяемой полоски
58 if ($health > $maxhealth){ $health = $maxhealth; }
59 $maxhealth != 0 ? $h_percent = round($health/$maxhealth*100,0) : $h_percent = 0;
60 $h_percent == 0 ? $h_l_on_off = "left-off" : $h_l_on_off = "left-on";
61 $h_percent == 100 ? $h_r_on_off = "right-on" : $h_r_on_off = "right-off";
62 echo "<table cellpadding='0' cellspacing='0' width=275px style='position:absolute; top:37px; left:73px;'>";
63 echo "<tbody>";
64 echo "<tr>";
65 echo "<td style='position:absolute; width: 275px; font-size:10px;' align = center><font color=white><b>$health / $maxhealth</b></font></td>";
66 echo "<td style='width: 6px; background: url(images/bar/$h_l_on_off.gif) left no-repeat;'></td>";
67 echo "<td style='width: ".($h_percent*2.75)."px; height:13px; background: url(images/bar/bar-on.gif) repeat-x;'></td>";
68 echo "<td style='width: ".(275-$h_percent*2.75)."px; height:13px; background: url(images/bar/bar-off.gif) repeat-x;'></td>";
69 echo "<td style='width: 6px;background: url(images/bar/$h_r_on_off.gif) right no-repeat;'></td>";
70 echo "</tr>";
71 echo "</tbody>";
72 echo "</table>";
74 // Вычисление и генерация переменных $power и $maxpower для создания изменяемой полоски
75 if ($power > $maxpower){ $power = $maxpower; }
77 //Цвет полоски
78 if ($powerType == 3) $typeSlid="energy"; //Энергия
79 elseif ($powerType == 1) $typeSlid="rage"; //Ярость
80 else $typeSlid="mana"; //Мана
82 $m_percent = $maxpower != 0 ? round($power/$maxpower*100,0) : 0;
83 $m_l_on_off = $m_percent == 0 ? "left-off" : "$typeSlid-left-on";
84 $m_r_on_off = $m_percent == 100 ? "$typeSlid-right-on" : "right-off";
86 echo "<table cellpadding='0' cellspacing='0' width=275px style='position:absolute; top:55px; left:73px'>";
87 echo "<tbody>";
88 echo "<tr>";
89 echo "<td style='position:absolute; width: 275px; font-size:10px;' align = center><font color=white><b>$power / $maxpower</b></font></td>";
90 echo "<td style='width: 6px; height:13px; background: url(images/bar/$m_l_on_off.gif) left no-repeat;'></td>";
91 echo "<td style='width: ".($m_percent*2.75)."px; height:13px; background: url(images/bar/$typeSlid-bar-on.gif) repeat-x;'></td>";
92 echo "<td style='width: ".(275-$m_percent*2.75)."px; height:13px; background: url(images/bar/bar-off.gif) repeat-x;'></td>";
93 echo "<td style='width: 6px; height:13px; background: url(images/bar/$m_r_on_off.gif) right no-repeat;'></td>";
94 echo "</tr>";
95 echo "</tbody>";
96 echo "</table>";
98 // Player stats render
99 echo '<table class=playerstats cellSpacing=0 style="width: 230px; position: absolute; left: 68px; top: 78px;">';
100 echo '<tbody>';
102 // Resistances render
103 echo '<tr><td colspan=2 align=center>';
104 echo '<table class=resistances cellSpacing=0>';
105 echo '<tbody>';
106 echo "<tr>\n";
107 renderResist(SCHOOL_FIRE,$char_stat['resFire'],$char); echo "\n";
108 renderResist(SCHOOL_NATURE,$char_stat['resNature'],$char); echo "\n";
109 renderResist(SCHOOL_FROST,$char_stat['resFrost'],$char); echo "\n";
110 renderResist(SCHOOL_SHADOW,$char_stat['resShadow'],$char); echo "\n";
111 renderResist(SCHOOL_ARCANE,$char_stat['resArcane'],$char); echo "\n";
112 echo "</tr>\n";
113 echo '</tbody>';
114 echo '</table>';
115 echo '</td></tr>';
117 echo '<tr><td class=head width=50%>'.$lang['player_page_base'].'</td><td class=head width=50%>'.$lang['player_page_defence'].'</td></tr>';
118 echo '<tr>';
119 // Base Stats render
120 echo '<td>';
121 echo '<div style="position: relative; left: 0px; top: 0px;">';
122 echo '<table class=stattext cellSpacing=0>';
123 echo "<tr><td>".getStatTypeName(STAT_STRENGTH).":</td></tr>\n";
124 echo "<tr><td>".getStatTypeName(STAT_AGILITY).":</td></tr>\n";
125 echo "<tr><td>".getStatTypeName(STAT_STAMINA).":</td></tr>\n";
126 echo "<tr><td>".getStatTypeName(STAT_INTELLECT).":</td></tr>\n";
127 echo "<tr><td>".getStatTypeName(STAT_SPIRIT).":</td></tr>\n";
128 echo "<tr><td>".getResistance(SCHOOL_ARMOR).":</td></tr>\n";
129 echo "</table>\n";
130 echo "<table class=statvalue cellSpacing=0 style=\"position: absolute; left: 0px; top: 0px;\">\n";
131 echo "<tr>";renderStatRow(STAT_STRENGTH,$char,$char_stat['strength']);echo "</tr>\n";
132 echo "<tr>";renderStatRow(STAT_AGILITY,$char,$char_stat['agility']);echo "</tr>\n";
133 echo "<tr>";renderStatRow(STAT_STAMINA,$char,$char_stat['stamina']);echo "</tr>\n";
134 echo "<tr>";renderStatRow(STAT_INTELLECT,$char,$char_stat['intellect']);echo "</tr>\n";
135 echo "<tr>";renderStatRow(STAT_SPIRIT,$char,$char_stat['spirit']);echo "</tr>\n";
136 echo "<tr>";renderResist(SCHOOL_ARMOR,$char_stat['armor'],$char);echo "</tr>\n";
137 echo '</table>';
138 echo '</div>';
139 echo '</td>';
140 // Defence render
141 echo '<td>';
142 echo '<div style="position: relative; left: 0px; top: 0px;">';
143 echo '<table class=stattext cellSpacing=0>';
144 echo '<tr><td>'.$lang['player_armor'].'</td></tr>';
145 // echo '<tr><td>'.$lang['player_defence'].'</td></tr>';
146 echo '<tr><td>'.$lang['player_dodge'].'</td></tr>';
147 echo '<tr><td>'.$lang['player_parry'].'</td></tr>';
148 echo '<tr><td>'.$lang['player_block'].'</td></tr>';
149 // echo '<tr><td>'.$lang['player_recilence'].'</td></tr>';
150 echo '</table>';
151 echo '<table class=statvalue cellSpacing=0 style="position: absolute; left: 0px; top: 0px;">';
152 echo "<tr>";@renderResist(SCHOOL_ARMOR,$char_stat['armor'],$char);echo "</tr>\n";
153 // echo "<tr>";@renderDefence($char_data);echo "</tr>\n";
154 echo "<tr>";@renderDodge($char_data);echo "</tr>\n"; // dodgePct
155 echo "<tr>";@renderParry($char_data);echo "</tr>\n"; // parryPct
156 echo "<tr>";@renderBlock($char_data);echo "</tr>\n"; // blockPct
157 // echo "<tr>";@renderRecilence($char_data);echo "</tr>\n";
158 echo '</table>';
159 echo '</div>';
160 echo '</td>';
161 echo '</tr>';
163 echo '<tr><td class=head width=50%>'.$lang['player_melee'].'</td><td class=head width=50%>'.$lang['player_ranged'].'</td></tr>';
164 echo '<tr>';
165 // Melee render
166 echo '<td>';
167 echo '<div style="position: relative; left: 0px; top: 0px;">';
169 echo '<table class=stattext cellSpacing=0>';
170 echo '<tr><td>'.$lang['player_m_skill'].'</td></tr>';
171 echo '<tr><td>'.$lang['player_m_damage'].'</td></tr>';
172 echo '<tr><td>'.$lang['player_m_speed'].'</td></tr>';
173 echo '<tr><td>'.$lang['player_m_power'].'</td></tr>';
174 echo '<tr><td>'.$lang['player_m_hit'].'</td></tr>';
175 echo '<tr><td>'.$lang['player_m_crit'].'</td></tr>';
176 echo '</table>';
177 echo '<table class=statvalue cellSpacing=0 style="position: absolute; left: 0px; top: 0px;">';
178 echo "<tr>";@renderMeleeSkill($char_data);echo "</tr>\n";
179 echo "<tr>";@renderMeleeDamage($char_data);echo "</tr>\n";
180 echo "<tr>";@renderMeleeSpeed($char_data);echo "</tr>\n";
181 echo "<tr>";@renderMeleeAP($char_data);echo "</tr>\n";
182 echo "<tr>";@renderMeleeHit($char_data);echo "</tr>\n";
183 echo "<tr>";@renderMeleeCrit($char_data);echo "</tr>\n";
184 echo '</table>';
185 echo '</div>';
186 echo '</td>';
187 // Ranged render
188 echo '<td>';
189 echo '<div style="position: relative; left: 0px; top: 0px;">';
190 echo '<table class=stattext cellSpacing=0>';
191 echo '<tr><td>'.$lang['player_r_skill'].'</td></tr>';
192 echo '<tr><td>'.$lang['player_r_damage'].'</td></tr>';
193 echo '<tr><td>'.$lang['player_r_speed'].'</td></tr>';
194 echo '<tr><td>'.$lang['player_r_power'].'</td></tr>';
195 echo '<tr><td>'.$lang['player_r_hit'].'</td></tr>';
196 echo '<tr><td>'.$lang['player_r_crit'].'</td></tr>';
197 echo '</table>';
198 echo '<table class=statvalue cellSpacing=0 style="position: absolute; left: 0px; top: 0px;">';
199 echo "<tr>";@renderRangedSkill($char_data);echo "</tr>\n";
200 echo "<tr>";@renderRangedDamage($char_data) ;echo "</tr>\n";
201 echo "<tr>";@renderRangedSpeed($char_data);echo "</tr>\n";
202 echo "<tr>";@renderRangedAP($char_data);echo "</tr>\n";
203 echo "<tr>";@renderRangedHit($char_data);echo "</tr>\n";
204 echo "<tr>";@renderRangedCrit($char_data);echo "</tr>\n";
205 echo '</table>';
206 echo '</div>';
207 echo '</td>';
208 echo '</tr>';
210 echo '<tr><td class=head colspan=2>'.$lang['player_spell'].'</td></tr>';
211 echo '<tr>';
212 echo '<td>';
213 // 1 part Spell render
214 echo '<div style="position: relative; left: 0px; top: 0px;">';
215 echo '<table class=stattext cellSpacing=0>';
216 echo '<tr><td>'.$lang['player_s_damage'].'</td></tr>';
217 echo '<tr><td>'.$lang['player_s_healing'].'</td></tr>';
218 echo '<tr><td>'.$lang['player_s_hit'].'</td></tr>';
219 echo '</table>';
220 echo '<table class=statvalue cellSpacing=0 style="position: absolute; left: 0px; top: 0px;">';
221 echo "<tr>";@renderSpellDamage($char_data);echo "</tr>\n";
222 echo "<tr>";@renderSpellHeal($char_data);echo "</tr>\n";
223 echo "<tr>";@renderSpellHit($char_data);echo "</tr>\n";
224 echo '</table>';
225 echo '</div>';
226 echo '</td>';
227 // 2 part Spell render
228 echo '<td>';
229 echo '<div style="position: relative; left: 0px; top: 0px;">';
230 echo '<table class=stattext cellSpacing=0>';
231 echo '<tr><td>'.$lang['player_s_crit'].'</td></tr>';
232 echo '<tr><td>'.$lang['player_s_haste'].'</td></tr>';
233 echo '<tr><td>'.$lang['player_s_regen'].'</td></tr>';
234 echo '</table>';
235 echo '<table class=statvalue cellSpacing=0 style="position: absolute; left: 0px; top: 0px;">';
237 echo "<tr>";@renderSpellCrit($char_data);echo "</tr>\n";
238 echo "<tr>";@renderSpellHaste($char_data);echo "</tr>\n";
239 echo "<tr>";@renderManaRegen($char_data);echo "</td></tr>\n";
241 echo '</table>';
242 echo '</div>';
243 echo '</td>';
244 echo '</tr>';
245 echo '</tbody>';
246 echo '</table>';
248 $imgsize="armory";
249 show_item_from_char($char_data[PLAYER_SLOT_ITEM_HEAD],$guid,$imgsize,22,73,"head");
250 show_item_from_char($char_data[PLAYER_SLOT_ITEM_NECK],$guid,$imgsize,22,114,"neck");
251 show_item_from_char($char_data[PLAYER_SLOT_ITEM_SHOULDER],$guid,$imgsize,22,155,"shoulder");
252 show_item_from_char($char_data[PLAYER_SLOT_ITEM_BACK],$guid,$imgsize,22,196,"back");
253 show_item_from_char($char_data[PLAYER_SLOT_ITEM_CHEST],$guid,$imgsize,22,237,"chest");
254 show_item_from_char($char_data[PLAYER_SLOT_ITEM_SHIRT],$guid,$imgsize,22,278,"shirt");
255 show_item_from_char($char_data[PLAYER_SLOT_ITEM_TABARD],$guid,$imgsize,22,319,"tabard");
256 show_item_from_char($char_data[PLAYER_SLOT_ITEM_WRIST],$guid,$imgsize,22,360,"wrist");
258 show_item_from_char($char_data[PLAYER_SLOT_ITEM_GLOVES],$guid,$imgsize,306,73,"gloves");
259 show_item_from_char($char_data[PLAYER_SLOT_ITEM_BELT],$guid,$imgsize,306,114,"belt");
260 show_item_from_char($char_data[PLAYER_SLOT_ITEM_LEGS],$guid,$imgsize,306,155,"legs");
261 show_item_from_char($char_data[PLAYER_SLOT_ITEM_FEET],$guid,$imgsize,306,196,"feet");
262 show_item_from_char($char_data[PLAYER_SLOT_ITEM_FINGER1],$guid,$imgsize,306,237,"finger");
263 show_item_from_char($char_data[PLAYER_SLOT_ITEM_FINGER2],$guid,$imgsize,306,278,"finger");
264 show_item_from_char($char_data[PLAYER_SLOT_ITEM_TRINKET1],$guid,$imgsize,306,319,"trinket");
265 show_item_from_char($char_data[PLAYER_SLOT_ITEM_TRINKET2],$guid,$imgsize,306,360,"trinket");
267 show_item_from_char($char_data[PLAYER_SLOT_ITEM_MAIN_HAND],$guid,$imgsize,122,384,"main");
268 show_item_from_char($char_data[PLAYER_SLOT_ITEM_OFF_HAND],$guid,$imgsize,164,384,"off");
269 show_item_from_char($char_data[PLAYER_SLOT_ITEM_RANGED],$guid,$imgsize,206,384,"ranged");
270 // Bags
271 // show_item_by_guid($char_data[PLAYER_SLOT_ITEM_TABARD+2],$imgsize,0,400);
272 // show_item_by_guid($char_data[PLAYER_SLOT_ITEM_TABARD+4],$imgsize,40,400);
273 // show_item_by_guid($char_data[PLAYER_SLOT_ITEM_TABARD+6],$imgsize,80,400);
274 // show_item_by_guid($char_data[PLAYER_SLOT_ITEM_TABARD+8],$imgsize,120,400);
276 //show_item_by_guid($char_data[OFFSET_EQU_RANGED+32],$imgsize,50,50);
277 echo "</div>";
278 echo "</td></tr></tbody>";
279 echo "</table></td>\n";
280 echo "<td valign=top>";
281 show_player_auras_from_db($guid);
282 echo "</td>";
283 echo "</tr>";
284 echo "</table>";