Локализация и другое.)
[cswow.git] / include / creature_table.php
blobc6551b9cc6ca79e1acffd2f8ec22de3dd3277169
1 <?php
3 define('UNIT_FLAG_UNKNOWN7', 0x00000001);
4 define('UNIT_FLAG_NON_ATTACKABLE', 0x00000002);
5 define('UNIT_FLAG_DISABLE_MOVE', 0x00000004);
6 define('UNIT_FLAG_PVP_ATTACKABLE', 0x00000008);
7 define('UNIT_FLAG_RENAME', 0x00000010);
8 define('UNIT_FLAG_RESTING', 0x00000020);
9 define('UNIT_FLAG_UNKNOWN9', 0x00000040);
10 define('UNIT_FLAG_NOT_ATTACKABLE_1', 0x00000080);
11 define('UNIT_FLAG_UNKNOWN2', 0x00000100);
12 define('UNIT_FLAG_UNKNOWN11', 0x00000200);
13 define('UNIT_FLAG_LOOTING', 0x00000400);
14 define('UNIT_FLAG_PET_IN_COMBAT', 0x00000800);
15 define('UNIT_FLAG_PVP', 0x00001000);
16 define('UNIT_FLAG_SILENCED', 0x00002000);
17 define('UNIT_FLAG_UNKNOWN4', 0x00004000);
18 define('UNIT_FLAG_UNKNOWN13', 0x00008000);
19 define('UNIT_FLAG_UNKNOWN14', 0x00010000);
20 define('UNIT_FLAG_PACIFIED', 0x00020000);
21 define('UNIT_FLAG_DISABLE_ROTATE', 0x00040000);
22 define('UNIT_FLAG_IN_COMBAT', 0x00080000);
23 define('UNIT_FLAG_TAXI_FLIGHT', 0x00100000);
24 define('UNIT_FLAG_DISARMED', 0x00200000);
25 define('UNIT_FLAG_CONFUSED', 0x00400000);
26 define('UNIT_FLAG_FLEEING', 0x00800000);
27 define('UNIT_FLAG_UNKNOWN5', 0x01000000);
28 define('UNIT_FLAG_NOT_SELECTABLE', 0x02000000);
29 define('UNIT_FLAG_SKINNABLE', 0x04000000);
30 define('UNIT_FLAG_MOUNT', 0x08000000);
31 define('UNIT_FLAG_UNKNOWN17', 0x10000000);
32 define('UNIT_FLAG_UNKNOWN6', 0x20000000);
33 define('UNIT_FLAG_SHEATHE', 0x40000000);
35 define('CREATURE_TYPEFLAGS_HERBLOOT', 0x00000100);
36 define('CREATURE_TYPEFLAGS_MININGLOOT', 0x00000200);
37 define('CREATURE_TYPEFLAGS_ENGINEERLOOT', 0x00008000);
39 define('UNIT_NPC_FLAG_NONE', 0x00000000);
40 define('UNIT_NPC_FLAG_GOSSIP', 0x00000001);
41 define('UNIT_NPC_FLAG_QUESTGIVER', 0x00000002);
42 define('UNIT_NPC_FLAG_UNK2', 0x00000004);
43 define('UNIT_NPC_FLAG_UNK3', 0x00000008);
44 define('UNIT_NPC_FLAG_TRAINER', 0x00000010);
45 define('UNIT_NPC_FLAG_TRAINER_CLASS', 0x00000020);
46 define('UNIT_NPC_FLAG_TRAINER_PROFESSION', 0x00000040);
47 define('UNIT_NPC_FLAG_VENDOR', 0x00000080);
48 define('UNIT_NPC_FLAG_VENDOR_AMMO', 0x00000100);
49 define('UNIT_NPC_FLAG_VENDOR_FOOD', 0x00000200);
50 define('UNIT_NPC_FLAG_VENDOR_POISON', 0x00000400);
51 define('UNIT_NPC_FLAG_VENDOR_REAGENT', 0x00000800);
52 define('UNIT_NPC_FLAG_REPAIR', 0x00001000);
53 define('UNIT_NPC_FLAG_FLIGHTMASTER', 0x00002000);
54 define('UNIT_NPC_FLAG_SPIRITHEALER', 0x00004000);
55 define('UNIT_NPC_FLAG_SPIRITGUIDE', 0x00008000);
56 define('UNIT_NPC_FLAG_INNKEEPER', 0x00010000);
57 define('UNIT_NPC_FLAG_BANKER', 0x00020000);
58 define('UNIT_NPC_FLAG_PETITIONER', 0x00040000);
59 define('UNIT_NPC_FLAG_TABARDDESIGNER', 0x00080000);
60 define('UNIT_NPC_FLAG_BATTLEMASTER', 0x00100000);
61 define('UNIT_NPC_FLAG_AUCTIONEER', 0x00200000);
62 define('UNIT_NPC_FLAG_STABLEMASTER', 0x00400000);
63 define('UNIT_NPC_FLAG_GUILD_BANKER', 0x00800000);
64 define('UNIT_NPC_FLAG_UNK24', 0x01000000);
65 define('UNIT_NPC_FLAG_UNK25', 0x02000000);
66 define('UNIT_NPC_FLAG_UNK26', 0x04000000);
67 define('UNIT_NPC_FLAG_UNK27', 0x08000000);
68 define('UNIT_NPC_FLAG_GUARD', 0x10000000);
69 define('UNIT_NPC_FLAG_UNK29', 0x20000000);
70 define('UNIT_NPC_FLAG_UNK30', 0x40000000);
71 define('UNIT_NPC_FLAG_UNK31', 0x80000000);
73 function noBorderCreatureTable($npc)
75 global $game_text;
76 $loyality= getLoyality($npc['faction_A']);
77 $type = $npc['type'];
78 $rank = $npc['rank'];
79 $family =$npc['family'];
80 $npcdmgmin = ROUND(($npc['mindmg']+$npc['attackpower'])*$npc['dmg_multiplier']);
81 $npcdmgmax = ROUND(($npc['maxdmg']+$npc['attackpower'])*$npc['dmg_multiplier']);
83 if ($npc['ScriptName']=="" && $npc['AIName']=="") {$npcscr='No script';}
84 else if ($npc['AIName']=="EventAI" && $npc['ScriptName']=="") {$npcscr='EventAI';}
85 else if ($npc['AIName']=="NullAI" && $npc['ScriptName']=="") {$npcscr='NullAI';}
86 else if ($npc['AIName']=="AggressorAI" && $npc['ScriptName']=="") {$npcscr='AggressorAI';}
87 else if ($npc['AIName']=="ReactorAI" && $npc['ScriptName']=="") {$npcscr='ReactorAI';}
88 else if ($npc['AIName']=="GuardAI" && $npc['ScriptName']=="") {$npcscr='GuardAI';}
89 else if ($npc['AIName']=="PetAI" && $npc['ScriptName']=="") {$npcscr='PetAI';}
90 else if ($npc['AIName']=="TotemAI" && $npc['ScriptName']=="") {$npcscr='TotemAI';}
91 else if ($npc['ScriptName']=="generic_creature") {$npcscr='Caster';}
92 else if ($npc['ScriptName']<>"" && $npc['AIName']=="EventAI") {$npcscr='EventAI + SD2';}
93 else {$npcscr='SD2';}
95 $npc['name'] = str_replace('(1)', '(difficulty_1)', $npc['name']);
96 $npc['name'] = str_replace('(2)', '(difficulty_2)', $npc['name']);
97 $npc['name'] = str_replace('(3)', '(difficulty_3)', $npc['name']);
99 echo "<TABLE class=creature cellSpacing=0>";
100 echo "<TBODY>";
101 echo "<TR><TD colSpan=2><b>$npc[name] ($loyality)</b>";
102 if ($npc['subname']!="")
103 echo "<br><FONT color=#008800 size=-3>&lt;$npc[subname]&gt;</FONT>";
104 echo "</td></tr>";
106 if ($rank)
107 echo "<td>".$game_text['npc_rank']."</td><td align=right>".getCreatureRank($rank)."</TD></TR>";
109 echo "<TR><TD>".$game_text['npc_type']."</TD><TD align=right>".getCreatureType($type)."</TD></TR>";
110 if ($npc['family']!=0)
111 echo "<TR><TD>".$game_text['npc_family']."</TD><TD align=right>".getCreatureFamily($family)."</TD></TR>";
113 echo "<TR><TD>".$game_text['npc_level']."</TD><TD align=right>$npc[maxlevel]</TD></TR>";
114 if ($npc['minhealth']==$npc['maxhealth'])
115 echo "<TR><TD>".$game_text['npc_health']."</TD><TD align=right>$npc[maxhealth]</TD></TR>";
116 else
117 echo "<TR><TD>".$game_text['npc_health']."</TD><TD align=right>$npc[minhealth]-$npc[maxhealth]</TD></TR>";
118 if ($npc['minmana']!=0)
120 if ($npc['minmana']!=$npc['maxmana'])
121 echo "<TR><TD>".$game_text['npc_mana']."</TD><TD align=right>$npc[minmana]-$npc[maxmana]</TD></TR>";
122 else
123 echo "<TR><TD>".$game_text['npc_mana']."</TD><TD align=right>$npc[minmana]</TD></TR>";
125 if ($npc['armor']!=0)
126 echo "<TR><TD>".$game_text['npc_armor']."</TD><TD align=right>$npc[armor]</TD></TR>";
128 echo "<TR><TD>".$game_text['npc_damage']."</TD><TD align=right>$npcdmgmin - $npcdmgmax</TD></TR>";
129 echo "<TR><TD>".$game_text['npc_ap']."</TD><TD align=right>$npc[attackpower]</TD></TR>";
130 $attackTime = $npc['baseattacktime']/1000;
131 echo "<TR><TD>".$game_text['npc_attack']."</TD><TD align=right>$attackTime сек</TD></TR>";
133 echo "<TR><TD>".$game_text['faction']."</TD><TD align=right>".getFactionTemplateName($npc['faction_A'])."</TD></TR>";
134 // echo "<TR><TD>Радиус аггро</TD><TD align=right>$npc[combat_reach]</TD></TR>";
135 // echo "<TR><TD>".$game_text['entry']."</TD><TD align=right>$npc[entry]</TD></TR>";
137 if ($npc['modelid_A']!=$npc['modelid_H'])
139 echo "<TR><TD>".$game_text['displayA']."</TD><TD align=right>$npc[modelid_A]</TD></TR>";
140 echo "<TR><TD>".$game_text['displayH']."</TD><TD align=right>$npc[modelid_H]</TD></TR>";
142 else
143 echo "<TR><TD>".$game_text['display']."</TD><TD align=right>$npc[modelid_A]</TD></TR>";
145 echo "<TR><TD>".$game_text['npc_script']."</TD><TD align=right>$npcscr</TD></TR>";
146 if ($npc['npcflag'])
147 echo "<TR><TD colspan=2>".getCreatureFlagsList($npc['npcflag'])."</TD></TR>";
149 // echo "<TR><TD colSpan=2 class=bottom>This is from MaNGOS database!</TD></TR>";
150 echo "</TBODY></TABLE>";
152 function generateCreatureTable($npc)
154 echo "<table class=border cellSpacing=0 cellPadding=0><tbody>";
155 echo "<tr><td class=btopl></td><td class=btop></td><td class=btopr></td></tr>";
156 echo "<tr><td class=bl></td><td class=bbody>";
157 noBorderCreatureTable($npc);
158 echo "</td><td class=br></td></tr>";
159 echo "<tr><td class=bbottoml></td><td class=bbottom></td><td class=bbottomr></td></tr>";
160 echo "</tbody></table>";