Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
DB2Structure.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SKYFIRE_DB2STRUCTURE_H
7#define SKYFIRE_DB2STRUCTURE_H
8
9#include "Common.h"
10#include "ItemPrototype.h"
11
12// GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform
13#if defined(__GNUC__)
14#pragma pack(1)
15#else
16#pragma pack(push, 1)
17#endif
18
19// Structures used to access raw DB2 data and required packing to portability
20/*
21struct BattlePetAbilityEffectEntry
22{
23 uint32 ID; // 0
24 //uint32 Unk1; // 1
25 //uint32 Unk2; // 2
26 //uint32 Unk3; // 3
27 //uint32 Unk4; // 4
28 //uint32 Unk5; // 5
29 //uint32 Unk6; // 6
30 //uint32 Unk7; // 7
31 //uint32 Unk8; // 8
32 //uint32 Unk9; // 9
33 //uint32 Unk10; // 10
34 //uint32 Unk11; // 11
35};
36
37struct BattlePetAbilityTurnEntry
38{
39 uint32 ID; // 0
40 //uint32 Unk1; // 1
41 //uint32 Unk2; // 2
42 //uint32 Unk3; // 3
43 //uint32 Unk4; // 4
44 //uint32 Unk5; // 5
45};
46
47struct BattlePetBreedQualityEntry
48{
49 uint32 ID; // 0
50 //uint32 Unk1; // 1
51 //uint32 Unk2; // 2
52 //uint32 Unk3; // 3
53};
54
55struct BattlePetEffectPropertiesEntry
56{
57 uint32 ID; // 0
58 //uint32 Unk1; // 1
59 //uint32 Unk2; // 2
60 //uint32 Unk3; // 3
61 //uint32 Unk4; // 4
62 //uint32 Unk5; // 5
63 //uint32 Unk6; // 6
64 //uint32 Unk7; // 7
65 //uint32 Unk8; // 8
66 //uint32 Unk9; // 9
67 //uint32 Unk10; // 10
68 //uint32 Unk11; // 11
69 //uint32 Unk12; // 12
70 //uint32 Unk13; // 13
71};
72
73struct BattlePetVisualEntry
74{
75 uint32 ID; // 0
76 //uint32 Unk1; // 1
77 //uint32 Unk2; // 2
78 //uint32 Unk3; // 3
79 //uint32 Unk4; // 4
80 //uint32 Unk5; // 5
81 //uint32 Unk6; // 6
82 //uint32 Unk7; // 7
83};
84
85struct CreatureDifficultyEntry
86{
87 uint32 ID; // 0
88 //uint32 Unk1; // 1
89 //uint32 Unk2; // 2
90 //uint32 Unk3; // 3
91 //uint32 Unk4; // 4
92 //uint32 Unk5; // 5
93 //uint32 Unk6; // 6
94 //uint32 Unk7; // 7
95 //uint32 Unk8; // 8
96 //uint32 Unk9; // 9
97 //uint32 Unk10; // 10
98};
99
100struct CreatureEntry
101{
102 uint32 ID; // 0
103 //uint32 Unk1; // 1
104 //uint32 Unk2; // 2
105 //uint32 Unk3; // 3
106 //uint32 Unk4; // 4
107 //uint32 Unk5; // 5
108 //uint32 Unk6; // 6
109 //uint32 Unk7; // 7
110 //uint32 Unk8; // 8
111 //uint32 Unk9; // 9
112 //uint32 Unk10; // 10
113 //uint32 Unk11; // 11
114 //uint32 Unk12; // 12
115 //uint32 Unk13; // 13
116 //uint32 Unk14; // 14
117 //uint32 Unk15; // 15
118 //uint32 Unk16; // 16
119 //uint32 Unk17; // 17
120};
121
122struct GameObjectsEntry
123{
124 uint32 ID; // 0
125 //uint32 Unk1; // 1
126 //uint32 Unk2; // 2
127 //uint32 Unk3; // 3
128 //uint32 Unk4; // 4
129 //uint32 Unk5; // 5
130 //uint32 Unk6; // 6
131 //uint32 Unk7; // 7
132 //uint32 Unk8; // 8
133 //uint32 Unk9; // 9
134 //uint32 Unk10; // 10
135 //uint32 Unk11; // 11
136 //uint32 Unk12; // 12
137 //uint32 Unk13; // 13
138 //uint32 Unk14; // 14
139 //uint32 Unk15; // 15
140 //uint32 Unk16; // 16
141};
142
143struct ItemToMountSpellEntry
144{
145 uint32 ID; // 0
146 uint32 SpellId; // 1
147};
148
149struct RulesetItemUpgradeEntry
150{
151 uint32 ID; // 0
152 //uint32 Unk1; // 1
153 uint32 UpgradeID; // 2
154 uint32 ItemEntry; // 3
155};
156
157struct RulesetRaidLootUpgradeEntry
158{
159 uint32 ID; // 0
160 //uint32 Unk1; // 1
161 //uint32 Unk2; // 2
162 //uint32 Unk3; // 3
163 //uint32 Unk4; // 4
164};
165*/
166
167#define MAX_BATTLE_PET_EFFECT_PROPERTIES 6
168
170{
171 uint32 AbilityId; // 0 - battle pet ability id
172 int32 FamilyId; // 1 - battle pet family id or -1 for aura
173 //uint32 IconId; // 2 - icon id
174 uint32 Cooldown; // 3 - cooldown in turns
175 uint32 AuraAbilityId; // 4 - linked aura ability id
176 uint32 AuraDuration; // 5 - aura duration in turns
177 //LocalizedString* Name; // 6 - name text
178 //LocalizedString* Description; // 7 - description text
179};
180
182{
183 uint32 Id; // 0
184 uint32 TurnEntryId; // 1 - BattlePetAbilityTurn.db2
185 //uint32 Unk1; // 2
186 //uint32 Unk2; // 3
187 uint32 PropertiesId; // 4 - BattlePetEffectProperties.db2
190};
191
193{
194 uint32 Id; // 0
195 uint32 AbilityId; // 1 - battle pet ability id (BattlePetAbility.db2)
196 uint32 StateId; // 2 - battle pet state id (BattlePetState.db2)
197 uint32 Value; // 3 - value for state
198};
199
201{
202 uint32 Id; // 0
203 uint32 AbilityId; // 1 - battle pet ability id
204 //uint32 StateId; // 2
206 //uint32 Unk1; // 4
207 //uint32 ProcIndex; // 5
208};
209
211{
212 uint32 Id; // 0
213 uint32 Quality; // 1 - ItemQualities
214 float QualityModifier; // 2
215};
216
218{
219 uint32 Id; // 0
220 //uint32 Flags; // 1
222 //uint32 Unk1; // 8
223 //uint32 Unk2; // 9
224 //uint32 Unk3; // 10
225 //uint32 Unk4; // 11
226 //uint32 Unk5; // 12
227 //uint32 Unk6; // 13
228};
229
231{
232 uint32 StateId; // 0 - battle pet state id
233 //uint32 Unk1; // 1
234 LocalizedString* Name; // 2 - name text
236};
237
239{
240 uint32 ID; // 0
241 //LocalizedString* Nane; // 1
242};
243/*
244struct SceneScriptPackageMemberEntry
245{
246 uint32 ID; // 0
247 //uint32 Unk1; // 1
248 //uint32 Unk2; // 2
249 //uint32 Unk3; // 3
250 //uint32 Unk4; // 4
251};
252
253struct BattlePetAbilityEntry
254{
255 uint32 AbilityId; // 0 - battle pet ability id
256 int32 FamilyId; // 1 - battle pet family id or -1 for aura
257 uint32 IconId; // 2 - icon id
258 uint32 Cooldown; // 3 - cooldown in turns
259 //uint32 Unk1; // 4 - something to do with linked abilities
260 //uint32 Unk2; // 5
261 LocalizedString* Name; // 6 - name text
262 LocalizedString* Description; // 7 - description text
263};
264
265struct BattlePetAbilityStateEntry
266{
267 uint32 Id; // 0
268 uint32 AbilityId; // 1 - battle pet ability id (BattlePetAbility.db2)
269 uint32 StateId; // 2 - battle pet state id (BattlePetState.db2)
270 uint32 Value; // 3 - value for state
271};
272*/
274{
275 //uint32 Id; // 0
276 uint32 BreedId; // 1 - battle pet breed id
277 uint32 StateId; // 2 - battle pet state id (BattlePetState.db2)
278 uint32 Value; // 3 - value for state
279};
280
281typedef std::set<uint32> BattlePetBreedSet;
282
284{
285 //uint32 SpeciesId; // 0 - battle pet species id
286 uint32 NpcId; // 1 - npc id
287 //uint32 IconId; // 2 - icon id
288 uint32 SpellId; // 3 - summon spell id (Spell.dbc)
289 uint32 FamilyId; // 4 - battle pet family id
290 //int32 Unk1; // 5
291 uint32 Flags; // 6 - flags (see BattlePetSpeciesFlags enum)
292 //LocalizedString* Description; // 7 - description text, contains method to obtain and cost
293 //LocalizedString* Flavor; // 8 - flavor text
294};
295
297{
298 //uint32 Id; // 0
299 uint32 SpeciesId; // 1 - battle pet species id (BattlePetSpecies.db2)
300 uint32 StateId; // 2 - battle pet state id (BattlePetState.db2)
301 int32 Modifier; // 3 - modifier value for state
302};
304{
305 uint32 SpeciesId; // 1 - battle pet species id (BattlePetSpecies.db2)
306 uint32 AbilityId; // 2 - battle pet ability id (BattlePetAbility.db2)
307 uint32 RequiredLevel; // 3 - required level to use this ability
308 uint32 SlotId; // 4 - ability slot id (0-2)
309};
310
311/*
312struct BattlePetStateEntry
313{
314 uint32 StateId; // 0 - battle pet state id
315 //uint32 Unk1; // 1 - only states 21 and 34 (linked states?)
316 LocalizedString* Name; // 2 - name text
317 uint32 Flags; // 3 - flags
318};
319*/
320typedef std::map<uint32, uint16> BattlePetItemXSpeciesStore;
321
323{
324 uint32 ItemId; // 0 - item id
325 uint32 SpeciesId; // 1 - battle pet species id (BattlePetSpecies.db2)
326};
327
329{
330 uint32 ID; // 0
331 //uint32 Unk0; // 1
332 //LocalizedString* text_0; // 2
333 //LocalizedString* text_1; // 3
334 //uint32 Unk1; // 4
335 //uint32 Unk2; // 5
336 //uint32 Unk3; // 6
337 //uint32 Unk4; // 7
338 //uint32 Unk5; // 8
339 //uint32 Unk6; // 9
340 //uint32 SoundID; // 10
341 //uint32 Unk7; // 11
342 //uint32 Unk8; // 12
343};
344
346{
347 //uint32 ID; // 0
351 //int32 Material; // 4
354 //uint32 Sheath; // 7
355};
356
358{
359 //uint32 Id;
361};
362
364{
365 uint32 ID; // 0
370 float Unk430_1; // 5
371 float Unk430_2; // 6
397 float RangedModRange; // 68
406 //LocalizedString* Name2; // 101
407 //LocalizedString* Name3; // 102
408 //LocalizedString* Name4; // 103
420 uint32 Area; // 115
421 uint32 Map; // 116
432 float StatScalingFactor; // 131
435};
436/*
437struct ItemUpgradeEntry
438{
439 uint32 UpgradeID; // 0
440 uint32 UpgradeGroupId; // 1 groupid from ItemUpgradePath.dbc
441 uint32 IlvlStep; // 2
442 uint32 ItemLvl; // 3 required ilvl
443 uint32 CurrencyType; // 4 CurrencyType cost
444 uint32 CurrencyCost; // 5 CurrencyCost amount
445};
446*/
447#define MAX_ITEM_EXT_COST_ITEMS 5
448#define MAX_ITEM_EXT_COST_CURRENCIES 5
449
451{
452 uint32 ID; // 0 extended-cost entry id
453 //uint32 reqhonorpoints; // 1 required honor points
454 //uint32 reqarenapoints; // 2 required arena points
455 uint32 RequiredArenaSlot; // 3 arena slot restrictions (min slot value)
457 uint32 RequiredItemCount[MAX_ITEM_EXT_COST_ITEMS]; // 9-13 required count of 1st item
458 uint32 RequiredPersonalArenaRating; // 14 required personal arena rating
459 //uint32 ItemPurchaseGroup; // 15
467};
468
469#define KEYCHAIN_SIZE 32
470
476
477// QuestPackageItem.db2
478/*
479struct QuestPackageItemEntry
480{
481 uint32 ID; // 0
482 uint32 QuestPackageID; // 1
483 uint32 ItemID; // 2
484 uint32 Unk1; // 3
485 uint32 Unk2; // 4
486};*/
487/*
488// SceneScript.db2
489struct SceneScriptEntry
490{
491 uint32 m_ID; // 0 m_ID
492 LocalizedString* m_name; // 1 m_name
493 LocalizedString* m_script; // 2 m_script
494 uint32 m_prevScriptPartID; // 3 m_prevScriptPartID - Prev Script Part Id From Chain
495 uint32 m_nextScriptPartID; // 4 m_nextScriptPartID - Next Script Part Id From Chain
496};
497*/
498#define MAX_SPELL_REAGENTS 8
499#define MAX_SPELL_REAGENTS2 10
500
501// SpellReagents.db2
503{
504 //uint32 Id; // 0 m_ID
505 int32 Reagent[MAX_SPELL_REAGENTS]; // 1 - 10 m_reagent
506 uint32 ReagentCount[MAX_SPELL_REAGENTS2]; // 11 - 20 m_reagentCount
507};
508
509// GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform
510#if defined(__GNUC__)
511#pragma pack()
512#else
513#pragma pack(pop)
514#endif
515
516#endif
#define MAX_ITEM_EXT_COST_ITEMS
#define MAX_SPELL_REAGENTS2
#define MAX_BATTLE_PET_EFFECT_PROPERTIES
#define MAX_ITEM_EXT_COST_CURRENCIES
#define KEYCHAIN_SIZE
#define MAX_SPELL_REAGENTS
std::map< uint32, uint16 > BattlePetItemXSpeciesStore
std::set< uint32 > BattlePetBreedSet
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define MAX_ITEM_PROTO_SOCKETS
#define MAX_ITEM_PROTO_SPELLS
#define MAX_ITEM_PROTO_STATS
uint32 EffectIndex
uint32 TurnEntryId
uint32 PropertiesId
uint32 Id
uint32 PropertyValues[MAX_BATTLE_PET_EFFECT_PROPERTIES]
uint32 AbilityId
uint32 AuraAbilityId
uint32 Cooldown
int32 FamilyId
uint32 AuraDuration
uint32 StateId
uint32 AbilityId
uint32 Value
uint32 Id
uint32 TurnIndex
uint32 Id
uint32 AbilityId
uint32 Quality
uint32 Id
float QualityModifier
uint32 BreedId
uint32 StateId
uint32 Value
LocalizedString * PropertyDescriptions[MAX_BATTLE_PET_EFFECT_PROPERTIES]
uint32 Id
uint32 Flags
uint32 SpellId
uint32 FamilyId
uint32 NpcId
int32 Modifier
uint32 SpeciesId
uint32 StateId
uint32 AbilityId
uint32 RequiredLevel
uint32 SpeciesId
uint32 SlotId
uint32 Flags
LocalizedString * Name
uint32 StateId
uint32 ID
uint32 ItemId
uint32 InventoryType
uint32 Class
uint32 DisplayId
int32 SoundOverrideSubclass
uint32 SubClass
uint32 RequiredItem[MAX_ITEM_EXT_COST_ITEMS]
uint32 RequiredItemCount[MAX_ITEM_EXT_COST_ITEMS]
uint32 RequiredCurrency[MAX_ITEM_EXT_COST_CURRENCIES]
uint32 RequiredPersonalArenaRating
uint32 RequiredArenaSlot
uint32 ID
uint32 RequiredCurrencyCount[MAX_ITEM_EXT_COST_CURRENCIES]
uint32 RequiredGuildLevel
uint32 RequiredFactionId
uint32 RequirementFlags
uint32 RequiredAchievement
uint32 RequiredFactionStanding
int32 ItemStatUnk1[MAX_ITEM_PROTO_STATS]
uint32 RandomSuffix
uint32 ContainerSlots
uint32 DamageType
int32 AllowableRace
int32 CurrencySubstitutionCount
uint32 RequiredReputationRank
uint32 Stackable
float Unk430_1
int32 RequiredLevel
LocalizedString * Description
uint32 RequiredReputationFaction
uint32 Flags3
uint32 ScalingStatDistribution
uint32 BuyPrice
int32 SpellId[MAX_ITEM_PROTO_SPELLS]
int32 SpellTrigger[MAX_ITEM_PROTO_SPELLS]
uint32 Sheath
uint32 MaxCount
uint32 BuyCount
uint32 HolidayId
uint32 Flags
uint32 ItemStatValue[MAX_ITEM_PROTO_STATS]
uint32 RequiredHonorRank
float StatScalingFactor
int32 CurrencySubstitutionId
LocalizedString * Name
float Unk430_2
uint32 ItemLevel
int32 SpellCooldown[MAX_ITEM_PROTO_SPELLS]
uint32 ID
uint32 Map
int32 SpellCategoryCooldown[MAX_ITEM_PROTO_SPELLS]
uint32 ItemSet
uint32 InventoryType
uint32 Area
uint32 Bonding
uint32 RequiredSpell
uint32 RequiredSkill
uint32 BagFamily
float ArmorDamageModifier
uint32 Content[MAX_ITEM_PROTO_SOCKETS]
uint32 GemProperties
uint32 RequiredCityRank
uint32 Quality
int32 AllowableClass
int32 ItemStatUnk2[MAX_ITEM_PROTO_STATS]
uint32 Delay
int32 ItemStatType[MAX_ITEM_PROTO_STATS]
uint32 RequiredSkillRank
uint32 Duration
uint32 ItemLimitCategory
uint32 LockID
uint32 Color[MAX_ITEM_PROTO_SOCKETS]
uint32 PageMaterial
int32 SpellCategory[MAX_ITEM_PROTO_SPELLS]
int32 Material
uint32 LanguageID
int32 SocketBonus
uint32 StartQuest
uint32 SellPrice
uint32 RandomProperty
uint32 PageText
uint32 TotemCategory
int32 SpellCharges[MAX_ITEM_PROTO_SPELLS]
float RangedModRange
uint32 Flags2
uint32 SpeciesId
uint32 ItemId
uint32 Id
uint8 Key[KEYCHAIN_SIZE]
uint32 ID
int32 Reagent[MAX_SPELL_REAGENTS]
uint32 ReagentCount[MAX_SPELL_REAGENTS2]