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