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;
38
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
222static bool LoadDBC_assert_print(uint32 fsize, uint32 rsize, const std::string& filename)
223{
224 TC_LOG_ERROR("misc", "Size of '{}' set by format string ({}) not equal size of C++ structure ({}).", filename, fsize, rsize);
225
226 // ASSERT must fail after function call
227 return false;
228}
229
230template<class T>
231inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCStorage<T>& storage, std::string const& dbcPath, std::string const& filename,
232 char const* dbTable = nullptr, char const* dbFormat = nullptr, char const* dbIndexName = nullptr)
233{
234 // compatibility format and C++ structure sizes
236
237 ++DBCFileCount;
238 std::string dbcFilename = dbcPath + filename;
239
240 if (storage.Load(dbcFilename.c_str()))
241 {
242 for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
243 {
244 if (!(availableDbcLocales & (1 << i)))
245 continue;
246
247 std::string localizedName(dbcPath);
248 localizedName.append(localeNames[i]);
249 localizedName.push_back('/');
250 localizedName.append(filename);
251
252 if (!storage.LoadStringsFrom(localizedName.c_str()))
253 availableDbcLocales &= ~(1 << i); // mark as not available for speedup next checks
254 }
255
256 if (dbTable)
257 storage.LoadFromDB(dbTable, dbFormat, dbIndexName);
258 }
259 else
260 {
261 // sort problematic dbc to (1) non compatible and (2) non-existed
262 if (FILE* f = fopen(dbcFilename.c_str(), "rb"))
263 {
264 std::ostringstream stream;
265 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.";
266 std::string buf = stream.str();
267 errors.push_back(buf);
268 fclose(f);
269 }
270 else
271 errors.push_back(dbcFilename);
272 }
273}
274
275void LoadDBCStores(const std::string& dataPath)
276{
277 uint32 oldMSTime = getMSTime();
278
279 std::string dbcPath = dataPath + "dbc/";
280
281 StoreProblemList bad_dbc_files;
282 uint32 availableDbcLocales = 0xFFFFFFFF;
283
284#define LOAD_DBC(store, file) LoadDBC(availableDbcLocales, bad_dbc_files, store, dbcPath, file)
285
286 LOAD_DBC(sAreaTableStore, "AreaTable.dbc");
287 LOAD_DBC(sAchievementCriteriaStore, "Achievement_Criteria.dbc");
288 LOAD_DBC(sAreaTriggerStore, "AreaTrigger.dbc");
289 LOAD_DBC(sAreaGroupStore, "AreaGroup.dbc");
290 LOAD_DBC(sAuctionHouseStore, "AuctionHouse.dbc");
291 LOAD_DBC(sBankBagSlotPricesStore, "BankBagSlotPrices.dbc");
292 LOAD_DBC(sBannedAddOnsStore, "BannedAddOns.dbc");
293 LOAD_DBC(sBattlemasterListStore, "BattlemasterList.dbc");
294 LOAD_DBC(sBarberShopStyleStore, "BarberShopStyle.dbc");
295 LOAD_DBC(sCharacterFacialHairStylesStore, "CharacterFacialHairStyles.dbc");
296 LOAD_DBC(sCharSectionsStore, "CharSections.dbc");
297 LOAD_DBC(sCharStartOutfitStore, "CharStartOutfit.dbc");
298 LOAD_DBC(sCharTitlesStore, "CharTitles.dbc");
299 LOAD_DBC(sChatChannelsStore, "ChatChannels.dbc");
300 LOAD_DBC(sChrClassesStore, "ChrClasses.dbc");
301 LOAD_DBC(sChrRacesStore, "ChrRaces.dbc");
302 LOAD_DBC(sCinematicCameraStore, "CinematicCamera.dbc");
303 LOAD_DBC(sCinematicSequencesStore, "CinematicSequences.dbc");
304 LOAD_DBC(sCreatureDisplayInfoStore, "CreatureDisplayInfo.dbc");
305 LOAD_DBC(sCreatureDisplayInfoExtraStore, "CreatureDisplayInfoExtra.dbc");
306 LOAD_DBC(sCreatureFamilyStore, "CreatureFamily.dbc");
307 LOAD_DBC(sCreatureModelDataStore, "CreatureModelData.dbc");
308 LOAD_DBC(sCreatureSpellDataStore, "CreatureSpellData.dbc");
309 LOAD_DBC(sCreatureTypeStore, "CreatureType.dbc");
310 LOAD_DBC(sCurrencyTypesStore, "CurrencyTypes.dbc");
311 LOAD_DBC(sDestructibleModelDataStore, "DestructibleModelData.dbc");
312 LOAD_DBC(sDungeonEncounterStore, "DungeonEncounter.dbc");
313 LOAD_DBC(sDurabilityCostsStore, "DurabilityCosts.dbc");
314 LOAD_DBC(sDurabilityQualityStore, "DurabilityQuality.dbc");
315 LOAD_DBC(sEmotesStore, "Emotes.dbc");
316 LOAD_DBC(sEmotesTextStore, "EmotesText.dbc");
317 LOAD_DBC(sEmotesTextSoundStore, "EmotesTextSound.dbc");
318 LOAD_DBC(sFactionStore, "Faction.dbc");
319 LOAD_DBC(sFactionTemplateStore, "FactionTemplate.dbc");
320 LOAD_DBC(sGameObjectArtKitStore, "GameObjectArtKit.dbc");
321 LOAD_DBC(sGameObjectDisplayInfoStore, "GameObjectDisplayInfo.dbc");
322 LOAD_DBC(sGemPropertiesStore, "GemProperties.dbc");
323 LOAD_DBC(sGlyphPropertiesStore, "GlyphProperties.dbc");
324 LOAD_DBC(sGlyphSlotStore, "GlyphSlot.dbc");
325 LOAD_DBC(sGtBarberShopCostBaseStore, "gtBarberShopCostBase.dbc");
326 LOAD_DBC(sGtCombatRatingsStore, "gtCombatRatings.dbc");
327 LOAD_DBC(sGtChanceToMeleeCritBaseStore, "gtChanceToMeleeCritBase.dbc");
328 LOAD_DBC(sGtChanceToMeleeCritStore, "gtChanceToMeleeCrit.dbc");
329 LOAD_DBC(sGtChanceToSpellCritBaseStore, "gtChanceToSpellCritBase.dbc");
330 LOAD_DBC(sGtChanceToSpellCritStore, "gtChanceToSpellCrit.dbc");
331 LOAD_DBC(sGtNPCManaCostScalerStore, "gtNPCManaCostScaler.dbc");
332 LOAD_DBC(sGtOCTClassCombatRatingScalarStore, "gtOCTClassCombatRatingScalar.dbc");
333 LOAD_DBC(sGtOCTRegenHPStore, "gtOCTRegenHP.dbc");
334 //LOAD_DBC(sGtOCTRegenMPStore, "gtOCTRegenMP.dbc"); -- not used currently
335 LOAD_DBC(sGtRegenHPPerSptStore, "gtRegenHPPerSpt.dbc");
336 LOAD_DBC(sGtRegenMPPerSptStore, "gtRegenMPPerSpt.dbc");
337 LOAD_DBC(sHolidaysStore, "Holidays.dbc");
338 LOAD_DBC(sItemStore, "Item.dbc");
339 LOAD_DBC(sItemBagFamilyStore, "ItemBagFamily.dbc");
340 //LOAD_DBC(sItemDisplayInfoStore, "ItemDisplayInfo.dbc"); -- not used currently
341 //LOAD_DBC(sItemCondExtCostsStore, "ItemCondExtCosts.dbc");
342 LOAD_DBC(sItemExtendedCostStore, "ItemExtendedCost.dbc");
343 LOAD_DBC(sItemLimitCategoryStore, "ItemLimitCategory.dbc");
344 LOAD_DBC(sItemRandomPropertiesStore, "ItemRandomProperties.dbc");
345 LOAD_DBC(sItemRandomSuffixStore, "ItemRandomSuffix.dbc");
346 LOAD_DBC(sItemSetStore, "ItemSet.dbc");
347 LOAD_DBC(sLFGDungeonStore, "LFGDungeons.dbc");
348 LOAD_DBC(sLFGDungeonExpansionStore, "LFGDungeonExpansion.dbc");
349 LOAD_DBC(sLightStore, "Light.dbc");
350 LOAD_DBC(sLiquidTypeStore, "LiquidType.dbc");
351 LOAD_DBC(sLockStore, "Lock.dbc");
352 LOAD_DBC(sMailTemplateStore, "MailTemplate.dbc");
353 LOAD_DBC(sMapStore, "Map.dbc");
354 LOAD_DBC(sMapDifficultyStore, "MapDifficulty.dbc");
355 LOAD_DBC(sMovieStore, "Movie.dbc");
356 LOAD_DBC(sNamesProfanityStore, "NamesProfanity.dbc");
357 LOAD_DBC(sNamesReservedStore, "NamesReserved.dbc");
358 LOAD_DBC(sOverrideSpellDataStore, "OverrideSpellData.dbc");
359 LOAD_DBC(sPowerDisplayStore, "PowerDisplay.dbc");
360 LOAD_DBC(sPvPDifficultyStore, "PvpDifficulty.dbc");
361 LOAD_DBC(sQuestXPStore, "QuestXP.dbc");
362 LOAD_DBC(sQuestFactionRewardStore, "QuestFactionReward.dbc");
363 LOAD_DBC(sQuestSortStore, "QuestSort.dbc");
364 LOAD_DBC(sRandPropPointsStore, "RandPropPoints.dbc");
365 LOAD_DBC(sScalingStatDistributionStore, "ScalingStatDistribution.dbc");
366 LOAD_DBC(sScalingStatValuesStore, "ScalingStatValues.dbc");
367 LOAD_DBC(sSkillLineStore, "SkillLine.dbc");
368 LOAD_DBC(sSkillLineAbilityStore, "SkillLineAbility.dbc");
369 LOAD_DBC(sSkillRaceClassInfoStore, "SkillRaceClassInfo.dbc");
370 LOAD_DBC(sSkillTiersStore, "SkillTiers.dbc");
371 LOAD_DBC(sSoundEntriesStore, "SoundEntries.dbc");
372 LOAD_DBC(sSpellCastTimesStore, "SpellCastTimes.dbc");
373 LOAD_DBC(sSpellCategoryStore, "SpellCategory.dbc");
374 LOAD_DBC(sSpellDurationStore, "SpellDuration.dbc");
375 LOAD_DBC(sSpellFocusObjectStore, "SpellFocusObject.dbc");
376 LOAD_DBC(sSpellItemEnchantmentStore, "SpellItemEnchantment.dbc");
377 LOAD_DBC(sSpellItemEnchantmentConditionStore, "SpellItemEnchantmentCondition.dbc");
378 LOAD_DBC(sSpellRadiusStore, "SpellRadius.dbc");
379 LOAD_DBC(sSpellRangeStore, "SpellRange.dbc");
380 LOAD_DBC(sSpellRuneCostStore, "SpellRuneCost.dbc");
381 LOAD_DBC(sSpellShapeshiftFormStore, "SpellShapeshiftForm.dbc");
382 LOAD_DBC(sSpellVisualStore, "SpellVisual.dbc");
383 LOAD_DBC(sStableSlotPricesStore, "StableSlotPrices.dbc");
384 LOAD_DBC(sSummonPropertiesStore, "SummonProperties.dbc");
385 LOAD_DBC(sTalentStore, "Talent.dbc");
386 LOAD_DBC(sTalentTabStore, "TalentTab.dbc");
387 LOAD_DBC(sTaxiNodesStore, "TaxiNodes.dbc");
388 LOAD_DBC(sTaxiPathStore, "TaxiPath.dbc");
389 LOAD_DBC(sTaxiPathNodeStore, "TaxiPathNode.dbc");
390 LOAD_DBC(sTeamContributionPointsStore, "TeamContributionPoints.dbc");
391 LOAD_DBC(sTotemCategoryStore, "TotemCategory.dbc");
392 LOAD_DBC(sTransportAnimationStore, "TransportAnimation.dbc");
393 LOAD_DBC(sTransportRotationStore, "TransportRotation.dbc");
394 LOAD_DBC(sVehicleStore, "Vehicle.dbc");
395 LOAD_DBC(sVehicleSeatStore, "VehicleSeat.dbc");
396 LOAD_DBC(sWMOAreaTableStore, "WMOAreaTable.dbc");
397 LOAD_DBC(sWorldMapAreaStore, "WorldMapArea.dbc");
398 LOAD_DBC(sWorldMapOverlayStore, "WorldMapOverlay.dbc");
399 LOAD_DBC(sWorldSafeLocsStore, "WorldSafeLocs.dbc");
400
401#undef LOAD_DBC
402
403#define LOAD_DBC_EXT(store, file, dbtable, dbformat, dbpk) LoadDBC(availableDbcLocales, bad_dbc_files, store, dbcPath, file, dbtable, dbformat, dbpk)
404
405 LOAD_DBC_EXT(sAchievementStore, "Achievement.dbc", "achievement_dbc", CustomAchievementfmt, CustomAchievementIndex);
407 LOAD_DBC_EXT(sSpellDifficultyStore, "SpellDifficulty.dbc", "spelldifficulty_dbc", CustomSpellDifficultyfmt, CustomSpellDifficultyIndex);
408
409#undef LOAD_DBC_EXT
410
412 if (entry->RaceID && ((1 << (entry->RaceID - 1)) & RACEMASK_ALL_PLAYABLE) != 0) // ignore nonplayable races
413 sCharFacialHairMap.insert({ entry->RaceID | (entry->SexID << 8) | (entry->VariationID << 16), entry });
414
415 for (CharSectionsEntry const* entry : sCharSectionsStore)
416 if (entry->RaceID && ((1 << (entry->RaceID - 1)) & RACEMASK_ALL_PLAYABLE) != 0) // ignore nonplayable races
417 sCharSectionMap.insert({ entry->BaseSection | (entry->SexID << 8) | (entry->RaceID << 16), entry });
418
419 for (CharStartOutfitEntry const* outfit : sCharStartOutfitStore)
420 sCharStartOutfitMap[outfit->RaceID | (outfit->ClassID << 8) | (outfit->SexID << 16)] = outfit;
421
423 sEmotesTextSoundMap[EmotesTextSoundKey(entry->EmotesTextID, entry->RaceID, entry->SexID)] = entry;
424
425 for (FactionEntry const* faction : sFactionStore)
426 {
427 if (faction->ParentFactionID)
428 {
429 SimpleFactionsList& flist = sFactionTeamMap[faction->ParentFactionID];
430 flist.push_back(faction->ID);
431 }
432 }
433
435 {
436 if (info->GeoBoxMax.X < info->GeoBoxMin.X)
437 std::swap(*(float*)(&info->GeoBoxMax.X), *(float*)(&info->GeoBoxMin.X));
438 if (info->GeoBoxMax.Y < info->GeoBoxMin.Y)
439 std::swap(*(float*)(&info->GeoBoxMax.Y), *(float*)(&info->GeoBoxMin.Y));
440 if (info->GeoBoxMax.Z < info->GeoBoxMin.Z)
441 std::swap(*(float*)(&info->GeoBoxMax.Z), *(float*)(&info->GeoBoxMin.Z));
442 }
443
444 // fill data
445 for (MapDifficultyEntry const* entry : sMapDifficultyStore)
446 sMapDifficultyMap[MAKE_PAIR32(entry->MapID, entry->Difficulty)] = MapDifficulty(entry->RaidDuration, entry->MaxPlayers, entry->Message[0] != '\0');
447
448 for (NamesProfanityEntry const* namesProfanity : sNamesProfanityStore)
449 {
450 ASSERT(namesProfanity->Language < TOTAL_LOCALES || namesProfanity->Language == -1);
451 std::wstring wname;
452 bool conversionResult = Utf8toWStr(namesProfanity->Name, wname);
453 ASSERT(conversionResult);
454
455 if (namesProfanity->Language != -1)
456 NamesProfaneValidators[namesProfanity->Language].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
457 else
458 for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
459 NamesProfaneValidators[i].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
460 }
461
462 for (NamesReservedEntry const* namesReserved : sNamesReservedStore)
463 {
464 ASSERT(namesReserved->Language < TOTAL_LOCALES || namesReserved->Language == -1);
465 std::wstring wname;
466 bool conversionResult = Utf8toWStr(namesReserved->Name, wname);
467 ASSERT(conversionResult);
468
469 if (namesReserved->Language != -1)
470 NamesReservedValidators[namesReserved->Language].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
471 else
472 for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
473 NamesReservedValidators[i].emplace_back(wname, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
474 }
475
476 for (PvPDifficultyEntry const* entry : sPvPDifficultyStore)
477 {
478 ASSERT(entry->RangeIndex < MAX_BATTLEGROUND_BRACKETS, "PvpDifficulty bracket (%d) exceeded max allowed value (%d)", entry->RangeIndex, MAX_BATTLEGROUND_BRACKETS);
479 }
480
482 if (sSkillLineStore.LookupEntry(entry->SkillID))
483 SkillRaceClassInfoBySkill.emplace(entry->SkillID, entry);
484
485 for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore)
486 {
487 SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->Spell);
488 if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE)
489 {
490 for (CreatureFamilyEntry const* cFamily : sCreatureFamilyStore)
491 {
492 if (skillLine->SkillLine != cFamily->SkillLine[0] && skillLine->SkillLine != cFamily->SkillLine[1])
493 continue;
494 if (spellInfo->SpellLevel)
495 continue;
496
497 if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
498 continue;
499
500 sPetFamilySpellsStore[cFamily->ID].insert(spellInfo->ID);
501 }
502 }
503
504 SkillLineAbilitiesBySkill[skillLine->SkillLine].push_back(skillLine);
505 }
506
507 // Create Spelldifficulty searcher
508 for (SpellDifficultyEntry const* spellDiff : sSpellDifficultyStore)
509 {
510 SpellDifficultyEntry newEntry;
511 memset(newEntry.DifficultySpellID, 0, 4*sizeof(uint32));
512 for (uint8 x = 0; x < MAX_DIFFICULTY; ++x)
513 {
514 if (spellDiff->DifficultySpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->DifficultySpellID[x]))
515 {
516 if (spellDiff->DifficultySpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values
517 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);
518 newEntry.DifficultySpellID[x] = 0;//spell was <= 0 or invalid, set to 0
519 }
520 else
521 newEntry.DifficultySpellID[x] = spellDiff->DifficultySpellID[x];
522 }
523 if (newEntry.DifficultySpellID[0] <= 0 || newEntry.DifficultySpellID[1] <= 0)//id0-1 must be always set!
524 continue;
525
526 for (uint8 x = 0; x < MAX_DIFFICULTY; ++x)
527 if (newEntry.DifficultySpellID[x])
528 sSpellMgr->SetSpellDifficultyId(uint32(newEntry.DifficultySpellID[x]), spellDiff->ID);
529 }
530
531 // create talent spells set
532 for (TalentEntry const* talentInfo : sTalentStore)
533 {
534 TalentTabEntry const* talentTab = sTalentTabStore.LookupEntry(talentInfo->TabID);
535 for (uint8 j = 0; j < MAX_TALENT_RANK; ++j)
536 {
537 if (talentInfo->SpellRank[j])
538 {
539 sTalentSpellPosMap[talentInfo->SpellRank[j]] = TalentSpellPos(talentInfo->ID, j);
540 if (talentTab && talentTab->PetTalentMask)
541 sPetTalentSpells.insert(talentInfo->SpellRank[j]);
542 }
543 }
544 }
545
546 // prepare fast data access to bit pos of talent ranks for use at inspecting
547 {
548 // now have all max ranks (and then bit amount used for store talent ranks in inspect)
549 for (TalentTabEntry const* talentTabInfo : sTalentTabStore)
550 {
551 // prevent memory corruption; otherwise cls will become 12 below
552 if ((talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE) == 0)
553 continue;
554
555 // store class talent tab pages
556 for (uint32 cls = 1; cls < MAX_CLASSES; ++cls)
557 if (talentTabInfo->ClassMask & (1 << (cls - 1)))
558 sTalentTabPages[cls][talentTabInfo->OrderIndex] = talentTabInfo->ID;
559 }
560 }
561
562 for (TaxiPathEntry const* entry : sTaxiPathStore)
563 sTaxiPathSetBySource[entry->FromTaxiNode][entry->ToTaxiNode] = TaxiPathBySourceAndDestination(entry->ID, entry->Cost);
564
565 uint32 pathCount = sTaxiPathStore.GetNumRows();
566 // Calculate path nodes count
567 std::vector<uint32> pathLength;
568 pathLength.resize(pathCount); // 0 and some other indexes not used
569 for (TaxiPathNodeEntry const* entry : sTaxiPathNodeStore)
570 {
571 if (pathLength[entry->PathID] < entry->NodeIndex + 1)
572 pathLength[entry->PathID] = entry->NodeIndex + 1;
573 }
574
575 // Set path length
576 sTaxiPathNodesByPath.resize(pathCount); // 0 and some other indexes not used
577 for (uint32 i = 1; i < sTaxiPathNodesByPath.size(); ++i)
578 sTaxiPathNodesByPath[i].resize(pathLength[i]);
579 // fill data
580 for (TaxiPathNodeEntry const* entry : sTaxiPathNodeStore)
581 sTaxiPathNodesByPath[entry->PathID][entry->NodeIndex] = entry;
582
583 // Initialize global taxinodes mask
584 // include existed nodes that have at least single not spell base (scripted) path
585 {
586 std::set<uint32> spellPaths;
587 for (SpellEntry const* sInfo : sSpellStore)
588 for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
589 if (sInfo->Effect[j] == SPELL_EFFECT_SEND_TAXI)
590 spellPaths.insert(sInfo->EffectMiscValue[j]);
591
592 // reinitialize internal storage for globals after loading TaxiNodes.db2
593 sTaxiNodesMask = {};
598 for (TaxiNodesEntry const* node : sTaxiNodesStore)
599 {
600 TaxiPathSetBySource::const_iterator src_i = sTaxiPathSetBySource.find(node->ID);
601 if (src_i != sTaxiPathSetBySource.end() && !src_i->second.empty())
602 {
603 bool ok = false;
604 for (TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin(); dest_i != src_i->second.end(); ++dest_i)
605 {
606 // not spell path
607 if (dest_i->second.price || spellPaths.find(dest_i->second.ID) == spellPaths.end())
608 {
609 ok = true;
610 break;
611 }
612 }
613
614 if (!ok)
615 continue;
616 }
617
618 // valid taxi network node
619 uint32 field = uint32((node->ID - 1) / (sizeof(TaxiMask::value_type) * 8));
620 TaxiMask::value_type submask = TaxiMask::value_type(1 << ((node->ID - 1) % (sizeof(TaxiMask::value_type) * 8)));
621 sTaxiNodesMask[field] |= submask;
622
623 if (node->MountCreatureID[0] && node->MountCreatureID[0] != 32981)
624 sHordeTaxiNodesMask[field] |= submask;
625 if (node->MountCreatureID[1] && node->MountCreatureID[1] != 32981)
626 sAllianceTaxiNodesMask[field] |= submask;
627 if (node->MountCreatureID[0] == 32981 || node->MountCreatureID[1] == 32981)
628 sDeathKnightTaxiNodesMask[field] |= submask;
629
630 // old continent node (+ nodes virtually at old continents, check explicitly to avoid loading map files for zone info)
631 if (node->ContinentID < 2 || node->ID == 82 || node->ID == 83 || node->ID == 93 || node->ID == 94)
632 sOldContinentsNodesMask[field] |= submask;
633
634 // fix DK node at Ebon Hold and Shadow Vault flight master
635 if (node->ID == 315 || node->ID == 333)
636 const_cast<TaxiNodesEntry*>(node)->MountCreatureID[1] = 32981;
637 }
638 }
639
640 for (WMOAreaTableEntry const* entry : sWMOAreaTableStore)
641 sWMOAreaInfoByTripple[WMOAreaTableKey(entry->WMOID, entry->NameSetID, entry->WMOGroupID)] = entry;
642
643 // error checks
644 if (bad_dbc_files.size() >= DBCFileCount)
645 {
646 TC_LOG_ERROR("misc", "Incorrect DataDir value in worldserver.conf or ALL required *.dbc files ({}) not found by path: {}dbc", DBCFileCount, dataPath);
647 exit(1);
648 }
649 else if (!bad_dbc_files.empty())
650 {
651 std::string str;
652 for (StoreProblemList::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
653 str += *i + "\n";
654
655 TC_LOG_ERROR("misc", "Some required *.dbc files ({} from {}) not found or not compatible:\n{}", (uint32)bad_dbc_files.size(), DBCFileCount, str);
656 exit(1);
657 }
658
659 // Check loaded DBC files proper version
660 if (!sAreaTableStore.LookupEntry(4987) || // last area added in 3.3.5a
661 !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a
662 !sGemPropertiesStore.LookupEntry(1629) || // last gem property added in 3.3.5a
663 !sItemStore.LookupEntry(56806) || // last client known item added in 3.3.5a
664 !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a
665 !sMapStore.LookupEntry(724) || // last map added in 3.3.5a
666 !sSpellStore.LookupEntry(80864) ) // last added spell in 3.3.5a
667 {
668 TC_LOG_ERROR("misc", "You have _outdated_ DBC files. Please extract correct versions from current using client.");
669 exit(1);
670 }
671
672 TC_LOG_INFO("server.loading", ">> Initialized {} data stores in {} ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime));
673
674}
675
677{
678 FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction);
679 if (itr != sFactionTeamMap.end())
680 return &itr->second;
681
682 return nullptr;
683}
684
685char const* GetPetName(uint32 petfamily, uint32 dbclang)
686{
687 if (!petfamily)
688 return nullptr;
689 CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily);
690 if (!pet_family)
691 return nullptr;
692 return pet_family->Name[dbclang];
693}
694
696{
697 TalentSpellPosMap::const_iterator itr = sTalentSpellPosMap.find(spellId);
698 if (itr == sTalentSpellPosMap.end())
699 return nullptr;
700
701 return &itr->second;
702}
703
705{
706 if (TalentSpellPos const* pos = GetTalentSpellPos(spellId))
707 return pos->rank+1;
708
709 return 0;
710}
711
713{
714 auto i = sWMOAreaInfoByTripple.find(WMOAreaTableKey(int16(rootid), int8(adtid), groupid));
715 if (i != sWMOAreaInfoByTripple.end())
716 return i->second;
717
718 return nullptr;
719}
720
721char const* GetRaceName(uint8 race, uint8 locale)
722{
723 ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race);
724 return raceEntry ? raceEntry->Name[locale] : nullptr;
725}
726
727char const* GetClassName(uint8 class_, uint8 locale)
728{
729 ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_);
730 return classEntry ? classEntry->Name[locale] : nullptr;
731}
732
734{
735 if (mapid != 530 && mapid != 571) // speed for most cases
736 return mapid;
737
738 if (WorldMapAreaEntry const* wma = sWorldMapAreaStore.LookupEntry(zoneId))
739 return wma->DisplayMapID >= 0 ? wma->DisplayMapID : wma->MapID;
740
741 return mapid;
742}
743
745{
746 mapid = GetVirtualMapForMapAndZone(mapid, zoneId);
747 if (mapid < 2)
748 return CONTENT_1_60;
749
750 MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
751 if (!mapEntry)
752 return CONTENT_1_60;
753
754 switch (mapEntry->Expansion())
755 {
756 default: return CONTENT_1_60;
757 case 1: return CONTENT_61_70;
758 case 2: return CONTENT_71_80;
759 }
760}
761
762bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId)
763{
764 if (requiredTotemCategoryId == 0)
765 return true;
766 if (itemTotemCategoryId == 0)
767 return false;
768
769 TotemCategoryEntry const* itemEntry = sTotemCategoryStore.LookupEntry(itemTotemCategoryId);
770 if (!itemEntry)
771 return false;
772 TotemCategoryEntry const* reqEntry = sTotemCategoryStore.LookupEntry(requiredTotemCategoryId);
773 if (!reqEntry)
774 return false;
775
776 if (itemEntry->TotemCategoryType != reqEntry->TotemCategoryType)
777 return false;
778
779 return (itemEntry->TotemCategoryMask & reqEntry->TotemCategoryMask) == reqEntry->TotemCategoryMask;
780}
781
782void Zone2MapCoordinates(float& x, float& y, uint32 zone)
783{
784 WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
785
786 // if not listed then map coordinates (instance)
787 if (!maEntry)
788 return;
789
790 std::swap(x, y); // at client map coords swapped
791 x = x*((maEntry->LocBottom-maEntry->LocTop)/100)+maEntry->LocTop;
792 y = y*((maEntry->LocRight-maEntry->LocLeft)/100)+maEntry->LocLeft; // client y coord from top to down
793}
794
795void Map2ZoneCoordinates(float& x, float& y, uint32 zone)
796{
797 WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
798
799 // if not listed then map coordinates (instance)
800 if (!maEntry)
801 return;
802
803 x = (x-maEntry->LocTop)/((maEntry->LocBottom-maEntry->LocTop)/100);
804 y = (y-maEntry->LocLeft)/((maEntry->LocRight-maEntry->LocLeft)/100); // client y coord from top to down
805 std::swap(x, y); // client have map coords swapped
806}
807
809{
810 MapDifficultyMap::const_iterator itr = sMapDifficultyMap.find(MAKE_PAIR32(mapId, difficulty));
811 return itr != sMapDifficultyMap.end() ? &itr->second : nullptr;
812}
813
815{
816 uint32 tmpDiff = difficulty;
817 MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff));
818 if (!mapDiff)
819 {
820 if (tmpDiff > RAID_DIFFICULTY_25MAN_NORMAL) // heroic, downscale to normal
821 tmpDiff -= 2;
822 else
823 tmpDiff -= 1; // any non-normal mode for raids like tbc (only one mode)
824
825 // pull new data
826 mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // we are 10 normal or 25 normal
827 if (!mapDiff)
828 {
829 tmpDiff -= 1;
830 mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // 10 normal
831 }
832 }
833
834 difficulty = Difficulty(tmpDiff);
835 return mapDiff;
836}
837
839{
840 PvPDifficultyEntry const* maxEntry = nullptr; // used for level > max listed level case
841 for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
842 {
843 if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
844 {
845 // skip unrelated and too-high brackets
846 if (entry->MapID != mapid || entry->MinLevel > level)
847 continue;
848
849 // exactly fit
850 if (entry->MaxLevel >= level)
851 return entry;
852
853 // remember for possible out-of-range case (search higher from existed)
854 if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel)
855 maxEntry = entry;
856 }
857 }
858
859 return maxEntry;
860}
861
863{
864 for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
865 if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
866 if (entry->MapID == mapid && entry->GetBracketId() == id)
867 return entry;
868
869 return nullptr;
870}
871
873{
874 return sTalentTabPages[cls];
875}
876
878{
879 if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
880 return 1 << liq->SoundBank;
881
882 return 0;
883}
884
886{
887 auto itr = sCharFacialHairMap.find(uint32(race) | uint32(gender << 8) | uint32(facialHairID << 16));
888 if (itr == sCharFacialHairMap.end())
889 return nullptr;
890
891 return itr->second;
892}
893
895{
896 uint32 const key = uint32(genType) | uint32(gender << 8) | uint32(race << 16);
897 for (auto const& section : Trinity::Containers::MapEqualRange(sCharSectionMap, key))
898 {
899 if (section.second->VariationIndex == type && section.second->ColorIndex == color)
900 return section.second;
901 }
902
903 return nullptr;
904}
905
907{
908 std::map<uint32, CharStartOutfitEntry const*>::const_iterator itr = sCharStartOutfitMap.find(race | (class_ << 8) | (gender << 16));
909 if (itr == sCharStartOutfitMap.end())
910 return nullptr;
911
912 return itr->second;
913}
914
917{
918 for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i)
919 {
920 LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(i);
921 if (!dungeon)
922 continue;
923
924 if (dungeon->MapID == int32(mapId) && Difficulty(dungeon->Difficulty) == difficulty)
925 return dungeon;
926 }
927
928 return nullptr;
929}
930
932{
933 for (int32 i = sLightStore.GetNumRows(); i >= 0; --i)
934 {
935 LightEntry const* light = sLightStore.LookupEntry(uint32(i));
936 if (!light)
937 continue;
938
939 if (light->ContinentID == mapId && light->GameCoords.X == 0.0f && light->GameCoords.Y == 0.0f && light->GameCoords.Z == 0.0f)
940 return light->ID;
941 }
942
943 return 0;
944}
945
946std::vector<SkillLineAbilityEntry const*> const* GetSkillLineAbilitiesBySkill(uint32 skillLine)
947{
949}
950
952{
953 SkillRaceClassInfoBounds bounds = SkillRaceClassInfoBySkill.equal_range(skill);
954 for (SkillRaceClassInfoMap::iterator itr = bounds.first; itr != bounds.second; ++itr)
955 {
956 if (itr->second->RaceMask && !(itr->second->RaceMask & (1 << (race - 1))))
957 continue;
958 if (itr->second->ClassMask && !(itr->second->ClassMask & (1 << (class_ - 1))))
959 continue;
960
961 return itr->second;
962 }
963
964 return nullptr;
965}
966
967ResponseCodes ValidateName(std::wstring const& name, LocaleConstant locale)
968{
969 if (locale >= TOTAL_LOCALES)
970 return RESPONSE_FAILURE;
971
972 for (Trinity::wregex const& regex : NamesProfaneValidators[locale])
973 if (Trinity::regex_search(name, regex))
974 return CHAR_NAME_PROFANE;
975
976 // regexes at TOTAL_LOCALES are loaded from NamesReserved which is not locale specific
977 for (Trinity::wregex const& regex : NamesReservedValidators[locale])
978 if (Trinity::regex_search(name, regex))
979 return CHAR_NAME_RESERVED;
980
981 return CHAR_NAME_SUCCESS;
982}
983
985{
986 auto itr = sEmotesTextSoundMap.find(EmotesTextSoundKey(emote, race, gender));
987 return itr != sEmotesTextSoundMap.end() ? itr->second : nullptr;
988}
989
991{
992 if (sTaxiNodesStore.GetNumRows())
993 {
994 _data.resize((sTaxiNodesStore.GetNumRows() + (8 * sizeof(uint64) - 1)) / (8 * sizeof(uint64)) * (sizeof(uint64) / sizeof(value_type)), 0);
995 ASSERT((_data.size() % (8 / sizeof(value_type))) == 0, "TaxiMask byte size must be aligned to a multiple of uint64");
996 }
997}
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:296
#define MAX_BATTLEGROUND_BRACKETS
Definition DBCEnums.h:63
#define MAX_TALENT_RANK
Definition DBCEnums.h:432
@ SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN
Definition DBCEnums.h:350
BattlegroundBracketId
Definition DBCEnums.h:57
#define MAX_SPELL_EFFECTS
Definition DBCEnums.h:388
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
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)
MapDifficulty const * GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty)
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
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)
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)
MapDifficulty const * GetMapDifficultyData(uint32 mapId, Difficulty difficulty)
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)
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)
static bool LoadDBC_assert_print(uint32 fsize, uint32 rsize, const std::string &filename)
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:82
std::pair< SkillRaceClassInfoMap::iterator, SkillRaceClassInfoMap::iterator > SkillRaceClassInfoBounds
Definition DBCStores.h:83
std::map< uint32, MapDifficulty > MapDifficultyMap
Definition DBCStores.h:63
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
uint32 MAKE_PAIR32(uint16 l, uint16 h)
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:439
std::vector< value_type > _data
Definition DBCEnums.h:453
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