1 | /* |
---|
2 | * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> |
---|
3 | * |
---|
4 | * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/> |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or modify |
---|
7 | * it under the terms of the GNU General Public License as published by |
---|
8 | * the Free Software Foundation; either version 2 of the License, or |
---|
9 | * (at your option) any later version. |
---|
10 | * |
---|
11 | * This program is distributed in the hope that it will be useful, |
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | * GNU General Public License for more details. |
---|
15 | * |
---|
16 | * You should have received a copy of the GNU General Public License |
---|
17 | * along with this program; if not, write to the Free Software |
---|
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef DBCSTRUCTURE_H |
---|
22 | #define DBCSTRUCTURE_H |
---|
23 | |
---|
24 | #include "Platform/Define.h" |
---|
25 | |
---|
26 | #include <map> |
---|
27 | #include <set> |
---|
28 | #include <vector> |
---|
29 | |
---|
30 | // Structures using to access raw DBC data and required packing to portability |
---|
31 | |
---|
32 | // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform |
---|
33 | #if defined( __GNUC__ ) |
---|
34 | #pragma pack(1) |
---|
35 | #else |
---|
36 | #pragma pack(push,1) |
---|
37 | #endif |
---|
38 | |
---|
39 | enum AreaTeams |
---|
40 | { |
---|
41 | AREATEAM_NONE = 0, |
---|
42 | AREATEAM_ALLY = 2, |
---|
43 | AREATEAM_HORDE = 4 |
---|
44 | }; |
---|
45 | |
---|
46 | enum AreaFlags |
---|
47 | { |
---|
48 | AREA_FLAG_SNOW = 0x00000001, // snow (only Dun Morogh, Naxxramas, Razorfen Downs and Winterspring) |
---|
49 | AREA_FLAG_UNK1 = 0x00000002, // unknown, (only Naxxramas and Razorfen Downs) |
---|
50 | AREA_FLAG_UNK2 = 0x00000004, // Only used on development map |
---|
51 | AREA_FLAG_SLAVE_CAPITAL = 0x00000008, // slave capital city flag? |
---|
52 | AREA_FLAG_UNK3 = 0x00000010, // unknown |
---|
53 | AREA_FLAG_SLAVE_CAPITAL2 = 0x00000020, // slave capital city flag? |
---|
54 | AREA_FLAG_UNK4 = 0x00000040, // many zones have this flag |
---|
55 | AREA_FLAG_ARENA = 0x00000080, // arena, both instanced and world arenas |
---|
56 | AREA_FLAG_CAPITAL = 0x00000100, // main capital city flag |
---|
57 | AREA_FLAG_CITY = 0x00000200, // only for one zone named "City" (where it located?) |
---|
58 | AREA_FLAG_OUTLAND = 0x00000400, // outland zones? (only Eye of the Storm not have this flag, but have 0x00004000 flag) |
---|
59 | AREA_FLAG_SANCTUARY = 0x00000800, // sanctuary area (PvP disabled) |
---|
60 | AREA_FLAG_NEED_FLY = 0x00001000, // only Netherwing Ledge, Socrethar's Seat, Tempest Keep, The Arcatraz, The Botanica, The Mechanar, Sorrow Wing Point, Dragonspine Ridge, Netherwing Mines, Dragonmaw Base Camp, Dragonmaw Skyway |
---|
61 | AREA_FLAG_UNUSED1 = 0x00002000, // not used now (no area/zones with this flag set in 2.4.2) |
---|
62 | AREA_FLAG_OUTLAND2 = 0x00004000, // outland zones? (only Circle of Blood Arena not have this flag, but have 0x00000400 flag) |
---|
63 | AREA_FLAG_PVP = 0x00008000, // pvp objective area? (Death's Door also has this flag although it's no pvp object area) |
---|
64 | AREA_FLAG_ARENA_INSTANCE = 0x00010000, // used by instanced arenas only |
---|
65 | AREA_FLAG_UNUSED2 = 0x00020000, // not used now (no area/zones with this flag set in 2.4.2) |
---|
66 | AREA_FLAG_UNK5 = 0x00040000, // just used for Amani Pass, Hatchet Hills |
---|
67 | AREA_FLAG_LOWLEVEL = 0x00100000 // used for some starting areas with area_level <=15 |
---|
68 | }; |
---|
69 | |
---|
70 | enum FactionTemplateFlags |
---|
71 | { |
---|
72 | FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats |
---|
73 | }; |
---|
74 | |
---|
75 | struct AreaTableEntry |
---|
76 | { |
---|
77 | uint32 ID; // 0 |
---|
78 | uint32 mapid; // 1 |
---|
79 | uint32 zone; // 2 if 0 then it's zone, else it's zone id of this area |
---|
80 | uint32 exploreFlag; // 3, main index |
---|
81 | uint32 flags; // 4, unknown value but 312 for all cities |
---|
82 | // 5-9 unused |
---|
83 | int32 area_level; // 10 |
---|
84 | char* area_name[16]; // 11-26 |
---|
85 | // 27, string flags, unused |
---|
86 | uint32 team; // 28 |
---|
87 | }; |
---|
88 | |
---|
89 | struct AreaTriggerEntry |
---|
90 | { |
---|
91 | uint32 id; // 0 |
---|
92 | uint32 mapid; // 1 |
---|
93 | float x; // 2 |
---|
94 | float y; // 3 |
---|
95 | float z; // 4 |
---|
96 | float radius; // 5 |
---|
97 | float box_x; // 6 extent x edge |
---|
98 | float box_y; // 7 extent y edge |
---|
99 | float box_z; // 8 extent z edge |
---|
100 | float box_orientation; // 9 extent rotation by about z axis |
---|
101 | }; |
---|
102 | |
---|
103 | struct BankBagSlotPricesEntry |
---|
104 | { |
---|
105 | uint32 ID; |
---|
106 | uint32 price; |
---|
107 | }; |
---|
108 | |
---|
109 | struct BattlemasterListEntry |
---|
110 | { |
---|
111 | uint32 id; // 0 |
---|
112 | uint32 mapid[3]; // 1-3 mapid |
---|
113 | // 4-8 unused |
---|
114 | uint32 type; // 9 (3 - BG, 4 - arena) |
---|
115 | uint32 minlvl; // 10 |
---|
116 | uint32 maxlvl; // 11 |
---|
117 | uint32 maxplayersperteam; // 12 |
---|
118 | // 13-14 unused |
---|
119 | char* name[16]; // 15-30 |
---|
120 | // 31 string flag, unused |
---|
121 | // 32 unused |
---|
122 | }; |
---|
123 | |
---|
124 | struct CharTitlesEntry |
---|
125 | { |
---|
126 | uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId() |
---|
127 | //uint32 unk1; // 1 flags? |
---|
128 | //char* name[16]; // 2-17, unused |
---|
129 | // 18 string flag, unused |
---|
130 | //char* name2[16]; // 19-34, unused |
---|
131 | // 35 string flag, unused |
---|
132 | uint32 bit_index; // 36 used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES |
---|
133 | }; |
---|
134 | |
---|
135 | struct ChatChannelsEntry |
---|
136 | { |
---|
137 | uint32 ChannelID; // 0 |
---|
138 | uint32 flags; // 1 |
---|
139 | char* pattern[16]; // 3-18 |
---|
140 | // 19 string flags, unused |
---|
141 | //char* name[16]; // 20-35 unused |
---|
142 | // 36 string flag, unused |
---|
143 | }; |
---|
144 | |
---|
145 | struct ChrClassesEntry |
---|
146 | { |
---|
147 | uint32 ClassID; // 0 |
---|
148 | // 1-2, unused |
---|
149 | uint32 powerType; // 3 |
---|
150 | // 4, unused |
---|
151 | //char* name[16]; // 5-20 unused |
---|
152 | char* name[16]; // 5-20 unused |
---|
153 | // 21 string flag, unused |
---|
154 | //char* string1[16]; // 21-36 unused |
---|
155 | // 37 string flag, unused |
---|
156 | //char* string2[16]; // 38-53 unused |
---|
157 | // 54 string flag, unused |
---|
158 | // 55, unused |
---|
159 | uint32 spellfamily; // 56 |
---|
160 | // 57, unused |
---|
161 | }; |
---|
162 | |
---|
163 | struct ChrRacesEntry |
---|
164 | { |
---|
165 | uint32 RaceID; // 0 |
---|
166 | // 1 unused |
---|
167 | uint32 FactionID; // 2 facton template id |
---|
168 | // 3 unused |
---|
169 | uint32 model_m; // 4 |
---|
170 | uint32 model_f; // 5 |
---|
171 | // 6-7 unused |
---|
172 | uint32 TeamID; // 8 (7-Alliance 1-Horde) |
---|
173 | // 9-12 unused |
---|
174 | uint32 startmovie; // 13 id from CinematicCamera.dbc |
---|
175 | char* name[16]; // 14-29 used for DBC language detection/selection |
---|
176 | // 30 string flags, unused |
---|
177 | //char* string1[16]; // 31-46 used for DBC language detection/selection |
---|
178 | // 47 string flags, unused |
---|
179 | //char* string2[16]; // 48-63 used for DBC language detection/selection |
---|
180 | // 64 string flags, unused |
---|
181 | // 65-67 unused |
---|
182 | //uint32 addon // 68 (0 - original race, 1 - tbc addon, ...) unused |
---|
183 | }; |
---|
184 | |
---|
185 | struct CreatureDisplayInfoEntry |
---|
186 | { |
---|
187 | uint32 Displayid; // 0 |
---|
188 | // 1-3,unused |
---|
189 | float scale; // 4 |
---|
190 | // 5-13,unused |
---|
191 | }; |
---|
192 | |
---|
193 | struct CreatureFamilyEntry |
---|
194 | { |
---|
195 | uint32 ID; // 0 |
---|
196 | float minScale; // 1 |
---|
197 | uint32 minScaleLevel; // 2 0/1 |
---|
198 | float maxScale; // 3 |
---|
199 | uint32 maxScaleLevel; // 4 0/60 |
---|
200 | uint32 skillLine; // 5 |
---|
201 | uint32 skillLine2; // 6 |
---|
202 | uint32 petFoodMask; // 7 |
---|
203 | char* Name[16]; // 8-23 |
---|
204 | // 24 string flags, unused |
---|
205 | // 25 icon, unused |
---|
206 | }; |
---|
207 | |
---|
208 | struct CreatureSpellDataEntry |
---|
209 | { |
---|
210 | uint32 ID; // 0 |
---|
211 | //uint32 spellId[4]; // 1-4 hunter pet learned spell (for later use) |
---|
212 | }; |
---|
213 | |
---|
214 | struct DurabilityCostsEntry |
---|
215 | { |
---|
216 | uint32 Itemlvl; // 0 |
---|
217 | uint32 multiplier[29]; // 1-29 |
---|
218 | }; |
---|
219 | |
---|
220 | struct DurabilityQualityEntry |
---|
221 | { |
---|
222 | uint32 Id; // 0 |
---|
223 | float quality_mod; // 1 |
---|
224 | }; |
---|
225 | |
---|
226 | struct EmotesTextEntry |
---|
227 | { |
---|
228 | uint32 Id; |
---|
229 | uint32 textid; |
---|
230 | }; |
---|
231 | |
---|
232 | struct FactionEntry |
---|
233 | { |
---|
234 | uint32 ID; // 0 |
---|
235 | int32 reputationListID; // 1 |
---|
236 | uint32 BaseRepRaceMask[4]; // 2-5 Base reputation race masks (see enum Races) |
---|
237 | uint32 BaseRepClassMask[4]; // 6-9 Base reputation class masks (see enum Classes) |
---|
238 | int32 BaseRepValue[4]; // 10-13 Base reputation values |
---|
239 | uint32 ReputationFlags[4]; // 14-17 Default flags to apply |
---|
240 | uint32 team; // 18 enum Team |
---|
241 | char* name[16]; // 19-34 |
---|
242 | // 35 string flags, unused |
---|
243 | //char* description[16]; // 36-51 unused |
---|
244 | // 52 string flags, unused |
---|
245 | }; |
---|
246 | |
---|
247 | enum FactionMasks |
---|
248 | { |
---|
249 | FACTION_MASK_PLAYER = 1, // any player |
---|
250 | FACTION_MASK_ALLIANCE = 2, // player or creature from alliance team |
---|
251 | FACTION_MASK_HORDE = 4, // player or creature from horde team |
---|
252 | FACTION_MASK_MONSTER = 8 // aggressive creature from monster team |
---|
253 | // if none flags set then non-aggressive creature |
---|
254 | }; |
---|
255 | |
---|
256 | struct FactionTemplateEntry |
---|
257 | { |
---|
258 | uint32 ID; // 0 |
---|
259 | uint32 faction; // 1 |
---|
260 | uint32 factionFlags; // 2 specific flags for that faction |
---|
261 | uint32 ourMask; // 3 if mask set (see FactionMasks) then faction included in masked team |
---|
262 | uint32 friendlyMask; // 4 if mask set (see FactionMasks) then faction friendly to masked team |
---|
263 | uint32 hostileMask; // 5 if mask set (see FactionMasks) then faction hostile to masked team |
---|
264 | uint32 enemyFaction1; // 6 |
---|
265 | uint32 enemyFaction2; // 7 |
---|
266 | uint32 enemyFaction3; // 8 |
---|
267 | uint32 enemyFaction4; // 9 |
---|
268 | uint32 friendFaction1; // 10 |
---|
269 | uint32 friendFaction2; // 11 |
---|
270 | uint32 friendFaction3; // 12 |
---|
271 | uint32 friendFaction4; // 13 |
---|
272 | //------------------------------------------------------- end structure |
---|
273 | |
---|
274 | // helpers |
---|
275 | bool IsFriendlyTo(FactionTemplateEntry const& entry) const |
---|
276 | { |
---|
277 | if(enemyFaction1 == entry.faction || enemyFaction2 == entry.faction || enemyFaction3 == entry.faction || enemyFaction4 == entry.faction ) |
---|
278 | return false; |
---|
279 | if(friendFaction1 == entry.faction || friendFaction2 == entry.faction || friendFaction3 == entry.faction || friendFaction4 == entry.faction ) |
---|
280 | return true; |
---|
281 | return (friendlyMask & entry.ourMask) || (ourMask & entry.friendlyMask); |
---|
282 | } |
---|
283 | bool IsHostileTo(FactionTemplateEntry const& entry) const |
---|
284 | { |
---|
285 | if(enemyFaction1 == entry.faction || enemyFaction2 == entry.faction || enemyFaction3 == entry.faction || enemyFaction4 == entry.faction ) |
---|
286 | return true; |
---|
287 | if(friendFaction1 == entry.faction || friendFaction2 == entry.faction || friendFaction3 == entry.faction || friendFaction4 == entry.faction ) |
---|
288 | return false; |
---|
289 | return (hostileMask & entry.ourMask) != 0; |
---|
290 | } |
---|
291 | bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; } |
---|
292 | bool IsNeutralToAll() const { return hostileMask == 0 && friendlyMask == 0 && enemyFaction1==0 && enemyFaction2==0 && enemyFaction3==0 && enemyFaction4==0; } |
---|
293 | bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD)!=0; } |
---|
294 | }; |
---|
295 | |
---|
296 | struct GemPropertiesEntry |
---|
297 | { |
---|
298 | uint32 ID; |
---|
299 | uint32 spellitemenchantement; |
---|
300 | uint32 color; |
---|
301 | }; |
---|
302 | |
---|
303 | #define GT_MAX_LEVEL 100 |
---|
304 | struct GtCombatRatingsEntry |
---|
305 | { |
---|
306 | float ratio; |
---|
307 | }; |
---|
308 | |
---|
309 | struct GtChanceToMeleeCritBaseEntry |
---|
310 | { |
---|
311 | float base; |
---|
312 | }; |
---|
313 | |
---|
314 | struct GtChanceToMeleeCritEntry |
---|
315 | { |
---|
316 | float ratio; |
---|
317 | }; |
---|
318 | |
---|
319 | struct GtChanceToSpellCritBaseEntry |
---|
320 | { |
---|
321 | float base; |
---|
322 | }; |
---|
323 | |
---|
324 | struct GtChanceToSpellCritEntry |
---|
325 | { |
---|
326 | float ratio; |
---|
327 | }; |
---|
328 | |
---|
329 | struct GtOCTRegenHPEntry |
---|
330 | { |
---|
331 | float ratio; |
---|
332 | }; |
---|
333 | |
---|
334 | //struct GtOCTRegenMPEntry |
---|
335 | //{ |
---|
336 | // float ratio; |
---|
337 | //}; |
---|
338 | |
---|
339 | struct GtRegenHPPerSptEntry |
---|
340 | { |
---|
341 | float ratio; |
---|
342 | }; |
---|
343 | |
---|
344 | struct GtRegenMPPerSptEntry |
---|
345 | { |
---|
346 | float ratio; |
---|
347 | }; |
---|
348 | |
---|
349 | struct ItemEntry |
---|
350 | { |
---|
351 | uint32 ID; |
---|
352 | uint32 DisplayId; |
---|
353 | uint32 InventoryType; |
---|
354 | uint32 Sheath; |
---|
355 | }; |
---|
356 | |
---|
357 | struct ItemDisplayInfoEntry |
---|
358 | { |
---|
359 | uint32 ID; |
---|
360 | uint32 randomPropertyChance; |
---|
361 | }; |
---|
362 | |
---|
363 | //struct ItemCondExtCostsEntry |
---|
364 | //{ |
---|
365 | // uint32 ID; |
---|
366 | // uint32 condExtendedCost; // ItemPrototype::CondExtendedCost |
---|
367 | // uint32 itemextendedcostentry; // ItemPrototype::ExtendedCost |
---|
368 | // uint32 arenaseason; // arena season number(1-4) |
---|
369 | //}; |
---|
370 | |
---|
371 | struct ItemExtendedCostEntry |
---|
372 | { |
---|
373 | uint32 ID; // 0 extended-cost entry id |
---|
374 | uint32 reqhonorpoints; // 1 required honor points |
---|
375 | uint32 reqarenapoints; // 2 required arena points |
---|
376 | uint32 reqitem[5]; // 3-7 required item id |
---|
377 | uint32 reqitemcount[5]; // 8-12 required count of 1st item |
---|
378 | uint32 reqpersonalarenarating; // 13 required personal arena rating |
---|
379 | }; |
---|
380 | |
---|
381 | struct ItemRandomPropertiesEntry |
---|
382 | { |
---|
383 | uint32 ID; // 0 |
---|
384 | //char* internalName // 1 unused |
---|
385 | uint32 enchant_id[3]; // 2-4 |
---|
386 | // 5-6 unused, 0 only values, reserved for additional enchantments? |
---|
387 | //char* nameSuffix[16] // 7-22, unused |
---|
388 | // 23 nameSufix flags, unused |
---|
389 | }; |
---|
390 | |
---|
391 | struct ItemRandomSuffixEntry |
---|
392 | { |
---|
393 | uint32 ID; // 0 |
---|
394 | //char* name[16] // 1-16 unused |
---|
395 | // 17, name flags, unused |
---|
396 | // 18 unused |
---|
397 | uint32 enchant_id[3]; // 19-21 |
---|
398 | uint32 prefix[3]; // 22-24 |
---|
399 | }; |
---|
400 | |
---|
401 | struct ItemSetEntry |
---|
402 | { |
---|
403 | //uint32 id // 0 item set ID |
---|
404 | char* name[16]; // 1-16 |
---|
405 | // 17 string flags, unused |
---|
406 | // 18-28 items from set, but not have all items listed, use ItemPrototype::ItemSet instead |
---|
407 | // 29-34 unused |
---|
408 | uint32 spells[8]; // 35-42 |
---|
409 | uint32 items_to_triggerspell[8]; // 43-50 |
---|
410 | uint32 required_skill_id; // 51 |
---|
411 | uint32 required_skill_value; // 52 |
---|
412 | }; |
---|
413 | |
---|
414 | struct LockEntry |
---|
415 | { |
---|
416 | uint32 ID; // 0 |
---|
417 | uint32 keytype[5]; // 1-5 |
---|
418 | // 6-8, not used |
---|
419 | uint32 key[5]; // 9-13 |
---|
420 | // 14-16, not used |
---|
421 | uint32 requiredminingskill; // 17 |
---|
422 | uint32 requiredlockskill; // 18 |
---|
423 | // 19-32, not used |
---|
424 | }; |
---|
425 | |
---|
426 | struct MailTemplateEntry |
---|
427 | { |
---|
428 | uint32 ID; // 0 |
---|
429 | //char* subject[16]; // 1-16 |
---|
430 | // 17 name flags, unused |
---|
431 | //char* content[16]; // 18-33 |
---|
432 | }; |
---|
433 | |
---|
434 | enum MapTypes |
---|
435 | { |
---|
436 | MAP_COMMON = 0, |
---|
437 | MAP_INSTANCE = 1, |
---|
438 | MAP_RAID = 2, |
---|
439 | MAP_BATTLEGROUND = 3, |
---|
440 | MAP_ARENA = 4 |
---|
441 | }; |
---|
442 | |
---|
443 | struct MapEntry |
---|
444 | { |
---|
445 | uint32 MapID; // 0 |
---|
446 | //char* internalname; // 1 unused |
---|
447 | uint32 map_type; // 2 |
---|
448 | // 3 unused |
---|
449 | char* name[16]; // 4-19 |
---|
450 | // 20 name flags, unused |
---|
451 | // 21-23 unused (something PvPZone related - levels?) |
---|
452 | // 24-26 |
---|
453 | uint32 linked_zone; // 27 common zone for instance and continent map |
---|
454 | //char* hordeIntro // 28-43 text for PvP Zones |
---|
455 | // 44 intro text flags |
---|
456 | //char* allianceIntro // 45-60 text for PvP Zones |
---|
457 | // 46 intro text flags |
---|
458 | // 47-61 not used |
---|
459 | uint32 multimap_id; // 62 |
---|
460 | // 63-65 not used |
---|
461 | //chat* unknownText1 // 66-81 unknown empty text fields, possible normal Intro text. |
---|
462 | // 82 text flags |
---|
463 | //chat* heroicIntroText // 83-98 heroic mode requirement text |
---|
464 | // 99 text flags |
---|
465 | //chat* unknownText2 // 100-115 unknown empty text fields |
---|
466 | // 116 text flags |
---|
467 | int32 parent_map; // 117 map_id of parent map |
---|
468 | //float start_x // 118 enter x coordinate (if exist single entry) |
---|
469 | //float start_y // 119 enter y coordinate (if exist single entry) |
---|
470 | uint32 resetTimeRaid; // 120 |
---|
471 | uint32 resetTimeHeroic; // 121 |
---|
472 | // 122-123 |
---|
473 | uint32 addon; // 124 (0-original maps,1-tbc addon) |
---|
474 | |
---|
475 | // Helpers |
---|
476 | bool IsExpansionMap() const { return addon != 0; } |
---|
477 | |
---|
478 | |
---|
479 | bool IsDungeon() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID; } |
---|
480 | bool Instanceable() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID || map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; } |
---|
481 | bool IsRaid() const { return map_type == MAP_RAID; } |
---|
482 | bool IsBattleGround() const { return map_type == MAP_BATTLEGROUND; } |
---|
483 | bool IsBattleArena() const { return map_type == MAP_ARENA; } |
---|
484 | bool IsBattleGroundOrArena() const { return map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; } |
---|
485 | bool SupportsHeroicMode() const { return resetTimeHeroic && !resetTimeRaid; } |
---|
486 | bool HasResetTime() const { return resetTimeHeroic || resetTimeRaid; } |
---|
487 | |
---|
488 | bool IsMountAllowed() const |
---|
489 | { |
---|
490 | return !IsDungeon() || |
---|
491 | MapID==568 || MapID==309 || MapID==209 || MapID==534 || |
---|
492 | MapID==560 || MapID==509 || MapID==269; |
---|
493 | } |
---|
494 | }; |
---|
495 | |
---|
496 | struct QuestSortEntry |
---|
497 | { |
---|
498 | uint32 id; // 0, sort id |
---|
499 | //char* name[16]; // 1-16, unused |
---|
500 | // 17 name flags, unused |
---|
501 | }; |
---|
502 | |
---|
503 | struct RandomPropertiesPointsEntry |
---|
504 | { |
---|
505 | //uint32 Id; // 0 hidden key |
---|
506 | uint32 itemLevel; // 1 |
---|
507 | uint32 EpicPropertiesPoints[5]; // 2-6 |
---|
508 | uint32 RarePropertiesPoints[5]; // 7-11 |
---|
509 | uint32 UncommonPropertiesPoints[5]; // 12-16 |
---|
510 | }; |
---|
511 | |
---|
512 | //struct SkillLineCategoryEntry{ |
---|
513 | // uint32 id; // 0 hidden key |
---|
514 | // char* name[16]; // 1 - 17 Category name |
---|
515 | // // 18 string flag |
---|
516 | // uint32 displayOrder; // Display order in character tab |
---|
517 | //}; |
---|
518 | |
---|
519 | //struct SkillRaceClassInfoEntry{ |
---|
520 | // uint32 id; // 0 |
---|
521 | // uint32 skillId; // 1 present some refrences to unknown skill |
---|
522 | // uint32 raceMask; // 2 |
---|
523 | // uint32 classMask; // 3 |
---|
524 | // uint32 flags; // 4 mask for some thing |
---|
525 | // uint32 reqLevel; // 5 |
---|
526 | // uint32 skillTierId; // 6 |
---|
527 | // uint32 skillCostID; // 7 |
---|
528 | //}; |
---|
529 | |
---|
530 | //struct SkillTiersEntry{ |
---|
531 | // uint32 id; // 0 |
---|
532 | // uint32 skillValue[16]; // 1-17 unknown possibly add value on learn? |
---|
533 | // uint32 maxSkillValue[16]; // Max value for rank |
---|
534 | //}; |
---|
535 | |
---|
536 | struct SkillLineEntry |
---|
537 | { |
---|
538 | uint32 id; // 0 |
---|
539 | uint32 categoryId; // 1 (index from SkillLineCategory.dbc) |
---|
540 | //uint32 skillCostID; // 2 not used |
---|
541 | char* name[16]; // 3-18 |
---|
542 | // 19 string flags, not used |
---|
543 | //char* description[16]; // 20-35, not used |
---|
544 | // 36 string flags, not used |
---|
545 | uint32 spellIcon; // 37 |
---|
546 | }; |
---|
547 | |
---|
548 | enum AbilytyLearnType |
---|
549 | { |
---|
550 | ABILITY_LEARNED_ON_GET_PROFESSION_SKILL = 1, |
---|
551 | ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL = 2 |
---|
552 | }; |
---|
553 | |
---|
554 | struct SkillLineAbilityEntry |
---|
555 | { |
---|
556 | uint32 id; // 0, INDEX |
---|
557 | uint32 skillId; // 1 |
---|
558 | uint32 spellId; // 2 |
---|
559 | uint32 racemask; // 3 |
---|
560 | uint32 classmask; // 4 |
---|
561 | //uint32 racemaskNot; // 5 always 0 in 2.4.2 |
---|
562 | //uint32 classmaskNot; // 6 always 0 in 2.4.2 |
---|
563 | uint32 req_skill_value; // 7 for trade skill.not for training. |
---|
564 | uint32 forward_spellid; // 8 |
---|
565 | uint32 learnOnGetSkill; // 9 can be 1 or 2 for spells learned on get skill |
---|
566 | uint32 max_value; // 10 |
---|
567 | uint32 min_value; // 11 |
---|
568 | // 12-13, unknown, always 0 |
---|
569 | uint32 reqtrainpoints; // 14 |
---|
570 | }; |
---|
571 | |
---|
572 | struct SoundEntriesEntry |
---|
573 | { |
---|
574 | uint32 Id; // 0, sound id |
---|
575 | //uint32 Type; // 1, sound type (10 generally for creature, etc) |
---|
576 | //char* InternalName; // 2, internal name, for use in lookup command for example |
---|
577 | //char* FileName[10]; // 3-12, file names |
---|
578 | //uint32 Unk13[10]; // 13-22, linked with file names? |
---|
579 | //char* Path; // 23 |
---|
580 | // 24-28, unknown |
---|
581 | }; |
---|
582 | |
---|
583 | struct SpellEntry |
---|
584 | { |
---|
585 | uint32 Id; // 0 normally counted from 0 field (but some tools start counting from 1, check this before tool use for data view!) |
---|
586 | uint32 Category; // 1 |
---|
587 | //uint32 castUI // 2 not used |
---|
588 | uint32 Dispel; // 3 |
---|
589 | uint32 Mechanic; // 4 |
---|
590 | uint32 Attributes; // 5 |
---|
591 | uint32 AttributesEx; // 6 |
---|
592 | uint32 AttributesEx2; // 7 |
---|
593 | uint32 AttributesEx3; // 8 |
---|
594 | uint32 AttributesEx4; // 9 |
---|
595 | uint32 AttributesEx5; // 10 |
---|
596 | //uint32 AttributesEx6; // 11 not used |
---|
597 | uint32 Stances; // 12 |
---|
598 | uint32 StancesNot; // 13 |
---|
599 | uint32 Targets; // 14 |
---|
600 | uint32 TargetCreatureType; // 15 |
---|
601 | uint32 RequiresSpellFocus; // 16 |
---|
602 | uint32 FacingCasterFlags; // 17 |
---|
603 | uint32 CasterAuraState; // 18 |
---|
604 | uint32 TargetAuraState; // 19 |
---|
605 | uint32 CasterAuraStateNot; // 20 |
---|
606 | uint32 TargetAuraStateNot; // 21 |
---|
607 | uint32 CastingTimeIndex; // 22 |
---|
608 | uint32 RecoveryTime; // 23 |
---|
609 | uint32 CategoryRecoveryTime; // 24 |
---|
610 | uint32 InterruptFlags; // 25 |
---|
611 | uint32 AuraInterruptFlags; // 26 |
---|
612 | uint32 ChannelInterruptFlags; // 27 |
---|
613 | uint32 procFlags; // 28 |
---|
614 | uint32 procChance; // 29 |
---|
615 | uint32 procCharges; // 30 |
---|
616 | uint32 maxLevel; // 31 |
---|
617 | uint32 baseLevel; // 32 |
---|
618 | uint32 spellLevel; // 33 |
---|
619 | uint32 DurationIndex; // 34 |
---|
620 | uint32 powerType; // 35 |
---|
621 | uint32 manaCost; // 36 |
---|
622 | uint32 manaCostPerlevel; // 37 |
---|
623 | uint32 manaPerSecond; // 38 |
---|
624 | uint32 manaPerSecondPerLevel; // 39 |
---|
625 | uint32 rangeIndex; // 40 |
---|
626 | float speed; // 41 |
---|
627 | //uint32 modalNextSpell; // 42 |
---|
628 | uint32 StackAmount; // 43 |
---|
629 | uint32 Totem[2]; // 44-45 |
---|
630 | int32 Reagent[8]; // 46-53 |
---|
631 | uint32 ReagentCount[8]; // 54-61 |
---|
632 | int32 EquippedItemClass; // 62 (value) |
---|
633 | int32 EquippedItemSubClassMask; // 63 (mask) |
---|
634 | int32 EquippedItemInventoryTypeMask; // 64 (mask) |
---|
635 | uint32 Effect[3]; // 65-67 |
---|
636 | int32 EffectDieSides[3]; // 68-70 |
---|
637 | uint32 EffectBaseDice[3]; // 71-73 |
---|
638 | float EffectDicePerLevel[3]; // 74-76 |
---|
639 | float EffectRealPointsPerLevel[3]; // 77-79 |
---|
640 | int32 EffectBasePoints[3]; // 80-82 (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints) |
---|
641 | uint32 EffectMechanic[3]; // 83-85 |
---|
642 | uint32 EffectImplicitTargetA[3]; // 86-88 |
---|
643 | uint32 EffectImplicitTargetB[3]; // 89-91 |
---|
644 | uint32 EffectRadiusIndex[3]; // 92-94 - spellradius.dbc |
---|
645 | uint32 EffectApplyAuraName[3]; // 95-97 |
---|
646 | uint32 EffectAmplitude[3]; // 98-100 |
---|
647 | float EffectMultipleValue[3]; // 101-103 |
---|
648 | uint32 EffectChainTarget[3]; // 104-106 |
---|
649 | uint32 EffectItemType[3]; // 107-109 |
---|
650 | int32 EffectMiscValue[3]; // 110-112 |
---|
651 | int32 EffectMiscValueB[3]; // 113-115 |
---|
652 | uint32 EffectTriggerSpell[3]; // 116-118 |
---|
653 | float EffectPointsPerComboPoint[3]; // 119-121 |
---|
654 | uint32 SpellVisual; // 122 |
---|
655 | // 123 not used |
---|
656 | uint32 SpellIconID; // 124 |
---|
657 | uint32 activeIconID; // 125 |
---|
658 | //uint32 spellPriority; // 126 |
---|
659 | char* SpellName[16]; // 127-142 |
---|
660 | //uint32 SpellNameFlag; // 143 |
---|
661 | char* Rank[16]; // 144-159 |
---|
662 | //uint32 RankFlags; // 160 |
---|
663 | //char* Description[16]; // 161-176 not used |
---|
664 | //uint32 DescriptionFlags; // 177 not used |
---|
665 | //char* ToolTip[16]; // 178-193 not used |
---|
666 | //uint32 ToolTipFlags; // 194 not used |
---|
667 | uint32 ManaCostPercentage; // 195 |
---|
668 | uint32 StartRecoveryCategory; // 196 |
---|
669 | uint32 StartRecoveryTime; // 197 |
---|
670 | uint32 MaxTargetLevel; // 198 |
---|
671 | uint32 SpellFamilyName; // 199 |
---|
672 | uint64 SpellFamilyFlags; // 200+201 |
---|
673 | uint32 MaxAffectedTargets; // 202 |
---|
674 | uint32 DmgClass; // 203 defenseType |
---|
675 | uint32 PreventionType; // 204 |
---|
676 | //uint32 StanceBarOrder; // 205 not used |
---|
677 | float DmgMultiplier[3]; // 206-208 |
---|
678 | //uint32 MinFactionId; // 209 not used, and 0 in 2.4.2 |
---|
679 | //uint32 MinReputation; // 210 not used, and 0 in 2.4.2 |
---|
680 | //uint32 RequiredAuraVision; // 211 not used |
---|
681 | uint32 TotemCategory[2]; // 212-213 |
---|
682 | uint32 AreaId; // 214 |
---|
683 | uint32 SchoolMask; // 215 school mask |
---|
684 | |
---|
685 | private: |
---|
686 | // prevent creating custom entries (copy data from original in fact) |
---|
687 | SpellEntry(SpellEntry const&); // DON'T must have implementation |
---|
688 | }; |
---|
689 | |
---|
690 | typedef std::set<uint32> SpellCategorySet; |
---|
691 | typedef std::map<uint32,SpellCategorySet > SpellCategoryStore; |
---|
692 | typedef std::set<uint32> PetFamilySpellsSet; |
---|
693 | typedef std::map<uint32,PetFamilySpellsSet > PetFamilySpellsStore; |
---|
694 | |
---|
695 | struct SpellCastTimesEntry |
---|
696 | { |
---|
697 | uint32 ID; // 0 |
---|
698 | int32 CastTime; // 1 |
---|
699 | //float CastTimePerLevel; // 2 unsure / per skill? |
---|
700 | //int32 MinCastTime; // 3 unsure |
---|
701 | }; |
---|
702 | |
---|
703 | struct SpellFocusObjectEntry |
---|
704 | { |
---|
705 | uint32 ID; // 0 |
---|
706 | //char* Name[16]; // 1-15 unused |
---|
707 | // 16 string flags, unused |
---|
708 | }; |
---|
709 | |
---|
710 | // stored in SQL table |
---|
711 | struct SpellThreatEntry |
---|
712 | { |
---|
713 | uint32 spellId; |
---|
714 | int32 threat; |
---|
715 | }; |
---|
716 | |
---|
717 | struct SpellRadiusEntry |
---|
718 | { |
---|
719 | uint32 ID; |
---|
720 | float Radius; |
---|
721 | float Radius2; |
---|
722 | }; |
---|
723 | |
---|
724 | struct SpellRangeEntry |
---|
725 | { |
---|
726 | uint32 ID; |
---|
727 | float minRange; |
---|
728 | float maxRange; |
---|
729 | }; |
---|
730 | |
---|
731 | struct SpellShapeshiftEntry |
---|
732 | { |
---|
733 | uint32 ID; // 0 |
---|
734 | //uint32 buttonPosition; // 1 unused |
---|
735 | //char* Name[16]; // 2-17 unused |
---|
736 | //uint32 NameFlags; // 18 unused |
---|
737 | uint32 flags1; // 19 |
---|
738 | int32 creatureType; // 20 <=0 humanoid, other normal creature types |
---|
739 | //uint32 unk1; // 21 unused |
---|
740 | uint32 attackSpeed; // 22 |
---|
741 | //uint32 modelID; // 23 unused, alliance modelid (where horde case?) |
---|
742 | //uint32 unk2; // 24 unused |
---|
743 | //uint32 unk3; // 25 unused |
---|
744 | //uint32 unk4; // 26 unused |
---|
745 | //uint32 unk5; // 27 unused |
---|
746 | //uint32 unk6; // 28 unused |
---|
747 | //uint32 unk7; // 29 unused |
---|
748 | //uint32 unk8; // 30 unused |
---|
749 | //uint32 unk9; // 31 unused |
---|
750 | //uint32 unk10; // 32 unused |
---|
751 | //uint32 unk11; // 33 unused |
---|
752 | //uint32 unk12; // 34 unused |
---|
753 | }; |
---|
754 | |
---|
755 | struct SpellDurationEntry |
---|
756 | { |
---|
757 | uint32 ID; |
---|
758 | int32 Duration[3]; |
---|
759 | }; |
---|
760 | |
---|
761 | enum ItemEnchantmentType |
---|
762 | { |
---|
763 | ITEM_ENCHANTMENT_TYPE_NONE = 0, |
---|
764 | ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL = 1, |
---|
765 | ITEM_ENCHANTMENT_TYPE_DAMAGE = 2, |
---|
766 | ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL = 3, |
---|
767 | ITEM_ENCHANTMENT_TYPE_RESISTANCE = 4, |
---|
768 | ITEM_ENCHANTMENT_TYPE_STAT = 5, |
---|
769 | ITEM_ENCHANTMENT_TYPE_TOTEM = 6 |
---|
770 | }; |
---|
771 | |
---|
772 | struct SpellItemEnchantmentEntry |
---|
773 | { |
---|
774 | uint32 ID; // 0 |
---|
775 | uint32 type[3]; // 1-3 |
---|
776 | uint32 amount[3]; // 4-6 |
---|
777 | //uint32 amount2[3] // 7-9 always same as similar `amount` value |
---|
778 | uint32 spellid[3]; // 10-12 |
---|
779 | char* description[16]; // 13-29 |
---|
780 | // 30 description flags |
---|
781 | uint32 aura_id; // 31 |
---|
782 | uint32 slot; // 32 |
---|
783 | uint32 GemID; // 33 |
---|
784 | uint32 EnchantmentCondition; // 34 |
---|
785 | }; |
---|
786 | |
---|
787 | struct SpellItemEnchantmentConditionEntry |
---|
788 | { |
---|
789 | uint32 ID; |
---|
790 | uint8 Color[5]; |
---|
791 | uint8 Comparator[5]; |
---|
792 | uint8 CompareColor[5]; |
---|
793 | uint32 Value[5]; |
---|
794 | }; |
---|
795 | |
---|
796 | struct StableSlotPricesEntry |
---|
797 | { |
---|
798 | uint32 Slot; |
---|
799 | uint32 Price; |
---|
800 | }; |
---|
801 | |
---|
802 | struct TalentEntry |
---|
803 | { |
---|
804 | uint32 TalentID; // 0 |
---|
805 | uint32 TalentTab; // 1 index in TalentTab.dbc (TalentTabEntry) |
---|
806 | uint32 Row; // 2 |
---|
807 | uint32 Col; // 3 |
---|
808 | uint32 RankID[5]; // 4-8 |
---|
809 | // 9-12 not used, always 0, maybe not used high ranks |
---|
810 | uint32 DependsOn; // 13 index in Talent.dbc (TalentEntry) |
---|
811 | // 14-15 not used |
---|
812 | uint32 DependsOnRank; // 16 |
---|
813 | // 17-19 not used |
---|
814 | uint32 DependsOnSpell; // 20 req.spell |
---|
815 | }; |
---|
816 | |
---|
817 | struct TalentTabEntry |
---|
818 | { |
---|
819 | uint32 TalentTabID; // 0 |
---|
820 | //char* name[16]; // 1-16, unused |
---|
821 | //uint32 nameFlags; // 17, unused |
---|
822 | //unit32 spellicon; // 18 |
---|
823 | // 19 not used |
---|
824 | uint32 ClassMask; // 20 |
---|
825 | uint32 tabpage; // 21 |
---|
826 | //char* internalname; // 22 |
---|
827 | }; |
---|
828 | |
---|
829 | struct TaxiPathEntry |
---|
830 | { |
---|
831 | uint32 ID; |
---|
832 | uint32 from; |
---|
833 | uint32 to; |
---|
834 | uint32 price; |
---|
835 | }; |
---|
836 | |
---|
837 | struct TaxiNodesEntry |
---|
838 | { |
---|
839 | uint32 ID; // 0 |
---|
840 | uint32 map_id; // 1 |
---|
841 | float x; // 2 |
---|
842 | float y; // 3 |
---|
843 | float z; // 4 |
---|
844 | //char* name[16]; // 5-21 |
---|
845 | // 22 string flags, unused |
---|
846 | uint32 horde_mount_type; // 23 |
---|
847 | uint32 alliance_mount_type; // 24 |
---|
848 | }; |
---|
849 | |
---|
850 | enum TotemCategoryType |
---|
851 | { |
---|
852 | TOTEM_CATEGORY_TYPE_KNIFE = 1, |
---|
853 | TOTEM_CATEGORY_TYPE_TOTEM = 2, |
---|
854 | TOTEM_CATEGORY_TYPE_ROD = 3, |
---|
855 | TOTEM_CATEGORY_TYPE_PICK = 21, |
---|
856 | TOTEM_CATEGORY_TYPE_STONE = 22, |
---|
857 | TOTEM_CATEGORY_TYPE_HAMMER = 23, |
---|
858 | TOTEM_CATEGORY_TYPE_SPANNER = 24 |
---|
859 | }; |
---|
860 | |
---|
861 | struct TotemCategoryEntry |
---|
862 | { |
---|
863 | uint32 ID; // 0 |
---|
864 | //char* name[16]; // 1-16 |
---|
865 | // 17 string flags, unused |
---|
866 | uint32 categoryType; // 18 (one for specialization) |
---|
867 | uint32 categoryMask; // 19 (compatibility mask for same type: different for totems, compatible from high to low for rods) |
---|
868 | }; |
---|
869 | |
---|
870 | struct WorldMapAreaEntry |
---|
871 | { |
---|
872 | //uint32 ID; // 0 |
---|
873 | uint32 map_id; // 1 |
---|
874 | uint32 area_id; // 2 index (continent 0 areas ignored) |
---|
875 | //char* internal_name // 3 |
---|
876 | float y1; // 4 |
---|
877 | float y2; // 5 |
---|
878 | float x1; // 6 |
---|
879 | float x2; // 7 |
---|
880 | int32 virtual_map_id; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally) |
---|
881 | }; |
---|
882 | |
---|
883 | struct WorldSafeLocsEntry |
---|
884 | { |
---|
885 | uint32 ID; // 0 |
---|
886 | uint32 map_id; // 1 |
---|
887 | float x; // 2 |
---|
888 | float y; // 3 |
---|
889 | float z; // 4 |
---|
890 | //char* name[16] // 5-20 name, unused |
---|
891 | // 21 name flags, unused |
---|
892 | }; |
---|
893 | |
---|
894 | // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform |
---|
895 | #if defined( __GNUC__ ) |
---|
896 | #pragma pack() |
---|
897 | #else |
---|
898 | #pragma pack(pop) |
---|
899 | #endif |
---|
900 | |
---|
901 | // Structures not used for casting to loaded DBC data and not required then packing |
---|
902 | struct TalentSpellPos |
---|
903 | { |
---|
904 | TalentSpellPos() : talent_id(0), rank(0) {} |
---|
905 | TalentSpellPos(uint16 _talent_id, uint8 _rank) : talent_id(_talent_id), rank(_rank) {} |
---|
906 | |
---|
907 | uint16 talent_id; |
---|
908 | uint8 rank; |
---|
909 | }; |
---|
910 | |
---|
911 | typedef std::map<uint32,TalentSpellPos> TalentSpellPosMap; |
---|
912 | |
---|
913 | struct TaxiPathBySourceAndDestination |
---|
914 | { |
---|
915 | TaxiPathBySourceAndDestination() : ID(0),price(0) {} |
---|
916 | TaxiPathBySourceAndDestination(uint32 _id,uint32 _price) : ID(_id),price(_price) {} |
---|
917 | |
---|
918 | uint32 ID; |
---|
919 | uint32 price; |
---|
920 | }; |
---|
921 | typedef std::map<uint32,TaxiPathBySourceAndDestination> TaxiPathSetForSource; |
---|
922 | typedef std::map<uint32,TaxiPathSetForSource> TaxiPathSetBySource; |
---|
923 | |
---|
924 | struct TaxiPathNode |
---|
925 | { |
---|
926 | TaxiPathNode() : mapid(0), x(0),y(0),z(0),actionFlag(0),delay(0) {} |
---|
927 | TaxiPathNode(uint32 _mapid, float _x, float _y, float _z, uint32 _actionFlag, uint32 _delay) : mapid(_mapid), x(_x),y(_y),z(_z),actionFlag(_actionFlag),delay(_delay) {} |
---|
928 | |
---|
929 | uint32 mapid; |
---|
930 | float x; |
---|
931 | float y; |
---|
932 | float z; |
---|
933 | uint32 actionFlag; |
---|
934 | uint32 delay; |
---|
935 | }; |
---|
936 | typedef std::vector<TaxiPathNode> TaxiPathNodeList; |
---|
937 | typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath; |
---|
938 | |
---|
939 | #define TaxiMaskSize 16 |
---|
940 | typedef uint32 TaxiMask[TaxiMaskSize]; |
---|
941 | #endif |
---|