Требование: PHP => 5.3
[cswowd.git] / module / show / show_debug.php
blob5df6ea2f02e1d7214fcca5283559579a7aefe9fc
1 <?php
2 include_once("include/functions.php");
3 $debug = @$_REQUEST['debug'];
4 //********************************************************************************
5 // списки ex cost
6 //********************************************************************************
7 if ($debug == "ex_cost")
9 $rows = $wDB->select("SELECT * FROM `wowd_item_ex_cost`");
10 if ($rows)
12 echo "<br><table class=report width=500>";
13 echo "<tbody>";
14 echo "<tr><td colspan=3 class=head>Ex costs</td></tr>";
15 echo "<tr><th width=20>$lang[id]</th><th width=100%>$lang[item_list]</th><th>$lang[cost]</th></tr>";
16 foreach ($rows as $cost)
18 echo "<tr>";
19 echo "<td>".$cost['id']."</td>";
20 $items = $dDB->select("SELECT `item` FROM `npc_vendor` WHERE ExtendedCost = ?d GROUP BY `item`", $cost['id']);
21 if ($items)
23 echo "<td align=center>";
24 foreach ($items as $itemid)
25 show_item($itemid['item'], 0, "sell");
26 echo "</td>";
28 else
29 echo "<td align=center>$lang['not_found']</td>";
30 echo "<td align=center>".showExtendCostData($cost, 0)."</td>";
31 echo "</tr>";
33 echo "</tbody></table>";
36 //********************************************************************************
37 // Списки lock
38 //********************************************************************************
39 else
40 if ($debug == "lock")
42 $rows = $wDB->select("SELECT * FROM `wowd_lock`");
43 if ($rows)
45 echo "<br><table class=report width=500>";
46 echo "<tbody>";
47 echo "<tr><td colspan=3 class=head>lock</td></tr>";
48 echo "<tr><th width=1%>id</th><th>info</th><th>items and obj</th></tr>";
49 foreach ($rows as $lock)
51 echo "<tr>";
52 echo "<td>$lock[id]</td>";
53 echo "<td>";
54 for ($i=0;$i<8;$i++)
56 $type = $lock['keytype_'.$i];
57 $key = $lock['key_'.$i];
58 $reqskill = $lock['reqskill_'.$i];
59 $unk = $lock['unk_'.$i];
60 if ($type == 0)
61 continue;
62 echo "&nbsp;&nbsp;";
63 if ($type == 1)
64 echo text_show_item($key, 0, 'cost').($reqskill?" ($reqskill)":"")." - $unk";
65 if ($type == 2)
66 echo getLockType($key).($reqskill?" ($reqskill)":"")." - $unk";
67 echo "<br>";
69 echo "</td>";
70 echo "<td align=center>";
71 $data0 = array(2,3,6,10,13);
72 $data1 = array(0, 1);
73 $items = $dDB->select("SELECT `entry`, `Quality`, `displayid`, `name` FROM `item_template` WHERE `lockid` = ?d", $lock['id']);
74 $go_list = $dDB->select("SELECT `entry`,`name` FROM `gameobject_template`
75 WHERE
76 (`type` IN (?a) AND `data0` = ?d) OR
77 (`type` IN (?a) AND `data1` = ?d)", $data0, $lock['id'], $data1, $lock['id']);
78 if ($items)
79 foreach ($items as $_item)
80 show_item($_item['entry'], $_item['displayid'], "sell");
81 if ($items) echo "<br>";
82 if ($go_list)
83 foreach ($go_list as $go)
85 localiseGameobject($go);
86 echo "<a href=\"?object=$go[entry]\">$go[name]</a><br>";
88 if ($items AND $go_list == 0)
89 echo "$lang['not_found']";
90 echo "</td>";
91 echo "</tr>";
93 echo "</tbody></table>";
96 //********************************************************************************
97 // Таблица race_class_info
98 //********************************************************************************
99 else
100 if ($debug == "race_class_info")
102 echo "<br><table class=report width = 800><tbody>";
103 echo "<tr><td colspan=8 class=head>skill_race_class_info</td></tr>";
104 echo "<tr>";
105 $skillraceclass = $wDB->select("SELECT * FROM `wowd_skill_race_class_info` order by classMask, id");
106 foreach ($skillraceclass as $info)
108 $skillLine = getSkillLine($info['skillId']);
109 if (empty($skillLine) or @$skillLine['Category']!=@$_REQUEST['cat']) continue;
111 echo "<tr>";
112 echo "<td>$info[Id]</td>";
113 if ($skillLine)
114 echo "<td>".$skillLine['Name']."-".$info['skillId']."</td>";
115 else
116 echo "<td>".$info['skillId']."</td>";
117 echo "<td>".getAllowableRace($info['raceMask'])."</td>";
118 echo "<td>".getAllowableClass($info['classMask'])."</td>";
119 echo "<td>$info[Unc_5]</td>";
120 echo "<td>$info[reqLevel]</td>";
121 echo "<td>$info[skillTiers]</td>";
122 echo "<td>$info[Unc_8]</td>";
123 echo "</tr>";
125 echo "</tbody></table>";
127 //********************************************************************************
128 // Таблица skill_line_ability
129 //********************************************************************************
130 else
131 if ($debug == "skill_line")
133 echo "<br><table class=report width = 500><tbody>";
134 echo "<tr><td colspan=12 class=head>skill_line_ability</td></tr>";
135 echo "<tr>";
136 $skillAbility = $wDB->select("
137 SELECT *
138 FROM `wowd_skill_line_ability`
139 ORDER BY `skillId`, min_value");
140 $current = -1;
141 $skillLine = 0;
142 foreach ($skillAbility as $skill)
144 $n=false;
145 if ($skill['skillId']!=$current)
147 $current = $skill['skillId'];
148 $skillLine = getSkillLine($current);
149 $n=true;
151 if ($skillLine['Category'] != 11) continue;
153 if ($n)
154 echo "<tr><td colspan=12 class=head>".$skillLine['Name']."(".$skillLine['Category'].")</td></tr>";
155 $spell = getSpell($skill['spellId'],"`id`, `SpellIconID`, `SpellName`, `Rank`");
156 if ($spell==0)
157 continue;
158 echo "<tr>";
159 // echo "<td width=1px>";show_spell($spell['id'], $spell['SpellIconID'], "spell");echo "</td>";
160 echo "<td>($skill[spellId])<a href=\"?q=s&entry=$spell[id]\">$spell[SpellName]</a>";
161 if ($spell['Rank'] != "") echo "<div class=srank>($spell[Rank])</div>";
162 echo "</td>";
163 echo "<td>";echo getAllowableRace($skill['RaceMask']);echo "</td>";
164 echo "<td>";echo getAllowableClass($skill['ClassMask']);echo "</td>";
165 echo "<td>".$skill['unk3']."</td>";
166 echo "<td>".$skill['unk4']."</td>";
167 echo "<td>".$skill['req_skill_value']."</td>";
168 if ($skill['forward_spellid'])
170 $spell = getSpell($skill['forward_spellid'],"`id`, `SpellIconID`, `SpellName`, `Rank`");
171 echo "<td><a href=\"?q=s&entry=$spell[id]\">$spell[SpellName]</a>";
172 if ($spell['Rank'] != "") echo "<div class=srank>($spell[Rank])</div>";
173 echo "</td>";
175 else
176 echo "<td></td>";
177 echo "<td>".$skill['LearnOnGetSkill']."</td>";
178 echo "<td>".$skill['min_value']."-".$skill['max_value']."</td>";
179 echo "<td>".$skill['unk6']."</td>";
180 echo "<td>".$skill['unk7']."</td>";
181 echo "<td>".$skill['reqtrainpoints']."</td>";
182 echo "</tr>";
184 echo "</tbody></table>";
186 //********************************************************************************
187 // Таблица Glyph Properties
188 //********************************************************************************
189 else
190 if ($debug == "glyph")
192 echo "<br><table class=report width = 500><tbody>";
193 echo "<tr><td colspan=12 class=head>GLUPH</td></tr>";
194 $glyphs = $wDB->select("SELECT * FROM `wowd_glyphproperties`");
195 foreach($glyphs as $glyph)
197 echo "<tr>";
198 echo "<td>$glyph[id]</td>";
199 echo "<td>".getSpellName(getSpell($glyph['SpellId']))."</td>";
200 echo "<td>$glyph[TypeFlags]</td>";
201 echo "<td>$glyph[Unk1]</td><td><img src=".getSpellIcon($glyph['Unk1'])." width=24></td>";
202 echo "</tr>";
204 echo "</tbody></table>";
206 //********************************************************************************
207 // Таблица Achievement
208 //********************************************************************************
209 else
210 if ($debug == "achievement")
212 echo "<br><table class=report width = 100%><tbody>";
213 echo "<tr><td colspan=13 class=head>Achievement</td></tr>";
214 $achievements = $wDB->select("
215 SELECT *
216 FROM `wowd_achievement`
217 WHERE refAchievement <> 0
218 ORDER BY categoryId, OrderInCategory");
219 foreach ($achievements as $a)
221 echo "<tr>";
222 echo "<td>$a[id]</td>";
223 echo "<td>$a[factionFlag]</td>";
224 echo "<td>$a[mapID]</td>";
225 echo "<td>".$wDB->selectCell("SELECT `description` FROM `wowd_achievement` WHERE `id` = ?d", $a['unk1'])."</td>";
226 echo "<td>$a[name]</td>";
227 echo "<td>$a[description]</td>";
228 echo "<td>$a[categoryId]</td>";
229 echo "<td>$a[points]</td>";
230 echo "<td>$a[OrderInCategory]</td>";
231 echo "<td>$a[flags]</td>";
232 echo "<td><img src=".getSpellIcon($a['iconId'])." width=24></td>";
233 echo "<td>$a[unk2]</td>";
234 echo "<td>$a[count]</td>";
235 echo "<td>".$wDB->selectCell("SELECT `description` FROM `wowd_achievement` WHERE `id` = ?d", $a['refAchievement'])."</td>";
236 echo "</tr>";
238 echo "</tbody></table>";
240 else
241 if ($debug == "chain")
243 $chain = $wDB->select(
244 "select
245 `wowd_skill_line_ability`.`id` AS `id`,
246 `wowd_spell`.`id` AS `SpellId`,
247 `wowd_spell`.`SpellName` AS `SpellName`,
248 `wowd_spell`.`Rank` AS `Rank`,
249 `wowd_skill_line_ability`.`forward_spellid` AS `forward_spellid`,
250 `wowd_spell`.`SpellIconID` AS `SpellIconID`,
251 `wowd_spell`.`baseLevel` AS `baseLevel`,
252 `wowd_spell`.`spellLevel` AS `spellLevel`,
253 `wowd_skill_line_ability`.`skillId` AS `skillId`,
254 `wowd_skill_line_ability`.`LearnOnGetSkill` AS `LearnOnGetSkill`
255 from
256 `wowd_skill_line_ability`
257 left join
258 `wowd_spell`
259 on `wowd_skill_line_ability`.`spellId` = `wowd_spell`.`id`
260 where
261 `baseLevel` > 0 AND
262 `Rank` LIKE '%Rank%' AND
263 (`runeCostID` = '0' OR `ManaCostPercentage` = '0' OR `manaCost` = '0')
264 ORDER BY `skillId`, `SpellName`, `baseLevel`, `Rank`"
266 $currentSkill = -1;
267 $currentSpell = -1;
269 $first = 0;
270 $prev = 0;
271 echo "<div class=faq>";
272 foreach ($chain as $c)
274 if ($c['skillId']!=$currentSkill)
276 $currentSkill = $c['skillId'];
277 echo "/* ------------------<br>";
278 echo "-- (".$currentSkill.") ".getSkillName($currentSkill,0)."<br>";
279 echo "-- --------------- */<br>";
281 if ($currentSpell != $c['SpellName'])
283 $currentSpell = $c['SpellName'];
284 echo "/* ".$currentSpell." */<br>";
285 $first = $c['SpellId'];
286 $prev = 0;
288 $rank = str_ireplace("Rank ", "", $c['Rank']);
289 echo "INSERT INTO `spell_chain` VALUES (";
290 echo str_pad("'".$c['SpellId']."'", 7, "_", STR_PAD_LEFT).", ";
291 echo str_pad("'".$prev."'", 7, "_", STR_PAD_LEFT).", ";
292 echo str_pad("'".$first."'", 7, "_", STR_PAD_LEFT).", ";
293 echo str_pad("'".$rank."'", 4, "_", STR_PAD_LEFT).", '0');<br>";
295 $prev = $c['SpellId'];
297 echo "</div>";
299 else
300 if ($debug == "summon")
302 echo "<br><table class=report width = 100%><tbody>";
303 echo "<tr><td colspan=13 class=head>Summon type</td></tr>";
304 $summons = $wDB->select("SELECT * FROM `wowd_summon_type` WHERE `unk2` <> 0 ORDER BY unk2");
305 foreach ($summons as $s)
307 echo "<tr>";
308 if ($s['unk2'])
309 $s['unk2'] = getFactionTemplateName($s['unk2']);
310 echo "<td>".$s['id']." - $s[unk1], $s[unk2], $s[unk3], $s[unk4], $s[unk5]</td>";
311 echo "</tr>";
312 echo "<tr>";
313 echo "<td>";
315 $rows = $wDB->select(
316 "SELECT `id`, `SpellIconID`, `SpellName`, `Rank` FROM `wowd_spell`
317 WHERE
318 ((`Effect_1` = '28' AND `EffectMiscValue2_1` = ".$s['id']." ) OR
319 (`Effect_2` = '28' AND `EffectMiscValue2_2` = ".$s['id']." ) OR
320 (`Effect_3` = '28' AND `EffectMiscValue2_3` = ".$s['id']." ))
321 -- AND SpellFamilyName > 2
322 LIMIT 0, 200");
323 foreach ($rows as $spell)
325 echo "(".$spell['id'].") <a href=?spell=".$spell['id']." onmouseover=\"ajaxTip('s$spell[id]');\">".$spell['SpellName']."</a><br>";
328 echo "</td>";
329 echo "</tr>";
331 echo "</tbody></table>";
333 else
334 if ($debug == "talent")
336 echo "<br><table class=report width = 100%><tbody>";
337 echo "<tr><td colspan=13 class=head>Talent</td></tr>";
338 // $talent = $wDB->select("SELECT * FROM `wowd_talents` WHERE `unkFlags1` <> 0 ORDER BY `TalentTab`, `Row`, `Col`");
339 $petId = 0;
340 $petMask1=0;
341 $petMask2=0;
342 if ($petId < 32) $petMask1=1<<($petId);
343 else $petMask2=1<<($petId-32);
344 $talent = $wDB->select(
345 "SELECT
347 FROM
348 `wowd_talents`
349 WHERE
350 `TalentTab` = ?d
352 ((`unkFlags1`=0 AND `unkFlags2`=0) OR (`unkFlags1`& ?d) OR (`unkFlags2`& ?d))", 411, $petMask1, $petMask2);
354 foreach ($talent as $t)
356 echo "<tr>";
357 echo "<td>";echo "$t[TalentTab], $t[Row], $t[Col]";echo "</td>";
358 echo "<td>";echo getSpellName(getSpell($t['Rank_1']));echo "</td>";
359 // echo "<td>";echo getSpellName(getSpell($t['Rank_2']));echo "</td>";
360 // echo "<td>";echo getSpellName(getSpell($t['Rank_3']));echo "</td>";
361 // echo "<td>";echo getSpellName(getSpell($t['Rank_4']));echo "</td>";
362 // echo "<td>";echo getSpellName(getSpell($t['Rank_5']));echo "</td>";
363 echo "<td>".getHunterPetList($t['unkFlags1'])."</td>";
364 echo "</tr>";
366 echo "</tbody></table>";