[9362] Make specs work at least for action bars
[getmangos.git] / src / game / DBCStructure.h
blob4479f7d12c75a6d94a8b5843edc770f94967c7ea
1 /*
2 * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef MANGOS_DBCSTRUCTURE_H
20 #define MANGOS_DBCSTRUCTURE_H
22 #include "DBCEnums.h"
23 #include "Platform/Define.h"
25 #include <map>
26 #include <set>
27 #include <vector>
29 // Structures using to access raw DBC data and required packing to portability
31 // 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
32 #if defined( __GNUC__ )
33 #pragma pack(1)
34 #else
35 #pragma pack(push,1)
36 #endif
38 struct AchievementEntry
40 uint32 ID; // 0
41 uint32 factionFlag; // 1 -1=all, 0=horde, 1=alliance
42 uint32 mapID; // 2 -1=none
43 //uint32 parentAchievement; // 3 its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin)
44 char *name[16]; // 4-19
45 //uint32 name_flags; // 20
46 //char *description[16]; // 21-36
47 //uint32 desc_flags; // 37
48 uint32 categoryId; // 38
49 uint32 points; // 39 reward points
50 //uint32 OrderInCategory; // 40
51 uint32 flags; // 41
52 //uint32 icon; // 42 icon (from SpellIcon.dbc)
53 //char *titleReward[16]; // 43-58
54 //uint32 titleReward_flags; // 59
55 uint32 count; // 60 - need this count of completed criterias (own or referenced achievement criterias)
56 uint32 refAchievement; // 61 - referenced achievement (counting of all completed criterias)
59 struct AchievementCategoryEntry
61 uint32 ID; // 0
62 uint32 parentCategory; // 1 -1 for main category
63 //char *name[16]; // 2-17
64 //uint32 name_flags; // 18
65 //uint32 sortOrder; // 19
68 struct AchievementCriteriaEntry
70 uint32 ID; // 0
71 uint32 referredAchievement; // 1
72 uint32 requiredType; // 2
73 union
75 // ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0
76 // TODO: also used for player deaths..
77 struct
79 uint32 creatureID; // 3
80 uint32 creatureCount; // 4
81 } kill_creature;
83 // ACHIEVEMENT_CRITERIA_TYPE_WIN_BG = 1
84 struct
86 uint32 bgMapID; // 3
87 uint32 winCount; // 4
88 uint32 additionalRequirement1_type; // 5 additional requirement 1 type
89 uint32 additionalRequirement1_value; // 6 additional requirement 1 value
90 uint32 additionalRequirement2_type; // 7 additional requirement 2 type
91 uint32 additionalRequirement2_value; // 8 additional requirement 1 value
92 } win_bg;
94 // ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5
95 struct
97 uint32 unused; // 3
98 uint32 level; // 4
99 } reach_level;
101 // ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7
102 struct
104 uint32 skillID; // 3
105 uint32 skillLevel; // 4
106 } reach_skill_level;
108 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8
109 struct
111 uint32 linkedAchievement; // 3
112 } complete_achievement;
114 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT = 9
115 struct
117 uint32 unused; // 3
118 uint32 totalQuestCount; // 4
119 } complete_quest_count;
121 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10
122 struct
124 uint32 unused; // 3
125 uint32 numberOfDays; // 4
126 } complete_daily_quest_daily;
128 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11
129 struct
131 uint32 zoneID; // 3
132 uint32 questCount; // 4
133 } complete_quests_in_zone;
135 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14
136 struct
138 uint32 unused; // 3
139 uint32 questCount; // 4
140 } complete_daily_quest;
142 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND = 15
143 struct
145 uint32 mapID; // 3
146 } complete_battleground;
148 // ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP = 16
149 struct
151 uint32 mapID; // 3
152 } death_at_map;
154 // ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON = 18
155 struct
157 uint32 manLimit; // 3
158 } death_in_dungeon;
160 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID = 19
161 struct
163 uint32 groupSize; // 3 can be 5, 10 or 25
164 } complete_raid;
166 // ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE = 20
167 struct
169 uint32 creatureEntry; // 3
170 } killed_by_creature;
172 // ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING = 24
173 struct
175 uint32 unused; // 3
176 uint32 fallHeight; // 4
177 } fall_without_dying;
179 // ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM = 26
180 struct
182 uint32 type; // 3, see enum EnviromentalDamage
183 } death_from;
185 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST = 27
186 struct
188 uint32 questID; // 3
189 uint32 questCount; // 4
190 } complete_quest;
192 // ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET = 28
193 // ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2 = 69
194 struct
196 uint32 spellID; // 3
197 uint32 spellCount; // 4
198 } be_spell_target;
200 // ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL = 29
201 // ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110
202 struct
204 uint32 spellID; // 3
205 uint32 castCount; // 4
206 } cast_spell;
208 // ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA = 31
209 struct
211 uint32 areaID; // 3 Reference to AreaTable.dbc
212 uint32 killCount; // 4
213 } honorable_kill_at_area;
215 // ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA = 32
216 struct
218 uint32 mapID; // 3 Reference to Map.dbc
219 } win_arena;
221 // ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA = 33
222 struct
224 uint32 mapID; // 3 Reference to Map.dbc
225 } play_arena;
227 // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL = 34
228 struct
230 uint32 spellID; // 3 Reference to Map.dbc
231 } learn_spell;
233 // ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM = 36
234 struct
236 uint32 itemID; // 3
237 uint32 itemCount; // 4
238 } own_item;
240 // ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA = 37
241 struct
243 uint32 unused; // 3
244 uint32 count; // 4
245 uint32 flag; // 5 4=in a row
246 } win_rated_arena;
248 // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38
249 struct
251 uint32 teamtype; // 3 {2,3,5}
252 } highest_team_rating;
254 // ACHIEVEMENT_CRITERIA_TYPE_REACH_TEAM_RATING = 39
255 struct
257 uint32 teamtype; // 3 {2,3,5}
258 uint32 teamrating; // 4
259 } reach_team_rating;
261 // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL = 40
262 struct
264 uint32 skillID; // 3
265 uint32 skillLevel; // 4 apprentice=1, journeyman=2, expert=3, artisan=4, master=5, grand master=6
266 } learn_skill_level;
268 // ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM = 41
269 struct
271 uint32 itemID; // 3
272 uint32 itemCount; // 4
273 } use_item;
275 // ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM = 42
276 struct
278 uint32 itemID; // 3
279 uint32 itemCount; // 4
280 } loot_item;
282 // ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA = 43
283 struct
285 // TODO: This rank is _NOT_ the index from AreaTable.dbc
286 uint32 areaReference; // 3
287 } explore_area;
289 // ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK = 44
290 struct
292 // TODO: This rank is _NOT_ the index from CharTitles.dbc
293 uint32 rank; // 3
294 } own_rank;
296 // ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT = 45
297 struct
299 uint32 unused; // 3
300 uint32 numberOfSlots; // 4
301 } buy_bank_slot;
303 // ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION = 46
304 struct
306 uint32 factionID; // 3
307 uint32 reputationAmount; // 4 Total reputation amount, so 42000 = exalted
308 } gain_reputation;
310 // ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION= 47
311 struct
313 uint32 unused; // 3
314 uint32 numberOfExaltedFactions; // 4
315 } gain_exalted_reputation;
317 // ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP = 48
318 struct
320 uint32 unused; // 3
321 uint32 numberOfVisits; // 4
322 } visit_barber;
324 // ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM = 49
325 // TODO: where is the required itemlevel stored?
326 struct
328 uint32 itemSlot; // 3
329 } equip_epic_item;
331 // ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT = 50
332 struct
334 uint32 rollValue; // 3
335 uint32 count; // 4
336 } roll_need_on_loot;
337 // ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT = 51
338 struct
340 uint32 rollValue; // 3
341 uint32 count; // 4
342 } roll_greed_on_loot;
344 // ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52
345 struct
347 uint32 classID; // 3
348 uint32 count; // 4
349 } hk_class;
351 // ACHIEVEMENT_CRITERIA_TYPE_HK_RACE = 53
352 struct
354 uint32 raceID; // 3
355 uint32 count; // 4
356 } hk_race;
358 // ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE = 54
359 // TODO: where is the information about the target stored?
360 struct
362 uint32 emoteID; // 3 enum TextEmotes
363 uint32 count; // 4 count of emotes, always required special target or requirements
364 } do_emote;
365 // ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13
366 // ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE = 55
367 // ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS = 56
368 struct
370 uint32 unused; // 3
371 uint32 count; // 4
372 uint32 flag; // 5 =3 for battleground healing
373 uint32 mapid; // 6
374 } healing_done;
376 // ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM = 57
377 struct
379 uint32 itemID; // 3
380 uint32 count; // 4
381 } equip_item;
383 // ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD= 62
384 struct
386 uint32 unused; // 3
387 uint32 goldInCopper; // 4
388 } quest_reward_money;
391 // ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY = 67
392 struct
394 uint32 unused; // 3
395 uint32 goldInCopper; // 4
396 } loot_money;
398 // ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT = 68
399 struct
401 uint32 goEntry; // 3
402 uint32 useCount; // 4
403 } use_gameobject;
405 // ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL = 70
406 // TODO: are those special criteria stored in the dbc or do we have to add another sql table?
407 struct
409 uint32 unused; // 3
410 uint32 killCount; // 4
411 } special_pvp_kill;
413 // ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72
414 struct
416 uint32 goEntry; // 3
417 uint32 lootCount; // 4
418 } fish_in_gameobject;
420 // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS = 75
421 struct
423 uint32 skillLine; // 3
424 uint32 spellCount; // 4
425 } learn_skillline_spell;
427 // ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76
428 struct
430 uint32 unused; // 3
431 uint32 duelCount; // 4
432 } win_duel;
434 // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER = 96
435 struct
437 uint32 powerType; // 3 mana=0, 1=rage, 3=energy, 6=runic power
438 } highest_power;
440 // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT = 97
441 struct
443 uint32 statType; // 3 4=spirit, 3=int, 2=stamina, 1=agi, 0=strength
444 } highest_stat;
446 // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER = 98
447 struct
449 uint32 spellSchool; // 3
450 } highest_spellpower;
452 // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING = 100
453 struct
455 uint32 ratingType; // 3
456 } highest_rating;
458 // ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109
459 struct
461 uint32 lootType; // 3 3=fishing, 2=pickpocket, 4=disentchant
462 uint32 lootTypeCount; // 4
463 } loot_type;
465 // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE = 112
466 struct
468 uint32 skillLine; // 3
469 uint32 spellCount; // 4
470 } learn_skill_line;
472 // ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113
473 struct
475 uint32 unused; // 3
476 uint32 killCount; // 4
477 } honorable_kill;
479 struct
481 uint32 field3; // 3 main requirement
482 uint32 count; // 4 main requirement count
483 uint32 additionalRequirement1_type; // 5 additional requirement 1 type
484 uint32 additionalRequirement1_value; // 6 additional requirement 1 value
485 uint32 additionalRequirement2_type; // 7 additional requirement 2 type
486 uint32 additionalRequirement2_value; // 8 additional requirement 1 value
487 } raw;
489 //char* name[16]; // 9-24
490 //uint32 name_flags; // 25
491 uint32 completionFlag; // 26
492 uint32 groupFlag; // 27
493 //uint32 unk1; // 28 Alway appears with timed events
494 // for timed spells it is spell id for
495 // timed kills it is creature id
496 uint32 timeLimit; // 29 time limit in seconds
497 //uint32 showOrder; // 30 show order
500 struct AreaTableEntry
502 uint32 ID; // 0
503 uint32 mapid; // 1
504 uint32 zone; // 2 if 0 then it's zone, else it's zone id of this area
505 uint32 exploreFlag; // 3, main index
506 uint32 flags; // 4, unknown value but 312 for all cities
507 // 5-9 unused
508 int32 area_level; // 10
509 char* area_name[16]; // 11-26
510 // 27, string flags, unused
511 uint32 team; // 28
514 struct AreaGroupEntry
516 uint32 AreaGroupId; // 0
517 uint32 AreaId[6]; // 1-6
518 uint32 nextGroup; // 7 index of next group
521 struct AreaTriggerEntry
523 uint32 id; // 0 m_ID
524 uint32 mapid; // 1 m_ContinentID
525 float x; // 2 m_x
526 float y; // 3 m_y
527 float z; // 4 m_z
528 float radius; // 5 m_radius
529 float box_x; // 6 m_box_length
530 float box_y; // 7 m_box_width
531 float box_z; // 8 m_box_heigh
532 float box_orientation; // 9 m_box_yaw
535 struct AuctionHouseEntry
537 uint32 houseId; // 0 index
538 uint32 faction; // 1 id of faction.dbc for player factions associated with city
539 uint32 depositPercent; // 2 1/3 from real
540 uint32 cutPercent; // 3
541 //char* name[16]; // 4-19
542 // 20 string flag, unused
545 struct BankBagSlotPricesEntry
547 uint32 ID;
548 uint32 price;
551 struct BarberShopStyleEntry
553 uint32 Id; // 0
554 uint32 type; // 1 value 0 -> hair, value 2 -> facialhair
555 //char* name[16]; // 2-17 name of hair style
556 //uint32 name_flags; // 18
557 //uint32 unk_name[16]; // 19-34, all empty
558 //uint32 unk_flags; // 35
559 //float CostMultiplier; // 36 values 1 and 0.75
560 uint32 race; // 37 race
561 uint32 gender; // 38 0 -> male, 1 -> female
562 uint32 hair_id; // 39 real ID to hair/facial hair
565 struct BattlemasterListEntry
567 uint32 id; // 0
568 int32 mapid[8]; // 1-8 mapid
569 uint32 type; // 9 (3 - BG, 4 - arena)
570 uint32 maxplayersperteam; // 10
571 //uint32 canJoinAsGroup; // 11 (0 or 1)
572 char* name[16]; // 12-27
573 // 28 string flag, unused
574 //uint32 maxGroupSize // 29 maxGroupSize?
575 //uint32 HolidayWorldStateId; // 30 new 3.1
578 #define MAX_OUTFIT_ITEMS 24
580 struct CharStartOutfitEntry
582 //uint32 Id; // 0
583 uint32 RaceClassGender; // 1 (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender)
584 int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-13
585 //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 14-25 not required at server side
586 //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 26-37 not required at server side
587 //uint32 Unknown1; // 38, unique values (index-like with gaps ordered in other way as ids)
588 //uint32 Unknown2; // 39
589 //uint32 Unknown3; // 40
592 struct CharTitlesEntry
594 uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId()
595 //uint32 unk1; // 1 flags?
596 char* name[16]; // 2-17
597 // 18 string flag, unused
598 //char* name2[16]; // 19-34, unused
599 // 35 string flag, unused
600 uint32 bit_index; // 36 used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES
603 struct ChatChannelsEntry
605 uint32 ChannelID; // 0
606 uint32 flags; // 1
607 char* pattern[16]; // 3-18
608 // 19 string flags, unused
609 //char* name[16]; // 20-35 unused
610 // 36 string flag, unused
613 struct ChrClassesEntry
615 uint32 ClassID; // 0
616 //uint32 flags; // 1, unused
617 uint32 powerType; // 2
618 // 3-4, unused
619 //char* name[16]; // 5-20 unused
620 // 21 string flag, unused
621 //char* nameFemale[16]; // 21-36 unused, if different from base (male) case
622 // 37 string flag, unused
623 //char* nameNeutralGender[16]; // 38-53 unused, if different from base (male) case
624 // 54 string flag, unused
625 // 55, unused capitalized name
626 uint32 spellfamily; // 56
627 //uint32 flags2; // 57, unused 0x08 HasRelicSlot
628 uint32 CinematicSequence; // 58 id from CinematicSequences.dbc
629 uint32 expansion; // 59 (0 - original race, 1 - tbc addon, ...)
632 struct ChrRacesEntry
634 uint32 RaceID; // 0
635 // 1 unused
636 uint32 FactionID; // 2 facton template id
637 // 3 unused
638 uint32 model_m; // 4
639 uint32 model_f; // 5
640 // 6 unused
641 uint32 TeamID; // 7 (7-Alliance 1-Horde)
642 // 8-11 unused
643 uint32 CinematicSequence; // 12 id from CinematicSequences.dbc
644 //uint32 unk_322; // 13 faction (0 alliance, 1 horde, 2 not available?)
645 char* name[16]; // 14-29 used for DBC language detection/selection
646 // 30 string flags, unused
647 //char* nameFemale[16]; // 31-46, if different from base (male) case
648 // 47 string flags, unused
649 //char* nameNeutralGender[16]; // 48-63, if different from base (male) case
650 // 64 string flags, unused
651 // 65-67 unused
652 uint32 expansion; // 68 (0 - original race, 1 - tbc addon, ...)
655 /* not used
656 struct CinematicCameraEntry
658 uint32 id; // 0 index
659 char* filename; // 1
660 uint32 soundid; // 2 in SoundEntries.dbc or 0
661 float start_x; // 3
662 float start_y; // 4
663 float start_z; // 5
664 float unk6; // 6 speed?
668 struct CinematicSequencesEntry
670 uint32 Id; // 0 index
671 //uint32 unk1; // 1 always 0
672 //uint32 cinematicCamera; // 2 id in CinematicCamera.dbc
673 // 3-9 always 0
676 struct CreatureDisplayInfoEntry
678 uint32 Displayid; // 0 m_ID
679 // 1 m_modelID
680 // 2 m_soundID
681 // 3 m_extendedDisplayInfoID
682 float scale; // 4 m_creatureModelScale
683 // 5 m_creatureModelAlpha
684 // 6-8 m_textureVariation[3]
685 // 9 m_portraitTextureName
686 // 10 m_sizeClass
687 // 11 m_bloodID
688 // 12 m_NPCSoundID
689 // 13 m_particleColorID
690 // 14 m_creatureGeosetData
691 // 15 m_objectEffectPackageID
694 struct CreatureFamilyEntry
696 uint32 ID; // 0 m_ID
697 float minScale; // 1 m_minScale
698 uint32 minScaleLevel; // 2 m_minScaleLevel
699 float maxScale; // 3 m_maxScale
700 uint32 maxScaleLevel; // 4 m_maxScaleLevel
701 uint32 skillLine[2]; // 5-6 m_skillLine
702 uint32 petFoodMask; // 7 m_petFoodMask
703 int32 petTalentType; // 8 m_petTalentType
704 // 9 m_categoryEnumID
705 char* Name[16]; // 10-25 m_name_lang
706 // 26 string flags
707 // 27 m_iconFile
710 #define MAX_CREATURE_SPELL_DATA_SLOT 4
712 struct CreatureSpellDataEntry
714 uint32 ID; // 0 m_ID
715 uint32 spellId[MAX_CREATURE_SPELL_DATA_SLOT]; // 1-4 m_spells[4]
716 //uint32 availability[MAX_CREATURE_SPELL_DATA_SLOT]; // 4-7 m_availability[4]
719 struct CreatureTypeEntry
721 uint32 ID; // 0 m_ID
722 //char* Name[16]; // 1-16 name
723 // 17 string flags
724 //uint32 no_expirience; // 18 no exp? critters, non-combat pets, gas cloud.
727 /* not used
728 struct CurrencyCategoryEntry
730 uint32 ID; // 0
731 uint32 Unk1; // 1 0 for known categories and 3 for unknown one (3.0.9)
732 char* Name[16]; // 2-17 name
733 // // 18 string flags
737 struct CurrencyTypesEntry
739 //uint32 ID; // 0 not used
740 uint32 ItemId; // 1 used as real index
741 //uint32 Category; // 2 may be category
742 uint32 BitIndex; // 3 bit index in PLAYER_FIELD_KNOWN_CURRENCIES (1 << (index-1))
745 struct DurabilityCostsEntry
747 uint32 Itemlvl; // 0
748 uint32 multiplier[29]; // 1-29
751 struct DurabilityQualityEntry
753 uint32 Id; // 0
754 float quality_mod; // 1
757 struct EmotesEntry
759 uint32 Id; // 0
760 //char* Name; // 1, internal name
761 //uint32 AnimationId; // 2, ref to animationData
762 uint32 Flags; // 3, bitmask, may be unit_flags
763 uint32 EmoteType; // 4, Can be 0, 1 or 2 (determine how emote are shown)
764 uint32 UnitStandState; // 5, uncomfirmed, may be enum UnitStandStateType
765 //uint32 SoundId; // 6, ref to soundEntries
768 struct EmotesTextEntry
770 uint32 Id;
771 uint32 textid;
774 struct FactionEntry
776 uint32 ID; // 0 m_ID
777 int32 reputationListID; // 1 m_reputationIndex
778 uint32 BaseRepRaceMask[4]; // 2-5 m_reputationRaceMask
779 uint32 BaseRepClassMask[4]; // 6-9 m_reputationClassMask
780 int32 BaseRepValue[4]; // 10-13 m_reputationBase
781 uint32 ReputationFlags[4]; // 14-17 m_reputationFlags
782 uint32 team; // 18 m_parentFactionID
783 //float unk1; // 19
784 //float unk2; // 20
785 //uint32 unk3 // 21
786 //uint32 unk4; // 22
787 char* name[16]; // 23-38 m_name_lang
788 // 39 string flags
789 //char* description[16]; // 40-55 m_description_lang
790 // 56 string flags
793 struct FactionTemplateEntry
795 uint32 ID; // 0 m_ID
796 uint32 faction; // 1 m_faction
797 uint32 factionFlags; // 2 m_flags
798 uint32 ourMask; // 3 m_factionGroup
799 uint32 friendlyMask; // 4 m_friendGroup
800 uint32 hostileMask; // 5 m_enemyGroup
801 uint32 enemyFaction[4]; // 6 m_enemies[4]
802 uint32 friendFaction[4]; // 10 m_friend[4]
803 //------------------------------------------------------- end structure
805 // helpers
806 bool IsFriendlyTo(FactionTemplateEntry const& entry) const
808 if(entry.faction)
810 for(int i = 0; i < 4; ++i)
811 if (enemyFaction[i] == entry.faction)
812 return false;
813 for(int i = 0; i < 4; ++i)
814 if (friendFaction[i] == entry.faction)
815 return true;
817 return (friendlyMask & entry.ourMask) || (ourMask & entry.friendlyMask);
819 bool IsHostileTo(FactionTemplateEntry const& entry) const
821 if(entry.faction)
823 for(int i = 0; i < 4; ++i)
824 if (enemyFaction[i] == entry.faction)
825 return true;
826 for(int i = 0; i < 4; ++i)
827 if (friendFaction[i] == entry.faction)
828 return false;
830 return (hostileMask & entry.ourMask) != 0;
832 bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; }
833 bool IsNeutralToAll() const
835 for(int i = 0; i < 4; ++i)
836 if (enemyFaction[i] != 0)
837 return false;
838 return hostileMask == 0 && friendlyMask == 0;
840 bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD)!=0; }
843 struct GameObjectDisplayInfoEntry
845 uint32 Displayid; // 0 m_ID
846 // char* filename; // 1
847 // uint32 unknown2[10]; // 2-11 unknown data
848 // float unknown12[6]; // 12-17 unknown data
849 // uint32 unknown18; // 18 unknown data
852 struct GemPropertiesEntry
854 uint32 ID;
855 uint32 spellitemenchantement;
856 uint32 color;
859 struct GlyphPropertiesEntry
861 uint32 Id;
862 uint32 SpellId;
863 uint32 TypeFlags;
864 uint32 Unk1; // GlyphIconId (SpellIcon.dbc)
867 struct GlyphSlotEntry
869 uint32 Id;
870 uint32 TypeFlags;
871 uint32 Order;
874 // All Gt* DBC store data for 100 levels, some by 100 per class/race
875 #define GT_MAX_LEVEL 100
877 struct GtBarberShopCostBaseEntry
879 float cost;
882 struct GtCombatRatingsEntry
884 float ratio;
887 struct GtChanceToMeleeCritBaseEntry
889 float base;
892 struct GtChanceToMeleeCritEntry
894 float ratio;
897 struct GtChanceToSpellCritBaseEntry
899 float base;
902 struct GtChanceToSpellCritEntry
904 float ratio;
907 struct GtOCTRegenHPEntry
909 float ratio;
912 //struct GtOCTRegenMPEntry
914 // float ratio;
915 //};
917 struct GtRegenHPPerSptEntry
919 float ratio;
922 struct GtRegenMPPerSptEntry
924 float ratio;
927 /* no used
928 struct HolidayDescriptionsEntry
930 uint32 ID; // 0, this is NOT holiday id
931 //char* name[16] // 1-16 m_name_lang
932 // 17 name flags
936 /* no used
937 struct HolidayNamesEntry
939 uint32 ID; // 0, this is NOT holiday id
940 //char* name[16] // 1-16 m_name_lang
941 // 17 name flags
945 struct HolidaysEntry
947 uint32 ID; // 0, holiday id
948 //uint32 unk1; // 1
949 //uint32 unk2; // 2
950 //uint32 unk3[8] // 3-10, empty fields
951 //uint32 unk11[13] // 11-23, some unknown data (bit strings?)
952 //uint32 unk11[13] // 24-36, some empty fields (continue prev?)
953 //uint32 unk11[12] // 37-48, counters?
954 //uint32 holidayNameId; // 49, id for HolidayNames.dbc
955 //uint32 holidayDescriptionId; // 50, id for HolidayDescriptions.dbc
956 //uint32 unk51; // 51
957 //uint32 unk52; // 52
958 //uint32 unk53; // 53
959 //uint32 unk54; // 54
962 struct ItemEntry
964 uint32 ID; // 0
965 uint32 Class; // 1
966 uint32 SubClass; // 2 some items have strange subclasses
967 int32 Unk0; // 3
968 int32 Material; // 4
969 uint32 DisplayId; // 5
970 uint32 InventoryType; // 6
971 uint32 Sheath; // 7
974 struct ItemBagFamilyEntry
976 uint32 ID; // 0
977 //char* name[16] // 1-16 m_name_lang
978 // // 17 name flags
981 struct ItemDisplayInfoEntry
983 uint32 ID; // 0 m_ID
984 // 1 m_modelName[2]
985 // 2 m_modelTexture[2]
986 // 3 m_inventoryIcon
987 // 4 m_geosetGroup[3]
988 // 5 m_flags
989 // 6 m_spellVisualID
990 // 7 m_groupSoundIndex
991 // 8 m_helmetGeosetVis[2]
992 // 9 m_texture[2]
993 // 10 m_itemVisual[8]
994 // 11 m_particleColorID
997 //struct ItemCondExtCostsEntry
999 // uint32 ID;
1000 // uint32 condExtendedCost; // ItemPrototype::CondExtendedCost
1001 // uint32 itemextendedcostentry; // ItemPrototype::ExtendedCost
1002 // uint32 arenaseason; // arena season number(1-4)
1003 //};
1005 struct ItemExtendedCostEntry
1007 uint32 ID; // 0 extended-cost entry id
1008 uint32 reqhonorpoints; // 1 required honor points
1009 uint32 reqarenapoints; // 2 required arena points
1010 uint32 reqarenaslot; // 4 arena slot restrctions (min slot value)
1011 uint32 reqitem[5]; // 5-8 required item id
1012 uint32 reqitemcount[5]; // 9-13 required count of 1st item
1013 uint32 reqpersonalarenarating; // 14 required personal arena rating
1016 struct ItemLimitCategoryEntry
1018 uint32 ID; // 0 Id
1019 //char* name[16] // 1-16 m_name_lang
1020 // 17 name flags
1021 uint32 maxCount; // 18, max allowed equipped as item or in gem slot
1022 //uint32 unk; // 19, 1 for gems only...
1025 struct ItemRandomPropertiesEntry
1027 uint32 ID; // 0 m_ID
1028 //char* internalName // 1 m_Name
1029 uint32 enchant_id[5]; // 2-6 m_Enchantment
1030 char* nameSuffix[16]; // 7-22 m_name_lang
1031 // 23 name flags
1034 struct ItemRandomSuffixEntry
1036 uint32 ID; // 0 m_ID
1037 char* nameSuffix[16]; // 1-16 m_name_lang
1038 // 17, name flags
1039 // 18 m_internalName
1040 uint32 enchant_id[5]; // 19-21 m_enchantment
1041 uint32 prefix[5]; // 22-24 m_allocationPct
1044 struct ItemSetEntry
1046 //uint32 id // 0 m_ID
1047 char* name[16]; // 1-16 m_name_lang
1048 // 17 string flags, unused
1049 //uint32 itemId[17]; // 18-34 m_itemID
1050 uint32 spells[8]; // 35-42 m_setSpellID
1051 uint32 items_to_triggerspell[8]; // 43-50 m_setThreshold
1052 uint32 required_skill_id; // 51 m_requiredSkill
1053 uint32 required_skill_value; // 52 m_requiredSkillRank
1056 #define MAX_LOCK_CASE 8
1058 struct LockEntry
1060 uint32 ID; // 0 m_ID
1061 uint32 Type[MAX_LOCK_CASE]; // 1-8 m_Type
1062 uint32 Index[MAX_LOCK_CASE]; // 9-16 m_Index
1063 uint32 Skill[MAX_LOCK_CASE]; // 17-24 m_Skill
1064 //uint32 Action[MAX_LOCK_CASE]; // 25-32 m_Action
1067 struct MailTemplateEntry
1069 uint32 ID; // 0
1070 //char* subject[16]; // 1-16
1071 // 17 name flags, unused
1072 char* content[16]; // 18-33
1075 struct MapEntry
1077 uint32 MapID; // 0
1078 //char* internalname; // 1 unused
1079 uint32 map_type; // 2
1080 //uint32 mapFlags; // 3 some kind of flags (0x100 - CAN_CHANGE_PLAYER_DIFFICULTY)
1081 //uint32 isPvP; // 4 0 or 1 for battlegrounds (not arenas)
1082 char* name[16]; // 5-20
1083 // 21 name flags, unused
1084 uint32 linked_zone; // 22 common zone for instance and continent map
1085 //char* hordeIntro[16]; // 23-38 text for PvP Zones
1086 // 39 intro text flags
1087 //char* allianceIntro[16]; // 40-55 text for PvP Zones
1088 // 56 intro text flags
1089 uint32 multimap_id; // 57 index in LoadingScreens.dbc
1090 //float BattlefieldMapIconScale; // 58 BattlefieldMapIconScale
1091 int32 entrance_map; // 59 map_id of entrance map
1092 float entrance_x; // 60 entrance x coordinate (if exist single entry)
1093 float entrance_y; // 61 entrance y coordinate (if exist single entry)
1094 //uint32 timeOfDayOverride; // 62 time of day override
1095 uint32 addon; // 63 expansion
1096 // 64 some kind of time?
1097 //uint32 maxPlayers; // 65 max players
1099 // Helpers
1100 uint32 Expansion() const { return addon; }
1102 bool IsDungeon() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID; }
1103 bool IsNonRaidDungeon() const { return map_type == MAP_INSTANCE; }
1104 bool Instanceable() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID || map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; }
1105 bool IsRaid() const { return map_type == MAP_RAID; }
1106 bool IsBattleGround() const { return map_type == MAP_BATTLEGROUND; }
1107 bool IsBattleArena() const { return map_type == MAP_ARENA; }
1108 bool IsBattleGroundOrArena() const { return map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; }
1110 bool IsMountAllowed() const
1112 return !IsDungeon() ||
1113 MapID==209 || MapID==269 || MapID==309 || // TanarisInstance, CavernsOfTime, Zul'gurub
1114 MapID==509 || MapID==534 || MapID==560 || // AhnQiraj, HyjalPast, HillsbradPast
1115 MapID==568 || MapID==580 || MapID==595 || // ZulAman, Sunwell Plateau, Culling of Stratholme
1116 MapID==615 || MapID==616; // Obsidian Sanctum, Eye Of Eternity
1119 bool IsContinent() const
1121 return MapID == 0 || MapID == 1 || MapID == 530 || MapID == 571;
1125 struct MapDifficultyEntry
1127 //uint32 Id; // 0
1128 uint32 MapId; // 1
1129 uint32 Difficulty; // 2 (for arenas: arena slot)
1130 //char* areaTriggerText[16]; // 3-18 text showed when transfer to map failed (missing requirements)
1131 //uint32 textFlags; // 19
1132 uint32 resetTime; // 20
1133 uint32 maxPlayers; // 21
1134 //char* difficultyString; // 22
1137 struct MovieEntry
1139 uint32 Id; // 0 index
1140 //char* filename; // 1
1141 //uint32 unk2; // 2 always 100
1144 struct PvPDifficultyEntry
1146 //uint32 id; // 0 m_ID
1147 uint32 mapId; // 1
1148 uint32 bracketId; // 2
1149 uint32 minLevel; // 3
1150 uint32 maxLevel; // 4
1151 uint32 difficulty; // 5
1153 // helpers
1154 BattleGroundBracketId GetBracketId() const { return BattleGroundBracketId(bracketId); }
1157 struct QuestFactionRewardEntry
1159 uint32 id; // 0
1160 int32 rewardValue[10]; // 1-10
1163 struct QuestSortEntry
1165 uint32 id; // 0 m_ID
1166 //char* name[16]; // 1-16 m_SortName_lang
1167 // 17 name flags
1170 struct QuestXPLevel
1172 uint32 questLevel; // 0
1173 uint32 xpIndex[9]; // 1-9
1174 //unk // 10
1177 struct RandomPropertiesPointsEntry
1179 //uint32 Id; // 0 hidden key
1180 uint32 itemLevel; // 1
1181 uint32 EpicPropertiesPoints[5]; // 2-6
1182 uint32 RarePropertiesPoints[5]; // 7-11
1183 uint32 UncommonPropertiesPoints[5]; // 12-16
1186 struct ScalingStatDistributionEntry
1188 uint32 Id; // 0
1189 int32 StatMod[10]; // 1-10
1190 uint32 Modifier[10]; // 11-20
1191 uint32 MaxLevel; // 21
1194 struct ScalingStatValuesEntry
1196 uint32 Id; // 0
1197 uint32 Level; // 1
1198 uint32 ssdMultiplier[4]; // 2-5 Multiplier for ScalingStatDistribution
1199 uint32 armorMod[4]; // 6-9 Armor for level
1200 uint32 dpsMod[6]; // 10-15 DPS mod for level
1201 uint32 spellBonus; // 16 spell power for level
1202 uint32 ssdMultiplier2; // 17 there's data from 3.1 dbc ssdMultiplier[3]
1203 uint32 ssdMultiplier3; // 18 3.3
1204 //uint32 unk2; // 19 unk, probably also Armor for level (flag 0x80000?)
1205 uint32 armorMod2[4]; // 20-23 Armor for level
1207 uint32 getssdMultiplier(uint32 mask) const
1209 if (mask & 0x4001F)
1211 if(mask & 0x00000001) return ssdMultiplier[0];
1212 if(mask & 0x00000002) return ssdMultiplier[1];
1213 if(mask & 0x00000004) return ssdMultiplier[2];
1214 if(mask & 0x00000008) return ssdMultiplier2;
1215 if(mask & 0x00000010) return ssdMultiplier[3];
1216 if(mask & 0x00040000) return ssdMultiplier3;
1218 return 0;
1221 uint32 getArmorMod(uint32 mask) const
1223 if (mask & 0x00F001E0)
1225 if(mask & 0x00000020) return armorMod[0];
1226 if(mask & 0x00000040) return armorMod[1];
1227 if(mask & 0x00000080) return armorMod[2];
1228 if(mask & 0x00000100) return armorMod[3];
1230 if(mask & 0x00100000) return armorMod2[0]; // cloth
1231 if(mask & 0x00200000) return armorMod2[1]; // leather
1232 if(mask & 0x00400000) return armorMod2[2]; // mail
1233 if(mask & 0x00800000) return armorMod2[3]; // plate
1235 return 0;
1238 uint32 getDPSMod(uint32 mask) const
1240 if (mask & 0x7E00)
1242 if(mask & 0x00000200) return dpsMod[0];
1243 if(mask & 0x00000400) return dpsMod[1];
1244 if(mask & 0x00000800) return dpsMod[2];
1245 if(mask & 0x00001000) return dpsMod[3];
1246 if(mask & 0x00002000) return dpsMod[4];
1247 if(mask & 0x00004000) return dpsMod[5]; // not used?
1249 return 0;
1252 uint32 getSpellBonus(uint32 mask) const
1254 if (mask & 0x00008000)
1255 return spellBonus;
1256 return 0;
1259 uint32 getFeralBonus(uint32 mask) const // removed in 3.2.x?
1261 if (mask & 0x00010000) // not used?
1262 return 0;
1263 return 0;
1267 //struct SkillLineCategoryEntry{
1268 // uint32 id; // 0 m_ID
1269 // char* name[16]; // 1-17 m_name_lang
1270 // // 18 string flag
1271 // uint32 displayOrder; // 19 m_sortIndex
1272 //};
1274 //struct SkillRaceClassInfoEntry{
1275 // uint32 id; // 0 m_ID
1276 // uint32 skillId; // 1 m_skillID
1277 // uint32 raceMask; // 2 m_raceMask
1278 // uint32 classMask; // 3 m_classMask
1279 // uint32 flags; // 4 m_flags
1280 // uint32 reqLevel; // 5 m_minLevel
1281 // uint32 skillTierId; // 6 m_skillTierID
1282 // uint32 skillCostID; // 7 m_skillCostIndex
1283 //};
1285 //struct SkillTiersEntry{
1286 // uint32 id; // 0 m_ID
1287 // uint32 skillValue[16]; // 1-17 m_cost
1288 // uint32 maxSkillValue[16]; // 18-32 m_valueMax
1289 //};
1291 struct SkillLineEntry
1293 uint32 id; // 0 m_ID
1294 int32 categoryId; // 1 m_categoryID
1295 //uint32 skillCostID; // 2 m_skillCostsID
1296 char* name[16]; // 3-18 m_displayName_lang
1297 // 19 string flags
1298 //char* description[16]; // 20-35 m_description_lang
1299 // 36 string flags
1300 uint32 spellIcon; // 37 m_spellIconID
1301 //char* alternateVerb[16]; // 38-53 m_alternateVerb_lang
1302 // 54 string flags
1303 uint32 canLink; // 55 m_canLink (prof. with recipes
1306 struct SkillLineAbilityEntry
1308 uint32 id; // 0 m_ID
1309 uint32 skillId; // 1 m_skillLine
1310 uint32 spellId; // 2 m_spell
1311 uint32 racemask; // 3 m_raceMask
1312 uint32 classmask; // 4 m_classMask
1313 //uint32 racemaskNot; // 5 m_excludeRace
1314 //uint32 classmaskNot; // 6 m_excludeClass
1315 uint32 req_skill_value; // 7 m_minSkillLineRank
1316 uint32 forward_spellid; // 8 m_supercededBySpell
1317 uint32 learnOnGetSkill; // 9 m_acquireMethod
1318 uint32 max_value; // 10 m_trivialSkillLineRankHigh
1319 uint32 min_value; // 11 m_trivialSkillLineRankLow
1320 //uint32 characterPoints[2]; // 12-13 m_characterPoints[2]
1323 struct SoundEntriesEntry
1325 uint32 Id; // 0 m_ID
1326 //uint32 Type; // 1 m_soundType
1327 //char* InternalName; // 2 m_name
1328 //char* FileName[10]; // 3-12 m_File[10]
1329 //uint32 Unk13[10]; // 13-22 m_Freq[10]
1330 //char* Path; // 23 m_DirectoryBase
1331 // 24 m_volumeFloat
1332 // 25 m_flags
1333 // 26 m_minDistance
1334 // 27 m_distanceCutoff
1335 // 28 m_EAXDef
1336 // 29 new in 3.1
1339 struct SpellEntry
1341 uint32 Id; // 0 m_ID
1342 uint32 Category; // 1 m_category
1343 uint32 Dispel; // 2 m_dispelType
1344 uint32 Mechanic; // 3 m_mechanic
1345 uint32 Attributes; // 4 m_attribute
1346 uint32 AttributesEx; // 5 m_attributesEx
1347 uint32 AttributesEx2; // 6 m_attributesExB
1348 uint32 AttributesEx3; // 7 m_attributesExC
1349 uint32 AttributesEx4; // 8 m_attributesExD
1350 uint32 AttributesEx5; // 9 m_attributesExE
1351 uint32 AttributesEx6; // 10 m_attributesExF
1352 // uint32 unk_320_1; // 11 3.2.0 (0x20 - totems, 0x4 - paladin auras, etc...)
1353 uint32 Stances; // 12 m_shapeshiftMask
1354 // uint32 unk_320_2; // 13 3.2.0
1355 uint32 StancesNot; // 14 m_shapeshiftExclude
1356 // uint32 unk_320_3; // 15 3.2.0
1357 uint32 Targets; // 16 m_targets
1358 uint32 TargetCreatureType; // 17 m_targetCreatureType
1359 uint32 RequiresSpellFocus; // 18 m_requiresSpellFocus
1360 uint32 FacingCasterFlags; // 19 m_facingCasterFlags
1361 uint32 CasterAuraState; // 20 m_casterAuraState
1362 uint32 TargetAuraState; // 21 m_targetAuraState
1363 uint32 CasterAuraStateNot; // 22 m_excludeCasterAuraState
1364 uint32 TargetAuraStateNot; // 23 m_excludeTargetAuraState
1365 uint32 casterAuraSpell; // 24 m_casterAuraSpell
1366 uint32 targetAuraSpell; // 25 m_targetAuraSpell
1367 uint32 excludeCasterAuraSpell; // 26 m_excludeCasterAuraSpell
1368 uint32 excludeTargetAuraSpell; // 27 m_excludeTargetAuraSpell
1369 uint32 CastingTimeIndex; // 28 m_castingTimeIndex
1370 uint32 RecoveryTime; // 29 m_recoveryTime
1371 uint32 CategoryRecoveryTime; // 30 m_categoryRecoveryTime
1372 uint32 InterruptFlags; // 31 m_interruptFlags
1373 uint32 AuraInterruptFlags; // 32 m_auraInterruptFlags
1374 uint32 ChannelInterruptFlags; // 33 m_channelInterruptFlags
1375 uint32 procFlags; // 34 m_procTypeMask
1376 uint32 procChance; // 35 m_procChance
1377 uint32 procCharges; // 36 m_procCharges
1378 uint32 maxLevel; // 37 m_maxLevel
1379 uint32 baseLevel; // 38 m_baseLevel
1380 uint32 spellLevel; // 39 m_spellLevel
1381 uint32 DurationIndex; // 40 m_durationIndex
1382 uint32 powerType; // 41 m_powerType
1383 uint32 manaCost; // 42 m_manaCost
1384 uint32 manaCostPerlevel; // 43 m_manaCostPerLevel
1385 uint32 manaPerSecond; // 44 m_manaPerSecond
1386 uint32 manaPerSecondPerLevel; // 45 m_manaPerSecondPerLeve
1387 uint32 rangeIndex; // 46 m_rangeIndex
1388 float speed; // 47 m_speed
1389 //uint32 modalNextSpell; // 48 m_modalNextSpell not used
1390 uint32 StackAmount; // 49 m_cumulativeAura
1391 uint32 Totem[2]; // 50-51 m_totem
1392 int32 Reagent[8]; // 52-59 m_reagent
1393 uint32 ReagentCount[8]; // 60-67 m_reagentCount
1394 int32 EquippedItemClass; // 68 m_equippedItemClass (value)
1395 int32 EquippedItemSubClassMask; // 69 m_equippedItemSubclass (mask)
1396 int32 EquippedItemInventoryTypeMask; // 70 m_equippedItemInvTypes (mask)
1397 uint32 Effect[3]; // 71-73 m_effect
1398 int32 EffectDieSides[3]; // 74-76 m_effectDieSides
1399 uint32 EffectBaseDice[3]; // 77-79 m_effectBaseDice
1400 float EffectDicePerLevel[3]; // 80-82 m_effectDicePerLevel
1401 float EffectRealPointsPerLevel[3]; // 83-85 m_effectRealPointsPerLevel
1402 int32 EffectBasePoints[3]; // 86-88 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
1403 uint32 EffectMechanic[3]; // 89-91 m_effectMechanic
1404 uint32 EffectImplicitTargetA[3]; // 92-94 m_implicitTargetA
1405 uint32 EffectImplicitTargetB[3]; // 95-97 m_implicitTargetB
1406 uint32 EffectRadiusIndex[3]; // 98-100 m_effectRadiusIndex - spellradius.dbc
1407 uint32 EffectApplyAuraName[3]; // 101-103 m_effectAura
1408 uint32 EffectAmplitude[3]; // 104-106 m_effectAuraPeriod
1409 float EffectMultipleValue[3]; // 107-109 m_effectAmplitude
1410 uint32 EffectChainTarget[3]; // 110-112 m_effectChainTargets
1411 uint32 EffectItemType[3]; // 113-115 m_effectItemType
1412 int32 EffectMiscValue[3]; // 116-118 m_effectMiscValue
1413 int32 EffectMiscValueB[3]; // 119-121 m_effectMiscValueB
1414 uint32 EffectTriggerSpell[3]; // 122-124 m_effectTriggerSpell
1415 float EffectPointsPerComboPoint[3]; // 125-127 m_effectPointsPerCombo
1416 uint32 EffectSpellClassMaskA[3]; // 128-130 m_effectSpellClassMaskA
1417 uint32 EffectSpellClassMaskB[3]; // 131-133 m_effectSpellClassMaskB
1418 uint32 EffectSpellClassMaskC[3]; // 134-136 m_effectSpellClassMaskC
1419 uint32 SpellVisual[2]; // 137-138 m_spellVisualID
1420 uint32 SpellIconID; // 139 m_spellIconID
1421 uint32 activeIconID; // 140 m_activeIconID
1422 //uint32 spellPriority; // 141 m_spellPriority not used
1423 char* SpellName[16]; // 142-157 m_name_lang
1424 //uint32 SpellNameFlag; // 158 not used
1425 char* Rank[16]; // 159-174 m_nameSubtext_lang
1426 //uint32 RankFlags; // 175 not used
1427 //char* Description[16]; // 176-191 m_description_lang not used
1428 //uint32 DescriptionFlags; // 192 not used
1429 //char* ToolTip[16]; // 193-208 m_auraDescription_lang not used
1430 //uint32 ToolTipFlags; // 209 not used
1431 uint32 ManaCostPercentage; // 210 m_manaCostPct
1432 uint32 StartRecoveryCategory; // 211 m_startRecoveryCategory
1433 uint32 StartRecoveryTime; // 212 m_startRecoveryTime
1434 uint32 MaxTargetLevel; // 213 m_maxTargetLevel
1435 uint32 SpellFamilyName; // 214 m_spellClassSet
1436 uint64 SpellFamilyFlags; // 215-216 m_spellClassMask NOTE: size is 12 bytes!!!
1437 uint32 SpellFamilyFlags2; // 217 addition to m_spellClassMask
1438 uint32 MaxAffectedTargets; // 218 m_maxTargets
1439 uint32 DmgClass; // 219 m_defenseType
1440 uint32 PreventionType; // 220 m_preventionType
1441 //uint32 StanceBarOrder; // 221 m_stanceBarOrder not used
1442 float DmgMultiplier[3]; // 222-224 m_effectChainAmplitude
1443 //uint32 MinFactionId; // 225 m_minFactionID not used
1444 //uint32 MinReputation; // 226 m_minReputation not used
1445 //uint32 RequiredAuraVision; // 227 m_requiredAuraVision not used
1446 uint32 TotemCategory[2]; // 228-229 m_requiredTotemCategoryID
1447 int32 AreaGroupId; // 230 m_requiredAreaGroupId
1448 uint32 SchoolMask; // 231 m_schoolMask
1449 uint32 runeCostID; // 232 m_runeCostID
1450 //uint32 spellMissileID; // 233 m_spellMissileID not used
1451 //uint32 PowerDisplayId; // 234 PowerDisplay.dbc, new in 3.1
1452 //float unk_320_4[3]; // 235-237 3.2.0
1453 //uint32 spellDescriptionVariableID; // 238 3.2.0
1454 //uint32 SpellDifficultyId; // 239 3.3.0
1456 // helpers
1457 int32 CalculateSimpleValue(uint8 eff) const { return EffectBasePoints[eff]+int32(EffectBaseDice[eff]); }
1458 uint32 const* GetEffectSpellClassMask(uint8 effect) const
1460 return EffectSpellClassMaskA + effect * 3;
1463 private:
1464 // prevent creating custom entries (copy data from original in fact)
1465 SpellEntry(SpellEntry const&); // DON'T must have implementation
1468 typedef std::set<uint32> SpellCategorySet;
1469 typedef std::map<uint32,SpellCategorySet > SpellCategoryStore;
1470 typedef std::set<uint32> PetFamilySpellsSet;
1471 typedef std::map<uint32,PetFamilySpellsSet > PetFamilySpellsStore;
1473 struct SpellCastTimesEntry
1475 uint32 ID; // 0
1476 int32 CastTime; // 1
1477 //float CastTimePerLevel; // 2 unsure / per skill?
1478 //int32 MinCastTime; // 3 unsure
1481 struct SpellFocusObjectEntry
1483 uint32 ID; // 0
1484 //char* Name[16]; // 1-15 unused
1485 // 16 string flags, unused
1488 struct SpellRadiusEntry
1490 uint32 ID;
1491 float Radius;
1492 float Radius2;
1495 struct SpellRangeEntry
1497 uint32 ID;
1498 float minRange;
1499 float minRangeFriendly;
1500 float maxRange;
1501 float maxRangeFriendly;
1504 struct SpellRuneCostEntry
1506 uint32 ID; // 0
1507 uint32 RuneCost[3]; // 1-3 (0=blood, 1=frost, 2=unholy)
1508 uint32 runePowerGain; // 4
1510 bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; }
1511 bool NoRunicPowerGain() const { return runePowerGain == 0; }
1514 struct SpellShapeshiftEntry
1516 uint32 ID; // 0
1517 //uint32 buttonPosition; // 1 unused
1518 //char* Name[16]; // 2-17 unused
1519 //uint32 NameFlags; // 18 unused
1520 uint32 flags1; // 19
1521 int32 creatureType; // 20 <=0 humanoid, other normal creature types
1522 //uint32 unk1; // 21 unused, related to next field
1523 uint32 attackSpeed; // 22
1524 uint32 modelID_A; // 23 alliance modelid (0 means no model)
1525 uint32 modelID_H; // 24 horde modelid (but only for one form)
1526 //uint32 unk3; // 25 unused always 0
1527 //uint32 unk4; // 26 unused always 0
1528 uint32 spellId[8]; // 27-34 spells which appear in the bar after shapeshifting
1531 struct SpellDurationEntry
1533 uint32 ID;
1534 int32 Duration[3];
1537 struct SpellItemEnchantmentEntry
1539 uint32 ID; // 0 m_ID
1540 //uint32 charges; // 1 m_charges
1541 uint32 type[3]; // 2-4 m_effect[3]
1542 uint32 amount[3]; // 5-7 m_effectPointsMin[3]
1543 //uint32 amount2[3] // 8-10 m_effectPointsMax[3]
1544 uint32 spellid[3]; // 11-13 m_effectArg[3]
1545 char* description[16]; // 14-29 m_name_lang[16]
1546 //uint32 descriptionFlags; // 30 name flags
1547 uint32 aura_id; // 31 m_itemVisual
1548 uint32 slot; // 32 m_flags
1549 uint32 GemID; // 33 m_src_itemID
1550 uint32 EnchantmentCondition; // 34 m_condition_id
1551 //uint32 requiredSkill; // 35 m_requiredSkillID
1552 //uint32 requiredSkillValue; // 36 m_requiredSkillRank
1553 // 37 new in 3.1
1556 struct SpellItemEnchantmentConditionEntry
1558 uint32 ID; // 0 m_ID
1559 uint8 Color[5]; // 1-5 m_lt_operandType[5]
1560 //uint32 LT_Operand[5]; // 6-10 m_lt_operand[5]
1561 uint8 Comparator[5]; // 11-15 m_operator[5]
1562 uint8 CompareColor[5]; // 15-20 m_rt_operandType[5]
1563 uint32 Value[5]; // 21-25 m_rt_operand[5]
1564 //uint8 Logic[5] // 25-30 m_logic[5]
1567 struct StableSlotPricesEntry
1569 uint32 Slot;
1570 uint32 Price;
1573 struct SummonPropertiesEntry
1575 uint32 Id; // 0
1576 uint32 Group; // 1, enum SummonPropGroup
1577 uint32 FactionId; // 2, 14 rows > 0
1578 uint32 Type; // 3, enum SummonPropType
1579 uint32 Slot; // 4, if type = SUMMON_PROP_TYPE_TOTEM, its actual slot 0-6
1580 uint32 Flags; // 5, enum SummonPropFlags
1583 #define MAX_TALENT_RANK 5
1584 #define MAX_PET_TALENT_RANK 3 // use in calculations, expected <= MAX_TALENT_RANK
1586 struct TalentEntry
1588 uint32 TalentID; // 0
1589 uint32 TalentTab; // 1 index in TalentTab.dbc (TalentTabEntry)
1590 uint32 Row; // 2
1591 uint32 Col; // 3
1592 uint32 RankID[MAX_TALENT_RANK]; // 4-8
1593 // 9-12 not used, always 0, maybe not used high ranks
1594 uint32 DependsOn; // 13 index in Talent.dbc (TalentEntry)
1595 // 14-15 not used
1596 uint32 DependsOnRank; // 16
1597 // 17-18 not used
1598 //uint32 needAddInSpellBook; // 19 also need disable higest ranks on reset talent tree
1599 //uint32 unk2; // 20, all 0
1600 //uint64 allowForPet; // 21 its a 64 bit mask for pet 1<<m_categoryEnumID in CreatureFamily.dbc
1603 struct TalentTabEntry
1605 uint32 TalentTabID; // 0
1606 //char* name[16]; // 1-16, unused
1607 //uint32 nameFlags; // 17, unused
1608 //unit32 spellicon; // 18
1609 // 19 not used
1610 uint32 ClassMask; // 20
1611 uint32 petTalentMask; // 21
1612 uint32 tabpage; // 22
1613 //char* internalname; // 23
1616 struct TaxiNodesEntry
1618 uint32 ID; // 0 m_ID
1619 uint32 map_id; // 1 m_ContinentID
1620 float x; // 2 m_x
1621 float y; // 3 m_y
1622 float z; // 4 m_z
1623 char* name[16]; // 5-21 m_Name_lang
1624 // 22 string flags
1625 uint32 MountCreatureID[2]; // 23-24 m_MountCreatureID[2]
1628 struct TaxiPathEntry
1630 uint32 ID; // 0 m_ID
1631 uint32 from; // 1 m_FromTaxiNode
1632 uint32 to; // 2 m_ToTaxiNode
1633 uint32 price; // 3 m_Cost
1636 struct TaxiPathNodeEntry
1638 // 0 m_ID
1639 uint32 path; // 1 m_PathID
1640 uint32 index; // 2 m_NodeIndex
1641 uint32 mapid; // 3 m_ContinentID
1642 float x; // 4 m_LocX
1643 float y; // 5 m_LocY
1644 float z; // 6 m_LocZ
1645 uint32 actionFlag; // 7 m_flags
1646 uint32 delay; // 8 m_delay
1647 // 9 m_arrivalEventID
1648 // 10 m_departureEventID
1651 struct TotemCategoryEntry
1653 uint32 ID; // 0
1654 //char* name[16]; // 1-16
1655 // 17 string flags, unused
1656 uint32 categoryType; // 18 (one for specialization)
1657 uint32 categoryMask; // 19 (compatibility mask for same type: different for totems, compatible from high to low for rods)
1660 struct VehicleEntry
1662 uint32 m_ID; // 0
1663 uint32 m_flags; // 1
1664 float m_turnSpeed; // 2
1665 float m_pitchSpeed; // 3
1666 float m_pitchMin; // 4
1667 float m_pitchMax; // 5
1668 uint32 m_seatID[8]; // 6-13
1669 float m_mouseLookOffsetPitch; // 14
1670 float m_cameraFadeDistScalarMin; // 15
1671 float m_cameraFadeDistScalarMax; // 16
1672 float m_cameraPitchOffset; // 17
1673 //int m_powerType[3]; // removed in 3.1
1674 //int m_powerToken[3]; // removed in 3.1
1675 float m_facingLimitRight; // 18
1676 float m_facingLimitLeft; // 19
1677 float m_msslTrgtTurnLingering; // 20
1678 float m_msslTrgtPitchLingering; // 21
1679 float m_msslTrgtMouseLingering; // 22
1680 float m_msslTrgtEndOpacity; // 23
1681 float m_msslTrgtArcSpeed; // 24
1682 float m_msslTrgtArcRepeat; // 25
1683 float m_msslTrgtArcWidth; // 26
1684 float m_msslTrgtImpactRadius[2]; // 27-28
1685 char* m_msslTrgtArcTexture; // 29
1686 char* m_msslTrgtImpactTexture; // 30
1687 char* m_msslTrgtImpactModel[2]; // 31-32
1688 float m_cameraYawOffset; // 33
1689 uint32 m_uiLocomotionType; // 34
1690 float m_msslTrgtImpactTexRadius; // 35
1691 uint32 m_uiSeatIndicatorType; // 36
1692 // 37, new in 3.1
1693 // 38, new in 3.1
1694 // 39, new in 3.1
1697 struct VehicleSeatEntry
1699 uint32 m_ID; // 0
1700 uint32 m_flags; // 1
1701 int32 m_attachmentID; // 2
1702 float m_attachmentOffsetX; // 3
1703 float m_attachmentOffsetY; // 4
1704 float m_attachmentOffsetZ; // 5
1705 float m_enterPreDelay; // 6
1706 float m_enterSpeed; // 7
1707 float m_enterGravity; // 8
1708 float m_enterMinDuration; // 9
1709 float m_enterMaxDuration; // 10
1710 float m_enterMinArcHeight; // 11
1711 float m_enterMaxArcHeight; // 12
1712 int32 m_enterAnimStart; // 13
1713 int32 m_enterAnimLoop; // 14
1714 int32 m_rideAnimStart; // 15
1715 int32 m_rideAnimLoop; // 16
1716 int32 m_rideUpperAnimStart; // 17
1717 int32 m_rideUpperAnimLoop; // 18
1718 float m_exitPreDelay; // 19
1719 float m_exitSpeed; // 20
1720 float m_exitGravity; // 21
1721 float m_exitMinDuration; // 22
1722 float m_exitMaxDuration; // 23
1723 float m_exitMinArcHeight; // 24
1724 float m_exitMaxArcHeight; // 25
1725 int32 m_exitAnimStart; // 26
1726 int32 m_exitAnimLoop; // 27
1727 int32 m_exitAnimEnd; // 28
1728 float m_passengerYaw; // 29
1729 float m_passengerPitch; // 30
1730 float m_passengerRoll; // 31
1731 int32 m_passengerAttachmentID; // 32
1732 int32 m_vehicleEnterAnim; // 33
1733 int32 m_vehicleExitAnim; // 34
1734 int32 m_vehicleRideAnimLoop; // 35
1735 int32 m_vehicleEnterAnimBone; // 36
1736 int32 m_vehicleExitAnimBone; // 37
1737 int32 m_vehicleRideAnimLoopBone; // 38
1738 float m_vehicleEnterAnimDelay; // 39
1739 float m_vehicleExitAnimDelay; // 40
1740 uint32 m_vehicleAbilityDisplay; // 41
1741 uint32 m_enterUISoundID; // 42
1742 uint32 m_exitUISoundID; // 43
1743 int32 m_uiSkin; // 44
1744 uint32 m_flagsB; // 45
1745 // 46-57 added in 3.1, floats mostly
1748 struct WorldMapAreaEntry
1750 //uint32 ID; // 0
1751 uint32 map_id; // 1
1752 uint32 area_id; // 2 index (continent 0 areas ignored)
1753 //char* internal_name // 3
1754 float y1; // 4
1755 float y2; // 5
1756 float x1; // 6
1757 float x2; // 7
1758 int32 virtual_map_id; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally)
1759 // int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1,x2,y1,y2 coordinates)
1760 // uint32 someMapID; // 10
1763 #define MAX_WORLD_MAP_OVERLAY_AREA_IDX 4
1765 struct WorldMapOverlayEntry
1767 uint32 ID; // 0
1768 //uint32 worldMapAreaId; // 1 idx in WorldMapArea.dbc
1769 uint32 areatableID[MAX_WORLD_MAP_OVERLAY_AREA_IDX]; // 2-5
1770 // 6-7 always 0, possible part of areatableID[]
1771 //char* internal_name // 8
1772 // 9-16 some ints
1775 struct WorldSafeLocsEntry
1777 uint32 ID; // 0
1778 uint32 map_id; // 1
1779 float x; // 2
1780 float y; // 3
1781 float z; // 4
1782 //char* name[16] // 5-20 name, unused
1783 // 21 name flags, unused
1786 // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
1787 #if defined( __GNUC__ )
1788 #pragma pack()
1789 #else
1790 #pragma pack(pop)
1791 #endif
1793 // Structures not used for casting to loaded DBC data and not required then packing
1794 struct MapDifficulty
1796 MapDifficulty() : resetTime(0), maxPlayers(0) {}
1797 MapDifficulty(uint32 _resetTime, uint32 _maxPlayers) : resetTime(_resetTime), maxPlayers(_maxPlayers) {}
1799 uint32 resetTime;
1800 uint32 maxPlayers; // some heroic dungeons have 0 when expect same value as in normal dificulty case
1803 struct TalentSpellPos
1805 TalentSpellPos() : talent_id(0), rank(0) {}
1806 TalentSpellPos(uint16 _talent_id, uint8 _rank) : talent_id(_talent_id), rank(_rank) {}
1808 uint16 talent_id;
1809 uint8 rank;
1812 typedef std::map<uint32,TalentSpellPos> TalentSpellPosMap;
1814 struct TaxiPathBySourceAndDestination
1816 TaxiPathBySourceAndDestination() : ID(0),price(0) {}
1817 TaxiPathBySourceAndDestination(uint32 _id,uint32 _price) : ID(_id),price(_price) {}
1819 uint32 ID;
1820 uint32 price;
1822 typedef std::map<uint32,TaxiPathBySourceAndDestination> TaxiPathSetForSource;
1823 typedef std::map<uint32,TaxiPathSetForSource> TaxiPathSetBySource;
1825 struct TaxiPathNode
1827 TaxiPathNode() : mapid(0), x(0),y(0),z(0),actionFlag(0),delay(0) {}
1828 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) {}
1830 uint32 mapid;
1831 float x;
1832 float y;
1833 float z;
1834 uint32 actionFlag;
1835 uint32 delay;
1837 typedef std::vector<TaxiPathNode> TaxiPathNodeList;
1838 typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath;
1840 #define TaxiMaskSize 12
1841 typedef uint32 TaxiMask[TaxiMaskSize];
1842 #endif