2 * Copyright (C) 2005-2008 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 DBCSTRUCTURE_H
20 #define DBCSTRUCTURE_H
23 #include "Platform/Define.h"
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__ )
38 struct AchievementEntry
41 uint32 factionFlag
; // 1 -1=all, 0=horde, 1=alliance
42 uint32 mapID
; // 2 -1=none
43 //char *name[16]; // 3-19
44 //uint32 name_flags; // 20
45 //char *description[16]; // 21-36
46 //uint32 desc_flags; // 37
47 uint32 categoryId
; // 38
48 uint32 points
; // 39 reward points
49 //uint32 OrderInCategory; // 40
51 //uint32 flags; // 42 not flags, some unknown value...
52 //char *unk1[16]; // 43-58
53 //uint32 unk_flags; // 59
55 uint32 refAchievement
; // 61
58 struct AchievementCategoryEntry
61 uint32 parentCategory
; // 1 -1 for main category
62 //char *name[16]; // 2-17
63 //uint32 name_flags; // 18
64 uint32 sortOrder
; // 19
67 struct AchievementCriteriaEntry
70 uint32 referredAchievement
; // 1
71 uint32 requiredType
; // 2
74 // ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0
75 // TODO: also used for player deaths..
78 uint32 creatureID
; // 3
79 uint32 creatureCount
; // 4
82 // ACHIEVEMENT_CRITERIA_TYPE_WIN_BG = 1
83 // TODO: there are further criterias instead just winning
90 // ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5
97 // ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7
101 uint32 skillLevel
; // 4
104 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8
107 uint32 linkedAchievement
; // 3
108 } complete_achievement
;
110 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT = 9
114 uint32 totalQuestCount
; // 4
115 } complete_quest_count
;
117 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10
121 uint32 numberOfDays
; // 4
122 } complete_daily_quest_daily
;
124 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11
128 uint32 questCount
; // 4
129 } complete_quests_in_zone
;
131 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14
135 uint32 questCount
; // 4
136 } complete_daily_quest
;
138 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND= 15
142 } complete_battleground
;
144 // ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP= 16
150 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID = 19
153 uint32 groupSize
; // 3 can be 5, 10 or 25
156 // ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE = 20
159 uint32 creatureEntry
; // 3
160 } killed_by_creature
;
162 // ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING = 24
166 uint32 fallHeight
; // 4
167 } fall_without_dying
;
169 // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST = 27
173 uint32 questCount
; // 4
176 // ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET = 28
177 // ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2= 69
181 uint32 spellCount
; // 4
184 // ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL= 29
185 // ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110
189 uint32 castCount
; // 4
192 // ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA = 31
195 uint32 areaID
; // 3 Reference to AreaTable.dbc
196 uint32 killCount
; // 4
197 } honorable_kill_at_area
;
199 // ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA = 32
202 uint32 mapID
; // 3 Reference to Map.dbc
205 // ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA = 33
208 uint32 mapID
; // 3 Reference to Map.dbc
211 // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL = 34
214 uint32 spellID
; // 3 Reference to Map.dbc
217 // ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM = 36
221 uint32 itemCount
; // 4
224 // ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA = 37
229 uint32 flag
; // 5 4=in a row
232 // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38
235 uint32 teamtype
; // 3 {2,3,5}
236 } highest_team_rating
;
238 // ACHIEVEMENT_CRITERIA_TYPE_REACH_TEAM_RATING = 39
241 uint32 teamtype
; // 3 {2,3,5}
242 uint32 teamrating
; // 4
245 // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL = 40
249 uint32 skillLevel
; // 4 apprentice=1, journeyman=2, expert=3, artisan=4, master=5, grand master=6
252 // ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM = 41
256 uint32 itemCount
; // 4
259 // ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM = 42
263 uint32 itemCount
; // 4
266 // ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA = 43
269 // TODO: This rank is _NOT_ the index from AreaTable.dbc
270 uint32 areaReference
; // 3
273 // ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK= 44
276 // TODO: This rank is _NOT_ the index from CharTitles.dbc
280 // ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT= 45
284 uint32 numberOfSlots
; // 4
287 // ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION= 46
290 uint32 factionID
; // 3
291 uint32 reputationAmount
; // 4 Total reputation amount, so 42000 = exalted
294 // ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION= 47
298 uint32 numberOfExaltedFactions
; // 4
299 } gain_exalted_reputation
;
301 // ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP = 48
305 uint32 numberOfVisits
; // 4
308 // ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM = 49
309 // TODO: where is the required itemlevel stored?
312 uint32 itemSlot
; // 3
315 // ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT= 50
318 uint32 rollValue
; // 3
322 // ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52
329 // ACHIEVEMENT_CRITERIA_TYPE_HK_RACE = 53
336 // ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE = 54
337 // TODO: where is the information about the target stored?
343 // ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE = 55
348 uint32 flag
; // 5 =3 for battleground healing
352 // ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM = 57
359 // ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY = 67
363 uint32 goldInCopper
; // 4
366 // ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT = 68
370 uint32 useCount
; // 4
373 // ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL= 70
374 // TODO: are those special criteria stored in the dbc or do we have to add another sql table?
378 uint32 killCount
; // 4
381 // ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72
385 uint32 lootCount
; // 4
386 } fish_in_gameobject
;
388 // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS= 75
391 uint32 skillLine
; // 3
392 uint32 spellCount
; // 4
393 } learn_skilline_spell
;
395 // ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76
399 uint32 duelCount
; // 4
402 // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER = 96
405 uint32 powerType
; // 3 mana=0, 1=rage, 3=energy, 6=runic power
408 // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT = 97
411 uint32 statType
; // 3 4=spirit, 3=int, 2=stamina, 1=agi, 0=strength
414 // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER = 98
417 uint32 spellSchool
; // 3
418 } highest_spellpower
;
420 // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING = 100
423 uint32 ratingType
; // 3
426 // ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109
429 uint32 lootType
; // 3 3=fishing, 2=pickpocket, 4=disentchant
430 uint32 lootTypeCount
; // 4
433 // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE= 112
436 uint32 skillLine
; // 3
437 uint32 spellCount
; // 4
440 // ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113
444 uint32 killCount
; // 4
449 uint32 field3
; // 3 main requirement
450 uint32 field4
; // 4 main requirement count
451 uint32 additionalRequirement1_type
; // 5 additional requirement 1 type
452 uint32 additionalRequirement1_value
; // 6 additional requirement 1 value
453 uint32 additionalRequirement2_type
; // 7 additional requirement 2 type
454 uint32 additionalRequirement2_value
; // 8 additional requirement 1 value
457 //char* name[16]; // 9-24
458 //uint32 name_flags; // 25
459 uint32 completionFlag
; // 26
460 uint32 groupFlag
; // 27
461 uint32 timeLimit
; // 29 time limit in seconds
465 struct AreaTableEntry
469 uint32 zone
; // 2 if 0 then it's zone, else it's zone id of this area
470 uint32 exploreFlag
; // 3, main index
471 uint32 flags
; // 4, unknown value but 312 for all cities
473 int32 area_level
; // 10
474 char* area_name
[16]; // 11-26
475 // 27, string flags, unused
479 struct AreaTriggerEntry
482 uint32 mapid
; // 1 m_ContinentID
486 float radius
; // 5 m_radius
487 float box_x
; // 6 m_box_length
488 float box_y
; // 7 m_box_width
489 float box_z
; // 8 m_box_heigh
490 float box_orientation
; // 9 m_box_yaw
493 struct BankBagSlotPricesEntry
499 struct BarberShopStyleEntry
502 uint32 type
; // 1 value 0 -> hair, value 2 -> facialhair
503 //char* name[16]; // 2-17 name of hair style
504 //uint32 name_flags; // 18
505 //uint32 unk_name[16]; // 19-34, all empty
506 //uint32 unk_flags; // 35
507 //float CostMultiplier; // 36 values 1 and 0.75
508 uint32 race
; // 37 race
509 uint32 gender
; // 38 0 -> male, 1 -> female
510 uint32 hair_id
; // 39 real ID to hair/facial hair
513 struct BattlemasterListEntry
516 int32 mapid
[8]; // 1-8 mapid
517 uint32 type
; // 9 (3 - BG, 4 - arena)
520 uint32 maxplayersperteam
; // 12
524 char* name
[16]; // 16-31
525 // 32 string flag, unused
529 #define MAX_OUTFIT_ITEMS 12
530 // #define MAX_OUTFIT_ITEMS 24 // 12->24 in 3.0.x
532 struct CharStartOutfitEntry
535 uint32 RaceClassGender
; // 1 (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender)
536 int32 ItemId
[MAX_OUTFIT_ITEMS
]; // 2-13
537 //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 14-25 not required at server side
538 //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 26-37 not required at server side
539 //uint32 Unknown1; // 38, unique values (index-like with gaps ordered in other way as ids)
540 //uint32 Unknown2; // 39
541 //uint32 Unknown3; // 40
544 struct CharTitlesEntry
546 uint32 ID
; // 0, title ids, for example in Quest::GetCharTitleId()
547 //uint32 unk1; // 1 flags?
548 //char* name[16]; // 2-17, unused
549 // 18 string flag, unused
550 //char* name2[16]; // 19-34, unused
551 // 35 string flag, unused
552 uint32 bit_index
; // 36 used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES
555 struct ChatChannelsEntry
557 uint32 ChannelID
; // 0
559 char* pattern
[16]; // 3-18
560 // 19 string flags, unused
561 //char* name[16]; // 20-35 unused
562 // 36 string flag, unused
565 struct ChrClassesEntry
569 uint32 powerType
; // 2
571 //char* name[16]; // 5-20 unused
572 // 21 string flag, unused
573 //char* string1[16]; // 21-36 unused
574 // 37 string flag, unused
575 //char* string2[16]; // 38-53 unused
576 // 54 string flag, unused
578 uint32 spellfamily
; // 56
580 uint32 CinematicSequence
; // 58 id from CinematicSequences.dbc
581 uint32 addon
; // 59 (0 - original race, 1 - tbc addon, ...)
588 uint32 FactionID
; // 2 facton template id
593 uint32 TeamID
; // 8 (7-Alliance 1-Horde)
595 uint32 CinematicSequence
; // 13 id from CinematicSequences.dbc
596 char* name
[16]; // 14-29 used for DBC language detection/selection
597 // 30 string flags, unused
598 //char* string1[16]; // 31-46 used for DBC language detection/selection
599 // 47 string flags, unused
600 //char* string2[16]; // 48-63 used for DBC language detection/selection
601 // 64 string flags, unused
603 uint32 addon
; // 68 (0 - original race, 1 - tbc addon, ...)
606 struct CreatureDisplayInfoEntry
608 uint32 Displayid
; // 0 m_ID
611 // 3 m_extendedDisplayInfoID
612 float scale
; // 4 m_creatureModelScale
613 // 5 m_creatureModelAlpha
614 // 6-8 m_textureVariation[3]
615 // 9 m_portraitTextureName
619 // 13 m_particleColorID
620 // 14 m_creatureGeosetData
621 // 15 m_objectEffectPackageID
624 struct CreatureFamilyEntry
627 float minScale
; // 1 m_minScale
628 uint32 minScaleLevel
; // 2 m_minScaleLevel
629 float maxScale
; // 3 m_maxScale
630 uint32 maxScaleLevel
; // 4 m_maxScaleLevel
631 uint32 skillLine
[2]; // 5-6 m_skillLine
632 uint32 petFoodMask
; // 7 m_petFoodMask
633 int32 petTalentType
; // 8 m_petTalentType
634 // 9 m_categoryEnumID
635 char* Name
[16]; // 10-25 m_name_lang
640 struct CreatureSpellDataEntry
643 //uint32 spellId[4]; // 1-4 m_spells[4]
644 //uint32 availability[4]; // 4-7 m_availability[4]
647 struct DurabilityCostsEntry
650 uint32 multiplier
[29]; // 1-29
653 struct DurabilityQualityEntry
656 float quality_mod
; // 1
659 struct EmotesTextEntry
668 int32 reputationListID
; // 1 m_reputationIndex
669 uint32 BaseRepRaceMask
[4]; // 2-5 m_reputationRaceMask
670 uint32 BaseRepClassMask
[4]; // 6-9 m_reputationClassMask
671 int32 BaseRepValue
[4]; // 10-13 m_reputationBase
672 uint32 ReputationFlags
[4]; // 14-17 m_reputationFlags
673 uint32 team
; // 18 m_parentFactionID
674 char* name
[16]; // 19-34 m_name_lang
676 //char* description[16]; // 36-51 m_description_lang
680 struct FactionTemplateEntry
683 uint32 faction
; // 1 m_faction
684 uint32 factionFlags
; // 2 m_flags
685 uint32 ourMask
; // 3 m_factionGroup
686 uint32 friendlyMask
; // 4 m_friendGroup
687 uint32 hostileMask
; // 5 m_enemyGroup
688 uint32 enemyFaction
[4]; // 6 m_enemies[4]
689 uint32 friendFaction
[4]; // 10 m_friend[4]
690 //------------------------------------------------------- end structure
693 bool IsFriendlyTo(FactionTemplateEntry
const& entry
) const
695 if(enemyFaction
[0] == entry
.faction
|| enemyFaction
[1] == entry
.faction
|| enemyFaction
[2] == entry
.faction
|| enemyFaction
[3] == entry
.faction
)
697 if(friendFaction
[0] == entry
.faction
|| friendFaction
[1] == entry
.faction
|| friendFaction
[2] == entry
.faction
|| friendFaction
[3] == entry
.faction
)
699 return (friendlyMask
& entry
.ourMask
) || (ourMask
& entry
.friendlyMask
);
701 bool IsHostileTo(FactionTemplateEntry
const& entry
) const
703 if(enemyFaction
[0] == entry
.faction
|| enemyFaction
[1] == entry
.faction
|| enemyFaction
[2] == entry
.faction
|| enemyFaction
[3] == entry
.faction
)
705 if(friendFaction
[0] == entry
.faction
|| friendFaction
[1] == entry
.faction
|| friendFaction
[2] == entry
.faction
|| friendFaction
[3] == entry
.faction
)
707 return (hostileMask
& entry
.ourMask
) != 0;
709 bool IsHostileToPlayers() const { return (hostileMask
& FACTION_MASK_PLAYER
) !=0; }
710 bool IsNeutralToAll() const { return hostileMask
== 0 && friendlyMask
== 0 && enemyFaction
[0]==0 && enemyFaction
[1]==0 && enemyFaction
[2]==0 && enemyFaction
[3]==0; }
711 bool IsContestedGuardFaction() const { return (factionFlags
& FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
)!=0; }
714 struct GemPropertiesEntry
717 uint32 spellitemenchantement
;
721 struct GlyphPropertiesEntry
729 struct GlyphSlotEntry
736 #define GT_MAX_LEVEL 100
738 struct GtBarberShopCostBaseEntry
743 struct GtCombatRatingsEntry
748 struct GtChanceToMeleeCritBaseEntry
753 struct GtChanceToMeleeCritEntry
758 struct GtChanceToSpellCritBaseEntry
763 struct GtChanceToSpellCritEntry
768 struct GtOCTRegenHPEntry
773 //struct GtOCTRegenMPEntry
778 struct GtRegenHPPerSptEntry
783 struct GtRegenMPPerSptEntry
796 uint32 InventoryType
;
800 struct ItemDisplayInfoEntry
804 // 2 m_modelTexture[2]
806 // 4 m_geosetGroup[3]
809 // 7 m_groupSoundIndex
810 // 8 m_helmetGeosetVis[2]
812 // 10 m_itemVisual[8]
813 // 11 m_particleColorID
816 //struct ItemCondExtCostsEntry
819 // uint32 condExtendedCost; // ItemPrototype::CondExtendedCost
820 // uint32 itemextendedcostentry; // ItemPrototype::ExtendedCost
821 // uint32 arenaseason; // arena season number(1-4)
824 struct ItemExtendedCostEntry
826 uint32 ID
; // 0 extended-cost entry id
827 uint32 reqhonorpoints
; // 1 required honor points
828 uint32 reqarenapoints
; // 2 required arena points
829 uint32 reqitem
[5]; // 3-7 required item id
830 uint32 reqitemcount
[5]; // 8-12 required count of 1st item
831 uint32 reqpersonalarenarating
; // 13 required personal arena rating
834 struct ItemRandomPropertiesEntry
837 //char* internalName // 1 m_Name
838 uint32 enchant_id
[5]; // 2-6 m_Enchantment
839 //char* nameSuffix[16] // 7-22 m_name_lang
843 struct ItemRandomSuffixEntry
846 //char* name[16] // 1-16 m_name_lang
849 uint32 enchant_id
[5]; // 19-21 m_enchantment
850 uint32 prefix
[5]; // 22-24 m_allocationPct
855 //uint32 id // 0 m_ID
856 char* name
[16]; // 1-16 m_name_lang
857 // 17 string flags, unused
858 //uint32 itemId[17]; // 18-34 m_itemID
859 uint32 spells
[8]; // 35-42 m_setSpellID
860 uint32 items_to_triggerspell
[8]; // 43-50 m_setThreshold
861 uint32 required_skill_id
; // 51 m_requiredSkill
862 uint32 required_skill_value
; // 52 m_requiredSkillRank
868 uint32 Type
[8]; // 1-8 m_Type
869 uint32 Index
[8]; // 9-16 m_Index
870 uint32 Skill
[8]; // 17-24 m_Skill
871 //uint32 Action[8]; // 25-32 m_Action
874 struct MailTemplateEntry
877 //char* subject[16]; // 1-16
878 // 17 name flags, unused
879 //char* content[16]; // 18-33
885 //char* internalname; // 1 unused
886 uint32 map_type
; // 2
887 // 3 0 or 1 for battlegrounds (not arenas)
888 char* name
[16]; // 4-19
889 // 20 name flags, unused
890 uint32 linked_zone
; // 21 common zone for instance and continent map
891 //char* hordeIntro[16]; // 23-37 text for PvP Zones
892 // 38 intro text flags
893 //char* allianceIntro[16]; // 39-54 text for PvP Zones
894 // 55 intro text flags
895 uint32 multimap_id
; // 56
897 //chat* unknownText1[16]; // 58-73 unknown empty text fields, possible normal Intro text.
899 //chat* heroicIntroText[16]; // 75-90 heroic mode requirement text
901 //chat* unknownText2[16]; // 92-107 unknown empty text fields
903 int32 entrance_map
; // 109 map_id of entrance map
904 float entrance_x
; // 110 entrance x coordinate (if exist single entry)
905 float entrance_y
; // 111 entrance y coordinate (if exist single entry)
906 uint32 resetTimeRaid
; // 112
907 uint32 resetTimeHeroic
; // 113
910 uint32 addon
; // 116 (0-original maps,1-tbc addon)
911 // 117 some kind of time?
914 uint32
Expansion() const { return addon
; }
915 bool Instanceable() const { return map_type
== MAP_INSTANCE
|| map_type
== MAP_RAID
; }
916 // NOTE: this duplicate of Instanceable(), but Instanceable() can be changed when BG also will be instanceable
917 bool IsDungeon() const { return map_type
== MAP_INSTANCE
|| map_type
== MAP_RAID
; }
918 bool IsRaid() const { return map_type
== MAP_RAID
; }
919 bool IsBattleGround() const { return map_type
== MAP_BATTLEGROUND
; }
920 bool IsBattleArena() const { return map_type
== MAP_ARENA
; }
921 bool IsBattleGroundOrArena() const { return map_type
== MAP_BATTLEGROUND
|| map_type
== MAP_ARENA
; }
922 bool SupportsHeroicMode() const { return resetTimeHeroic
&& !resetTimeRaid
; }
923 bool HasResetTime() const { return resetTimeHeroic
|| resetTimeRaid
; }
925 bool IsMountAllowed() const
927 return !IsDungeon() ||
928 MapID
==568 || MapID
==309 || MapID
==209 || MapID
==534 ||
929 MapID
==560 || MapID
==509 || MapID
==269;
932 bool IsContinent() const
934 return MapID
== 0 || MapID
== 1 || MapID
== 530 || MapID
== 571;
938 struct QuestSortEntry
941 //char* name[16]; // 1-16 m_SortName_lang
945 struct RandomPropertiesPointsEntry
947 //uint32 Id; // 0 hidden key
948 uint32 itemLevel
; // 1
949 uint32 EpicPropertiesPoints
[5]; // 2-6
950 uint32 RarePropertiesPoints
[5]; // 7-11
951 uint32 UncommonPropertiesPoints
[5]; // 12-16
954 struct ScalingStatDistributionEntry
962 struct ScalingStatValuesEntry
966 uint32 Multiplier
[17];
969 //struct SkillLineCategoryEntry{
970 // uint32 id; // 0 m_ID
971 // char* name[16]; // 1-17 m_name_lang
973 // uint32 displayOrder; // 19 m_sortIndex
976 //struct SkillRaceClassInfoEntry{
977 // uint32 id; // 0 m_ID
978 // uint32 skillId; // 1 m_skillID
979 // uint32 raceMask; // 2 m_raceMask
980 // uint32 classMask; // 3 m_classMask
981 // uint32 flags; // 4 m_flags
982 // uint32 reqLevel; // 5 m_minLevel
983 // uint32 skillTierId; // 6 m_skillTierID
984 // uint32 skillCostID; // 7 m_skillCostIndex
987 //struct SkillTiersEntry{
988 // uint32 id; // 0 m_ID
989 // uint32 skillValue[16]; // 1-17 m_cost
990 // uint32 maxSkillValue[16]; // 18-32 m_valueMax
993 struct SkillLineEntry
996 int32 categoryId
; // 1 m_categoryID
997 //uint32 skillCostID; // 2 m_skillCostsID
998 char* name
[16]; // 3-18 m_displayName_lang
1000 //char* description[16]; // 20-35 m_description_lang
1002 uint32 spellIcon
; // 37 m_spellIconID
1003 //char* alternateVerb[16]; // 38-53 m_alternateVerb_lang
1008 struct SkillLineAbilityEntry
1010 uint32 id
; // 0 m_ID
1011 uint32 skillId
; // 1 m_skillLine
1012 uint32 spellId
; // 2 m_spell
1013 uint32 racemask
; // 3 m_raceMask
1014 uint32 classmask
; // 4 m_classMask
1015 //uint32 racemaskNot; // 5 m_excludeRace
1016 //uint32 classmaskNot; // 6 m_excludeClass
1017 uint32 req_skill_value
; // 7 m_minSkillLineRank
1018 uint32 forward_spellid
; // 8 m_supercededBySpell
1019 uint32 learnOnGetSkill
; // 9 m_acquireMethod
1020 uint32 max_value
; // 10 m_trivialSkillLineRankHigh
1021 uint32 min_value
; // 11 m_trivialSkillLineRankLow
1022 //uint32 characterPoints[2]; // 12-13 m_characterPoints[2]
1025 struct SoundEntriesEntry
1027 uint32 Id
; // 0 m_ID
1028 //uint32 Type; // 1 m_soundType
1029 //char* InternalName; // 2 m_name
1030 //char* FileName[10]; // 3-12 m_File[10]
1031 //uint32 Unk13[10]; // 13-22 m_Freq[10]
1032 //char* Path; // 23 m_DirectoryBase
1036 // 27 m_distanceCutoff
1042 uint32 Id
; // 0 m_ID
1043 uint32 Category
; // 1 m_category
1044 uint32 Dispel
; // 2 m_dispelType
1045 uint32 Mechanic
; // 3 m_mechanic
1046 uint32 Attributes
; // 4 m_attribute
1047 uint32 AttributesEx
; // 5 m_attributesEx
1048 uint32 AttributesEx2
; // 6 m_attributesExB
1049 uint32 AttributesEx3
; // 7 m_attributesExC
1050 uint32 AttributesEx4
; // 8 m_attributesExD
1051 uint32 AttributesEx5
; // 9 m_attributesExE
1052 //uint32 AttributesEx6; // 10 m_attributesExF not used
1053 uint32 Stances
; // 11 m_shapeshiftMask
1054 uint32 StancesNot
; // 12 m_shapeshiftExclude
1055 uint32 Targets
; // 13 m_targets
1056 uint32 TargetCreatureType
; // 14 m_targetCreatureType
1057 uint32 RequiresSpellFocus
; // 15 m_requiresSpellFocus
1058 uint32 FacingCasterFlags
; // 16 m_facingCasterFlags
1059 uint32 CasterAuraState
; // 17 m_casterAuraState
1060 uint32 TargetAuraState
; // 18 m_targetAuraState
1061 uint32 CasterAuraStateNot
; // 19 m_excludeCasterAuraState
1062 uint32 TargetAuraStateNot
; // 20 m_excludeTargetAuraState
1063 //uint32 casterAuraSpell; // 21 m_casterAuraSpell not used
1064 //uint32 targetAuraSpell; // 22 m_targetAuraSpell not used
1065 //uint32 excludeCasterAuraSpell; // 23 m_excludeCasterAuraSpell not used
1066 //uint32 excludeTargetAuraSpell; // 24 m_excludeTargetAuraSpell not used
1067 uint32 CastingTimeIndex
; // 25 m_castingTimeIndex
1068 uint32 RecoveryTime
; // 26 m_recoveryTime
1069 uint32 CategoryRecoveryTime
; // 27 m_categoryRecoveryTime
1070 uint32 InterruptFlags
; // 28 m_interruptFlags
1071 uint32 AuraInterruptFlags
; // 29 m_auraInterruptFlags
1072 uint32 ChannelInterruptFlags
; // 30 m_channelInterruptFlags
1073 uint32 procFlags
; // 31 m_procTypeMask
1074 uint32 procChance
; // 32 m_procChance
1075 uint32 procCharges
; // 33 m_procCharges
1076 uint32 maxLevel
; // 34 m_maxLevel
1077 uint32 baseLevel
; // 35 m_baseLevel
1078 uint32 spellLevel
; // 36 m_spellLevel
1079 uint32 DurationIndex
; // 37 m_durationIndex
1080 uint32 powerType
; // 38 m_powerType
1081 uint32 manaCost
; // 39 m_manaCost
1082 uint32 manaCostPerlevel
; // 40 m_manaCostPerLevel
1083 uint32 manaPerSecond
; // 41 m_manaPerSecond
1084 uint32 manaPerSecondPerLevel
; // 42 m_manaPerSecondPerLeve
1085 uint32 rangeIndex
; // 43 m_rangeIndex
1086 float speed
; // 44 m_speed
1087 //uint32 modalNextSpell; // 45 m_modalNextSpell not used
1088 uint32 StackAmount
; // 46 m_cumulativeAura
1089 uint32 Totem
[2]; // 47-48 m_totem
1090 int32 Reagent
[8]; // 49-56 m_reagent
1091 uint32 ReagentCount
[8]; // 57-64 m_reagentCount
1092 int32 EquippedItemClass
; // 65 m_equippedItemClass (value)
1093 int32 EquippedItemSubClassMask
; // 66 m_equippedItemSubclass (mask)
1094 int32 EquippedItemInventoryTypeMask
; // 67 m_equippedItemInvTypes (mask)
1095 uint32 Effect
[3]; // 68-70 m_effect
1096 int32 EffectDieSides
[3]; // 71-73 m_effectDieSides
1097 uint32 EffectBaseDice
[3]; // 74-76 m_effectBaseDice
1098 float EffectDicePerLevel
[3]; // 77-79 m_effectDicePerLevel
1099 float EffectRealPointsPerLevel
[3]; // 80-82 m_effectRealPointsPerLevel
1100 int32 EffectBasePoints
[3]; // 83-85 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
1101 uint32 EffectMechanic
[3]; // 86-88 m_effectMechanic
1102 uint32 EffectImplicitTargetA
[3]; // 89-91 m_implicitTargetA
1103 uint32 EffectImplicitTargetB
[3]; // 92-94 m_implicitTargetB
1104 uint32 EffectRadiusIndex
[3]; // 95-97 m_effectRadiusIndex - spellradius.dbc
1105 uint32 EffectApplyAuraName
[3]; // 98-100 m_effectAura
1106 uint32 EffectAmplitude
[3]; // 101-103 m_effectAuraPeriod
1107 float EffectMultipleValue
[3]; // 104-106 m_effectAmplitude
1108 uint32 EffectChainTarget
[3]; // 107-109 m_effectChainTargets
1109 uint32 EffectItemType
[3]; // 110-112 m_effectItemType
1110 int32 EffectMiscValue
[3]; // 113-115 m_effectMiscValue
1111 int32 EffectMiscValueB
[3]; // 116-118 m_effectMiscValueB
1112 uint32 EffectTriggerSpell
[3]; // 119-121 m_effectTriggerSpell
1113 float EffectPointsPerComboPoint
[3]; // 122-124 m_effectPointsPerCombo
1114 //uint32 EffectSpellClassMaskA[3]; // 125-127 m_effectSpellClassMaskA not used
1115 //uint32 EffectSpellClassMaskB[3]; // 128-130 m_effectSpellClassMaskB not used
1116 //uint32 EffectSpellClassMaskC[3]; // 131-133 m_effectSpellClassMaskC not used
1117 uint32 SpellVisual
[2]; // 134-135 m_spellVisualID
1118 uint32 SpellIconID
; // 136 m_spellIconID
1119 uint32 activeIconID
; // 137 m_activeIconID
1120 //uint32 spellPriority; // 138 m_spellPriority not used
1121 char* SpellName
[16]; // 139-154 m_name_lang
1122 //uint32 SpellNameFlag; // 155 not used
1123 char* Rank
[16]; // 156-171 m_nameSubtext_lang
1124 //uint32 RankFlags; // 172 not used
1125 //char* Description[16]; // 173-188 m_description_lang not used
1126 //uint32 DescriptionFlags; // 189 not used
1127 //char* ToolTip[16]; // 190-205 m_auraDescription_lang not used
1128 //uint32 ToolTipFlags; // 206 not used
1129 uint32 ManaCostPercentage
; // 207 m_manaCostPct
1130 uint32 StartRecoveryCategory
; // 208 m_startRecoveryCategory
1131 uint32 StartRecoveryTime
; // 209 m_startRecoveryTime
1132 uint32 MaxTargetLevel
; // 210 m_maxTargetLevel
1133 uint32 SpellFamilyName
; // 211 m_spellClassSet
1134 uint64 SpellFamilyFlags
; // 212-213 m_spellClassMask NOTE: size is 12 bytes!!!
1135 uint32 SpellFamilyFlags2
; // 214 addition to m_spellClassMask
1136 uint32 MaxAffectedTargets
; // 215 m_maxTargets
1137 uint32 DmgClass
; // 216 m_defenseType
1138 uint32 PreventionType
; // 217 m_preventionType
1139 //uint32 StanceBarOrder; // 218 m_stanceBarOrder not used
1140 float DmgMultiplier
[3]; // 219-221 m_effectChainAmplitude
1141 //uint32 MinFactionId; // 222 m_minFactionID not used
1142 //uint32 MinReputation; // 223 m_minReputation not used
1143 //uint32 RequiredAuraVision; // 224 m_requiredAuraVision not used
1144 uint32 TotemCategory
[2]; // 225-226 m_requiredTotemCategoryID
1145 int32 AreaId
; // 227 m_requiredAreasID
1146 uint32 SchoolMask
; // 228 m_schoolMask
1147 uint32 runeCostID
; // 229 m_runeCostID
1148 //uint32 spellMissileID; // 230 m_spellMissileID not used
1151 // prevent creating custom entries (copy data from original in fact)
1152 SpellEntry(SpellEntry
const&); // DON'T must have implementation
1155 typedef std::set
<uint32
> SpellCategorySet
;
1156 typedef std::map
<uint32
,SpellCategorySet
> SpellCategoryStore
;
1157 typedef std::set
<uint32
> PetFamilySpellsSet
;
1158 typedef std::map
<uint32
,PetFamilySpellsSet
> PetFamilySpellsStore
;
1160 struct SpellCastTimesEntry
1163 int32 CastTime
; // 1
1164 //float CastTimePerLevel; // 2 unsure / per skill?
1165 //int32 MinCastTime; // 3 unsure
1168 struct SpellFocusObjectEntry
1171 //char* Name[16]; // 1-15 unused
1172 // 16 string flags, unused
1175 // stored in SQL table
1176 struct SpellThreatEntry
1182 struct SpellRadiusEntry
1189 struct SpellRangeEntry
1196 struct SpellRuneCostEntry
1199 uint32 bloodRuneCost
;
1200 uint32 frostRuneCost
;
1201 uint32 unholyRuneCost
;
1202 uint32 runePowerGain
;
1205 struct SpellShapeshiftEntry
1208 //uint32 buttonPosition; // 1 unused
1209 //char* Name[16]; // 2-17 unused
1210 //uint32 NameFlags; // 18 unused
1211 uint32 flags1
; // 19
1212 int32 creatureType
; // 20 <=0 humanoid, other normal creature types
1213 //uint32 unk1; // 21 unused
1214 uint32 attackSpeed
; // 22
1215 //uint32 modelID; // 23 unused, alliance modelid (where horde case?)
1216 //uint32 unk2; // 24 unused
1217 //uint32 unk3; // 25 unused
1218 //uint32 unk4; // 26 unused
1219 //uint32 unk5; // 27 unused
1220 //uint32 unk6; // 28 unused
1221 //uint32 unk7; // 29 unused
1222 //uint32 unk8; // 30 unused
1223 //uint32 unk9; // 31 unused
1224 //uint32 unk10; // 32 unused
1225 //uint32 unk11; // 33 unused
1226 //uint32 unk12; // 34 unused
1229 struct SpellDurationEntry
1235 struct SpellItemEnchantmentEntry
1237 uint32 ID
; // 0 m_ID
1238 //uint32 charges; // 1 m_charges
1239 uint32 type
[3]; // 2-4 m_effect[3]
1240 uint32 amount
[3]; // 5-7 m_effectPointsMin[3]
1241 //uint32 amount2[3] // 8-10 m_effectPointsMax[3]
1242 uint32 spellid
[3]; // 11-13 m_effectArg[3]
1243 char* description
[16]; // 14-30 m_name_lang[16]
1244 //uint32 descriptionFlags; // 31 name flags
1245 uint32 aura_id
; // 32 m_itemVisual
1246 uint32 slot
; // 33 m_flags
1247 uint32 GemID
; // 34 m_src_itemID
1248 uint32 EnchantmentCondition
; // 35 m_condition_id
1249 //uint32 requiredSkill; // 36 m_requiredSkillID
1250 //uint32 requiredSkillValue; // 37 m_requiredSkillRank
1253 struct SpellItemEnchantmentConditionEntry
1255 uint32 ID
; // 0 m_ID
1256 uint8 Color
[5]; // 1-5 m_lt_operandType[5]
1257 //uint32 LT_Operand[5]; // 6-10 m_lt_operand[5]
1258 uint8 Comparator
[5]; // 11-15 m_operator[5]
1259 uint8 CompareColor
[5]; // 15-20 m_rt_operandType[5]
1260 uint32 Value
[5]; // 21-25 m_rt_operand[5]
1261 //uint8 Logic[5] // 25-30 m_logic[5]
1264 struct StableSlotPricesEntry
1270 /*struct SummonPropertiesEntry
1273 uint32 Group; // 1, 0 - can't be controlled?, 1 - something guardian?, 2 - pet?, 3 - something controllable?, 4 - taxi/mount?
1274 uint32 Unk2; // 2, 14 rows > 0
1275 uint32 Type; // 3, see enum
1276 uint32 Slot; // 4, 0-6
1282 uint32 TalentID
; // 0
1283 uint32 TalentTab
; // 1 index in TalentTab.dbc (TalentTabEntry)
1286 uint32 RankID
[5]; // 4-8
1287 // 9-12 not used, always 0, maybe not used high ranks
1288 uint32 DependsOn
; // 13 index in Talent.dbc (TalentEntry)
1290 uint32 DependsOnRank
; // 16
1292 //uint32 unk1; // 19, 0 or 1
1293 //uint32 unk2; // 20, all 0
1294 //uint32 unkFlags1; // 21, related to hunter pet talents
1295 //uint32 unkFlags2; // 22, related to hunter pet talents
1298 struct TalentTabEntry
1300 uint32 TalentTabID
; // 0
1301 //char* name[16]; // 1-16, unused
1302 //uint32 nameFlags; // 17, unused
1303 //unit32 spellicon; // 18
1305 uint32 ClassMask
; // 20
1306 uint32 petTalentMask
; // 21
1307 uint32 tabpage
; // 22
1308 //char* internalname; // 23
1311 struct TaxiNodesEntry
1313 uint32 ID
; // 0 m_ID
1314 uint32 map_id
; // 1 m_ContinentID
1318 //char* name[16]; // 5-21 m_Name_lang
1320 uint32 MountCreatureID
[2]; // 23-24 m_MountCreatureID[2]
1323 struct TaxiPathEntry
1325 uint32 ID
; // 0 m_ID
1326 uint32 from
; // 1 m_FromTaxiNode
1327 uint32 to
; // 2 m_ToTaxiNode
1328 uint32 price
; // 3 m_Cost
1331 struct TaxiPathNodeEntry
1334 uint32 path
; // 1 m_PathID
1335 uint32 index
; // 2 m_NodeIndex
1336 uint32 mapid
; // 3 m_ContinentID
1337 float x
; // 4 m_LocX
1338 float y
; // 5 m_LocY
1339 float z
; // 6 m_LocZ
1340 uint32 actionFlag
; // 7 m_flags
1341 uint32 delay
; // 8 m_delay
1342 // 9 m_arrivalEventID
1343 // 10 m_departureEventID
1346 struct TotemCategoryEntry
1349 //char* name[16]; // 1-16
1350 // 17 string flags, unused
1351 uint32 categoryType
; // 18 (one for specialization)
1352 uint32 categoryMask
; // 19 (compatibility mask for same type: different for totems, compatible from high to low for rods)
1358 uint32 m_flags
; // 1
1359 float m_turnSpeed
; // 2
1360 float m_pitchSpeed
; // 3
1361 float m_pitchMin
; // 4
1362 float m_pitchMax
; // 5
1363 uint32 m_seatID
[8]; // 6-13
1364 float m_mouseLookOffsetPitch
; // 14
1365 float m_cameraFadeDistScalarMin
; // 15
1366 float m_cameraFadeDistScalarMax
; // 16
1367 float m_cameraPitchOffset
; // 17
1368 int m_powerType
[3]; // 18-20
1369 int m_powerToken
[3]; // 21-23
1370 float m_facingLimitRight
; // 24
1371 float m_facingLimitLeft
; // 25
1372 float m_msslTrgtTurnLingering
; // 26
1373 float m_msslTrgtPitchLingering
; // 27
1374 float m_msslTrgtMouseLingering
; // 28
1375 float m_msslTrgtEndOpacity
; // 29
1376 float m_msslTrgtArcSpeed
; // 30
1377 float m_msslTrgtArcRepeat
; // 31
1378 float m_msslTrgtArcWidth
; // 32
1379 float m_msslTrgtImpactRadius
[2]; // 33-34
1380 char* m_msslTrgtArcTexture
; // 35
1381 char* m_msslTrgtImpactTexture
; // 36
1382 char* m_msslTrgtImpactModel
[2]; // 37-38
1383 float m_cameraYawOffset
; // 39
1384 uint32 m_uiLocomotionType
; // 40
1385 float m_msslTrgtImpactTexRadius
; // 41
1386 uint32 m_uiSeatIndicatorType
; // 42
1389 struct VehicleSeatEntry
1392 uint32 m_flags
; // 1
1393 int32 m_attachmentID
; // 2
1394 float m_attachmentOffsetX
; // 3
1395 float m_attachmentOffsetY
; // 4
1396 float m_attachmentOffsetZ
; // 5
1397 float m_enterPreDelay
; // 6
1398 float m_enterSpeed
; // 7
1399 float m_enterGravity
; // 8
1400 float m_enterMinDuration
; // 9
1401 float m_enterMaxDuration
; // 10
1402 float m_enterMinArcHeight
; // 11
1403 float m_enterMaxArcHeight
; // 12
1404 int32 m_enterAnimStart
; // 13
1405 int32 m_enterAnimLoop
; // 14
1406 int32 m_rideAnimStart
; // 15
1407 int32 m_rideAnimLoop
; // 16
1408 int32 m_rideUpperAnimStart
; // 17
1409 int32 m_rideUpperAnimLoop
; // 18
1410 float m_exitPreDelay
; // 19
1411 float m_exitSpeed
; // 20
1412 float m_exitGravity
; // 21
1413 float m_exitMinDuration
; // 22
1414 float m_exitMaxDuration
; // 23
1415 float m_exitMinArcHeight
; // 24
1416 float m_exitMaxArcHeight
; // 25
1417 int32 m_exitAnimStart
; // 26
1418 int32 m_exitAnimLoop
; // 27
1419 int32 m_exitAnimEnd
; // 28
1420 float m_passengerYaw
; // 29
1421 float m_passengerPitch
; // 30
1422 float m_passengerRoll
; // 31
1423 int32 m_passengerAttachmentID
; // 32
1424 int32 m_vehicleEnterAnim
; // 33
1425 int32 m_vehicleExitAnim
; // 34
1426 int32 m_vehicleRideAnimLoop
; // 35
1427 int32 m_vehicleEnterAnimBone
; // 36
1428 int32 m_vehicleExitAnimBone
; // 37
1429 int32 m_vehicleRideAnimLoopBone
; // 38
1430 float m_vehicleEnterAnimDelay
; // 39
1431 float m_vehicleExitAnimDelay
; // 40
1432 uint32 m_vehicleAbilityDisplay
; // 41
1433 uint32 m_enterUISoundID
; // 42
1434 uint32 m_exitUISoundID
; // 43
1435 int32 m_uiSkin
; // 44
1436 uint32 m_flagsB
; // 45
1439 struct WorldMapAreaEntry
1443 uint32 area_id
; // 2 index (continent 0 areas ignored)
1444 //char* internal_name // 3
1449 int32 virtual_map_id
; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally)
1452 struct WorldSafeLocsEntry
1459 //char* name[16] // 5-20 name, unused
1460 // 21 name flags, unused
1463 // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
1464 #if defined( __GNUC__ )
1470 // Structures not used for casting to loaded DBC data and not required then packing
1471 struct TalentSpellPos
1473 TalentSpellPos() : talent_id(0), rank(0) {}
1474 TalentSpellPos(uint16 _talent_id
, uint8 _rank
) : talent_id(_talent_id
), rank(_rank
) {}
1480 typedef std::map
<uint32
,TalentSpellPos
> TalentSpellPosMap
;
1482 struct TaxiPathBySourceAndDestination
1484 TaxiPathBySourceAndDestination() : ID(0),price(0) {}
1485 TaxiPathBySourceAndDestination(uint32 _id
,uint32 _price
) : ID(_id
),price(_price
) {}
1490 typedef std::map
<uint32
,TaxiPathBySourceAndDestination
> TaxiPathSetForSource
;
1491 typedef std::map
<uint32
,TaxiPathSetForSource
> TaxiPathSetBySource
;
1495 TaxiPathNode() : mapid(0), x(0),y(0),z(0),actionFlag(0),delay(0) {}
1496 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
) {}
1505 typedef std::vector
<TaxiPathNode
> TaxiPathNodeList
;
1506 typedef std::vector
<TaxiPathNodeList
> TaxiPathNodesByPath
;
1508 #define TaxiMaskSize 12
1509 typedef uint32 TaxiMask
[TaxiMaskSize
];