TrinityCore
Loading...
Searching...
No Matches
DBCStores.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "DBCStores.h"
19#include "DBCFileLoader.h"
20#include "DBCfmt.h"
21#include "Containers.h"
22#include "Errors.h"
23#include "IteratorPair.h"
24#include "Log.h"
25#include "ObjectDefines.h"
26#include "Regex.h"
27#include "SharedDefines.h"
28#include "SpellMgr.h"
29#include "Timer.h"
30
31// temporary hack until includes are sorted out (don't want to pull in Windows.h)
32#ifdef GetClassName
33#undef GetClassName
34#endif
35
36typedef std::map<uint16, uint32> AreaFlagByAreaID;
37typedef std::map<uint32, uint32> AreaFlagByMapID;
38typedef std::map<std::pair<uint32, Difficulty>, MapDifficultyEntry const*> MapDifficultyMap;
39typedef std::tuple<int16, int8, int32> WMOAreaTableKey;
40typedef std::map<WMOAreaTableKey, WMOAreaTableEntry const*> WMOAreaInfoByTripple;
41
42DBCStorage <AreaTableEntry> sAreaTableStore(AreaTableEntryfmt);
43DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt);
44
46
47DBCStorage <AchievementEntry> sAchievementStore(Achievementfmt);
48DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore(AchievementCriteriafmt);
49DBCStorage <AreaTriggerEntry> sAreaTriggerStore(AreaTriggerEntryfmt);
50DBCStorage <AuctionHouseEntry> sAuctionHouseStore(AuctionHouseEntryfmt);
51DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore(BankBagSlotPricesEntryfmt);
52DBCStorage <BannedAddOnsEntry> sBannedAddOnsStore(BannedAddOnsfmt);
53DBCStorage <BattlemasterListEntry> sBattlemasterListStore(BattlemasterListEntryfmt);
54DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore(BarberShopStyleEntryfmt);
55DBCStorage <CharacterFacialHairStylesEntry> sCharacterFacialHairStylesStore(CharacterFacialHairStylesfmt);
56std::unordered_map<uint32, CharacterFacialHairStylesEntry const*> sCharFacialHairMap;
57DBCStorage <CharSectionsEntry> sCharSectionsStore(CharSectionsEntryfmt);
58std::unordered_multimap<uint32, CharSectionsEntry const*> sCharSectionMap;
59DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore(CharStartOutfitEntryfmt);
60std::map<uint32, CharStartOutfitEntry const*> sCharStartOutfitMap;
61DBCStorage <CharTitlesEntry> sCharTitlesStore(CharTitlesEntryfmt);
62DBCStorage <ChatChannelsEntry> sChatChannelsStore(ChatChannelsEntryfmt);
63DBCStorage <ChrClassesEntry> sChrClassesStore(ChrClassesEntryfmt);
64DBCStorage <ChrRacesEntry> sChrRacesStore(ChrRacesEntryfmt);
65DBCStorage <CinematicCameraEntry> sCinematicCameraStore(CinematicCameraEntryfmt);
66DBCStorage <CinematicSequencesEntry> sCinematicSequencesStore(CinematicSequencesEntryfmt);
67DBCStorage <CreatureDisplayInfoEntry> sCreatureDisplayInfoStore(CreatureDisplayInfofmt);
68DBCStorage <CreatureDisplayInfoExtraEntry> sCreatureDisplayInfoExtraStore(CreatureDisplayInfoExtrafmt);
69DBCStorage <CreatureFamilyEntry> sCreatureFamilyStore(CreatureFamilyfmt);
70DBCStorage <CreatureModelDataEntry> sCreatureModelDataStore(CreatureModelDatafmt);
71DBCStorage <CreatureSpellDataEntry> sCreatureSpellDataStore(CreatureSpellDatafmt);
72DBCStorage <CreatureTypeEntry> sCreatureTypeStore(CreatureTypefmt);
73DBCStorage <CurrencyTypesEntry> sCurrencyTypesStore(CurrencyTypesfmt);
74
75DBCStorage <DestructibleModelDataEntry> sDestructibleModelDataStore(DestructibleModelDatafmt);
76DBCStorage <DungeonEncounterEntry> sDungeonEncounterStore(DungeonEncounterfmt);
77DBCStorage <DurabilityQualityEntry> sDurabilityQualityStore(DurabilityQualityfmt);
78DBCStorage <DurabilityCostsEntry> sDurabilityCostsStore(DurabilityCostsfmt);
79
80DBCStorage <EmotesEntry> sEmotesStore(EmotesEntryfmt);
81DBCStorage <EmotesTextEntry> sEmotesTextStore(EmotesTextEntryfmt);
82typedef std::tuple<uint32, uint32, uint32> EmotesTextSoundKey;
83static std::map<EmotesTextSoundKey, EmotesTextSoundEntry const*> sEmotesTextSoundMap;
84DBCStorage <EmotesTextSoundEntry> sEmotesTextSoundStore(EmotesTextSoundEntryfmt);
85
86typedef std::map<uint32, SimpleFactionsList> FactionTeamMap;
88DBCStorage <FactionEntry> sFactionStore(FactionEntryfmt);
89DBCStorage <FactionTemplateEntry> sFactionTemplateStore(FactionTemplateEntryfmt);
90
91// Used exclusively for data validation
92DBCStorage <GameObjectArtKitEntry> sGameObjectArtKitStore(GameObjectArtKitfmt);
93
94DBCStorage <GameObjectDisplayInfoEntry> sGameObjectDisplayInfoStore(GameObjectDisplayInfofmt);
95DBCStorage <GemPropertiesEntry> sGemPropertiesStore(GemPropertiesEntryfmt);
96DBCStorage <GlyphPropertiesEntry> sGlyphPropertiesStore(GlyphPropertiesfmt);
97DBCStorage <GlyphSlotEntry> sGlyphSlotStore(GlyphSlotfmt);
98
99DBCStorage <GtBarberShopCostBaseEntry> sGtBarberShopCostBaseStore(GtBarberShopCostBasefmt);
100DBCStorage <GtCombatRatingsEntry> sGtCombatRatingsStore(GtCombatRatingsfmt);
101DBCStorage <GtChanceToMeleeCritBaseEntry> sGtChanceToMeleeCritBaseStore(GtChanceToMeleeCritBasefmt);
102DBCStorage <GtChanceToMeleeCritEntry> sGtChanceToMeleeCritStore(GtChanceToMeleeCritfmt);
103DBCStorage <GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore(GtChanceToSpellCritBasefmt);
104DBCStorage <GtChanceToSpellCritEntry> sGtChanceToSpellCritStore(GtChanceToSpellCritfmt);
105DBCStorage <GtNPCManaCostScalerEntry> sGtNPCManaCostScalerStore(GtNPCManaCostScalerfmt);
106DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore(GtOCTClassCombatRatingScalarfmt);
107DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore(GtOCTRegenHPfmt);
108//DBCStorage <GtOCTRegenMPEntry> sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently
109DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore(GtRegenHPPerSptfmt);
110DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore(GtRegenMPPerSptfmt);
111
112DBCStorage <HolidaysEntry> sHolidaysStore(Holidaysfmt);
113
114DBCStorage <ItemEntry> sItemStore(Itemfmt);
115DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore(ItemBagFamilyfmt);
116//DBCStorage <ItemCondExtCostsEntry> sItemCondExtCostsStore(ItemCondExtCostsEntryfmt);
117//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently
118DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt);
119DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt);
120DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt);
121DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt);
122DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt);
123
124DBCStorage <LFGDungeonEntry> sLFGDungeonStore(LFGDungeonEntryfmt);
125DBCStorage <LFGDungeonExpansionEntry> sLFGDungeonExpansionStore(LFGDungeonExpansionfmt);
126DBCStorage <LightEntry> sLightStore(LightEntryfmt);
127DBCStorage <LiquidTypeEntry> sLiquidTypeStore(LiquidTypefmt);
128DBCStorage <LockEntry> sLockStore(LockEntryfmt);
129
130DBCStorage <MailTemplateEntry> sMailTemplateStore(MailTemplateEntryfmt);
131DBCStorage <MapEntry> sMapStore(MapEntryfmt);
132
133// DBC used only for initialization sMapDifficultyMap at startup.
134DBCStorage <MapDifficultyEntry> sMapDifficultyStore(MapDifficultyEntryfmt); // only for loading
136
137DBCStorage <MovieEntry> sMovieStore(MovieEntryfmt);
138
141typedef std::array<std::vector<Trinity::wregex>, TOTAL_LOCALES> NameValidationRegexContainer;
144
145DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDatafmt);
146
147DBCStorage <PowerDisplayEntry> sPowerDisplayStore(PowerDisplayfmt);
148DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore(PvPDifficultyfmt);
149
150DBCStorage <QuestSortEntry> sQuestSortStore(QuestSortEntryfmt);
151DBCStorage <QuestXPEntry> sQuestXPStore(QuestXPfmt);
152DBCStorage <QuestFactionRewEntry> sQuestFactionRewardStore(QuestFactionRewardfmt);
153DBCStorage <RandPropPointsEntry> sRandPropPointsStore(RandPropPointsfmt);
154DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore(ScalingStatDistributionfmt);
155DBCStorage <ScalingStatValuesEntry> sScalingStatValuesStore(ScalingStatValuesfmt);
156
157DBCStorage <SkillLineEntry> sSkillLineStore(SkillLinefmt);
158DBCStorage <SkillLineAbilityEntry> sSkillLineAbilityStore(SkillLineAbilityfmt);
159DBCStorage <SkillRaceClassInfoEntry> sSkillRaceClassInfoStore(SkillRaceClassInfofmt);
160std::unordered_map<uint32, std::vector<SkillLineAbilityEntry const*>> SkillLineAbilitiesBySkill;
162
163DBCStorage <SkillTiersEntry> sSkillTiersStore(SkillTiersfmt);
164
165DBCStorage <SoundEntriesEntry> sSoundEntriesStore(SoundEntriesfmt);
166
167DBCStorage <SpellItemEnchantmentEntry> sSpellItemEnchantmentStore(SpellItemEnchantmentfmt);
168DBCStorage <SpellItemEnchantmentConditionEntry> sSpellItemEnchantmentConditionStore(SpellItemEnchantmentConditionfmt);
169DBCStorage <SpellEntry> sSpellStore(SpellEntryfmt);
171
172DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore(SpellCastTimefmt);
173DBCStorage <SpellCategoryEntry> sSpellCategoryStore(SpellCategoryfmt);
174DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore(SpellDifficultyfmt);
175DBCStorage <SpellDurationEntry> sSpellDurationStore(SpellDurationfmt);
176DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore(SpellFocusObjectfmt);
177DBCStorage <SpellRadiusEntry> sSpellRadiusStore(SpellRadiusfmt);
178DBCStorage <SpellRangeEntry> sSpellRangeStore(SpellRangefmt);
179DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostfmt);
180DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore(SpellShapeshiftFormfmt);
181DBCStorage <SpellVisualEntry> sSpellVisualStore(SpellVisualfmt);
182DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore(StableSlotPricesfmt);
183DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore(SummonPropertiesfmt);
184DBCStorage <TalentEntry> sTalentStore(TalentEntryfmt);
186std::unordered_set<uint32> sPetTalentSpells;
187DBCStorage <TalentTabEntry> sTalentTabStore(TalentTabEntryfmt);
188
189// store absolute bit position for first rank for talent inspect
191
192DBCStorage <TaxiNodesEntry> sTaxiNodesStore(TaxiNodesEntryfmt);
198
199// DBC used only for initialization sTaxiPathSetBySource at startup.
201DBCStorage <TaxiPathEntry> sTaxiPathStore(TaxiPathEntryfmt);
202
203// DBC used only for initialization sTaxiPathNodeStore at startup.
205static DBCStorage <TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt);
206
207DBCStorage <TeamContributionPointsEntry> sTeamContributionPointsStore(TeamContributionPointsfmt);
208DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt);
209DBCStorage <TransportAnimationEntry> sTransportAnimationStore(TransportAnimationfmt);
210DBCStorage <TransportRotationEntry> sTransportRotationStore(TransportRotationfmt);
211DBCStorage <VehicleEntry> sVehicleStore(VehicleEntryfmt);
212DBCStorage <VehicleSeatEntry> sVehicleSeatStore(VehicleSeatEntryfmt);
213DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore(WMOAreaTableEntryfmt);
214DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore(WorldMapAreaEntryfmt);
215DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore(WorldMapOverlayEntryfmt);
216DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore(WorldSafeLocsEntryfmt);
217
218typedef std::list<std::string> StoreProblemList;
219
221
222template<class T>
223inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCStorage<T>& storage, std::string const& dbcPath, std::string const& filename,
224 char const* dbTable = nullptr, char const* dbFormat = nullptr, char const* dbIndexName = nullptr)
225{
226 // compatibility format and C++ structure sizes
228 "Size of '%s' set by format string (%u) not equal size of C++ structure (%u).",
229 filename.c_str(), DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), uint32(sizeof(T)));
230
231 ++DBCFileCount;
232 std::string dbcFilename = dbcPath + filename;
233
234 if (storage.Load(dbcFilename.c_str()))
235 {
236 for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
237 {
238 if (!(availableDbcLocales & (1 << i)))
239 continue;
240
241 std::string localizedName(dbcPath);
242 localizedName.append(localeNames[i]);
243 localizedName.push_back('/');
244 localizedName.append(filename);
245
246 if (!storage.LoadStringsFrom(localizedName.c_str()))
247 availableDbcLocales &= ~(1 << i); // mark as not available for speedup next checks
248 }
249
250 if (dbTable)
251 storage.LoadFromDB(dbTable, dbFormat, dbIndexName);
252 }
253 else
254 {
255 // sort problematic dbc to (1) non compatible and (2) non-existed
256 if (FILE* f = fopen(dbcFilename.c_str(), "rb"))
257 {
258 std::ostringstream stream;
259 stream << dbcFilename << " exists, and has " << storage.GetFieldCount() << " field(s) (expected " << strlen(storage.GetFormat()) << "). Extracted file might be from wrong client version or a database-update has been forgotten. Search on forum for TCE00008 for more info.";
260 std::string buf = stream.str();
261 errors.push_back(buf);
262 fclose(f);
263 }
264 else
265 errors.push_back(dbcFilename);
266 }
267}
268
269void LoadDBCStores(const std::string& dataPath)
270{
271 uint32 oldMSTime = getMSTime();
272
273 std::string dbcPath = dataPath + "dbc/";
274
275 StoreProblemList bad_dbc_files;
276 uint32 availableDbcLocales = 0xFFFFFFFF;
277
278#define LOAD_DBC(store, file) LoadDBC(availableDbcLocales, bad_dbc_files, store, dbcPath, file)
279
280 LOAD_DBC(sAreaTableStore, "AreaTable.dbc");
281 LOAD_DBC(sAchievementCriteriaStore, "Achievement_Criteria.dbc");
282 LOAD_DBC(sAreaTriggerStore, "AreaTrigger.dbc");
283 LOAD_DBC(sAreaGroupStore, "AreaGroup.dbc");
284 LOAD_DBC(sAuctionHouseStore, "AuctionHouse.dbc");
285 LOAD_DBC(sBankBagSlotPricesStore, "BankBagSlotPrices.dbc");
286 LOAD_DBC(sBannedAddOnsStore, "BannedAddOns.dbc");
287 LOAD_DBC(sBattlemasterListStore, "BattlemasterList.dbc");
288 LOAD_DBC(sBarberShopStyleStore, "BarberShopStyle.dbc");
289 LOAD_DBC(sCharacterFacialHairStylesStore, "CharacterFacialHairStyles.dbc");
290 LOAD_DBC(sCharSectionsStore, "CharSections.dbc");
291 LOAD_DBC(sCharStartOutfitStore, "CharStartOutfit.dbc");
292 LOAD_DBC(sCharTitlesStore, "CharTitles.dbc");
293 LOAD_DBC(sChatChannelsStore, "ChatChannels.dbc");
294 LOAD_DBC(sChrClassesStore, "ChrClasses.dbc");
295 LOAD_DBC(sChrRacesStore, "ChrRaces.dbc");
296 LOAD_DBC(sCinematicCameraStore, "CinematicCamera.dbc");
297 LOAD_DBC(sCinematicSequencesStore, "CinematicSequences.dbc");
298 LOAD_DBC(sCreatureDisplayInfoStore, "CreatureDisplayInfo.dbc");
299 LOAD_DBC(sCreatureDisplayInfoExtraStore, "CreatureDisplayInfoExtra.dbc");
300 LOAD_DBC(sCreatureFamilyStore, "CreatureFamily.dbc");
301 LOAD_DBC(sCreatureModelDataStore, "CreatureModelData.dbc");
302 LOAD_DBC(sCreatureSpellDataStore, "CreatureSpellData.dbc");
303 LOAD_DBC(sCreatureTypeStore, "CreatureType.dbc");
304 LOAD_DBC(sCurrencyTypesStore, "CurrencyTypes.dbc");
305 LOAD_DBC(sDestructibleModelDataStore, "DestructibleModelData.dbc");
306 LOAD_DBC(sDungeonEncounterStore, "DungeonEncounter.dbc");
307 LOAD_DBC(sDurabilityCostsStore, "DurabilityCosts.dbc");
308 LOAD_DBC(sDurabilityQualityStore, "DurabilityQuality.dbc");
309 LOAD_DBC(sEmotesStore, "Emotes.dbc");
310 LOAD_DBC(sEmotesTextStore, "EmotesText.dbc");
311 LOAD_DBC(sEmotesTextSoundStore, "EmotesTextSound.dbc");
312 LOAD_DBC(sFactionStore, "Faction.dbc");
313 LOAD_DBC(sFactionTemplateStore, "FactionTemplate.dbc");
314 LOAD_DBC(sGameObjectArtKitStore, "GameObjectArtKit.dbc");
315 LOAD_DBC(sGameObjectDisplayInfoStore, "GameObjectDisplayInfo.dbc");
316 LOAD_DBC(sGemPropertiesStore, "GemProperties.dbc");
317 LOAD_DBC(sGlyphPropertiesStore, "GlyphProperties.dbc");
318 LOAD_DBC(sGlyphSlotStore, "GlyphSlot.dbc");
319 LOAD_DBC(sGtBarberShopCostBaseStore, "gtBarberShopCostBase.dbc");
320 LOAD_DBC(sGtCombatRatingsStore, "gtCombatRatings.dbc");
321 LOAD_DBC(sGtChanceToMeleeCritBaseStore, "gtChanceToMeleeCritBase.dbc");
322 LOAD_DBC(sGtChanceToMeleeCritStore, "gtChanceToMeleeCrit.dbc");
323 LOAD_DBC(sGtChanceToSpellCritBaseStore, "gtChanceToSpellCritBase.dbc");
324 LOAD_DBC(sGtChanceToSpellCritStore, "gtChanceToSpellCrit.dbc");
325 LOAD_DBC(sGtNPCManaCostScalerStore, "gtNPCManaCostScaler.dbc");
326 LOAD_DBC(sGtOCTClassCombatRatingScalarStore, "gtOCTClassCombatRatingScalar.dbc");
327 LOAD_DBC(sGtOCTRegenHPStore, "gtOCTRegenHP.dbc");
328 //LOAD_DBC(sGtOCTRegenMPStore, "gtOCTRegenMP.dbc"); -- not used currently
329 LOAD_DBC(sGtRegenHPPerSptStore, "gtRegenHPPerSpt.dbc");
330 LOAD_DBC(sGtRegenMPPerSptStore, "gtRegenMPPerSpt.dbc");
331 LOAD_DBC(sHolidaysStore, "Holidays.dbc");
332 LOAD_DBC(sItemStore, "Item.dbc");
333 LOAD_DBC(sItemBagFamilyStore, "ItemBagFamily.dbc");
334 //LOAD_DBC(sItemDisplayInfoStore, "ItemDisplayInfo.dbc"); -- not used currently
335 //LOAD_DBC(sItemCondExtCostsStore, "ItemCondExtCosts.dbc");
336 LOAD_DBC(sItemExtendedCostStore, "ItemExtendedCost.dbc");
337 LOAD_DBC(sItemLimitCategoryStore, "ItemLimitCategory.dbc");
338 LOAD_DBC(sItemRandomPropertiesStore, "ItemRandomProperties.dbc");
339 LOAD_DBC(sItemRandomSuffixStore, "ItemRandomSuffix.dbc");
340 LOAD_DBC(sItemSetStore, "ItemSet.dbc");
341 LOAD_DBC(sLFGDungeonStore, "LFGDungeons.dbc");
342 LOAD_DBC(sLFGDungeonExpansionStore, "LFGDungeonExpansion.dbc");
343 LOAD_DBC(sLightStore, "Light.dbc");
344 LOAD_DBC(sLiquidTypeStore, "LiquidType.dbc");
345 LOAD_DBC(sLockStore, "Lock.dbc");
346 LOAD_DBC(sMailTemplateStore, "MailTemplate.dbc");
347 LOAD_DBC(sMapStore, "Map.dbc");
348 LOAD_DBC(sMapDifficultyStore, "MapDifficulty.dbc");
349 LOAD_DBC(sMovieStore, "Movie.dbc");
350 LOAD_DBC(sNamesProfanityStore, "NamesProfanity.dbc");
351 LOAD_DBC(sNamesReservedStore, "NamesReserved.dbc");
352 LOAD_DBC(sOverrideSpellDataStore, "OverrideSpellData.dbc");
353 LOAD_DBC(sPowerDisplayStore, "PowerDisplay.dbc");
354 LOAD_DBC(sPvPDifficultyStore, "PvpDifficulty.dbc");
355 LOAD_DBC(sQuestXPStore, "QuestXP.dbc");
356 LOAD_DBC(sQuestFactionRewardStore, "QuestFactionReward.dbc");
357 LOAD_DBC(sQuestSortStore, "QuestSort.dbc");
358 LOAD_DBC(sRandPropPointsStore, "RandPropPoints.dbc");
359 LOAD_DBC(sScalingStatDistributionStore, "ScalingStatDistribution.dbc");
360 LOAD_DBC(sScalingStatValuesStore, "ScalingStatValues.dbc");
361 LOAD_DBC(sSkillLineStore, "SkillLine.dbc");
362 LOAD_DBC(sSkillLineAbilityStore, "SkillLineAbility.dbc");
363 LOAD_DBC(sSkillRaceClassInfoStore, "SkillRaceClassInfo.dbc");
364 LOAD_DBC(sSkillTiersStore, "SkillTiers.dbc");
365 LOAD_DBC(sSoundEntriesStore, "SoundEntries.dbc");
366 LOAD_DBC(sSpellCastTimesStore, "SpellCastTimes.dbc");
367 LOAD_DBC(sSpellCategoryStore, "SpellCategory.dbc");
368 LOAD_DBC(sSpellDurationStore, "SpellDuration.dbc");
369 LOAD_DBC(sSpellFocusObjectStore, "SpellFocusObject.dbc");
370 LOAD_DBC(sSpellItemEnchantmentStore, "SpellItemEnchantment.dbc");
371 LOAD_DBC(sSpellItemEnchantmentConditionStore, "SpellItemEnchantmentCondition.dbc");
372 LOAD_DBC(sSpellRadiusStore, "SpellRadius.dbc");
373 LOAD_DBC(sSpellRangeStore, "SpellRange.dbc");
374 LOAD_DBC(sSpellRuneCostStore, "SpellRuneCost.dbc");
375 LOAD_DBC(sSpellShapeshiftFormStore, "SpellShapeshiftForm.dbc");
376 LOAD_DBC(sSpellVisualStore, "SpellVisual.dbc");
377 LOAD_DBC(sStableSlotPricesStore, "StableSlotPrices.dbc");
378 LOAD_DBC(sSummonPropertiesStore, "SummonProperties.dbc");
379 LOAD_DBC(sTalentStore, "Talent.dbc");
380 LOAD_DBC(sTalentTabStore, "TalentTab.dbc");
381 LOAD_DBC(sTaxiNodesStore, "TaxiNodes.dbc");
382 LOAD_DBC(sTaxiPathStore, "TaxiPath.dbc");
383 LOAD_DBC(sTaxiPathNodeStore, "TaxiPathNode.dbc");
384 LOAD_DBC(sTeamContributionPointsStore, "TeamContributionPoints.dbc");
385 LOAD_DBC(sTotemCategoryStore, "TotemCategory.dbc");
386 LOAD_DBC(sTransportAnimationStore, "TransportAnimation.dbc");
387 LOAD_DBC(sTransportRotationStore, "TransportRotation.dbc");
388 LOAD_DBC(sVehicleStore, "Vehicle.dbc");
389 LOAD_DBC(sVehicleSeatStore, "VehicleSeat.dbc");
390 LOAD_DBC(sWMOAreaTableStore, "WMOAreaTable.dbc");
391 LOAD_DBC(sWorldMapAreaStore, "WorldMapArea.dbc");
392 LOAD_DBC(sWorldMapOverlayStore, "WorldMapOverlay.dbc");
393 LOAD_DBC(sWorldSafeLocsStore, "WorldSafeLocs.dbc");
394
395#undef LOAD_DBC
396
397#define LOAD_DBC_EXT(store, file, dbtable, dbformat, dbpk) LoadDBC(availableDbcLocales, bad_dbc_files, store, dbcPath, file, dbtable, dbformat, dbpk)
398
399 LOAD_DBC_EXT(sAchievementStore, "Achievement.dbc", "achievement_dbc", CustomAchievementfmt, CustomAchievementIndex);
401 LOAD_DBC_EXT(sSpellDifficultyStore, "SpellDifficulty.dbc", "spelldifficulty_dbc", CustomSpellDifficultyfmt, CustomSpellDifficultyIndex);
402
403#undef LOAD_DBC_EXT
404
406 if (entry->RaceID && ((1 << (entry->RaceID - 1)) & RACEMASK_ALL_PLAYABLE) != 0) // ignore nonplayable races
407 sCharFacialHairMap.insert({ entry->RaceID | (entry->SexID << 8) | (entry->VariationID << 16), entry });
408
409 for (CharSectionsEntry const* entry : sCharSectionsStore)
410 if (entry->RaceID && ((1 << (entry->RaceID - 1)) & RACEMASK_ALL_PLAYABLE) != 0) // ignore nonplayable races
411 sCharSectionMap.insert({ entry->BaseSection | (entry->SexID << 8) | (entry->RaceID << 16), entry });
412
413 for (CharStartOutfitEntry const* outfit : sCharStartOutfitStore)
414 sCharStartOutfitMap[outfit->RaceID | (outfit->ClassID << 8) | (outfit->SexID << 16)] = outfit;
415
417 sEmotesTextSoundMap[EmotesTextSoundKey(entry->EmotesTextID, entry->RaceID, entry->SexID)] = entry;
418
419 for (FactionEntry const* faction : sFactionStore)
420 {
421 if (faction->ParentFactionID)
422 {
423 SimpleFactionsList& flist = sFactionTeamMap[faction->ParentFactionID];
424 flist.push_back(faction->ID);
425 }
426 }
427
429 {
430 if (info->GeoBoxMax.X < info->GeoBoxMin.X)
431 std::swap(*(float*)(&info->GeoBoxMax.X), *(float*)(&info->GeoBoxMin.X));
432 if (info->GeoBoxMax.Y < info->GeoBoxMin.Y)
433 std::swap(*(float*)(&info->GeoBoxMax.Y), *(float*)(&info->GeoBoxMin.Y));
434 if (info->GeoBoxMax.Z < info->GeoBoxMin.Z)
435 std::swap(*(float*)(&info->GeoBoxMax.Z), *(float*)(&info->GeoBoxMin.Z));
436 }
437
438 // fill data
439 for (MapDifficultyEntry const* entry : sMapDifficultyStore)
440 sMapDifficultyMap[{ entry->MapID, Difficulty(entry->Difficulty) }] = entry;
441
442 for (NamesProfanityEntry const* namesProfanity : sNamesProfanityStore)
443 {
444 ASSERT(namesProfanity->Language < TOTAL_LOCALES || namesProfanity->Language == -1);
445 std::wstring wname;
446 bool conversionResult = Utf8toWStr(namesProfanity->Name, wname);
447 ASSERT(conversionResult);
448
449 if (namesProfanity->Language != -1)
450 NamesProfaneValidators[namesProfanity->Language].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
451 else
452 for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
453 NamesProfaneValidators[i].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
454 }
455
456 for (NamesReservedEntry const* namesReserved : sNamesReservedStore)
457 {
458 ASSERT(namesReserved->Language < TOTAL_LOCALES || namesReserved->Language == -1);
459 std::wstring wname;
460 bool conversionResult = Utf8toWStr(namesReserved->Name, wname);
461 ASSERT(conversionResult);
462
463 if (namesReserved->Language != -1)
464 NamesReservedValidators[namesReserved->Language].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
465 else
466 for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
467 NamesReservedValidators[i].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
468 }
469
470 for (PvPDifficultyEntry const* entry : sPvPDifficultyStore)
471 {
472 ASSERT(entry->RangeIndex < MAX_BATTLEGROUND_BRACKETS, "PvpDifficulty bracket (%d) exceeded max allowed value (%d)", entry->RangeIndex, MAX_BATTLEGROUND_BRACKETS);
473 }
474
476 if (sSkillLineStore.LookupEntry(entry->SkillID))
477 SkillRaceClassInfoBySkill.emplace(entry->SkillID, entry);
478
479 for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore)
480 {
481 SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->Spell);
482 if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE)
483 {
484 for (CreatureFamilyEntry const* cFamily : sCreatureFamilyStore)
485 {
486 if (skillLine->SkillLine != cFamily->SkillLine[0] && skillLine->SkillLine != cFamily->SkillLine[1])
487 continue;
488 if (spellInfo->SpellLevel)
489 continue;
490
491 if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
492 continue;
493
494 sPetFamilySpellsStore[cFamily->ID].insert(spellInfo->ID);
495 }
496 }
497
498 SkillLineAbilitiesBySkill[skillLine->SkillLine].push_back(skillLine);
499 }
500
501 // Create Spelldifficulty searcher
502 for (SpellDifficultyEntry const* spellDiff : sSpellDifficultyStore)
503 {
504 SpellDifficultyEntry newEntry;
505 memset(newEntry.DifficultySpellID, 0, 4*sizeof(uint32));
506 for (uint8 x = 0; x < MAX_DIFFICULTY; ++x)
507 {
508 if (spellDiff->DifficultySpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->DifficultySpellID[x]))
509 {
510 if (spellDiff->DifficultySpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values
511 TC_LOG_ERROR("sql.sql", "spelldifficulty_dbc: spell {} at field id:{} at spellid{} does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->DifficultySpellID[x], spellDiff->ID, x);
512 newEntry.DifficultySpellID[x] = 0;//spell was <= 0 or invalid, set to 0
513 }
514 else
515 newEntry.DifficultySpellID[x] = spellDiff->DifficultySpellID[x];
516 }
517 if (newEntry.DifficultySpellID[0] <= 0 || newEntry.DifficultySpellID[1] <= 0)//id0-1 must be always set!
518 continue;
519
520 for (uint8 x = 0; x < MAX_DIFFICULTY; ++x)
521 if (newEntry.DifficultySpellID[x])
522 sSpellMgr->SetSpellDifficultyId(uint32(newEntry.DifficultySpellID[x]), spellDiff->ID);
523 }
524
525 // create talent spells set
526 for (TalentEntry const* talentInfo : sTalentStore)
527 {
528 TalentTabEntry const* talentTab = sTalentTabStore.LookupEntry(talentInfo->TabID);
529 for (uint8 j = 0; j < MAX_TALENT_RANK; ++j)
530 {
531 if (talentInfo->SpellRank[j])
532 {
533 sTalentSpellPosMap[talentInfo->SpellRank[j]] = TalentSpellPos(talentInfo->ID, j);
534 if (talentTab && talentTab->PetTalentMask)
535 sPetTalentSpells.insert(talentInfo->SpellRank[j]);
536 }
537 }
538 }
539
540 // prepare fast data access to bit pos of talent ranks for use at inspecting
541 {
542 // now have all max ranks (and then bit amount used for store talent ranks in inspect)
543 for (TalentTabEntry const* talentTabInfo : sTalentTabStore)
544 {
545 // prevent memory corruption; otherwise cls will become 12 below
546 if ((talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE) == 0)
547 continue;
548
549 // store class talent tab pages
550 for (uint32 cls = 1; cls < MAX_CLASSES; ++cls)
551 if (talentTabInfo->ClassMask & (1 << (cls - 1)))
552 sTalentTabPages[cls][talentTabInfo->OrderIndex] = talentTabInfo->ID;
553 }
554 }
555
556 for (TaxiPathEntry const* entry : sTaxiPathStore)
557 sTaxiPathSetBySource[entry->FromTaxiNode][entry->ToTaxiNode] = TaxiPathBySourceAndDestination(entry->ID, entry->Cost);
558
559 uint32 pathCount = sTaxiPathStore.GetNumRows();
560 // Calculate path nodes count
561 std::vector<uint32> pathLength;
562 pathLength.resize(pathCount); // 0 and some other indexes not used
563 for (TaxiPathNodeEntry const* entry : sTaxiPathNodeStore)
564 {
565 if (pathLength[entry->PathID] < entry->NodeIndex + 1)
566 pathLength[entry->PathID] = entry->NodeIndex + 1;
567 }
568
569 // Set path length
570 sTaxiPathNodesByPath.resize(pathCount); // 0 and some other indexes not used
571 for (uint32 i = 1; i < sTaxiPathNodesByPath.size(); ++i)
572 sTaxiPathNodesByPath[i].resize(pathLength[i]);
573 // fill data
574 for (TaxiPathNodeEntry const* entry : sTaxiPathNodeStore)
575 sTaxiPathNodesByPath[entry->PathID][entry->NodeIndex] = entry;
576
577 // Initialize global taxinodes mask
578 // include existed nodes that have at least single not spell base (scripted) path
579 {
580 std::set<uint32> spellPaths;
581 for (SpellEntry const* sInfo : sSpellStore)
582 for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
583 if (sInfo->Effect[j] == SPELL_EFFECT_SEND_TAXI)
584 spellPaths.insert(sInfo->EffectMiscValue[j]);
585
586 // reinitialize internal storage for globals after loading TaxiNodes.db2
587 sTaxiNodesMask = {};
592 for (TaxiNodesEntry const* node : sTaxiNodesStore)
593 {
594 TaxiPathSetBySource::const_iterator src_i = sTaxiPathSetBySource.find(node->ID);
595 if (src_i != sTaxiPathSetBySource.end() && !src_i->second.empty())
596 {
597 bool ok = false;
598 for (TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin(); dest_i != src_i->second.end(); ++dest_i)
599 {
600 // not spell path
601 if (dest_i->second.price || spellPaths.find(dest_i->second.ID) == spellPaths.end())
602 {
603 ok = true;
604 break;
605 }
606 }
607
608 if (!ok)
609 continue;
610 }
611
612 // valid taxi network node
613 uint32 field = uint32((node->ID - 1) / (sizeof(TaxiMask::value_type) * 8));
614 TaxiMask::value_type submask = TaxiMask::value_type(1 << ((node->ID - 1) % (sizeof(TaxiMask::value_type) * 8)));
615 sTaxiNodesMask[field] |= submask;
616
617 if (node->MountCreatureID[0] && node->MountCreatureID[0] != 32981)
618 sHordeTaxiNodesMask[field] |= submask;
619 if (node->MountCreatureID[1] && node->MountCreatureID[1] != 32981)
620 sAllianceTaxiNodesMask[field] |= submask;
621 if (node->MountCreatureID[0] == 32981 || node->MountCreatureID[1] == 32981)
622 sDeathKnightTaxiNodesMask[field] |= submask;
623
624 // old continent node (+ nodes virtually at old continents, check explicitly to avoid loading map files for zone info)
625 if (node->ContinentID < 2 || node->ID == 82 || node->ID == 83 || node->ID == 93 || node->ID == 94)
626 sOldContinentsNodesMask[field] |= submask;
627
628 // fix DK node at Ebon Hold and Shadow Vault flight master
629 if (node->ID == 315 || node->ID == 333)
630 const_cast<TaxiNodesEntry*>(node)->MountCreatureID[1] = 32981;
631 }
632 }
633
634 for (WMOAreaTableEntry const* entry : sWMOAreaTableStore)
635 sWMOAreaInfoByTripple[WMOAreaTableKey(entry->WMOID, entry->NameSetID, entry->WMOGroupID)] = entry;
636
637 // error checks
638 if (bad_dbc_files.size() >= DBCFileCount)
639 {
640 TC_LOG_ERROR("misc", "Incorrect DataDir value in worldserver.conf or ALL required *.dbc files ({}) not found by path: {}dbc", DBCFileCount, dataPath);
641 exit(1);
642 }
643 else if (!bad_dbc_files.empty())
644 {
645 std::string str;
646 for (StoreProblemList::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
647 str += *i + "\n";
648
649 TC_LOG_ERROR("misc", "Some required *.dbc files ({} from {}) not found or not compatible:\n{}", (uint32)bad_dbc_files.size(), DBCFileCount, str);
650 exit(1);
651 }
652
653 // Check loaded DBC files proper version
654 if (!sAreaTableStore.LookupEntry(4987) || // last area added in 3.3.5a
655 !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a
656 !sGemPropertiesStore.LookupEntry(1629) || // last gem property added in 3.3.5a
657 !sItemStore.LookupEntry(56806) || // last client known item added in 3.3.5a
658 !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a
659 !sMapStore.LookupEntry(724) || // last map added in 3.3.5a
660 !sSpellStore.LookupEntry(80864) ) // last added spell in 3.3.5a
661 {
662 TC_LOG_ERROR("misc", "You have _outdated_ DBC files. Please extract correct versions from current using client.");
663 exit(1);
664 }
665
666 TC_LOG_INFO("server.loading", ">> Initialized {} data stores in {} ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime));
667
668}
669
671{
672 FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction);
673 if (itr != sFactionTeamMap.end())
674 return &itr->second;
675
676 return nullptr;
677}
678
679char const* GetPetName(uint32 petfamily, uint32 dbclang)
680{
681 if (!petfamily)
682 return nullptr;
683 CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily);
684 if (!pet_family)
685 return nullptr;
686 return pet_family->Name[dbclang];
687}
688
690{
691 TalentSpellPosMap::const_iterator itr = sTalentSpellPosMap.find(spellId);
692 if (itr == sTalentSpellPosMap.end())
693 return nullptr;
694
695 return &itr->second;
696}
697
699{
700 if (TalentSpellPos const* pos = GetTalentSpellPos(spellId))
701 return pos->rank+1;
702
703 return 0;
704}
705
707{
708 auto i = sWMOAreaInfoByTripple.find(WMOAreaTableKey(int16(rootid), int8(adtid), groupid));
709 if (i != sWMOAreaInfoByTripple.end())
710 return i->second;
711
712 return nullptr;
713}
714
715char const* GetRaceName(uint8 race, uint8 locale)
716{
717 ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race);
718 return raceEntry ? raceEntry->Name[locale] : nullptr;
719}
720
721char const* GetClassName(uint8 class_, uint8 locale)
722{
723 ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_);
724 return classEntry ? classEntry->Name[locale] : nullptr;
725}
726
728{
729 if (mapid != 530 && mapid != 571) // speed for most cases
730 return mapid;
731
732 if (WorldMapAreaEntry const* wma = sWorldMapAreaStore.LookupEntry(zoneId))
733 return wma->DisplayMapID >= 0 ? wma->DisplayMapID : wma->MapID;
734
735 return mapid;
736}
737
739{
740 mapid = GetVirtualMapForMapAndZone(mapid, zoneId);
741 if (mapid < 2)
742 return CONTENT_1_60;
743
744 MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
745 if (!mapEntry)
746 return CONTENT_1_60;
747
748 switch (mapEntry->Expansion())
749 {
750 default: return CONTENT_1_60;
751 case 1: return CONTENT_61_70;
752 case 2: return CONTENT_71_80;
753 }
754}
755
756bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId)
757{
758 if (requiredTotemCategoryId == 0)
759 return true;
760 if (itemTotemCategoryId == 0)
761 return false;
762
763 TotemCategoryEntry const* itemEntry = sTotemCategoryStore.LookupEntry(itemTotemCategoryId);
764 if (!itemEntry)
765 return false;
766 TotemCategoryEntry const* reqEntry = sTotemCategoryStore.LookupEntry(requiredTotemCategoryId);
767 if (!reqEntry)
768 return false;
769
770 if (itemEntry->TotemCategoryType != reqEntry->TotemCategoryType)
771 return false;
772
773 return (itemEntry->TotemCategoryMask & reqEntry->TotemCategoryMask) == reqEntry->TotemCategoryMask;
774}
775
776void Zone2MapCoordinates(float& x, float& y, uint32 zone)
777{
778 WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
779
780 // if not listed then map coordinates (instance)
781 if (!maEntry)
782 return;
783
784 std::swap(x, y); // at client map coords swapped
785 x = x * ((maEntry->LocBottom - maEntry->LocTop) / 100) + maEntry->LocTop;
786 y = y * ((maEntry->LocRight - maEntry->LocLeft) / 100) + maEntry->LocLeft; // client y coord from top to down
787}
788
789void Map2ZoneCoordinates(float& x, float& y, uint32 zone)
790{
791 WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
792
793 // if not listed then map coordinates (instance)
794 if (!maEntry)
795 return;
796
797 x = (x - maEntry->LocTop) / ((maEntry->LocBottom - maEntry->LocTop) / 100);
798 y = (y - maEntry->LocLeft) / ((maEntry->LocRight - maEntry->LocLeft) / 100); // client y coord from top to down
799 std::swap(x, y); // client have map coords swapped
800}
801
803{
804 return Trinity::Containers::MapGetValuePtr(sMapDifficultyMap, { mapId, difficulty });
805}
806
808{
809 uint32 tmpDiff = difficulty;
810 MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff));
811 if (!mapDiff)
812 {
813 if (tmpDiff > RAID_DIFFICULTY_25MAN_NORMAL) // heroic, downscale to normal
814 tmpDiff -= 2;
815 else
816 tmpDiff -= 1; // any non-normal mode for raids like tbc (only one mode)
817
818 // pull new data
819 mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // we are 10 normal or 25 normal
820 if (!mapDiff)
821 {
822 tmpDiff -= 1;
823 mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // 10 normal
824 }
825 }
826
827 difficulty = Difficulty(tmpDiff);
828 return mapDiff;
829}
830
832{
833 PvPDifficultyEntry const* maxEntry = nullptr; // used for level > max listed level case
834 for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
835 {
836 if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
837 {
838 // skip unrelated and too-high brackets
839 if (entry->MapID != mapid || entry->MinLevel > level)
840 continue;
841
842 // exactly fit
843 if (entry->MaxLevel >= level)
844 return entry;
845
846 // remember for possible out-of-range case (search higher from existed)
847 if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel)
848 maxEntry = entry;
849 }
850 }
851
852 return maxEntry;
853}
854
856{
857 for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
858 if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
859 if (entry->MapID == mapid && entry->GetBracketId() == id)
860 return entry;
861
862 return nullptr;
863}
864
866{
867 return sTalentTabPages[cls];
868}
869
871{
872 if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
873 return 1 << liq->SoundBank;
874
875 return 0;
876}
877
879{
880 auto itr = sCharFacialHairMap.find(uint32(race) | uint32(gender << 8) | uint32(facialHairID << 16));
881 if (itr == sCharFacialHairMap.end())
882 return nullptr;
883
884 return itr->second;
885}
886
888{
889 uint32 const key = uint32(genType) | uint32(gender << 8) | uint32(race << 16);
890 for (auto const& section : Trinity::Containers::MapEqualRange(sCharSectionMap, key))
891 {
892 if (section.second->VariationIndex == type && section.second->ColorIndex == color)
893 return section.second;
894 }
895
896 return nullptr;
897}
898
900{
901 std::map<uint32, CharStartOutfitEntry const*>::const_iterator itr = sCharStartOutfitMap.find(race | (class_ << 8) | (gender << 16));
902 if (itr == sCharStartOutfitMap.end())
903 return nullptr;
904
905 return itr->second;
906}
907
910{
911 for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i)
912 {
913 LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(i);
914 if (!dungeon)
915 continue;
916
917 if (dungeon->MapID == int32(mapId) && Difficulty(dungeon->Difficulty) == difficulty)
918 return dungeon;
919 }
920
921 return nullptr;
922}
923
925{
926 for (int32 i = sLightStore.GetNumRows(); i >= 0; --i)
927 {
928 LightEntry const* light = sLightStore.LookupEntry(uint32(i));
929 if (!light)
930 continue;
931
932 if (light->ContinentID == mapId && light->GameCoords.X == 0.0f && light->GameCoords.Y == 0.0f && light->GameCoords.Z == 0.0f)
933 return light->ID;
934 }
935
936 return 0;
937}
938
939std::vector<SkillLineAbilityEntry const*> const* GetSkillLineAbilitiesBySkill(uint32 skillLine)
940{
942}
943
945{
946 SkillRaceClassInfoBounds bounds = SkillRaceClassInfoBySkill.equal_range(skill);
947 for (SkillRaceClassInfoMap::iterator itr = bounds.first; itr != bounds.second; ++itr)
948 {
949 if (itr->second->RaceMask && !(itr->second->RaceMask & (1 << (race - 1))))
950 continue;
951 if (itr->second->ClassMask && !(itr->second->ClassMask & (1 << (class_ - 1))))
952 continue;
953
954 return itr->second;
955 }
956
957 return nullptr;
958}
959
960ResponseCodes ValidateName(std::wstring const& name, LocaleConstant locale)
961{
962 if (locale >= TOTAL_LOCALES)
963 return RESPONSE_FAILURE;
964
965 for (Trinity::wregex const& regex : NamesProfaneValidators[locale])
966 if (Trinity::regex_search(name, regex))
967 return CHAR_NAME_PROFANE;
968
969 // regexes at TOTAL_LOCALES are loaded from NamesReserved which is not locale specific
970 for (Trinity::wregex const& regex : NamesReservedValidators[locale])
971 if (Trinity::regex_search(name, regex))
972 return CHAR_NAME_RESERVED;
973
974 return CHAR_NAME_SUCCESS;
975}
976
978{
979 auto itr = sEmotesTextSoundMap.find(EmotesTextSoundKey(emote, race, gender));
980 return itr != sEmotesTextSoundMap.end() ? itr->second : nullptr;
981}
982
984{
985 if (sTaxiNodesStore.GetNumRows())
986 {
987 _data.resize((sTaxiNodesStore.GetNumRows() + (8 * sizeof(uint64) - 1)) / (8 * sizeof(uint64)) * (sizeof(uint64) / sizeof(value_type)), 0);
988 ASSERT((_data.size() % (8 / sizeof(value_type))) == 0, "TaxiMask byte size must be aligned to a multiple of uint64");
989 }
990}
char const * localeNames[TOTAL_LOCALES]
Definition Common.cpp:20
LocaleConstant
Definition Common.h:48
@ TOTAL_LOCALES
Definition Common.h:59
Difficulty
Definition DBCEnums.h:279
@ RAID_DIFFICULTY_25MAN_NORMAL
Definition DBCEnums.h:287
#define MAX_DIFFICULTY
Definition DBCEnums.h:294
#define MAX_BATTLEGROUND_BRACKETS
Definition DBCEnums.h:63
#define MAX_TALENT_RANK
Definition DBCEnums.h:430
@ SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN
Definition DBCEnums.h:348
BattlegroundBracketId
Definition DBCEnums.h:57
#define MAX_SPELL_EFFECTS
Definition DBCEnums.h:386
DBCStorage< DurabilityQualityEntry > sDurabilityQualityStore(DurabilityQualityfmt)
std::array< std::vector< Trinity::wregex >, TOTAL_LOCALES > NameValidationRegexContainer
DBCStorage< NamesReservedEntry > sNamesReservedStore(NamesReservedEntryfmt)
DBCStorage< AchievementCriteriaEntry > sAchievementCriteriaStore(AchievementCriteriafmt)
DBCStorage< MovieEntry > sMovieStore(MovieEntryfmt)
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
DBCStorage< CharTitlesEntry > sCharTitlesStore(CharTitlesEntryfmt)
NameValidationRegexContainer NamesReservedValidators
std::map< uint32, uint32 > AreaFlagByMapID
Definition DBCStores.cpp:37
std::map< std::pair< uint32, Difficulty >, MapDifficultyEntry const * > MapDifficultyMap
Definition DBCStores.cpp:38
DBCStorage< VehicleSeatEntry > sVehicleSeatStore(VehicleSeatEntryfmt)
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
DBCStorage< SpellShapeshiftFormEntry > sSpellShapeshiftFormStore(SpellShapeshiftFormfmt)
SkillRaceClassInfoEntry const * GetSkillRaceClassInfo(uint32 skill, uint8 race, uint8 class_)
DBCStorage< TalentTabEntry > sTalentTabStore(TalentTabEntryfmt)
DBCStorage< ScalingStatDistributionEntry > sScalingStatDistributionStore(ScalingStatDistributionfmt)
TaxiMask sAllianceTaxiNodesMask
char const * GetClassName(uint8 class_, uint8 locale)
ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId)
DBCStorage< ItemSetEntry > sItemSetStore(ItemSetEntryfmt)
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsEntryfmt)
ResponseCodes ValidateName(std::wstring const &name, LocaleConstant locale)
DBCStorage< DestructibleModelDataEntry > sDestructibleModelDataStore(DestructibleModelDatafmt)
DBCStorage< GlyphSlotEntry > sGlyphSlotStore(GlyphSlotfmt)
TaxiPathSetBySource sTaxiPathSetBySource
DBCStorage< RandPropPointsEntry > sRandPropPointsStore(RandPropPointsfmt)
DBCStorage< LFGDungeonEntry > sLFGDungeonStore(LFGDungeonEntryfmt)
std::map< WMOAreaTableKey, WMOAreaTableEntry const * > WMOAreaInfoByTripple
Definition DBCStores.cpp:40
DBCStorage< MailTemplateEntry > sMailTemplateStore(MailTemplateEntryfmt)
DBCStorage< GtChanceToSpellCritBaseEntry > sGtChanceToSpellCritBaseStore(GtChanceToSpellCritBasefmt)
DBCStorage< VehicleEntry > sVehicleStore(VehicleEntryfmt)
void Zone2MapCoordinates(float &x, float &y, uint32 zone)
DBCStorage< ItemLimitCategoryEntry > sItemLimitCategoryStore(ItemLimitCategoryEntryfmt)
DBCStorage< SpellRadiusEntry > sSpellRadiusStore(SpellRadiusfmt)
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
std::unordered_map< uint32, CharacterFacialHairStylesEntry const * > sCharFacialHairMap
Definition DBCStores.cpp:56
void Map2ZoneCoordinates(float &x, float &y, uint32 zone)
std::map< uint16, uint32 > AreaFlagByAreaID
Definition DBCStores.cpp:36
std::map< uint32, SimpleFactionsList > FactionTeamMap
Definition DBCStores.cpp:86
MapDifficultyEntry const * GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty)
CharacterFacialHairStylesEntry const * GetCharFacialHairEntry(uint8 race, uint8 gender, uint8 facialHairID)
char const * GetPetName(uint32 petfamily, uint32 dbclang)
TaxiMask sTaxiNodesMask
std::tuple< int16, int8, int32 > WMOAreaTableKey
Definition DBCStores.cpp:39
std::map< uint32, CharStartOutfitEntry const * > sCharStartOutfitMap
Definition DBCStores.cpp:60
std::vector< SkillLineAbilityEntry const * > const * GetSkillLineAbilitiesBySkill(uint32 skillLine)
DBCStorage< ScalingStatValuesEntry > sScalingStatValuesStore(ScalingStatValuesfmt)
void LoadDBC(uint32 &availableDbcLocales, StoreProblemList &errors, DBCStorage< T > &storage, std::string const &dbcPath, std::string const &filename, char const *dbTable=nullptr, char const *dbFormat=nullptr, char const *dbIndexName=nullptr)
DBCStorage< CharStartOutfitEntry > sCharStartOutfitStore(CharStartOutfitEntryfmt)
DBCStorage< QuestFactionRewEntry > sQuestFactionRewardStore(QuestFactionRewardfmt)
DBCStorage< GtCombatRatingsEntry > sGtCombatRatingsStore(GtCombatRatingsfmt)
EmotesTextSoundEntry const * FindTextSoundEmoteFor(uint32 emote, uint32 race, uint32 gender)
#define LOAD_DBC(store, file)
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
DBCStorage< SkillTiersEntry > sSkillTiersStore(SkillTiersfmt)
TaxiPathNodesByPath sTaxiPathNodesByPath
DBCStorage< SpellCategoryEntry > sSpellCategoryStore(SpellCategoryfmt)
DBCStorage< ItemEntry > sItemStore(Itemfmt)
DBCStorage< ChatChannelsEntry > sChatChannelsStore(ChatChannelsEntryfmt)
bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId)
DBCStorage< PowerDisplayEntry > sPowerDisplayStore(PowerDisplayfmt)
TalentSpellPos const * GetTalentSpellPos(uint32 spellId)
DBCStorage< BankBagSlotPricesEntry > sBankBagSlotPricesStore(BankBagSlotPricesEntryfmt)
DBCStorage< BattlemasterListEntry > sBattlemasterListStore(BattlemasterListEntryfmt)
static DBCStorage< TaxiPathNodeEntry > sTaxiPathNodeStore(TaxiPathNodeEntryfmt)
DBCStorage< CreatureSpellDataEntry > sCreatureSpellDataStore(CreatureSpellDatafmt)
static MapDifficultyMap sMapDifficultyMap
DBCStorage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore(CreatureDisplayInfofmt)
DBCStorage< SpellItemEnchantmentConditionEntry > sSpellItemEnchantmentConditionStore(SpellItemEnchantmentConditionfmt)
DBCStorage< SpellCastTimesEntry > sSpellCastTimesStore(SpellCastTimefmt)
DBCStorage< SpellRangeEntry > sSpellRangeStore(SpellRangefmt)
uint32 GetLiquidFlags(uint32 liquidType)
DBCStorage< MapDifficultyEntry > sMapDifficultyStore(MapDifficultyEntryfmt)
DBCStorage< ItemBagFamilyEntry > sItemBagFamilyStore(ItemBagFamilyfmt)
DBCStorage< BarberShopStyleEntry > sBarberShopStyleStore(BarberShopStyleEntryfmt)
SkillRaceClassInfoMap SkillRaceClassInfoBySkill
DBCStorage< ChrRacesEntry > sChrRacesStore(ChrRacesEntryfmt)
DBCStorage< SpellRuneCostEntry > sSpellRuneCostStore(SpellRuneCostfmt)
uint32 GetTalentSpellCost(uint32 spellId)
DBCStorage< GtChanceToSpellCritEntry > sGtChanceToSpellCritStore(GtChanceToSpellCritfmt)
DBCStorage< SpellDifficultyEntry > sSpellDifficultyStore(SpellDifficultyfmt)
TaxiMask sOldContinentsNodesMask
DBCStorage< SpellVisualEntry > sSpellVisualStore(SpellVisualfmt)
DBCStorage< OverrideSpellDataEntry > sOverrideSpellDataStore(OverrideSpellDatafmt)
DBCStorage< GameObjectDisplayInfoEntry > sGameObjectDisplayInfoStore(GameObjectDisplayInfofmt)
PvPDifficultyEntry const * GetBattlegroundBracketByLevel(uint32 mapid, uint32 level)
std::unordered_set< uint32 > sPetTalentSpells
DBCStorage< NamesProfanityEntry > sNamesProfanityStore(NamesProfanityEntryfmt)
TaxiMask sDeathKnightTaxiNodesMask
uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId)
DBCStorage< AreaTriggerEntry > sAreaTriggerStore(AreaTriggerEntryfmt)
CharSectionsEntry const * GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color)
std::unordered_map< uint32, std::vector< SkillLineAbilityEntry const * > > SkillLineAbilitiesBySkill
uint32 const * GetTalentTabPages(uint8 cls)
DBCStorage< HolidaysEntry > sHolidaysStore(Holidaysfmt)
#define LOAD_DBC_EXT(store, file, dbtable, dbformat, dbpk)
DBCStorage< GtOCTClassCombatRatingScalarEntry > sGtOCTClassCombatRatingScalarStore(GtOCTClassCombatRatingScalarfmt)
DBCStorage< BannedAddOnsEntry > sBannedAddOnsStore(BannedAddOnsfmt)
DBCStorage< WorldMapAreaEntry > sWorldMapAreaStore(WorldMapAreaEntryfmt)
DBCStorage< ItemRandomSuffixEntry > sItemRandomSuffixStore(ItemRandomSuffixfmt)
DBCStorage< SoundEntriesEntry > sSoundEntriesStore(SoundEntriesfmt)
DBCStorage< EmotesTextEntry > sEmotesTextStore(EmotesTextEntryfmt)
DBCStorage< AchievementEntry > sAchievementStore(Achievementfmt)
char const * GetRaceName(uint8 race, uint8 locale)
DBCStorage< TotemCategoryEntry > sTotemCategoryStore(TotemCategoryEntryfmt)
DBCStorage< TransportRotationEntry > sTransportRotationStore(TransportRotationfmt)
DBCStorage< QuestSortEntry > sQuestSortStore(QuestSortEntryfmt)
DBCStorage< LightEntry > sLightStore(LightEntryfmt)
DBCStorage< GtRegenMPPerSptEntry > sGtRegenMPPerSptStore(GtRegenMPPerSptfmt)
DBCStorage< GameObjectArtKitEntry > sGameObjectArtKitStore(GameObjectArtKitfmt)
PvPDifficultyEntry const * GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id)
DBCStorage< DurabilityCostsEntry > sDurabilityCostsStore(DurabilityCostsfmt)
DBCStorage< WorldMapOverlayEntry > sWorldMapOverlayStore(WorldMapOverlayEntryfmt)
DBCStorage< GtChanceToMeleeCritBaseEntry > sGtChanceToMeleeCritBaseStore(GtChanceToMeleeCritBasefmt)
DBCStorage< CreatureDisplayInfoExtraEntry > sCreatureDisplayInfoExtraStore(CreatureDisplayInfoExtrafmt)
DBCStorage< GtRegenHPPerSptEntry > sGtRegenHPPerSptStore(GtRegenHPPerSptfmt)
DBCStorage< SkillRaceClassInfoEntry > sSkillRaceClassInfoStore(SkillRaceClassInfofmt)
DBCStorage< CharSectionsEntry > sCharSectionsStore(CharSectionsEntryfmt)
static FactionTeamMap sFactionTeamMap
Definition DBCStores.cpp:87
DBCStorage< GemPropertiesEntry > sGemPropertiesStore(GemPropertiesEntryfmt)
DBCStorage< ItemRandomPropertiesEntry > sItemRandomPropertiesStore(ItemRandomPropertiesfmt)
uint32 DBCFileCount
NameValidationRegexContainer NamesProfaneValidators
DBCStorage< DungeonEncounterEntry > sDungeonEncounterStore(DungeonEncounterfmt)
MapDifficultyEntry const * GetMapDifficultyData(uint32 mapId, Difficulty difficulty)
LFGDungeonEntry const * GetLFGDungeon(uint32 mapId, Difficulty difficulty)
Returns LFGDungeonEntry for a specific map and difficulty. Will return first found entry if multiple ...
DBCStorage< GtNPCManaCostScalerEntry > sGtNPCManaCostScalerStore(GtNPCManaCostScalerfmt)
std::tuple< uint32, uint32, uint32 > EmotesTextSoundKey
Definition DBCStores.cpp:82
DBCStorage< SpellEntry > sSpellStore(SpellEntryfmt)
DBCStorage< AreaGroupEntry > sAreaGroupStore(AreaGroupEntryfmt)
DBCStorage< QuestXPEntry > sQuestXPStore(QuestXPfmt)
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
DBCStorage< GtOCTRegenHPEntry > sGtOCTRegenHPStore(GtOCTRegenHPfmt)
DBCStorage< EmotesTextSoundEntry > sEmotesTextSoundStore(EmotesTextSoundEntryfmt)
DBCStorage< TaxiPathEntry > sTaxiPathStore(TaxiPathEntryfmt)
DBCStorage< WMOAreaTableEntry > sWMOAreaTableStore(WMOAreaTableEntryfmt)
DBCStorage< TalentEntry > sTalentStore(TalentEntryfmt)
DBCStorage< TaxiNodesEntry > sTaxiNodesStore(TaxiNodesEntryfmt)
DBCStorage< TeamContributionPointsEntry > sTeamContributionPointsStore(TeamContributionPointsfmt)
DBCStorage< SpellDurationEntry > sSpellDurationStore(SpellDurationfmt)
DBCStorage< SpellFocusObjectEntry > sSpellFocusObjectStore(SpellFocusObjectfmt)
DBCStorage< AuctionHouseEntry > sAuctionHouseStore(AuctionHouseEntryfmt)
DBCStorage< TransportAnimationEntry > sTransportAnimationStore(TransportAnimationfmt)
uint32 GetDefaultMapLight(uint32 mapId)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
CharStartOutfitEntry const * GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender)
TalentSpellPosMap sTalentSpellPosMap
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
DBCStorage< CreatureModelDataEntry > sCreatureModelDataStore(CreatureModelDatafmt)
static uint32 sTalentTabPages[MAX_CLASSES][3]
DBCStorage< LFGDungeonExpansionEntry > sLFGDungeonExpansionStore(LFGDungeonExpansionfmt)
DBCStorage< CreatureTypeEntry > sCreatureTypeStore(CreatureTypefmt)
std::list< std::string > StoreProblemList
DBCStorage< CharacterFacialHairStylesEntry > sCharacterFacialHairStylesStore(CharacterFacialHairStylesfmt)
PetFamilySpellsStore sPetFamilySpellsStore
DBCStorage< CinematicSequencesEntry > sCinematicSequencesStore(CinematicSequencesEntryfmt)
DBCStorage< GtBarberShopCostBaseEntry > sGtBarberShopCostBaseStore(GtBarberShopCostBasefmt)
DBCStorage< CinematicCameraEntry > sCinematicCameraStore(CinematicCameraEntryfmt)
DBCStorage< ItemExtendedCostEntry > sItemExtendedCostStore(ItemExtendedCostEntryfmt)
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
void LoadDBCStores(const std::string &dataPath)
DBCStorage< SkillLineAbilityEntry > sSkillLineAbilityStore(SkillLineAbilityfmt)
DBCStorage< ChrClassesEntry > sChrClassesStore(ChrClassesEntryfmt)
DBCStorage< CurrencyTypesEntry > sCurrencyTypesStore(CurrencyTypesfmt)
SimpleFactionsList const * GetFactionTeamList(uint32 faction)
DBCStorage< EmotesEntry > sEmotesStore(EmotesEntryfmt)
DBCStorage< GtChanceToMeleeCritEntry > sGtChanceToMeleeCritStore(GtChanceToMeleeCritfmt)
DBCStorage< LiquidTypeEntry > sLiquidTypeStore(LiquidTypefmt)
static std::map< EmotesTextSoundKey, EmotesTextSoundEntry const * > sEmotesTextSoundMap
Definition DBCStores.cpp:83
DBCStorage< PvPDifficultyEntry > sPvPDifficultyStore(PvPDifficultyfmt)
std::unordered_multimap< uint32, CharSectionsEntry const * > sCharSectionMap
Definition DBCStores.cpp:58
TaxiMask sHordeTaxiNodesMask
WMOAreaTableEntry const * GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid)
DBCStorage< StableSlotPricesEntry > sStableSlotPricesStore(StableSlotPricesfmt)
static WMOAreaInfoByTripple sWMOAreaInfoByTripple
Definition DBCStores.cpp:45
std::list< uint32 > SimpleFactionsList
Definition DBCStores.h:36
std::unordered_multimap< uint32, SkillRaceClassInfoEntry const * > SkillRaceClassInfoMap
Definition DBCStores.h:81
std::pair< SkillRaceClassInfoMap::iterator, SkillRaceClassInfoMap::iterator > SkillRaceClassInfoBounds
Definition DBCStores.h:82
ContentLevels
Definition DBCStores.h:51
@ CONTENT_61_70
Definition DBCStores.h:53
@ CONTENT_71_80
Definition DBCStores.h:54
@ CONTENT_1_60
Definition DBCStores.h:52
CharSectionType
std::vector< TaxiPathNodeList > TaxiPathNodesByPath
std::map< uint32, TaxiPathSetForSource > TaxiPathSetBySource
std::map< uint32, PetFamilySpellsSet > PetFamilySpellsStore
std::map< uint32, TalentSpellPos > TalentSpellPosMap
char constexpr ItemBagFamilyfmt[]
Definition DBCfmt.h:77
char constexpr NamesProfanityEntryfmt[]
Definition DBCfmt.h:94
char constexpr GlyphPropertiesfmt[]
Definition DBCfmt.h:61
char constexpr Achievementfmt[]
Definition DBCfmt.h:21
char constexpr AuctionHouseEntryfmt[]
Definition DBCfmt.h:28
char constexpr PvPDifficultyfmt[]
Definition DBCfmt.h:101
char constexpr CreatureModelDatafmt[]
Definition DBCfmt.h:45
char constexpr GtChanceToSpellCritfmt[]
Definition DBCfmt.h:68
char constexpr BarberShopStyleEntryfmt[]
Definition DBCfmt.h:31
char constexpr SoundEntriesfmt[]
Definition DBCfmt.h:109
char constexpr WMOAreaTableEntryfmt[]
Definition DBCfmt.h:140
char constexpr TransportRotationfmt[]
Definition DBCfmt.h:137
char constexpr ScalingStatDistributionfmt[]
Definition DBCfmt.h:103
char constexpr ChatChannelsEntryfmt[]
Definition DBCfmt.h:37
char constexpr Itemfmt[]
Definition DBCfmt.h:76
char constexpr CreatureDisplayInfoExtrafmt[]
Definition DBCfmt.h:43
char constexpr SpellEntryfmt[]
Definition DBCfmt.h:116
char constexpr QuestXPfmt[]
Definition DBCfmt.h:99
char constexpr GtRegenHPPerSptfmt[]
Definition DBCfmt.h:73
char constexpr TalentTabEntryfmt[]
Definition DBCfmt.h:130
char constexpr CinematicCameraEntryfmt[]
Definition DBCfmt.h:40
char constexpr SpellCategoryfmt[]
Definition DBCfmt.h:111
char constexpr CreatureTypefmt[]
Definition DBCfmt.h:47
char constexpr LFGDungeonEntryfmt[]
Definition DBCfmt.h:85
char constexpr TalentEntryfmt[]
Definition DBCfmt.h:129
char constexpr SkillRaceClassInfofmt[]
Definition DBCfmt.h:107
char constexpr SpellShapeshiftFormfmt[]
Definition DBCfmt.h:125
char constexpr AchievementCriteriafmt[]
Definition DBCfmt.h:24
char constexpr StableSlotPricesfmt[]
Definition DBCfmt.h:127
char constexpr BannedAddOnsfmt[]
Definition DBCfmt.h:30
char constexpr SummonPropertiesfmt[]
Definition DBCfmt.h:128
char constexpr CharStartOutfitEntryfmt[]
Definition DBCfmt.h:34
char constexpr SpellRadiusfmt[]
Definition DBCfmt.h:122
char constexpr EmotesEntryfmt[]
Definition DBCfmt.h:53
char constexpr SpellCastTimefmt[]
Definition DBCfmt.h:110
char constexpr MapDifficultyEntryfmt[]
Definition DBCfmt.h:92
char constexpr CustomSpellDifficultyfmt[]
Definition DBCfmt.h:113
char constexpr ItemRandomPropertiesfmt[]
Definition DBCfmt.h:82
char constexpr SkillTiersfmt[]
Definition DBCfmt.h:108
char constexpr DungeonEncounterfmt[]
Definition DBCfmt.h:50
char constexpr SpellDurationfmt[]
Definition DBCfmt.h:115
char constexpr QuestSortEntryfmt[]
Definition DBCfmt.h:98
char constexpr TaxiNodesEntryfmt[]
Definition DBCfmt.h:131
char constexpr CreatureFamilyfmt[]
Definition DBCfmt.h:44
char constexpr AreaTableEntryfmt[]
Definition DBCfmt.h:25
char constexpr GtChanceToMeleeCritfmt[]
Definition DBCfmt.h:66
char constexpr GameObjectArtKitfmt[]
Definition DBCfmt.h:58
char constexpr CinematicSequencesEntryfmt[]
Definition DBCfmt.h:41
char constexpr CustomAchievementIndex[]
Definition DBCfmt.h:23
char constexpr LockEntryfmt[]
Definition DBCfmt.h:89
char constexpr DurabilityQualityfmt[]
Definition DBCfmt.h:52
char constexpr LightEntryfmt[]
Definition DBCfmt.h:87
char constexpr TransportAnimationfmt[]
Definition DBCfmt.h:136
char constexpr GameObjectDisplayInfofmt[]
Definition DBCfmt.h:59
char constexpr TotemCategoryEntryfmt[]
Definition DBCfmt.h:135
char constexpr CurrencyTypesfmt[]
Definition DBCfmt.h:48
char constexpr AreaTriggerEntryfmt[]
Definition DBCfmt.h:27
char constexpr ItemLimitCategoryEntryfmt[]
Definition DBCfmt.h:81
char constexpr SkillLineAbilityfmt[]
Definition DBCfmt.h:106
char constexpr GtOCTClassCombatRatingScalarfmt[]
Definition DBCfmt.h:70
char constexpr CustomSpellDifficultyIndex[]
Definition DBCfmt.h:114
char constexpr MailTemplateEntryfmt[]
Definition DBCfmt.h:90
char constexpr SpellFocusObjectfmt[]
Definition DBCfmt.h:119
char constexpr LFGDungeonExpansionfmt[]
Definition DBCfmt.h:86
char constexpr Holidaysfmt[]
Definition DBCfmt.h:75
char constexpr DurabilityCostsfmt[]
Definition DBCfmt.h:51
char constexpr TeamContributionPointsfmt[]
Definition DBCfmt.h:134
char constexpr EmotesTextSoundEntryfmt[]
Definition DBCfmt.h:55
char constexpr CustomSpellEntryIndex[]
Definition DBCfmt.h:118
char constexpr GtNPCManaCostScalerfmt[]
Definition DBCfmt.h:69
char constexpr GtRegenMPPerSptfmt[]
Definition DBCfmt.h:74
char constexpr PowerDisplayfmt[]
Definition DBCfmt.h:100
char constexpr ChrRacesEntryfmt[]
Definition DBCfmt.h:39
char constexpr RandPropPointsfmt[]
Definition DBCfmt.h:102
char constexpr GemPropertiesEntryfmt[]
Definition DBCfmt.h:60
char constexpr WorldMapOverlayEntryfmt[]
Definition DBCfmt.h:142
char constexpr GtChanceToSpellCritBasefmt[]
Definition DBCfmt.h:67
char constexpr CharacterFacialHairStylesfmt[]
Definition DBCfmt.h:33
char constexpr SpellDifficultyfmt[]
Definition DBCfmt.h:112
char constexpr MovieEntryfmt[]
Definition DBCfmt.h:93
char constexpr CreatureSpellDatafmt[]
Definition DBCfmt.h:46
char constexpr CharTitlesEntryfmt[]
Definition DBCfmt.h:36
char constexpr SpellVisualfmt[]
Definition DBCfmt.h:126
char constexpr VehicleEntryfmt[]
Definition DBCfmt.h:138
char constexpr DestructibleModelDatafmt[]
Definition DBCfmt.h:49
char constexpr QuestFactionRewardfmt[]
Definition DBCfmt.h:97
char constexpr SpellRuneCostfmt[]
Definition DBCfmt.h:124
char constexpr GlyphSlotfmt[]
Definition DBCfmt.h:62
char constexpr LiquidTypefmt[]
Definition DBCfmt.h:88
char constexpr ChrClassesEntryfmt[]
Definition DBCfmt.h:38
char constexpr GtOCTRegenHPfmt[]
Definition DBCfmt.h:71
char constexpr FactionEntryfmt[]
Definition DBCfmt.h:56
char constexpr CustomAchievementfmt[]
Definition DBCfmt.h:22
char constexpr BattlemasterListEntryfmt[]
Definition DBCfmt.h:32
char constexpr CustomSpellEntryfmt[]
Definition DBCfmt.h:117
char constexpr WorldMapAreaEntryfmt[]
Definition DBCfmt.h:141
char constexpr ScalingStatValuesfmt[]
Definition DBCfmt.h:104
char constexpr GtBarberShopCostBasefmt[]
Definition DBCfmt.h:63
char constexpr SpellItemEnchantmentConditionfmt[]
Definition DBCfmt.h:121
char constexpr BankBagSlotPricesEntryfmt[]
Definition DBCfmt.h:29
char constexpr ItemSetEntryfmt[]
Definition DBCfmt.h:84
char constexpr VehicleSeatEntryfmt[]
Definition DBCfmt.h:139
char constexpr ItemRandomSuffixfmt[]
Definition DBCfmt.h:83
char constexpr TaxiPathEntryfmt[]
Definition DBCfmt.h:132
char constexpr CreatureDisplayInfofmt[]
Definition DBCfmt.h:42
char constexpr CharSectionsEntryfmt[]
Definition DBCfmt.h:35
char constexpr SpellRangefmt[]
Definition DBCfmt.h:123
char constexpr MapEntryfmt[]
Definition DBCfmt.h:91
char constexpr EmotesTextEntryfmt[]
Definition DBCfmt.h:54
char constexpr OverrideSpellDatafmt[]
Definition DBCfmt.h:96
char constexpr WorldSafeLocsEntryfmt[]
Definition DBCfmt.h:143
char constexpr AreaGroupEntryfmt[]
Definition DBCfmt.h:26
char constexpr GtChanceToMeleeCritBasefmt[]
Definition DBCfmt.h:65
char constexpr NamesReservedEntryfmt[]
Definition DBCfmt.h:95
char constexpr TaxiPathNodeEntryfmt[]
Definition DBCfmt.h:133
char constexpr SkillLinefmt[]
Definition DBCfmt.h:105
char constexpr ItemExtendedCostEntryfmt[]
Definition DBCfmt.h:80
char constexpr GtCombatRatingsfmt[]
Definition DBCfmt.h:64
char constexpr FactionTemplateEntryfmt[]
Definition DBCfmt.h:57
char constexpr SpellItemEnchantmentfmt[]
Definition DBCfmt.h:120
uint8_t uint8
Definition Define.h:135
int16_t int16
Definition Define.h:130
int8_t int8
Definition Define.h:131
int32_t int32
Definition Define.h:129
uint64_t uint64
Definition Define.h:132
uint32_t uint32
Definition Define.h:133
#define ASSERT
Definition Errors.h:68
#define TC_LOG_ERROR(filterType__,...)
Definition Log.h:165
#define TC_LOG_INFO(filterType__,...)
Definition Log.h:159
if(posix_memalign(&__mallocedMemory, __align, __size)) return NULL
@ SPELL_EFFECT_SEND_TAXI
ResponseCodes
@ RESPONSE_FAILURE
@ CHAR_NAME_RESERVED
@ CHAR_NAME_PROFANE
@ CHAR_NAME_SUCCESS
@ SPELL_ATTR0_PASSIVE
#define MAX_CLASSES
#define CLASSMASK_ALL_PLAYABLE
#define RACEMASK_ALL_PLAYABLE
#define sSpellMgr
Definition SpellMgr.h:738
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition Timer.h:57
uint32 getMSTime()
Definition Timer.h:33
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
Definition Util.cpp:383
static uint32 GetFormatRecordSize(const char *format, int32 *index_pos=nullptr)
uint32 GetFieldCount() const
Definition DBCStore.h:34
char const * GetFormat() const
Definition DBCStore.h:33
bool LoadStringsFrom(char const *path) override
Definition DBCStore.h:78
bool Load(char const *path) override
Definition DBCStore.h:73
void LoadFromDB(char const *table, char const *format, char const *index) override
Definition DBCStore.h:83
uint32 value_type
Definition DBCEnums.h:437
std::vector< value_type > _data
Definition DBCEnums.h:451
auto MapEqualRange(M &map, typename M::key_type const &key)
auto MapGetValuePtr(M &map, typename M::key_type const &key)
Definition MapUtils.h:29
TC_REGEX_NAMESPACE ::wregex wregex
Definition Regex.h:29
char const * Name[16]
char const * Name[16]
char const * Name[16]
uint32 ContinentID
DBCPosition3D GameCoords
uint32 Expansion() const
int32 DifficultySpellID[MAX_DIFFICULTY]
uint32 Attributes
uint32 SpellLevel