root/trunk/src/shared/Database/DBCStructure.h @ 40

Revision 39, 44.6 kB (checked in by yumileroy, 17 years ago)

[svn] * Various small changes here and there.
* Implementing MangChat? IRC system.
* Added new config option, MAX_WHO, can be used to set the limit of characters being sent in a /who request from client.

Original author: XTZGZoReX
Date: 2008-10-12 14:03:38-05:00

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