2 include_once("conf.php");
3 include_once("include/creature_table.php");
4 include_once("include/info_table_generator.php");
5 include_once("include/report_generator.php");
8 Скрипт показывает Creature по его $entry
11 - Каким спеллом может быть призыван
14 - Нужен для какого квеста
15 - В какую группу входит существо (kredit)
17 - Какие квесты принимает
19 - Лут который можно украсть у существа
20 - Лут шкурок с трупа существа
22 $entry = intval(@$_REQUEST['npc']);
23 $page = intval(@$_REQUEST['page']);
24 $mark = @$_REQUEST['mark'];
26 $cr=getCreature($entry);
29 RenderError("$lang[creature_not_found]");
33 $baseLink = '?npc='.$entry;
37 if ($lang['www_creature'])
38 echo "<a href=\"".sprintf($lang['www_creature'], $entry)."\" target=\"_blank\"\">".sprintf($lang['www_creature'], $entry)."</a><br>";
39 echo "<table cellspacing=0 cellpadding=0 width=500>";
42 echo "<td align=center>";generateCreatureTable($cr);echo "</td>";
44 echo "</tbody></table>";
46 if ($cr['mingold']) echo "<b>$lang[Rew_money]</b> ".money($cr['mingold']);
47 if (($cr['maxgold']) && ($cr['maxgold']>$cr['mingold'])) echo " - ".money($cr['maxgold']);
48 if ($cr['mingold']) echo "<br>";
49 $heroic=getHeroicList();
50 $heroic1=getHeroicList1();
51 $heroic2=getHeroicList2();
52 $hentry=isset($heroic[$entry])?
$heroic[$entry]:$entry;
53 $hentry1=isset($heroic1[$entry])?
$heroic1[$entry]:$entry;
54 $hentry2=isset($heroic2[$entry])?
$heroic2[$entry]:$entry;
56 echo "<a href=\"?map&npc=$hentry2\">$lang[show_map] (".getCreatureCount($hentry2).")</a><br>";
59 echo "<a href=\"?map&npc=$hentry1\">$lang[show_map] (".getCreatureCount($hentry1).")</a><br>";
62 echo "<a href=\"?map&npc=$hentry\">$lang[show_map] (".getCreatureCount($hentry).")</a><br>";
64 if ($config['show_npc_detalis'])
66 echo "<br><table class=details width=600>";
68 echo "<tr><td colspan=4 class=head>$lang[detail_info]</td></tr>";
69 echo "<tr><th>entry</th><td>".$cr['entry']."</td><th>difficulty_entry_1</th><td>".$cr['difficulty_entry_1']."</td></tr>";
70 echo "<tr><th>difficulty_entry_2</th><td>".$cr['difficulty_entry_2']."</td><th>difficulty_entry_3</th><td>".$cr['difficulty_entry_3']."</td></tr>";
71 echo "<tr><th>modelid_1</th><td>".$cr['modelid_1']."</td><th>modelid_3</th><td>".$cr['modelid_3']."</td></tr>";
72 echo "<tr><th>modelid_2</th><td>".$cr['modelid_2']."</td><th>modelid_4</th><td>".$cr['modelid_4']."</td></tr>";
73 echo "<tr><th>name</th><td>".$cr['name']."<br><div class=subname>".$cr['subname']."</div></td>";
74 echo "<th>IconName</th><td>".$cr['IconName']."</td></tr>";
75 echo "<tr><th>level</th><td>".$cr['minlevel']." - ".$cr['maxlevel']."</td>";
76 echo "<th>armor</th><td>".$cr['armor']."</td></tr>";
77 echo "<tr><th>health</th><td>".$cr['minhealth']." - ".$cr['maxhealth']."</td>";
78 echo "<th>mana</th><td>".$cr['minmana']." - ".$cr['maxmana']."</td></tr>";
79 echo "<tr><th>faction_A</th><td>".$cr['faction_A']."</td><th>faction_H</th><td>".$cr['faction_H']."</td></tr>";
80 echo "<tr><th>npcflag</th><td>".$cr['npcflag']."</td><th>gossip_menu_id</th><td>".$cr['gossip_menu_id']."</td></tr>";
81 echo "<tr><th>speed_walk</th><td>".$cr['speed_walk']."</td><th>speed_run</th><td>".$cr['speed_run']."</td></tr>";
82 echo "<tr><th>scale</th><td>".$cr['scale']."</td><th>rank</th><td>".$cr['rank']."</td></tr>";
83 echo "<tr><th>mindmg</th><td>".$cr['mindmg']."</td><th>maxdmg</th><td>".$cr['maxdmg']."</td></tr>";
84 echo "<tr><th>dmgschool</th><td>".$cr['dmgschool']."</td><th>dmg_multiplier</th><td>".$cr['dmg_multiplier']."</td></tr>";
85 echo "<tr><th>attackpower</th><td>".$cr['attackpower']."</td><th>rangedattackpower</th><td>".$cr['rangedattackpower']."</td></tr>";
86 echo "<tr><th>baseattacktime</th><td>".$cr['baseattacktime']."</td><th>rangeattacktime</th><td>".$cr['rangeattacktime']."</td></tr>";
87 echo "<tr><th>unit_flags</th><td>".$cr['unit_flags']."</td><th>dynamicflags</th><td>".$cr['dynamicflags']."</td></tr>";
88 echo "<tr><th>unit_class</th><td>".$cr['unit_class']."</td><th>family</th><td>".$cr['family']."</td></tr>";
89 echo "<tr><th>trainer_type</th><td>".$cr['trainer_type']."</td><th>trainer_spell</th><td>".$cr['trainer_spell']."</td></tr>";
90 echo "<tr><th>trainer_class</th><td>".$cr['trainer_class']."</td><th>trainer_race</th><td>".$cr['trainer_race']."</td></tr>";
91 echo "<tr><th>minrangedmg</th><td>".$cr['minrangedmg']."</td><th>maxrangedmg</th><td>".$cr['maxrangedmg']."</td></tr>";
92 echo "<tr><th>type</th><td>".$cr['type']."</td><th>type_flags</th><td>".$cr['type_flags']."</td></tr>";
93 echo "<tr><th>lootid</th><td>".$cr['lootid']."</td></tr>";
94 echo "<tr><th>pickpocketloot</th><td>".$cr['pickpocketloot']."</td></tr>";
95 echo "<tr><th>skinloot</th><td>".$cr['skinloot']."</td></tr>";
96 echo "<tr><th>resistance1</th><td>".$cr['resistance1']."</td><th>resistance2</th><td>".$cr['resistance2']."</td></tr>";
97 echo "<tr><th>resistance3</th><td>".$cr['resistance3']."</td><th>resistance4</th><td>".$cr['resistance4']."</td></tr>";
98 echo "<tr><th>resistance5</th><td>".$cr['resistance5']."</td><th>resistance6</th><td>".$cr['resistance6']."</td></tr>";
99 echo "<tr><th>PetSpellDataId</th><td>".$cr['PetSpellDataId']."</td></tr>";
100 echo "<tr><th>mingold</th><td>".$cr['mingold']."</td><th>maxgold</th><td>".$cr['maxgold']."</td></tr>";
101 echo "<tr><th>MovementType</th><td>".$cr['MovementType']."</td><th>InhabitType</th><td>".$cr['InhabitType']."</td></tr>";
102 echo "<tr><th>RacialLeader</th><td>".$cr['RacialLeader']."</td><th>RegenHealth</th><td>".$cr['RegenHealth']."</td></tr>";
103 echo "<tr><th>equipment_id</th><td>".$cr['equipment_id']."</td></tr>";
104 echo "<tr><th>mechanic_immune_mask</th><td>".$cr['mechanic_immune_mask']."</td></tr>";
105 echo "<tr><th>flags_extra</th><td>".$cr['flags_extra']."</td></tr>";
106 echo "<tr><th>AIName</th><td>".$cr['AIName']."</td><th>ScriptName</th><td>".$cr['ScriptName']."</td></tr>";
107 echo "</tbody></table>";
111 //==========================================================
112 if ($config['show_3d_model_npc']) // Вывод 3D модели НПС
114 echo '<br><span><div align="center" style="margin-bottom:1px;font-size:11px;"> ';
115 echo '<input type="button" value="+" style="width:20px;font-size:9px;margin:0px;padding:0px;" ';
116 echo " onClick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') ";
117 echo "{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; ";
118 echo " this.innerText = ''; ";
119 echo " this.value = '-'; } ";
120 echo " else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; ";
121 echo " this.innerText = ''; ";
122 echo " this.value = '+'; }\"> <b>$lang[view3dnpc]</b></div>";
123 echo '<div class="alt2" style="margin: 0px; padding: 0px; border: 0px inset;">';
124 echo '<div style="display: none;">';
126 if ($cr['modelid_1'])
128 echo '<span><div align="center" style="margin-bottom:1px;font-size:11px;"> ';
129 echo '<input type="button" value="+" style="width:20px;font-size:9px;margin:0px;padding:0px;" ';
130 echo " onClick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') ";
131 echo "{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; ";
132 echo " this.innerText = ''; ";
133 echo " this.value = '-'; } ";
134 echo " else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; ";
135 echo " this.innerText = ''; ";
136 echo " this.value = '+'; }\"> <b>$game_text[display1] ($cr[modelid_1])</b></div>";
137 echo '<div class="alt2" style="margin: 0px; padding: 0px; border: 0px inset;">';
138 echo '<div style="display: none;">';
139 switch ($cr['type']):
142 echo "<object data='http://static.wowhead.com/modelviewer/ModelView.swf' type='application/x-shockwave-flash' height='400' width='600'>
143 <param value='high' name='quality'>
144 <param value='always' name='allowscriptaccess'>
145 <param value='false' name='menu'>
146 <param name='wmode' value='transparent'>
147 <param value='model=$cr[modelid_1]&modelType=32&contentPath=http://static.wowhead.com/modelviewer/&blur=1' name='flashvars'>
151 echo "<object data='http://static.wowhead.com/modelviewer/ModelView.swf' type='application/x-shockwave-flash' height='400' width='600'>
152 <param value='high' name='quality'>
153 <param value='always' name='allowscriptaccess'>
154 <param value='false' name='menu'>
155 <param name='wmode' value='transparent'>
156 <param value='model=$cr[modelid_1]&modelType=8&contentPath=http://static.wowhead.com/modelviewer/&blur=1' name='flashvars'>
159 echo "</div></div></span>";
161 if ($cr['modelid_2'])
163 echo '<span><div align="center" style="margin-bottom:1px;font-size:11px;"> ';
164 echo '<input type="button" value="+" style="width:20px;font-size:9px;margin:0px;padding:0px;" ';
165 echo " onClick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') ";
166 echo "{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; ";
167 echo " this.innerText = ''; ";
168 echo " this.value = '-'; } ";
169 echo " else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; ";
170 echo " this.innerText = ''; ";
171 echo " this.value = '+'; }\"> <b>$game_text[display2] ($cr[modelid_2])</b></div>";
172 echo '<div class="alt2" style="margin: 0px; padding: 0px; border: 0px inset;">';
173 echo '<div style="display: none;">';
174 switch ($cr['type']):
177 echo "<object data='http://static.wowhead.com/modelviewer/ModelView.swf' type='application/x-shockwave-flash' height='400' width='600'>
178 <param value='high' name='quality'>
179 <param value='always' name='allowscriptaccess'>
180 <param value='false' name='menu'>
181 <param name='wmode' value='transparent'>
182 <param value='model=$cr[modelid_2]&modelType=32&contentPath=http://static.wowhead.com/modelviewer/&blur=1' name='flashvars'>
186 echo "<object data='http://static.wowhead.com/modelviewer/ModelView.swf' type='application/x-shockwave-flash' height='400' width='600'>
187 <param value='high' name='quality'>
188 <param value='always' name='allowscriptaccess'>
189 <param value='false' name='menu'>
190 <param name='wmode' value='transparent'>
191 <param value='model=$cr[modelid_2]&modelType=8&contentPath=http://static.wowhead.com/modelviewer/&blur=1' name='flashvars'>
194 echo "</div></div></span>";
196 if ($cr['modelid_3'])
198 echo '<span><div align="center" style="margin-bottom:1px;font-size:11px;"> ';
199 echo '<input type="button" value="+" style="width:20px;font-size:9px;margin:0px;padding:0px;" ';
200 echo " onClick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') ";
201 echo "{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; ";
202 echo " this.innerText = ''; ";
203 echo " this.value = '-'; } ";
204 echo " else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; ";
205 echo " this.innerText = ''; ";
206 echo " this.value = '+'; }\"> <b>$game_text[display3] ($cr[modelid_3])</b></div>";
207 echo '<div class="alt2" style="margin: 0px; padding: 0px; border: 0px inset;">';
208 echo '<div style="display: none;">';
209 switch ($cr['type']):
212 echo "<object data='http://static.wowhead.com/modelviewer/ModelView.swf' type='application/x-shockwave-flash' height='400' width='600'>
213 <param value='high' name='quality'>
214 <param value='always' name='allowscriptaccess'>
215 <param value='false' name='menu'>
216 <param name='wmode' value='transparent'>
217 <param value='model=$cr[modelid_3]&modelType=32&contentPath=http://static.wowhead.com/modelviewer/&blur=1' name='flashvars'>
221 echo "<object data='http://static.wowhead.com/modelviewer/ModelView.swf' type='application/x-shockwave-flash' height='400' width='600'>
222 <param value='high' name='quality'>
223 <param value='always' name='allowscriptaccess'>
224 <param value='false' name='menu'>
225 <param name='wmode' value='transparent'>
226 <param value='model=$cr[modelid_3]&modelType=8&contentPath=http://static.wowhead.com/modelviewer/&blur=1' name='flashvars'>
229 echo "</div></div></span>";
231 if ($cr['modelid_4'])
233 echo '<span><div align="center" style="margin-bottom:1px;font-size:11px;"> ';
234 echo '<input type="button" value="+" style="width:20px;font-size:9px;margin:0px;padding:0px;" ';
235 echo " onClick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') ";
236 echo "{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; ";
237 echo " this.innerText = ''; ";
238 echo " this.value = '-'; } ";
239 echo " else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; ";
240 echo " this.innerText = ''; ";
241 echo " this.value = '+'; }\"> <b>$game_text[display4] ($cr[modelid_4])</b></div>";
242 echo '<div class="alt2" style="margin: 0px; padding: 0px; border: 0px inset;">';
243 echo '<div style="display: none;">';
244 switch ($cr['type']):
247 echo "<object data='http://static.wowhead.com/modelviewer/ModelView.swf' type='application/x-shockwave-flash' height='400' width='600'>
248 <param value='high' name='quality'>
249 <param value='always' name='allowscriptaccess'>
250 <param value='false' name='menu'>
251 <param name='wmode' value='transparent'>
252 <param value='model=$cr[modelid_4]&modelType=32&contentPath=http://static.wowhead.com/modelviewer/&blur=1' name='flashvars'>
256 echo "<object data='http://static.wowhead.com/modelviewer/ModelView.swf' type='application/x-shockwave-flash' height='400' width='600'>
257 <param value='high' name='quality'>
258 <param value='always' name='allowscriptaccess'>
259 <param value='false' name='menu'>
260 <param name='wmode' value='transparent'>
261 <param value='model=$cr[modelid_4]&modelType=8&contentPath=http://static.wowhead.com/modelviewer/&blur=1' name='flashvars'>
264 echo "</div></div></span>";
266 echo "</div></div></span>";
271 //********************************************************************************
273 //********************************************************************************
274 $summoned_by =& new SpellReportGenerator
;
275 $fields = array('SPELL_REPORT_ICON','SPELL_REPORT_NAME');
276 if ($summoned_by->Init($fields, $baseLink, 'summonLIST', $config['fade_limit'], 'name'))
278 $summoned_by->summonCreature($entry);
279 $summoned_by->createReport($lang['summoned_by_spell']);
281 //********************************************************************************
283 //********************************************************************************
284 $cast_spell =& new SpellReportGenerator
;
285 $fields = array('SPELL_REPORT_ICON','SPELL_REPORT_NAME');
286 if ($cast_spell->Init($fields, $baseLink, 'castLIST', $config['fade_limit'], 'name'))
288 $cast_spell->castByCreature($cr);
289 $cast_spell->createReport($lang['cast_spells']);
291 //**************************************************
293 //**************************************************
294 if ($cr['npcflag']&(UNIT_NPC_FLAG_VENDOR|UNIT_NPC_FLAG_VENDOR_AMMO|UNIT_NPC_FLAG_VENDOR_FOOD|UNIT_NPC_FLAG_VENDOR_POISON|UNIT_NPC_FLAG_VENDOR_REAGENT
))
296 $sold =& new ItemReportGenerator('vendor');
297 $fields = array('ITEM_REPORT_ICON','ITEM_REPORT_NAME', 'VENDOR_REPORT_COST', 'VENDOR_REPORT_COUNT', 'VENDOR_REPORT_INCTIME');
298 if ($sold->Init($fields, $baseLink, 'vendorLIST', $config['fade_limit'], 'name'))
300 $sold->vendorItemList($entry);
301 $sold->createReport($lang['sold']);
304 //**************************************************
306 //**************************************************
307 if ($cr['npcflag']&(UNIT_NPC_FLAG_TRAINER|UNIT_NPC_FLAG_TRAINER_CLASS|UNIT_NPC_FLAG_TRAINER_PROFESSION
))
309 $train =& new NPCTrainerReportGenerator();
310 $fields = array('TRAIN_REPORT_LEVEL','TRAIN_REPORT_ICON', 'TRAIN_REPORT_NAME', 'TRAIN_REPORT_SKILL', 'TRAIN_REPORT_VALUE', 'TRAIN_REPORT_COST');
311 if ($train->Init($fields, $baseLink, 'trainLIST', $config['fade_limit'], 'level'))
313 $train->trainSpell($entry);
314 $train->createReport($lang['train']);
317 //********************************************************************************
318 // Required for quest list
319 //********************************************************************************
320 $reqForQuest =& new QuestReportGenerator();
321 $fields = array('QUEST_REPORT_LEVEL', 'QUEST_REPORT_NAME', 'QUEST_REPORT_GIVER', 'QUEST_REPORT_REWARD');
322 if ($reqForQuest->Init($fields, $baseLink, 'qreqLIST', $config['fade_limit'], 'name'))
324 $reqForQuest->requireCreature($entry);
325 $reqForQuest->createReport($lang['req_for_quest']);
327 //********************************************************************************
329 //********************************************************************************
330 $kredit =& new CreatureReportGenerator();
331 $fields = array('NPC_REPORT_LEVEL', 'NPC_REPORT_RNAME', 'NPC_REPORT_MAP');
332 if ($kredit->Init($fields, $baseLink, 'r_creatureLIST', $config['fade_limit'], 'name'))
334 $kredit->kreditGroup($entry);
335 $kredit->createReport($lang['kill_kredit_group']);
337 //**************************************************
339 //**************************************************
340 if ($cr['npcflag']&(UNIT_NPC_FLAG_QUESTGIVER
))
342 $giveQuest =& new QuestReportGenerator('npc_giver');
343 $fields = array('QUEST_REPORT_LEVEL', 'QUEST_REPORT_NAME', 'QUEST_REPORT_REWARD');
344 if ($giveQuest->Init($fields, $baseLink, 'qgLIST', $config['fade_limit'], 'name'))
346 $giveQuest->getGiveTakeList($entry);
347 $giveQuest->createReport($lang['give_quest']);
350 //**************************************************
352 //**************************************************
353 if ($cr['npcflag']&(UNIT_NPC_FLAG_QUESTGIVER
))
355 $takeQuest =& new QuestReportGenerator('npc_take');
356 $fields = array('QUEST_REPORT_LEVEL', 'QUEST_REPORT_NAME', 'QUEST_REPORT_REWARD');
357 if ($takeQuest->Init($fields, $baseLink, 'qtLIST', $config['fade_limit'], 'name'))
359 $takeQuest->getGiveTakeList($entry);
360 $takeQuest->createReport($lang['take_quest']);
364 //**************************************************
366 //**************************************************
372 $loot =& new LootReportGenerator('creature_loot');
373 if ($loot->Init($fields, $baseLink, 'lootLIST', $config['fade_limit'], ''))
375 $loot->getLootList($cr['lootid']);
376 $loot->createReport($lang['can_loot']);
378 $page_seek = init_pagePerMark($mark, "lootLIST", $page);
379 $rows = getLootList($cr['lootid'], "creature_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
380 renderLootTableList($rows, $lang['can_loot'], $page_seek, $totalRecords, $baseLink, "lootLIST");
383 //**************************************************
385 //**************************************************
388 if ($cr['pickpocketloot'])
390 $page_seek = init_pagePerMark($mark, "pickpocketLIST", $page);
391 $rows = getLootList($cr['pickpocketloot'], "pickpocketing_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
392 renderLootTableList($rows, $lang['can_pickpocketing'], $page_seek, $totalRecords, $baseLink, "pickpocketLIST");
395 //**************************************************
397 //**************************************************
402 $page_seek = init_pagePerMark($mark, "skinLIST", $page);
403 $rows = getLootList($cr['skinloot'], "skinning_loot_template", $totalRecords, $page_seek, $config['fade_limit']);
404 if ($cr['type_flags'] & CREATURE_TYPEFLAGS_HERBLOOT
)
405 renderLootTableList($rows, $lang['give_herb'], $page_seek, $totalRecords, $baseLink, "skinLIST");
406 else if ($cr['type_flags'] & CREATURE_TYPEFLAGS_MININGLOOT
)
407 renderLootTableList($rows, $lang['give_mining'], $page_seek, $totalRecords, $baseLink, "skinLIST");
408 else if ($cr['type_flags'] & CREATURE_TYPEFLAGS_ENGINEERLOOT
)
409 renderLootTableList($rows, $lang['give_engineer'], $page_seek, $totalRecords, $baseLink, "skinLIST");
411 renderLootTableList($rows, $lang['give_skin'], $page_seek, $totalRecords, $baseLink, "skinLIST");
414 //**************************************************
416 //**************************************************
417 $r_knpc =& new CreatureReportGenerator('reputation');
418 $fields = array('ONKILL_REPUTATION');
419 if ($r_knpc->Init($fields, $baseLink, 'r_ccreatureLIST', $config['fade_limit'], 'rep'))
421 $r_knpc->rewardNpcFactionReputation($entry);
422 $r_knpc->createReport($lang['faction_kill_rew']);