TrinityCore
DB2Stores.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 "DB2Stores.h"
19#include "Containers.h"
20#include "DatabaseEnv.h"
21#include "DB2LoadInfo.h"
22#include "Hash.h"
23#include "ItemTemplate.h"
24#include "IteratorPair.h"
25#include "Log.h"
26#include "Random.h"
27#include "Regex.h"
28#include "Timer.h"
29#include "Util.h"
30#include "World.h"
31#include <boost/filesystem/operations.hpp>
32#include <array>
33#include <bitset>
34#include <numeric>
35#include <sstream>
36#include <cctype>
37
38// temporary hack until includes are sorted out (don't want to pull in Windows.h)
39#ifdef GetClassName
40#undef GetClassName
41#endif
42
378
384
386
387typedef std::map<uint32 /*hash*/, DB2StorageBase*> StorageMap;
388typedef std::unordered_map<uint32 /*areaGroupId*/, std::vector<uint32/*areaId*/>> AreaGroupMemberContainer;
389typedef std::unordered_map<uint32, std::vector<ArtifactPowerEntry const*>> ArtifactPowersContainer;
390typedef std::unordered_map<uint32, std::vector<uint32>> ArtifactPowerLinksContainer;
393typedef std::unordered_map<uint32 /*curveID*/, std::vector<DBCPosition2D>> CurvePointsContainer;
395typedef std::unordered_map<uint32, std::vector<uint32>> FactionTeamContainer;
396typedef std::unordered_map<uint32, HeirloomEntry const*> HeirloomItemsContainer;
397typedef std::unordered_map<uint32 /*glyphPropertiesId*/, std::vector<uint32>> GlyphBindableSpellsContainer;
398typedef std::unordered_map<uint32 /*glyphPropertiesId*/, std::vector<ChrSpecialization>> GlyphRequiredSpecsContainer;
399typedef std::unordered_map<uint32 /*itemId*/, ItemChildEquipmentEntry const*> ItemChildEquipmentContainer;
402typedef std::unordered_map<uint32 /*itemId | appearanceMod << 24*/, ItemModifiedAppearanceEntry const*> ItemModifiedAppearanceByItemContainer;
403typedef std::unordered_map<uint32, std::vector<ItemSetSpellEntry const*>> ItemSetSpellContainer;
404typedef std::unordered_map<uint32, std::vector<ItemSpecOverrideEntry const*>> ItemSpecOverridesContainer;
405typedef std::unordered_map<uint32, std::unordered_map<uint32, MapDifficultyEntry const*>> MapDifficultyContainer;
406typedef std::unordered_map<uint32, DB2Manager::MountTypeXCapabilitySet> MountCapabilitiesByTypeContainer;
407typedef std::unordered_map<uint32, DB2Manager::MountXDisplayContainer> MountDisplaysCointainer;
408typedef std::unordered_map<uint32, std::array<std::vector<NameGenEntry const*>, 2>> NameGenContainer;
410typedef std::unordered_map<uint32, std::vector<uint32>> PhaseGroupContainer;
412typedef std::unordered_map<uint32, std::pair<std::vector<QuestPackageItemEntry const*>, std::vector<QuestPackageItemEntry const*>>> QuestPackageItemContainer;
415typedef std::unordered_map<uint32, std::vector<SpellPowerEntry const*>> SpellPowerContainer;
416typedef std::unordered_map<uint32, std::unordered_map<uint32, std::vector<SpellPowerEntry const*>>> SpellPowerDifficultyContainer;
419typedef std::unordered_set<uint32> ToyItemIdsContainer;
422typedef std::pair<uint32 /*tableHash*/, int32 /*recordId*/> HotfixBlobKey;
423typedef std::map<HotfixBlobKey, std::vector<uint8>> HotfixBlobMap;
424using AllowedHotfixOptionalData = std::pair<uint32 /*optional data key*/, bool(*)(std::vector<uint8> const& data) /*validator*/>;
425
426namespace
427{
428 struct UiMapBounds
429 {
430 // these coords are mixed when calculated and used... its a mess
431 float Bounds[4];
432 bool IsUiAssignment;
433 bool IsUiLink;
434 };
435
436 StorageMap _stores;
437 DB2Manager::HotfixContainer _hotfixData;
438 std::array<HotfixBlobMap, TOTAL_LOCALES> _hotfixBlob;
439 std::unordered_multimap<uint32 /*tableHash*/, AllowedHotfixOptionalData> _allowedHotfixOptionalData;
440 std::array<std::map<HotfixBlobKey, std::vector<DB2Manager::HotfixOptionalData>>, TOTAL_LOCALES> _hotfixOptionalData;
441
442 AreaGroupMemberContainer _areaGroupMembers;
443 ArtifactPowersContainer _artifactPowers;
444 ArtifactPowerLinksContainer _artifactPowerLinks;
445 ArtifactPowerRanksContainer _artifactPowerRanks;
446 std::unordered_map<uint32 /*itemId*/, AzeriteEmpoweredItemEntry const*> _azeriteEmpoweredItems;
447 std::unordered_map<std::pair<uint32 /*azeriteEssenceId*/, uint32 /*rank*/>, AzeriteEssencePowerEntry const*> _azeriteEssencePowersByIdAndRank;
448 std::vector<AzeriteItemMilestonePowerEntry const*> _azeriteItemMilestonePowers;
449 std::array<AzeriteItemMilestonePowerEntry const*, MAX_AZERITE_ESSENCE_SLOT> _azeriteItemMilestonePowerByEssenceSlot;
450 std::unordered_map<uint32 /*azeritePowerSetId*/, std::vector<AzeritePowerSetMemberEntry const*>> _azeritePowers;
451 std::unordered_map<std::pair<uint32 /*azeriteUnlockSetId*/, ItemContext>, std::array<uint8, MAX_AZERITE_EMPOWERED_TIER>> _azeriteTierUnlockLevels;
452 std::unordered_map<std::pair<int32 /*broadcastTextId*/, CascLocaleBit /*cascLocaleBit*/>, int32> _broadcastTextDurations;
453 std::array<ChrClassUIDisplayEntry const*, MAX_CLASSES> _uiDisplayByClass;
454 std::array<std::array<uint32, MAX_POWERS>, MAX_CLASSES> _powersByClass;
455 std::unordered_map<uint32 /*chrCustomizationOptionId*/, std::vector<ChrCustomizationChoiceEntry const*>> _chrCustomizationChoicesByOption;
456 std::unordered_map<std::pair<uint8, uint8>, ChrModelEntry const*> _chrModelsByRaceAndGender;
457 std::map<std::tuple<uint8 /*race*/, uint8/*gender*/, uint8/*shapeshift*/>, ShapeshiftFormModelData> _chrCustomizationChoicesForShapeshifts;
458 std::unordered_map<std::pair<uint8 /*race*/, uint8/*gender*/>, std::vector<ChrCustomizationOptionEntry const*>> _chrCustomizationOptionsByRaceAndGender;
459 std::unordered_map<uint32 /*chrCustomizationReqId*/, std::vector<std::pair<uint32 /*chrCustomizationOptionId*/, std::vector<uint32>>>> _chrCustomizationRequiredChoices;
460 ChrSpecializationByIndexContainer _chrSpecializationsByIndex;
461 std::unordered_map<int32, ConditionalChrModelEntry const*> _conditionalChrModelsByChrModelId;
462 std::unordered_multimap<uint32, ConditionalContentTuningEntry const*> _conditionalContentTuning;
463 std::unordered_set<std::pair<uint32, int32>> _contentTuningLabels;
464 std::unordered_multimap<uint32, CurrencyContainerEntry const*> _currencyContainers;
465 CurvePointsContainer _curvePoints;
466 EmotesTextSoundContainer _emoteTextSounds;
467 std::unordered_map<std::pair<uint32 /*level*/, int32 /*expansion*/>, ExpectedStatEntry const*> _expectedStatsByLevel;
468 std::unordered_map<uint32 /*contentTuningId*/, std::vector<ContentTuningXExpectedEntry const*>> _expectedStatModsByContentTuning;
469 FactionTeamContainer _factionTeams;
470 std::unordered_map<uint32, std::set<FriendshipRepReactionEntry const*, DB2Manager::FriendshipRepReactionEntryComparator>> _friendshipRepReactions;
471 HeirloomItemsContainer _heirlooms;
472 GlyphBindableSpellsContainer _glyphBindableSpells;
473 GlyphRequiredSpecsContainer _glyphRequiredSpecs;
474 ItemChildEquipmentContainer _itemChildEquipment;
475 ItemClassByOldEnumContainer _itemClassByOldEnum;
476 std::unordered_set<uint32> _itemsWithCurrencyCost;
477 ItemLimitCategoryConditionContainer _itemCategoryConditions;
478 ItemModifiedAppearanceByItemContainer _itemModifiedAppearancesByItem;
479 ItemSetSpellContainer _itemSetSpells;
480 ItemSpecOverridesContainer _itemSpecOverrides;
481 std::vector<JournalTierEntry const*> _journalTiersByIndex;
482 MapDifficultyContainer _mapDifficulties;
483 std::unordered_map<uint32, DB2Manager::MapDifficultyConditionsContainer> _mapDifficultyConditions;
484 std::unordered_map<uint32, MountEntry const*> _mountsBySpellId;
485 MountCapabilitiesByTypeContainer _mountCapabilitiesByType;
486 MountDisplaysCointainer _mountDisplays;
487 NameGenContainer _nameGenData;
488 NameValidationRegexContainer _nameValidators;
489 std::unordered_map<uint32, ParagonReputationEntry const*> _paragonReputations;
490 PhaseGroupContainer _phasesByGroup;
491 PowerTypesContainer _powerTypes;
492 std::unordered_map<uint32, uint8> _pvpItemBonus;
493 PvpTalentSlotUnlockEntry const* _pvpTalentSlotUnlock[MAX_PVP_TALENT_SLOTS];
494 std::unordered_map<uint32, std::vector<QuestLineXQuestEntry const*>> _questsByQuestLine;
495 QuestPackageItemContainer _questPackages;
496 std::unordered_map<uint32, std::vector<RewardPackXCurrencyTypeEntry const*>> _rewardPackCurrencyTypes;
497 std::unordered_map<uint32, std::vector<RewardPackXItemEntry const*>> _rewardPackItems;
498 std::unordered_map<uint32, std::vector<SkillLineEntry const*>> _skillLinesByParentSkillLine;
499 std::unordered_map<uint32, std::vector<SkillLineAbilityEntry const*>> _skillLineAbilitiesBySkillupSkill;
500 SkillRaceClassInfoContainer _skillRaceClassInfoBySkill;
501 std::unordered_map<std::pair<int32, int32>, SoulbindConduitRankEntry const*> _soulbindConduitRanks;
502 SpecializationSpellsContainer _specializationSpellsBySpec;
503 std::unordered_set<std::pair<int32, uint32>> _specsBySpecSet;
504 std::unordered_set<uint8> _spellFamilyNames;
505 SpellProcsPerMinuteModContainer _spellProcsPerMinuteMods;
506 std::unordered_map<int32, std::vector<SpellVisualMissileEntry const*>> _spellVisualMissilesBySet;
507 TalentsByPosition _talentsByPosition;
508 std::unordered_map<std::pair<uint32, uint32>, TaxiPathEntry const*> _taxiPaths;
510 std::unordered_map<uint32, TransmogIllusionEntry const*> _transmogIllusionsByEnchantmentId;
511 std::unordered_map<uint32, std::vector<TransmogSetEntry const*>> _transmogSetsByItemModifiedAppearance;
512 std::unordered_map<uint32, std::vector<TransmogSetItemEntry const*>> _transmogSetItemsByTransmogSet;
513 std::unordered_map<int32, UiMapBounds> _uiMapBounds;
514 std::unordered_multimap<int32, UiMapAssignmentEntry const*> _uiMapAssignmentByMap[MAX_UI_MAP_SYSTEM];
515 std::unordered_multimap<int32, UiMapAssignmentEntry const*> _uiMapAssignmentByArea[MAX_UI_MAP_SYSTEM];
516 std::unordered_multimap<int32, UiMapAssignmentEntry const*> _uiMapAssignmentByWmoDoodadPlacement[MAX_UI_MAP_SYSTEM];
517 std::unordered_multimap<int32, UiMapAssignmentEntry const*> _uiMapAssignmentByWmoGroup[MAX_UI_MAP_SYSTEM];
518 std::unordered_set<int32> _uiMapPhases;
519 WMOAreaTableLookupContainer _wmoAreaTableLookup;
520 std::unordered_map<uint32, std::unordered_set<uint32>> _pvpStatIdsByMap;
521}
522
523void LoadDB2(std::bitset<TOTAL_LOCALES>& availableDb2Locales, std::vector<std::string>& errlist, StorageMap& stores, DB2StorageBase* storage, std::string const& db2Path,
524 LocaleConstant defaultLocale, std::size_t cppRecordSize)
525{
526 // validate structure
527 {
528 DB2LoadInfo const* loadInfo = storage->GetLoadInfo();
529 std::string clientMetaString, ourMetaString;
530 for (std::size_t i = 0; i < loadInfo->Meta->FieldCount; ++i)
531 {
532 for (std::size_t j = 0; j < loadInfo->Meta->Fields[i].ArraySize; ++j)
533 {
534 if (i >= loadInfo->Meta->FileFieldCount && int32(i) == loadInfo->Meta->ParentIndexField)
535 {
536 clientMetaString += char(FT_INT);
537 continue;
538 }
539
540 clientMetaString += char(loadInfo->Meta->Fields[i].Type);
541 }
542 }
543
544 for (std::size_t i = loadInfo->Meta->HasIndexFieldInData() ? 0 : 1; i < loadInfo->FieldCount; ++i)
545 ourMetaString += char(loadInfo->Fields[i].Type);
546
547 ASSERT(clientMetaString == ourMetaString,
548 "%s C++ structure fields %s do not match generated types from the client %s",
549 storage->GetFileName().c_str(), ourMetaString.c_str(), clientMetaString.c_str());
550
551 // compatibility format and C++ structure sizes
552 ASSERT(loadInfo->Meta->GetRecordSize() == cppRecordSize,
553 "Size of '%s' set by format string (%u) not equal size of C++ structure (" SZFMTD ").",
554 storage->GetFileName().c_str(), loadInfo->Meta->GetRecordSize(), cppRecordSize);
555 }
556
557 try
558 {
559 storage->Load(db2Path + localeNames[defaultLocale] + '/', defaultLocale);
560 }
561 catch (std::system_error const& e)
562 {
563 if (e.code() == std::errc::no_such_file_or_directory)
564 {
565 errlist.push_back(Trinity::StringFormat("File {}{}/{} does not exist", db2Path, localeNames[defaultLocale], storage->GetFileName()));
566 }
567 else
568 throw;
569 }
570 catch (std::exception const& e)
571 {
572 errlist.emplace_back(e.what());
573 return;
574 }
575
576 // load additional data and enUS strings from db
577 storage->LoadFromDB();
578
579 for (LocaleConstant i = LOCALE_enUS; i < TOTAL_LOCALES; i = LocaleConstant(i + 1))
580 {
581 if (defaultLocale == i || !availableDb2Locales[i])
582 continue;
583
584 try
585 {
586 storage->LoadStringsFrom((db2Path + localeNames[i] + '/'), i);
587 }
588 catch (std::system_error const& e)
589 {
590 if (e.code() != std::errc::no_such_file_or_directory)
591 throw;
592
593 // locale db2 files are optional, do not error if nothing is found
594 }
595 catch (std::exception const& e)
596 {
597 errlist.emplace_back(e.what());
598 }
599 }
600
601 for (LocaleConstant i = LOCALE_koKR; i < TOTAL_LOCALES; i = LocaleConstant(i + 1))
602 if (availableDb2Locales[i])
603 storage->LoadStringsFromDB(i);
604
605 stores[storage->GetTableHash()] = storage;
606}
607
609{
610 static DB2Manager instance;
611 return instance;
612}
613
614uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaultLocale)
615{
616 uint32 oldMSTime = getMSTime();
617
618 std::string db2Path = dataPath + "dbc/";
619
620 std::vector<std::string> loadErrors;
621 std::bitset<TOTAL_LOCALES> availableDb2Locales = [&]()
622 {
623 std::bitset<TOTAL_LOCALES> foundLocales;
624 boost::filesystem::directory_iterator db2PathItr(db2Path), end;
625 while (db2PathItr != end)
626 {
627 LocaleConstant locale = GetLocaleByName(db2PathItr->path().filename().string());
628 if (IsValidLocale(locale))
629 foundLocales[locale] = true;
630
631 ++db2PathItr;
632 }
633 return foundLocales;
634 }();
635
636 if (!availableDb2Locales[defaultLocale])
637 return 0;
638
639 auto LOAD_DB2 = [&]<typename T>(DB2Storage<T>& store)
640 {
641 LoadDB2(availableDb2Locales, loadErrors, _stores, &store, db2Path, defaultLocale, sizeof(T));
642 };
643
644 LOAD_DB2(sAchievementStore);
646 LOAD_DB2(sAdventureJournalStore);
647 LOAD_DB2(sAdventureMapPOIStore);
648 LOAD_DB2(sAnimationDataStore);
649 LOAD_DB2(sAnimKitStore);
650 LOAD_DB2(sAreaGroupMemberStore);
651 LOAD_DB2(sAreaTableStore);
652 LOAD_DB2(sAreaTriggerStore);
653 LOAD_DB2(sArmorLocationStore);
654 LOAD_DB2(sArtifactStore);
655 LOAD_DB2(sArtifactAppearanceStore);
657 LOAD_DB2(sArtifactCategoryStore);
658 LOAD_DB2(sArtifactPowerStore);
659 LOAD_DB2(sArtifactPowerLinkStore);
661 LOAD_DB2(sArtifactPowerRankStore);
662 LOAD_DB2(sArtifactTierStore);
663 LOAD_DB2(sArtifactUnlockStore);
664 LOAD_DB2(sAuctionHouseStore);
666 LOAD_DB2(sAzeriteEssenceStore);
668 LOAD_DB2(sAzeriteItemStore);
671 LOAD_DB2(sAzeriteLevelInfoStore);
672 LOAD_DB2(sAzeritePowerStore);
674 LOAD_DB2(sAzeriteTierUnlockStore);
677 LOAD_DB2(sBankBagSlotPricesStore);
678 LOAD_DB2(sBannedAddonsStore);
679 LOAD_DB2(sBarberShopStyleStore);
680 LOAD_DB2(sBattlePetAbilityStore);
683 LOAD_DB2(sBattlePetSpeciesStore);
685 LOAD_DB2(sBattlemasterListStore);
686 LOAD_DB2(sBroadcastTextStore);
688 LOAD_DB2(sCfgCategoriesStore);
689 LOAD_DB2(sCfgRegionsStore);
691 LOAD_DB2(sCharTitlesStore);
692 LOAD_DB2(sCharacterLoadoutStore);
694 LOAD_DB2(sChatChannelsStore);
695 LOAD_DB2(sChrClassUIDisplayStore);
696 LOAD_DB2(sChrClassesStore);
704 LOAD_DB2(sChrModelStore);
705 LOAD_DB2(sChrRaceXChrModelStore);
706 LOAD_DB2(sChrRacesStore);
707 LOAD_DB2(sChrSpecializationStore);
708 LOAD_DB2(sCinematicCameraStore);
709 LOAD_DB2(sCinematicSequencesStore);
712 LOAD_DB2(sContentTuningStore);
715 LOAD_DB2(sConversationLineStore);
716 LOAD_DB2(sCorruptionEffectsStore);
719 LOAD_DB2(sCreatureFamilyStore);
720 LOAD_DB2(sCreatureModelDataStore);
721 LOAD_DB2(sCreatureTypeStore);
722 LOAD_DB2(sCriteriaStore);
723 LOAD_DB2(sCriteriaTreeStore);
724 LOAD_DB2(sCurrencyContainerStore);
725 LOAD_DB2(sCurrencyTypesStore);
726 LOAD_DB2(sCurveStore);
727 LOAD_DB2(sCurvePointStore);
729 LOAD_DB2(sDifficultyStore);
730 LOAD_DB2(sDungeonEncounterStore);
731 LOAD_DB2(sDurabilityCostsStore);
732 LOAD_DB2(sDurabilityQualityStore);
733 LOAD_DB2(sEmotesStore);
734 LOAD_DB2(sEmotesTextStore);
735 LOAD_DB2(sEmotesTextSoundStore);
736 LOAD_DB2(sExpectedStatStore);
737 LOAD_DB2(sExpectedStatModStore);
738 LOAD_DB2(sFactionStore);
739 LOAD_DB2(sFactionTemplateStore);
742 LOAD_DB2(sGameObjectsStore);
743 LOAD_DB2(sGameObjectArtKitStore);
745 LOAD_DB2(sGarrAbilityStore);
746 LOAD_DB2(sGarrBuildingStore);
748 LOAD_DB2(sGarrClassSpecStore);
749 LOAD_DB2(sGarrFollowerStore);
751 LOAD_DB2(sGarrMissionStore);
752 LOAD_DB2(sGarrPlotStore);
753 LOAD_DB2(sGarrPlotBuildingStore);
754 LOAD_DB2(sGarrPlotInstanceStore);
755 LOAD_DB2(sGarrSiteLevelStore);
757 LOAD_DB2(sGarrTalentTreeStore);
758 LOAD_DB2(sGemPropertiesStore);
759 LOAD_DB2(sGlobalCurveStore);
760 LOAD_DB2(sGlyphBindableSpellStore);
761 LOAD_DB2(sGlyphPropertiesStore);
762 LOAD_DB2(sGlyphRequiredSpecStore);
763 LOAD_DB2(sGossipNPCOptionStore);
765 LOAD_DB2(sGuildColorBorderStore);
766 LOAD_DB2(sGuildColorEmblemStore);
767 LOAD_DB2(sGuildPerkSpellsStore);
768 LOAD_DB2(sHeirloomStore);
769 LOAD_DB2(sHolidaysStore);
770 LOAD_DB2(sImportPriceArmorStore);
771 LOAD_DB2(sImportPriceQualityStore);
772 LOAD_DB2(sImportPriceShieldStore);
773 LOAD_DB2(sImportPriceWeaponStore);
774 LOAD_DB2(sItemAppearanceStore);
775 LOAD_DB2(sItemArmorQualityStore);
776 LOAD_DB2(sItemArmorShieldStore);
777 LOAD_DB2(sItemArmorTotalStore);
778 LOAD_DB2(sItemBagFamilyStore);
779 LOAD_DB2(sItemBonusStore);
782 LOAD_DB2(sItemBonusTreeStore);
783 LOAD_DB2(sItemBonusTreeNodeStore);
784 LOAD_DB2(sItemChildEquipmentStore);
785 LOAD_DB2(sItemClassStore);
787 LOAD_DB2(sItemCurrencyCostStore);
788 LOAD_DB2(sItemDamageAmmoStore);
789 LOAD_DB2(sItemDamageOneHandStore);
791 LOAD_DB2(sItemDamageTwoHandStore);
793 LOAD_DB2(sItemDisenchantLootStore);
794 LOAD_DB2(sItemEffectStore);
795 LOAD_DB2(sItemStore);
796 LOAD_DB2(sItemExtendedCostStore);
797 LOAD_DB2(sItemLevelSelectorStore);
800 LOAD_DB2(sItemLimitCategoryStore);
805 LOAD_DB2(sItemPriceBaseStore);
806 LOAD_DB2(sItemSearchNameStore);
807 LOAD_DB2(sItemSetStore);
808 LOAD_DB2(sItemSetSpellStore);
809 LOAD_DB2(sItemSparseStore);
810 LOAD_DB2(sItemSpecStore);
811 LOAD_DB2(sItemSpecOverrideStore);
812 LOAD_DB2(sItemXBonusTreeStore);
813 LOAD_DB2(sItemXItemEffectStore);
814 LOAD_DB2(sJournalEncounterStore);
816 LOAD_DB2(sJournalInstanceStore);
817 LOAD_DB2(sJournalTierStore);
818 LOAD_DB2(sKeychainStore);
819 LOAD_DB2(sKeystoneAffixStore);
820 LOAD_DB2(sLanguageWordsStore);
821 LOAD_DB2(sLanguagesStore);
822 LOAD_DB2(sLFGDungeonsStore);
823 LOAD_DB2(sLightStore);
824 LOAD_DB2(sLiquidTypeStore);
825 LOAD_DB2(sLockStore);
826 LOAD_DB2(sMailTemplateStore);
827 LOAD_DB2(sMapStore);
828 LOAD_DB2(sMapChallengeModeStore);
829 LOAD_DB2(sMapDifficultyStore);
831 LOAD_DB2(sMawPowerStore);
832 LOAD_DB2(sModifierTreeStore);
833 LOAD_DB2(sMountCapabilityStore);
834 LOAD_DB2(sMountStore);
836 LOAD_DB2(sMountXDisplayStore);
837 LOAD_DB2(sMovieStore);
838 LOAD_DB2(sMythicPlusSeasonStore);
839 LOAD_DB2(sNameGenStore);
840 LOAD_DB2(sNamesProfanityStore);
841 LOAD_DB2(sNamesReservedStore);
843 LOAD_DB2(sNumTalentsAtLevelStore);
844 LOAD_DB2(sOverrideSpellDataStore);
845 LOAD_DB2(sParagonReputationStore);
846 LOAD_DB2(sPhaseStore);
847 LOAD_DB2(sPhaseXPhaseGroupStore);
848 LOAD_DB2(sPlayerConditionStore);
849 LOAD_DB2(sPowerDisplayStore);
850 LOAD_DB2(sPowerTypeStore);
851 LOAD_DB2(sPrestigeLevelInfoStore);
852 LOAD_DB2(sPVPDifficultyStore);
853 LOAD_DB2(sPVPItemStore);
854 LOAD_DB2(sPVPStatStore);
855 LOAD_DB2(sPvpSeasonStore);
856 LOAD_DB2(sPvpTalentStore);
857 LOAD_DB2(sPvpTalentCategoryStore);
859 LOAD_DB2(sPvpTierStore);
860 LOAD_DB2(sQuestFactionRewardStore);
861 LOAD_DB2(sQuestInfoStore);
862 LOAD_DB2(sQuestLineXQuestStore);
863 LOAD_DB2(sQuestMoneyRewardStore);
864 LOAD_DB2(sQuestPackageItemStore);
865 LOAD_DB2(sQuestSortStore);
866 LOAD_DB2(sQuestV2Store);
867 LOAD_DB2(sQuestXPStore);
868 LOAD_DB2(sRandPropPointsStore);
869 LOAD_DB2(sRewardPackStore);
871 LOAD_DB2(sRewardPackXItemStore);
872 LOAD_DB2(sScenarioStore);
873 LOAD_DB2(sScenarioStepStore);
874 LOAD_DB2(sSceneScriptStore);
876 LOAD_DB2(sSceneScriptPackageStore);
877 LOAD_DB2(sSceneScriptTextStore);
878 LOAD_DB2(sServerMessagesStore);
879 LOAD_DB2(sSkillLineStore);
880 LOAD_DB2(sSkillLineAbilityStore);
882 LOAD_DB2(sSkillRaceClassInfoStore);
884 LOAD_DB2(sSoundKitStore);
886 LOAD_DB2(sSpecSetMemberStore);
887 LOAD_DB2(sSpellAuraOptionsStore);
889 LOAD_DB2(sSpellCastTimesStore);
891 LOAD_DB2(sSpellCategoriesStore);
892 LOAD_DB2(sSpellCategoryStore);
893 LOAD_DB2(sSpellClassOptionsStore);
894 LOAD_DB2(sSpellCooldownsStore);
895 LOAD_DB2(sSpellDurationStore);
896 LOAD_DB2(sSpellEffectStore);
897 LOAD_DB2(sSpellEquippedItemsStore);
898 LOAD_DB2(sSpellFocusObjectStore);
899 LOAD_DB2(sSpellInterruptsStore);
903 LOAD_DB2(sSpellLabelStore);
904 LOAD_DB2(sSpellLearnSpellStore);
905 LOAD_DB2(sSpellLevelsStore);
906 LOAD_DB2(sSpellMiscStore);
907 LOAD_DB2(sSpellNameStore);
908 LOAD_DB2(sSpellPowerStore);
912 LOAD_DB2(sSpellRadiusStore);
913 LOAD_DB2(sSpellRangeStore);
914 LOAD_DB2(sSpellReagentsStore);
916 LOAD_DB2(sSpellScalingStore);
917 LOAD_DB2(sSpellShapeshiftStore);
920 LOAD_DB2(sSpellTotemsStore);
921 LOAD_DB2(sSpellVisualStore);
923 LOAD_DB2(sSpellVisualMissileStore);
924 LOAD_DB2(sSpellVisualKitStore);
925 LOAD_DB2(sSpellXSpellVisualStore);
926 LOAD_DB2(sSummonPropertiesStore);
927 LOAD_DB2(sTactKeyStore);
928 LOAD_DB2(sTalentStore);
929 LOAD_DB2(sTaxiNodesStore);
930 LOAD_DB2(sTaxiPathStore);
931 LOAD_DB2(sTaxiPathNodeStore);
932 LOAD_DB2(sTotemCategoryStore);
933 LOAD_DB2(sToyStore);
934 LOAD_DB2(sTraitCondStore);
935 LOAD_DB2(sTraitCostStore);
936 LOAD_DB2(sTraitCurrencyStore);
938 LOAD_DB2(sTraitDefinitionStore);
940 LOAD_DB2(sTraitEdgeStore);
941 LOAD_DB2(sTraitNodeStore);
942 LOAD_DB2(sTraitNodeEntryStore);
945 LOAD_DB2(sTraitNodeGroupStore);
952 LOAD_DB2(sTraitTreeStore);
953 LOAD_DB2(sTraitTreeLoadoutStore);
957 LOAD_DB2(sTransmogHolidayStore);
958 LOAD_DB2(sTransmogIllusionStore);
959 LOAD_DB2(sTransmogSetStore);
960 LOAD_DB2(sTransmogSetGroupStore);
961 LOAD_DB2(sTransmogSetItemStore);
962 LOAD_DB2(sTransportAnimationStore);
963 LOAD_DB2(sTransportRotationStore);
964 LOAD_DB2(sUiMapStore);
965 LOAD_DB2(sUiMapAssignmentStore);
966 LOAD_DB2(sUiMapLinkStore);
967 LOAD_DB2(sUiMapXMapArtStore);
968 LOAD_DB2(sUISplashScreenStore);
969 LOAD_DB2(sUnitConditionStore);
970 LOAD_DB2(sUnitPowerBarStore);
971 LOAD_DB2(sVehicleStore);
972 LOAD_DB2(sVehicleSeatStore);
973 LOAD_DB2(sVignetteStore);
974 LOAD_DB2(sWMOAreaTableStore);
975 LOAD_DB2(sWorldEffectStore);
976 LOAD_DB2(sWorldMapOverlayStore);
978
979#undef LOAD_DB2
980
981 // error checks
982 if (!loadErrors.empty())
983 {
984 sLog->SetSynchronous(); // server will shut down after this, so set sync logging to prevent messages from getting lost
985
986 for (std::string const& error : loadErrors)
987 TC_LOG_ERROR("misc", "{}", error);
988
989 return 0;
990 }
991
992 // Check loaded DB2 files proper version
993 if (!sAreaTableStore.LookupEntry(15151) || // last area added in 10.2.5 (53007)
994 !sCharTitlesStore.LookupEntry(805) || // last char title added in 10.2.5 (53007)
995 !sGemPropertiesStore.LookupEntry(4081) || // last gem property added in 10.2.5 (53007)
996 !sItemStore.LookupEntry(215160) || // last item added in 10.2.5 (53007)
997 !sItemExtendedCostStore.LookupEntry(8510) || // last item extended cost added in 10.2.5 (53007)
998 !sMapStore.LookupEntry(2708) || // last map added in 10.2.5 (53007)
999 !sSpellNameStore.LookupEntry(438878)) // last spell added in 10.2.5 (53007)
1000 {
1001 TC_LOG_ERROR("misc", "You have _outdated_ DB2 files. Please extract correct versions from current using client.");
1002 exit(1);
1003 }
1004
1005 for (AreaGroupMemberEntry const* areaGroupMember : sAreaGroupMemberStore)
1006 _areaGroupMembers[areaGroupMember->AreaGroupID].push_back(areaGroupMember->AreaID);
1007
1008 for (AreaTableEntry const* areaTable : sAreaTableStore)
1009 {
1010 ASSERT(areaTable->AreaBit <= 0 || (size_t(areaTable->AreaBit / 64) < PLAYER_EXPLORED_ZONES_SIZE),
1011 "PLAYER_EXPLORED_ZONES_SIZE must be at least %d", (areaTable->AreaBit + 63) / 64);
1012 }
1013
1014 for (ArtifactPowerEntry const* artifactPower : sArtifactPowerStore)
1015 _artifactPowers[artifactPower->ArtifactID].push_back(artifactPower);
1016
1017 for (ArtifactPowerLinkEntry const* artifactPowerLink : sArtifactPowerLinkStore)
1018 {
1019 _artifactPowerLinks[artifactPowerLink->PowerA].push_back(artifactPowerLink->PowerB);
1020 _artifactPowerLinks[artifactPowerLink->PowerB].push_back(artifactPowerLink->PowerA);
1021 }
1022
1023 for (ArtifactPowerRankEntry const* artifactPowerRank : sArtifactPowerRankStore)
1024 _artifactPowerRanks[std::pair<uint32, uint8>{ artifactPowerRank->ArtifactPowerID, artifactPowerRank->RankIndex }] = artifactPowerRank;
1025
1026 for (AzeriteEmpoweredItemEntry const* azeriteEmpoweredItem : sAzeriteEmpoweredItemStore)
1027 _azeriteEmpoweredItems[azeriteEmpoweredItem->ItemID] = azeriteEmpoweredItem;
1028
1029 for (AzeriteEssencePowerEntry const* azeriteEssencePower : sAzeriteEssencePowerStore)
1030 _azeriteEssencePowersByIdAndRank[std::pair<uint32, uint32>{ azeriteEssencePower->AzeriteEssenceID, azeriteEssencePower->Tier }] = azeriteEssencePower;
1031
1032 for (AzeriteItemMilestonePowerEntry const* azeriteItemMilestonePower : sAzeriteItemMilestonePowerStore)
1033 _azeriteItemMilestonePowers.push_back(azeriteItemMilestonePower);
1034
1035 std::sort(_azeriteItemMilestonePowers.begin(), _azeriteItemMilestonePowers.end(), [](AzeriteItemMilestonePowerEntry const* a1, AzeriteItemMilestonePowerEntry const* a2)
1036 {
1037 return a1->RequiredLevel < a2->RequiredLevel;
1038 });
1039
1040 {
1041 uint32 azeriteEssenceSlot = 0;
1042 for (AzeriteItemMilestonePowerEntry const* azeriteItemMilestonePower : _azeriteItemMilestonePowers)
1043 {
1044 AzeriteItemMilestoneType type = AzeriteItemMilestoneType(azeriteItemMilestonePower->Type);
1046 {
1047 ASSERT(azeriteEssenceSlot < MAX_AZERITE_ESSENCE_SLOT);
1048 _azeriteItemMilestonePowerByEssenceSlot[azeriteEssenceSlot] = azeriteItemMilestonePower;
1049 ++azeriteEssenceSlot;
1050 }
1051 }
1052 }
1053
1054 for (AzeritePowerSetMemberEntry const* azeritePowerSetMember : sAzeritePowerSetMemberStore)
1055 if (sAzeritePowerStore.LookupEntry(azeritePowerSetMember->AzeritePowerID))
1056 _azeritePowers[azeritePowerSetMember->AzeritePowerSetID].push_back(azeritePowerSetMember);
1057
1058 for (AzeriteTierUnlockEntry const* azeriteTierUnlock : sAzeriteTierUnlockStore)
1059 _azeriteTierUnlockLevels[std::pair<uint32, ItemContext>{ azeriteTierUnlock->AzeriteTierUnlockSetID, ItemContext(azeriteTierUnlock->ItemCreationContext) }][azeriteTierUnlock->Tier] = azeriteTierUnlock->AzeriteLevel;
1060
1061 for (BattlemasterListEntry const* battlemaster : sBattlemasterListStore)
1062 {
1063 if (battlemaster->MaxLevel < battlemaster->MinLevel)
1064 {
1065 TC_LOG_ERROR("db2.hotfix.battlemaster_list", "Battlemaster ({}) contains bad values for MinLevel ({}) and MaxLevel ({}). Swapping values.", battlemaster->ID, battlemaster->MinLevel, battlemaster->MaxLevel);
1066 std::swap(const_cast<BattlemasterListEntry*>(battlemaster)->MaxLevel, const_cast<BattlemasterListEntry*>(battlemaster)->MinLevel);
1067 }
1068 if (battlemaster->MaxPlayers < battlemaster->MinPlayers)
1069 {
1070 TC_LOG_ERROR("db2.hotfix.battlemaster_list", "Battlemaster ({}) contains bad values for MinPlayers ({}) and MaxPlayers ({}). Swapping values.", battlemaster->ID, battlemaster->MinPlayers, battlemaster->MaxPlayers);
1071 int8 minPlayers = battlemaster->MinPlayers;
1072 const_cast<BattlemasterListEntry*>(battlemaster)->MinPlayers = battlemaster->MaxPlayers;
1073 const_cast<BattlemasterListEntry*>(battlemaster)->MaxPlayers = minPlayers;
1074 }
1075 }
1076
1077 _broadcastTextDurations.reserve(sBroadcastTextDurationStore.GetNumRows());
1078 for (BroadcastTextDurationEntry const* broadcastTextDuration : sBroadcastTextDurationStore)
1079 _broadcastTextDurations[{ broadcastTextDuration->BroadcastTextID, CascLocaleBit(broadcastTextDuration->Locale) }] = broadcastTextDuration->Duration;
1080
1081 for (ChrClassUIDisplayEntry const* uiDisplay : sChrClassUIDisplayStore)
1082 {
1083 ASSERT(uiDisplay->ChrClassesID < MAX_CLASSES);
1084 _uiDisplayByClass[uiDisplay->ChrClassesID] = uiDisplay;
1085 }
1086
1087 {
1088 std::set<ChrClassesXPowerTypesEntry const*, ChrClassesXPowerTypesEntryComparator> powers;
1090 powers.insert(power);
1091
1092 for (std::size_t i = 0; i < _powersByClass.size(); ++i)
1093 _powersByClass[i].fill(MAX_POWERS);
1094
1095 for (ChrClassesXPowerTypesEntry const* power : powers)
1096 {
1097 uint32 index = 0;
1098 for (uint32 j = 0; j < MAX_POWERS; ++j)
1099 if (_powersByClass[power->ClassID][j] != MAX_POWERS)
1100 ++index;
1101
1102 ASSERT(power->ClassID < MAX_CLASSES);
1103 ASSERT(power->PowerType < MAX_POWERS);
1104 _powersByClass[power->ClassID][power->PowerType] = index;
1105 }
1106 }
1107
1108 for (ChrCustomizationChoiceEntry const* customizationChoice : sChrCustomizationChoiceStore)
1109 _chrCustomizationChoicesByOption[customizationChoice->ChrCustomizationOptionID].push_back(customizationChoice);
1110
1111 std::unordered_multimap<uint32, std::pair<uint32, uint8>> shapeshiftFormByModel;
1112 std::unordered_map<uint32, ChrCustomizationDisplayInfoEntry const*> displayInfoByCustomizationChoice;
1113
1114 // build shapeshift form model lookup
1115 for (ChrCustomizationElementEntry const* customizationElement : sChrCustomizationElementStore)
1116 {
1117 if (ChrCustomizationDisplayInfoEntry const* customizationDisplayInfo = sChrCustomizationDisplayInfoStore.LookupEntry(customizationElement->ChrCustomizationDisplayInfoID))
1118 {
1119 if (ChrCustomizationChoiceEntry const* customizationChoice = sChrCustomizationChoiceStore.LookupEntry(customizationElement->ChrCustomizationChoiceID))
1120 {
1121 displayInfoByCustomizationChoice[customizationElement->ChrCustomizationChoiceID] = customizationDisplayInfo;
1122 if (ChrCustomizationOptionEntry const* customizationOption = sChrCustomizationOptionStore.LookupEntry(customizationChoice->ChrCustomizationOptionID))
1123 shapeshiftFormByModel.emplace(customizationOption->ChrModelID, std::make_pair(customizationOption->ID, uint8(customizationDisplayInfo->ShapeshiftFormID)));
1124 }
1125 }
1126 }
1127
1128 std::unordered_map<uint32, std::vector<ChrCustomizationOptionEntry const*>> customizationOptionsByModel;
1129 for (ChrCustomizationOptionEntry const* customizationOption : sChrCustomizationOptionStore)
1130 customizationOptionsByModel[customizationOption->ChrModelID].push_back(customizationOption);
1131
1133 {
1134 if (ChrCustomizationChoiceEntry const* customizationChoice = sChrCustomizationChoiceStore.LookupEntry(reqChoice->ChrCustomizationChoiceID))
1135 {
1136 std::vector<std::pair<uint32, std::vector<uint32>>>& requiredChoicesForReq = _chrCustomizationRequiredChoices[reqChoice->ChrCustomizationReqID];
1137 std::vector<uint32>* choices = nullptr;
1138 for (std::pair<uint32, std::vector<uint32>>& choicesForOption : requiredChoicesForReq)
1139 {
1140 if (int32(choicesForOption.first) == customizationChoice->ChrCustomizationOptionID)
1141 {
1142 choices = &choicesForOption.second;
1143 break;
1144 }
1145 }
1146 if (!choices)
1147 {
1148 std::pair<uint32, std::vector<uint32>>& choicesForReq = requiredChoicesForReq.emplace_back();
1149 choicesForReq.first = customizationChoice->ChrCustomizationOptionID;
1150 choices = &choicesForReq.second;
1151 }
1152 choices->push_back(reqChoice->ChrCustomizationChoiceID);
1153 }
1154 }
1155
1156 std::unordered_map<uint32, uint32> parentRaces;
1157 for (ChrRacesEntry const* chrRace : sChrRacesStore)
1158 if (chrRace->UnalteredVisualRaceID)
1159 parentRaces[chrRace->UnalteredVisualRaceID] = chrRace->ID;
1160
1161 for (ChrRaceXChrModelEntry const* raceModel : sChrRaceXChrModelStore)
1162 {
1163 if (ChrModelEntry const* model = sChrModelStore.LookupEntry(raceModel->ChrModelID))
1164 {
1165 _chrModelsByRaceAndGender[{ uint8(raceModel->ChrRacesID), uint8(raceModel->Sex) }] = model;
1166
1167 if (std::vector<ChrCustomizationOptionEntry const*> const* customizationOptionsForModel = Trinity::Containers::MapGetValuePtr(customizationOptionsByModel, model->ID))
1168 {
1169 std::vector<ChrCustomizationOptionEntry const*>& raceOptions = _chrCustomizationOptionsByRaceAndGender[{ uint8(raceModel->ChrRacesID), uint8(raceModel->Sex) }];
1170 raceOptions.insert(raceOptions.end(), customizationOptionsForModel->begin(), customizationOptionsForModel->end());
1171
1172 if (uint32 const* parentRace = Trinity::Containers::MapGetValuePtr(parentRaces, raceModel->ChrRacesID))
1173 {
1174 std::vector<ChrCustomizationOptionEntry const*>& parentRaceOptions = _chrCustomizationOptionsByRaceAndGender[{ uint8(*parentRace), uint8(raceModel->Sex) }];
1175 parentRaceOptions.insert(parentRaceOptions.end(), customizationOptionsForModel->begin(), customizationOptionsForModel->end());
1176 }
1177 }
1178
1179 // link shapeshift displays to race/gender/form
1180 for (std::pair<uint32 const, std::pair<uint32, uint8>> const& shapeshiftOptionsForModel : Trinity::Containers::MapEqualRange(shapeshiftFormByModel, model->ID))
1181 {
1182 ShapeshiftFormModelData& data = _chrCustomizationChoicesForShapeshifts[{ uint8(raceModel->ChrRacesID), uint8(raceModel->Sex), shapeshiftOptionsForModel.second.second }];
1183 data.OptionID = shapeshiftOptionsForModel.second.first;
1184 data.Choices = Trinity::Containers::MapGetValuePtr(_chrCustomizationChoicesByOption, shapeshiftOptionsForModel.second.first);
1185 if (data.Choices)
1186 {
1187 data.Displays.resize(data.Choices->size());
1188 for (std::size_t i = 0; i < data.Choices->size(); ++i)
1189 data.Displays[i] = Trinity::Containers::MapGetValuePtr(displayInfoByCustomizationChoice, (*data.Choices)[i]->ID);
1190 }
1191 }
1192 }
1193 }
1194
1195 memset(_chrSpecializationsByIndex, 0, sizeof(_chrSpecializationsByIndex));
1196 for (ChrSpecializationEntry const* chrSpec : sChrSpecializationStore)
1197 {
1198 ASSERT(chrSpec->ClassID < MAX_CLASSES);
1199 ASSERT(chrSpec->OrderIndex < MAX_SPECIALIZATIONS);
1200
1201 uint32 storageIndex = chrSpec->ClassID;
1202 if (chrSpec->GetFlags().HasFlag(ChrSpecializationFlag::PetOverrideSpec))
1203 {
1204 ASSERT(!chrSpec->ClassID);
1205 storageIndex = PET_SPEC_OVERRIDE_CLASS_INDEX;
1206 }
1207
1208 _chrSpecializationsByIndex[storageIndex][chrSpec->OrderIndex] = chrSpec;
1209 }
1210
1211 for (ConditionalChrModelEntry const* conditionalChrModel : sConditionalChrModelStore)
1212 _conditionalChrModelsByChrModelId[conditionalChrModel->ChrModelID] = conditionalChrModel;
1213
1214 for (ConditionalContentTuningEntry const* conditionalContentTuning : sConditionalContentTuningStore)
1215 _conditionalContentTuning.emplace(conditionalContentTuning->ParentContentTuningID, conditionalContentTuning);
1216
1217 for (ContentTuningXExpectedEntry const* contentTuningXExpectedStat : sContentTuningXExpectedStore)
1218 if (sExpectedStatModStore.LookupEntry(contentTuningXExpectedStat->ExpectedStatModID))
1219 _expectedStatModsByContentTuning[contentTuningXExpectedStat->ContentTuningID].push_back(contentTuningXExpectedStat);
1220
1221 for (ContentTuningXLabelEntry const* contentTuningXLabel : sContentTuningXLabelStore)
1222 _contentTuningLabels.emplace(contentTuningXLabel->ContentTuningID, contentTuningXLabel->LabelID);
1223
1224 for (CurrencyContainerEntry const* currencyContainer : sCurrencyContainerStore)
1225 _currencyContainers.emplace(currencyContainer->CurrencyTypesID, currencyContainer);
1226
1227 {
1228 std::unordered_map<uint32 /*curveID*/, std::vector<CurvePointEntry const*>> unsortedPoints;
1229 for (CurvePointEntry const* curvePoint : sCurvePointStore)
1230 if (sCurveStore.LookupEntry(curvePoint->CurveID))
1231 unsortedPoints[curvePoint->CurveID].push_back(curvePoint);
1232
1233 for (auto& [curveId, curvePoints] : unsortedPoints)
1234 {
1235 std::sort(curvePoints.begin(), curvePoints.end(), [](CurvePointEntry const* point1, CurvePointEntry const* point2) { return point1->OrderIndex < point2->OrderIndex; });
1236 std::vector<DBCPosition2D>& points = _curvePoints[curveId];
1237 points.resize(curvePoints.size());
1238 std::transform(curvePoints.begin(), curvePoints.end(), points.begin(), [](CurvePointEntry const* point) { return point->Pos; });
1239 }
1240 }
1241
1242 for (EmotesTextSoundEntry const* emoteTextSound : sEmotesTextSoundStore)
1243 _emoteTextSounds[EmotesTextSoundContainer::key_type(emoteTextSound->EmotesTextID, emoteTextSound->RaceID, emoteTextSound->SexID, emoteTextSound->ClassID)] = emoteTextSound;
1244
1245 for (ExpectedStatEntry const* expectedStat : sExpectedStatStore)
1246 _expectedStatsByLevel[std::make_pair(expectedStat->Lvl, expectedStat->ExpansionID)] = expectedStat;
1247
1248 for (FactionEntry const* faction : sFactionStore)
1249 if (faction->ParentFactionID)
1250 _factionTeams[faction->ParentFactionID].push_back(faction->ID);
1251
1252 for (FriendshipRepReactionEntry const* friendshipRepReaction : sFriendshipRepReactionStore)
1253 _friendshipRepReactions[friendshipRepReaction->FriendshipRepID].insert(friendshipRepReaction);
1254
1255 for (GameObjectDisplayInfoEntry const* gameObjectDisplayInfo : sGameObjectDisplayInfoStore)
1256 {
1257 if (gameObjectDisplayInfo->GeoBoxMax.X < gameObjectDisplayInfo->GeoBoxMin.X)
1258 std::swap(const_cast<GameObjectDisplayInfoEntry*>(gameObjectDisplayInfo)->GeoBoxMax.X, const_cast<GameObjectDisplayInfoEntry*>(gameObjectDisplayInfo)->GeoBoxMin.X);
1259 if (gameObjectDisplayInfo->GeoBoxMax.Y < gameObjectDisplayInfo->GeoBoxMin.Y)
1260 std::swap(const_cast<GameObjectDisplayInfoEntry*>(gameObjectDisplayInfo)->GeoBoxMax.Y, const_cast<GameObjectDisplayInfoEntry*>(gameObjectDisplayInfo)->GeoBoxMin.Y);
1261 if (gameObjectDisplayInfo->GeoBoxMax.Z < gameObjectDisplayInfo->GeoBoxMin.Z)
1262 std::swap(const_cast<GameObjectDisplayInfoEntry*>(gameObjectDisplayInfo)->GeoBoxMax.Z, const_cast<GameObjectDisplayInfoEntry*>(gameObjectDisplayInfo)->GeoBoxMin.Z);
1263 }
1264
1265 for (HeirloomEntry const* heirloom : sHeirloomStore)
1266 _heirlooms[heirloom->ItemID] = heirloom;
1267
1268 for (GlyphBindableSpellEntry const* glyphBindableSpell : sGlyphBindableSpellStore)
1269 _glyphBindableSpells[glyphBindableSpell->GlyphPropertiesID].push_back(glyphBindableSpell->SpellID);
1270
1271 for (GlyphRequiredSpecEntry const* glyphRequiredSpec : sGlyphRequiredSpecStore)
1272 _glyphRequiredSpecs[glyphRequiredSpec->GlyphPropertiesID].push_back(ChrSpecialization(glyphRequiredSpec->ChrSpecializationID));
1273
1274 for (ItemChildEquipmentEntry const* itemChildEquipment : sItemChildEquipmentStore)
1275 {
1276 ASSERT(_itemChildEquipment.find(itemChildEquipment->ParentItemID) == _itemChildEquipment.end(), "Item must have max 1 child item.");
1277 _itemChildEquipment[itemChildEquipment->ParentItemID] = itemChildEquipment;
1278 }
1279
1280 for (ItemClassEntry const* itemClass : sItemClassStore)
1281 {
1282 ASSERT(itemClass->ClassID < int32(_itemClassByOldEnum.size()));
1283 ASSERT(!_itemClassByOldEnum[itemClass->ClassID]);
1284 _itemClassByOldEnum[itemClass->ClassID] = itemClass;
1285 }
1286
1287 for (ItemCurrencyCostEntry const* itemCurrencyCost : sItemCurrencyCostStore)
1288 _itemsWithCurrencyCost.insert(itemCurrencyCost->ItemID);
1289
1291 _itemCategoryConditions[condition->ParentItemLimitCategoryID].push_back(condition);
1292
1294 {
1295 ASSERT(appearanceMod->ItemID <= 0xFFFFFF);
1296 _itemModifiedAppearancesByItem[appearanceMod->ItemID | (appearanceMod->ItemAppearanceModifierID << 24)] = appearanceMod;
1297 }
1298
1299 for (ItemSetSpellEntry const* itemSetSpell : sItemSetSpellStore)
1300 _itemSetSpells[itemSetSpell->ItemSetID].push_back(itemSetSpell);
1301
1302 for (ItemSpecOverrideEntry const* itemSpecOverride : sItemSpecOverrideStore)
1303 _itemSpecOverrides[itemSpecOverride->ItemID].push_back(itemSpecOverride);
1304
1305 for (JournalTierEntry const* journalTier : sJournalTierStore)
1306 _journalTiersByIndex.push_back(journalTier);
1307
1308 for (MapDifficultyEntry const* entry : sMapDifficultyStore)
1309 _mapDifficulties[entry->MapID][entry->DifficultyID] = entry;
1310
1311 std::vector<MapDifficultyXConditionEntry const*> mapDifficultyConditions;
1312 mapDifficultyConditions.reserve(sMapDifficultyXConditionStore.GetNumRows());
1313 for (MapDifficultyXConditionEntry const* mapDifficultyCondition : sMapDifficultyXConditionStore)
1314 mapDifficultyConditions.push_back(mapDifficultyCondition);
1315
1316 std::sort(mapDifficultyConditions.begin(), mapDifficultyConditions.end(), [](MapDifficultyXConditionEntry const* left, MapDifficultyXConditionEntry const* right)
1317 {
1318 return left->OrderIndex < right->OrderIndex;
1319 });
1320
1321 for (MapDifficultyXConditionEntry const* mapDifficultyCondition : mapDifficultyConditions)
1322 if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(mapDifficultyCondition->PlayerConditionID))
1323 _mapDifficultyConditions[mapDifficultyCondition->MapDifficultyID].emplace_back(mapDifficultyCondition->ID, playerCondition);
1324
1325 for (MountEntry const* mount : sMountStore)
1326 _mountsBySpellId[mount->SourceSpellID] = mount;
1327
1328 for (MountTypeXCapabilityEntry const* mountTypeCapability : sMountTypeXCapabilityStore)
1329 _mountCapabilitiesByType[mountTypeCapability->MountTypeID].insert(mountTypeCapability);
1330
1331 for (MountXDisplayEntry const* mountDisplay : sMountXDisplayStore)
1332 _mountDisplays[mountDisplay->MountID].push_back(mountDisplay);
1333
1334 for (NameGenEntry const* nameGen : sNameGenStore)
1335 _nameGenData[nameGen->RaceID][nameGen->Sex].push_back(nameGen);
1336
1337 for (NamesProfanityEntry const* namesProfanity : sNamesProfanityStore)
1338 {
1339 ASSERT(namesProfanity->Language < TOTAL_LOCALES || namesProfanity->Language == -1);
1340 std::wstring name;
1341 bool conversionResult = Utf8toWStr(namesProfanity->Name, name);
1342 ASSERT(conversionResult);
1343 if (namesProfanity->Language != -1)
1344 _nameValidators[namesProfanity->Language].emplace_back(name, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
1345 else
1346 {
1347 for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
1348 {
1349 if (i == LOCALE_none)
1350 continue;
1351
1352 _nameValidators[i].emplace_back(name, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
1353 }
1354 }
1355 }
1356
1357 for (NamesReservedEntry const* namesReserved : sNamesReservedStore)
1358 {
1359 std::wstring name;
1360 bool conversionResult = Utf8toWStr(namesReserved->Name, name);
1361 ASSERT(conversionResult);
1362 _nameValidators[TOTAL_LOCALES].emplace_back(name, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
1363 }
1364
1365 for (NamesReservedLocaleEntry const* namesReserved : sNamesReservedLocaleStore)
1366 {
1367 ASSERT(!(namesReserved->LocaleMask & ~((1u << TOTAL_LOCALES) - 1)));
1368 std::wstring name;
1369 bool conversionResult = Utf8toWStr(namesReserved->Name, name);
1370 ASSERT(conversionResult);
1371 for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
1372 {
1373 if (i == LOCALE_none)
1374 continue;
1375
1376 if (namesReserved->LocaleMask & (1 << i))
1377 _nameValidators[i].emplace_back(name, Trinity::regex::perl | Trinity::regex::icase | Trinity::regex::optimize);
1378 }
1379 }
1380
1381 for (ParagonReputationEntry const* paragonReputation : sParagonReputationStore)
1382 if (sFactionStore.HasRecord(paragonReputation->FactionID))
1383 _paragonReputations[paragonReputation->FactionID] = paragonReputation;
1384
1386 if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseID))
1387 _phasesByGroup[group->PhaseGroupID].push_back(phase->ID);
1388
1389 for (PowerTypeEntry const* powerType : sPowerTypeStore)
1390 {
1391 ASSERT(powerType->PowerTypeEnum < MAX_POWERS);
1392 ASSERT(!_powerTypes[powerType->PowerTypeEnum]);
1393
1394 _powerTypes[powerType->PowerTypeEnum] = powerType;
1395 }
1396
1397 for (PVPDifficultyEntry const* entry : sPVPDifficultyStore)
1398 {
1399 ASSERT(entry->RangeIndex < MAX_BATTLEGROUND_BRACKETS, "PvpDifficulty bracket (%d) exceeded max allowed value (%d)", entry->RangeIndex, MAX_BATTLEGROUND_BRACKETS);
1400 }
1401
1402 for (PVPItemEntry const* pvpItem : sPVPItemStore)
1403 _pvpItemBonus[pvpItem->ItemID] = pvpItem->ItemLevelDelta;
1404
1405 for (PvpTalentSlotUnlockEntry const* talentUnlock : sPvpTalentSlotUnlockStore)
1406 {
1407 ASSERT(talentUnlock->Slot < (1 << MAX_PVP_TALENT_SLOTS));
1408 for (int8 i = 0; i < MAX_PVP_TALENT_SLOTS; ++i)
1409 {
1410 if (talentUnlock->Slot & (1 << i))
1411 {
1412 ASSERT(!_pvpTalentSlotUnlock[i]);
1413 _pvpTalentSlotUnlock[i] = talentUnlock;
1414 }
1415 }
1416 }
1417
1418 for (QuestLineXQuestEntry const* questLineQuest : sQuestLineXQuestStore)
1419 _questsByQuestLine[questLineQuest->QuestLineID].push_back(questLineQuest);
1420
1421 for (QuestPackageItemEntry const* questPackageItem : sQuestPackageItemStore)
1422 {
1423 if (questPackageItem->DisplayType != QUEST_PACKAGE_FILTER_UNMATCHED)
1424 _questPackages[questPackageItem->PackageID].first.push_back(questPackageItem);
1425 else
1426 _questPackages[questPackageItem->PackageID].second.push_back(questPackageItem);
1427 }
1428
1429 for (RewardPackXCurrencyTypeEntry const* rewardPackXCurrencyType : sRewardPackXCurrencyTypeStore)
1430 _rewardPackCurrencyTypes[rewardPackXCurrencyType->RewardPackID].push_back(rewardPackXCurrencyType);
1431
1432 for (RewardPackXItemEntry const* rewardPackXItem : sRewardPackXItemStore)
1433 _rewardPackItems[rewardPackXItem->RewardPackID].push_back(rewardPackXItem);
1434
1435 for (SkillLineEntry const* skill : sSkillLineStore)
1436 if (skill->ParentSkillLineID)
1437 _skillLinesByParentSkillLine[skill->ParentSkillLineID].push_back(skill);
1438
1439 for (SkillLineAbilityEntry const* skillLineAbility : sSkillLineAbilityStore)
1440 _skillLineAbilitiesBySkillupSkill[skillLineAbility->SkillupSkillLineID ? skillLineAbility->SkillupSkillLineID : skillLineAbility->SkillLine].push_back(skillLineAbility);
1441
1443 if (sSkillLineStore.LookupEntry(entry->SkillID))
1444 _skillRaceClassInfoBySkill.insert(SkillRaceClassInfoContainer::value_type(entry->SkillID, entry));
1445
1446 for (SoulbindConduitRankEntry const* soulbindConduitRank : sSoulbindConduitRankStore)
1447 _soulbindConduitRanks[{ soulbindConduitRank->SoulbindConduitID, soulbindConduitRank->RankIndex }] = soulbindConduitRank;
1448
1450 _specializationSpellsBySpec[specSpells->SpecID].push_back(specSpells);
1451
1452 for (SpecSetMemberEntry const* specSetMember : sSpecSetMemberStore)
1453 _specsBySpecSet.insert(std::make_pair(specSetMember->SpecSetID, uint32(specSetMember->ChrSpecializationID)));
1454
1455 for (SpellClassOptionsEntry const* classOption : sSpellClassOptionsStore)
1456 _spellFamilyNames.insert(classOption->SpellClassSet);
1457
1459 _spellProcsPerMinuteMods[ppmMod->SpellProcsPerMinuteID].push_back(ppmMod);
1460
1461 for (SpellVisualMissileEntry const* spellVisualMissile : sSpellVisualMissileStore)
1462 _spellVisualMissilesBySet[spellVisualMissile->SpellVisualMissileSetID].push_back(spellVisualMissile);
1463
1464 for (TalentEntry const* talentInfo : sTalentStore)
1465 {
1466 ASSERT(talentInfo->ClassID < MAX_CLASSES);
1467 ASSERT(talentInfo->TierID < MAX_TALENT_TIERS, "MAX_TALENT_TIERS must be at least %u", talentInfo->TierID + 1);
1468 ASSERT(talentInfo->ColumnIndex < MAX_TALENT_COLUMNS, "MAX_TALENT_COLUMNS must be at least %u", talentInfo->ColumnIndex + 1);
1469
1470 _talentsByPosition[talentInfo->ClassID][talentInfo->TierID][talentInfo->ColumnIndex].push_back(talentInfo);
1471 }
1472
1473 for (TaxiPathEntry const* entry : sTaxiPathStore)
1474 _taxiPaths[{ entry->FromTaxiNode, entry->ToTaxiNode }] = entry;
1475
1476 uint32 pathCount = sTaxiPathStore.GetNumRows();
1477
1478 // Calculate path nodes count
1479 std::vector<uint32> pathLength;
1480 pathLength.resize(pathCount); // 0 and some other indexes not used
1481 for (TaxiPathNodeEntry const* entry : sTaxiPathNodeStore)
1482 if (pathLength[entry->PathID] < entry->NodeIndex + 1u)
1483 pathLength[entry->PathID] = entry->NodeIndex + 1u;
1484
1485 // Set path length
1486 sTaxiPathNodesByPath.resize(pathCount); // 0 and some other indexes not used
1487 for (uint32 i = 0; i < sTaxiPathNodesByPath.size(); ++i)
1488 sTaxiPathNodesByPath[i].resize(pathLength[i]);
1489
1490 // fill data
1491 for (TaxiPathNodeEntry const* entry : sTaxiPathNodeStore)
1492 sTaxiPathNodesByPath[entry->PathID][entry->NodeIndex] = entry;
1493
1494 for (ToyEntry const* toy : sToyStore)
1495 _toys.insert(toy->ItemID);
1496
1497 for (TransmogIllusionEntry const* transmogIllusion : sTransmogIllusionStore)
1498 _transmogIllusionsByEnchantmentId[transmogIllusion->SpellItemEnchantmentID] = transmogIllusion;
1499
1500 for (TransmogSetItemEntry const* transmogSetItem : sTransmogSetItemStore)
1501 {
1502 TransmogSetEntry const* set = sTransmogSetStore.LookupEntry(transmogSetItem->TransmogSetID);
1503 if (!set)
1504 continue;
1505
1506 _transmogSetsByItemModifiedAppearance[transmogSetItem->ItemModifiedAppearanceID].push_back(set);
1507 _transmogSetItemsByTransmogSet[transmogSetItem->TransmogSetID].push_back(transmogSetItem);
1508 }
1509
1510 std::unordered_multimap<int32, UiMapAssignmentEntry const*> uiMapAssignmentByUiMap;
1511 for (UiMapAssignmentEntry const* uiMapAssignment : sUiMapAssignmentStore)
1512 {
1513 uiMapAssignmentByUiMap.emplace(uiMapAssignment->UiMapID, uiMapAssignment);
1514 if (UiMapEntry const* uiMap = sUiMapStore.LookupEntry(uiMapAssignment->UiMapID))
1515 {
1516 ASSERT(uiMap->System < MAX_UI_MAP_SYSTEM, "MAX_UI_MAP_SYSTEM must be at least %u", uiMap->System + 1);
1517 if (uiMapAssignment->MapID >= 0)
1518 _uiMapAssignmentByMap[uiMap->System].emplace(uiMapAssignment->MapID, uiMapAssignment);
1519 if (uiMapAssignment->AreaID)
1520 _uiMapAssignmentByArea[uiMap->System].emplace(uiMapAssignment->AreaID, uiMapAssignment);
1521 if (uiMapAssignment->WmoDoodadPlacementID)
1522 _uiMapAssignmentByWmoDoodadPlacement[uiMap->System].emplace(uiMapAssignment->WmoDoodadPlacementID, uiMapAssignment);
1523 if (uiMapAssignment->WmoGroupID)
1524 _uiMapAssignmentByWmoGroup[uiMap->System].emplace(uiMapAssignment->WmoGroupID, uiMapAssignment);
1525 }
1526 }
1527
1528 std::unordered_map<std::pair<int32, uint32>, UiMapLinkEntry const*> uiMapLinks;
1529 for (UiMapLinkEntry const* uiMapLink : sUiMapLinkStore)
1530 uiMapLinks[std::make_pair(uiMapLink->ParentUiMapID, uint32(uiMapLink->ChildUiMapID))] = uiMapLink;
1531
1532 for (UiMapEntry const* uiMap : sUiMapStore)
1533 {
1534 UiMapBounds& bounds = _uiMapBounds[uiMap->ID];
1535 memset(&bounds, 0, sizeof(bounds));
1536 if (UiMapEntry const* parentUiMap = sUiMapStore.LookupEntry(uiMap->ParentUiMapID))
1537 {
1538 if (parentUiMap->GetFlags().HasFlag(UiMapFlag::NoWorldPositions))
1539 continue;
1540
1541 UiMapAssignmentEntry const* uiMapAssignment = nullptr;
1542 UiMapAssignmentEntry const* parentUiMapAssignment = nullptr;
1543 for (std::pair<int32 const, UiMapAssignmentEntry const*> const& uiMapAssignmentForMap : Trinity::Containers::MapEqualRange(uiMapAssignmentByUiMap, uiMap->ID))
1544 {
1545 if (uiMapAssignmentForMap.second->MapID >= 0 &&
1546 uiMapAssignmentForMap.second->Region[1].X - uiMapAssignmentForMap.second->Region[0].X > 0 &&
1547 uiMapAssignmentForMap.second->Region[1].Y - uiMapAssignmentForMap.second->Region[0].Y > 0)
1548 {
1549 uiMapAssignment = uiMapAssignmentForMap.second;
1550 break;
1551 }
1552 }
1553
1554 if (!uiMapAssignment)
1555 continue;
1556
1557 for (std::pair<int32 const, UiMapAssignmentEntry const*> const& uiMapAssignmentForMap : Trinity::Containers::MapEqualRange(uiMapAssignmentByUiMap, uiMap->ParentUiMapID))
1558 {
1559 if (uiMapAssignmentForMap.second->MapID == uiMapAssignment->MapID &&
1560 uiMapAssignmentForMap.second->Region[1].X - uiMapAssignmentForMap.second->Region[0].X > 0 &&
1561 uiMapAssignmentForMap.second->Region[1].Y - uiMapAssignmentForMap.second->Region[0].Y > 0)
1562 {
1563 parentUiMapAssignment = uiMapAssignmentForMap.second;
1564 break;
1565 }
1566 }
1567
1568 if (!parentUiMapAssignment)
1569 continue;
1570
1571 float parentXsize = parentUiMapAssignment->Region[1].X - parentUiMapAssignment->Region[0].X;
1572 float parentYsize = parentUiMapAssignment->Region[1].Y - parentUiMapAssignment->Region[0].Y;
1573 float bound0scale = (uiMapAssignment->Region[1].X - parentUiMapAssignment->Region[0].X) / parentXsize;
1574 float bound0 = ((1.0f - bound0scale) * parentUiMapAssignment->UiMax.Y) + (bound0scale * parentUiMapAssignment->UiMin.Y);
1575 float bound2scale = (uiMapAssignment->Region[0].X - parentUiMapAssignment->Region[0].X) / parentXsize;
1576 float bound2 = ((1.0f - bound2scale) * parentUiMapAssignment->UiMax.Y) + (bound2scale * parentUiMapAssignment->UiMin.Y);
1577 float bound1scale = (uiMapAssignment->Region[1].Y - parentUiMapAssignment->Region[0].Y) / parentYsize;
1578 float bound1 = ((1.0f - bound1scale) * parentUiMapAssignment->UiMax.X) + (bound1scale * parentUiMapAssignment->UiMin.X);
1579 float bound3scale = (uiMapAssignment->Region[0].Y - parentUiMapAssignment->Region[0].Y) / parentYsize;
1580 float bound3 = ((1.0f - bound3scale) * parentUiMapAssignment->UiMax.X) + (bound3scale * parentUiMapAssignment->UiMin.X);
1581 if ((bound3 - bound1) > 0.0f || (bound2 - bound0) > 0.0f)
1582 {
1583 bounds.Bounds[0] = bound0;
1584 bounds.Bounds[1] = bound1;
1585 bounds.Bounds[2] = bound2;
1586 bounds.Bounds[3] = bound3;
1587 bounds.IsUiAssignment = true;
1588 }
1589 }
1590
1591 if (UiMapLinkEntry const* uiMapLink = Trinity::Containers::MapGetValuePtr(uiMapLinks, std::make_pair(uiMap->ParentUiMapID, uiMap->ID)))
1592 {
1593 bounds.IsUiAssignment = false;
1594 bounds.IsUiLink = true;
1595 bounds.Bounds[0] = uiMapLink->UiMin.Y;
1596 bounds.Bounds[1] = uiMapLink->UiMin.X;
1597 bounds.Bounds[2] = uiMapLink->UiMax.Y;
1598 bounds.Bounds[3] = uiMapLink->UiMax.X;
1599 }
1600 }
1601
1602 for (UiMapXMapArtEntry const* uiMapArt : sUiMapXMapArtStore)
1603 if (uiMapArt->PhaseID)
1604 _uiMapPhases.insert(uiMapArt->PhaseID);
1605
1606 for (WMOAreaTableEntry const* entry : sWMOAreaTableStore)
1607 _wmoAreaTableLookup[WMOAreaTableKey(entry->WmoID, entry->NameSetID, entry->WmoGroupID)] = entry;
1608
1609 // Initialize global taxinodes mask
1610 // reinitialize internal storage for globals after loading TaxiNodes.db2
1611 sTaxiNodesMask = {};
1615 // include existed nodes that have at least single not spell base (scripted) path
1616 for (TaxiNodesEntry const* node : sTaxiNodesStore)
1617 {
1618 if (!node->IsPartOfTaxiNetwork())
1619 continue;
1620
1621 // valid taxi network node
1622 uint32 field = uint32((node->ID - 1) / (sizeof(TaxiMask::value_type) * 8));
1623 TaxiMask::value_type submask = TaxiMask::value_type(1 << ((node->ID - 1) % (sizeof(TaxiMask::value_type) * 8)));
1624
1625 sTaxiNodesMask[field] |= submask;
1626 if (node->GetFlags().HasFlag(TaxiNodeFlags::ShowOnHordeMap))
1627 sHordeTaxiNodesMask[field] |= submask;
1628 if (node->GetFlags().HasFlag(TaxiNodeFlags::ShowOnAllianceMap))
1629 sAllianceTaxiNodesMask[field] |= submask;
1630
1631 int32 uiMapId = -1;
1632 if (!GetUiMapPosition(node->Pos.X, node->Pos.Y, node->Pos.Z, node->ContinentID, 0, 0, 0, UI_MAP_SYSTEM_ADVENTURE, false, &uiMapId))
1633 GetUiMapPosition(node->Pos.X, node->Pos.Y, node->Pos.Z, node->ContinentID, 0, 0, 0, UI_MAP_SYSTEM_TAXI, false, &uiMapId);
1634
1635 if (uiMapId == 985 || uiMapId == 986)
1636 sOldContinentsNodesMask[field] |= submask;
1637 }
1638
1639 for (PVPStatEntry const* pvpStat : sPVPStatStore)
1640 _pvpStatIdsByMap[pvpStat->MapID].insert(pvpStat->ID);
1641
1642 TC_LOG_INFO("server.loading", ">> Initialized {} DB2 data stores in {} ms", _stores.size(), GetMSTimeDiffToNow(oldMSTime));
1643
1644 return availableDb2Locales.to_ulong();
1645}
1646
1648{
1649 auto itr = _stores.find(type);
1650 if (itr != _stores.end())
1651 return itr->second;
1652
1653 return nullptr;
1654}
1655
1657{
1658 uint32 oldMSTime = getMSTime();
1659
1660 QueryResult result = HotfixDatabase.Query("SELECT Id, UniqueId, TableHash, RecordId, Status FROM hotfix_data ORDER BY Id");
1661
1662 if (!result)
1663 {
1664 TC_LOG_INFO("server.loading", ">> Loaded 0 hotfix info entries.");
1665 return;
1666 }
1667
1668 uint32 count = 0;
1669
1670 std::map<std::pair<uint32, int32>, bool> deletedRecords;
1671
1672 do
1673 {
1674 Field* fields = result->Fetch();
1675
1676 int32 id = fields[0].GetInt32();
1677 uint32 uniqueId = fields[1].GetUInt32();
1678 uint32 tableHash = fields[2].GetUInt32();
1679 int32 recordId = fields[3].GetInt32();
1680 HotfixRecord::Status status = static_cast<HotfixRecord::Status>(fields[4].GetUInt8());
1681 std::bitset<TOTAL_LOCALES> availableDb2Locales = localeMask;
1682 if (status == HotfixRecord::Status::Valid && !_stores.contains(tableHash))
1683 {
1684 HotfixBlobKey key = std::make_pair(tableHash, recordId);
1685 for (std::size_t locale = 0; locale < TOTAL_LOCALES; ++locale)
1686 {
1687 if (!availableDb2Locales[locale])
1688 continue;
1689
1690 if (!_hotfixBlob[locale].contains(key))
1691 availableDb2Locales[locale] = false;
1692 }
1693
1694 if (availableDb2Locales.none())
1695 {
1696 TC_LOG_ERROR("sql.sql", "Table `hotfix_data` references unknown DB2 store by hash 0x{:X} and has no reference to `hotfix_blob` in hotfix id {} with RecordID: {}", tableHash, id, recordId);
1697 continue;
1698 }
1699 }
1700
1701 HotfixRecord hotfixRecord;
1702 hotfixRecord.TableHash = tableHash;
1703 hotfixRecord.RecordID = recordId;
1704 hotfixRecord.ID.PushID = id;
1705 hotfixRecord.ID.UniqueID = uniqueId;
1706 hotfixRecord.HotfixStatus = status;
1707 hotfixRecord.AvailableLocalesMask = availableDb2Locales.to_ulong();
1708
1709 HotfixPush& push = _hotfixData[id];
1710 push.Records.push_back(hotfixRecord);
1711 push.AvailableLocalesMask |= hotfixRecord.AvailableLocalesMask;
1712
1713 _maxHotfixId = std::max(_maxHotfixId, id);
1714 deletedRecords[std::make_pair(tableHash, recordId)] = status == HotfixRecord::Status::RecordRemoved;
1715 ++count;
1716 } while (result->NextRow());
1717
1718 for (auto itr = deletedRecords.begin(); itr != deletedRecords.end(); ++itr)
1719 if (itr->second)
1720 if (DB2StorageBase* store = Trinity::Containers::MapGetValuePtr(_stores, itr->first.first))
1721 store->EraseRecord(itr->first.second);
1722
1723 TC_LOG_INFO("server.loading", ">> Loaded {} hotfix records in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1724}
1725
1727{
1728 uint32 oldMSTime = getMSTime();
1729
1730 QueryResult result = HotfixDatabase.Query("SELECT TableHash, RecordId, locale, `Blob` FROM hotfix_blob ORDER BY TableHash");
1731
1732 if (!result)
1733 {
1734 TC_LOG_INFO("server.loading", ">> Loaded 0 hotfix blob entries.");
1735 return;
1736 }
1737
1738 std::bitset<TOTAL_LOCALES> availableDb2Locales = localeMask;
1739 uint32 hotfixBlobCount = 0;
1740 do
1741 {
1742 Field* fields = result->Fetch();
1743
1744 uint32 tableHash = fields[0].GetUInt32();
1745 auto storeItr = _stores.find(tableHash);
1746 if (storeItr != _stores.end())
1747 {
1748 TC_LOG_ERROR("sql.sql", "Table hash 0x{:X} points to a loaded DB2 store {}, fill related table instead of hotfix_blob",
1749 tableHash, storeItr->second->GetFileName());
1750 continue;
1751 }
1752
1753 int32 recordId = fields[1].GetInt32();
1754 std::string localeName = fields[2].GetString();
1755 LocaleConstant locale = GetLocaleByName(localeName);
1756
1757 if (!IsValidLocale(locale))
1758 {
1759 TC_LOG_ERROR("sql.sql", "`hotfix_blob` contains invalid locale: {} at TableHash: 0x{:X} and RecordID: {}", localeName, tableHash, recordId);
1760 continue;
1761 }
1762
1763 if (!availableDb2Locales[locale])
1764 continue;
1765
1766 _hotfixBlob[locale][std::make_pair(tableHash, recordId)] = fields[3].GetBinary();
1767 hotfixBlobCount++;
1768 } while (result->NextRow());
1769
1770 TC_LOG_INFO("server.loading", ">> Loaded {} hotfix blob records in {} ms", hotfixBlobCount, GetMSTimeDiffToNow(oldMSTime));
1771}
1772
1773bool ValidateBroadcastTextTactKeyOptionalData(std::vector<uint8> const& data)
1774{
1775 return data.size() == 8 + 16;
1776}
1777
1779{
1780 // Register allowed optional data keys
1781 _allowedHotfixOptionalData.emplace(sBroadcastTextStore.GetTableHash(), std::make_pair(sTactKeyStore.GetTableHash(), &ValidateBroadcastTextTactKeyOptionalData));
1782
1783 uint32 oldMSTime = getMSTime();
1784
1785 QueryResult result = HotfixDatabase.Query("SELECT TableHash, RecordId, locale, `Key`, `Data` FROM hotfix_optional_data ORDER BY TableHash");
1786
1787 if (!result)
1788 {
1789 TC_LOG_INFO("server.loading", ">> Loaded 0 hotfix optional data records.");
1790 return;
1791 }
1792
1793 std::bitset<TOTAL_LOCALES> availableDb2Locales = localeMask;
1794 uint32 hotfixOptionalDataCount = 0;
1795 do
1796 {
1797 Field* fields = result->Fetch();
1798
1799 uint32 tableHash = fields[0].GetUInt32();
1800 auto allowedHotfixes = Trinity::Containers::MapEqualRange(_allowedHotfixOptionalData, tableHash);
1801 if (allowedHotfixes.begin() == allowedHotfixes.end())
1802 {
1803 TC_LOG_ERROR("sql.sql", "Table `hotfix_optional_data` references DB2 store by hash 0x{:X} that is not allowed to have optional data", tableHash);
1804 continue;
1805 }
1806
1807 uint32 recordId = fields[1].GetInt32();
1808 auto storeItr = _stores.find(tableHash);
1809 if (storeItr == _stores.end())
1810 {
1811 TC_LOG_ERROR("sql.sql", "Table `hotfix_optional_data` references unknown DB2 store by hash 0x{:X} with RecordID: {}", tableHash, recordId);
1812 continue;
1813 }
1814
1815 std::string localeName = fields[2].GetString();
1816 LocaleConstant locale = GetLocaleByName(localeName);
1817
1818 if (!IsValidLocale(locale))
1819 {
1820 TC_LOG_ERROR("sql.sql", "`hotfix_optional_data` contains invalid locale: {} at TableHash: 0x{:X} and RecordID: {}", localeName, tableHash, recordId);
1821 continue;
1822 }
1823
1824 if (!availableDb2Locales[locale])
1825 continue;
1826
1827 DB2Manager::HotfixOptionalData optionalData;
1828 optionalData.Key = fields[3].GetUInt32();
1829 auto allowedHotfixItr = std::find_if(allowedHotfixes.begin(), allowedHotfixes.end(), [&](std::pair<uint32 const, AllowedHotfixOptionalData> const& v)
1830 {
1831 return v.second.first == optionalData.Key;
1832 });
1833 if (allowedHotfixItr == allowedHotfixes.end())
1834 {
1835 TC_LOG_ERROR("sql.sql", "Table `hotfix_optional_data` references non-allowed optional data key 0x{:X} for DB2 store by hash 0x{:X} and RecordID: {}",
1836 optionalData.Key, tableHash, recordId);
1837 continue;
1838 }
1839
1840 optionalData.Data = fields[4].GetBinary();
1841 if (!allowedHotfixItr->second.second(optionalData.Data))
1842 {
1843 TC_LOG_ERROR("sql.sql", "Table `hotfix_optional_data` contains invalid data for DB2 store 0x{:X}, RecordID: {} and Key: 0x{:X}",
1844 tableHash, recordId, optionalData.Key);
1845 continue;
1846 }
1847
1848 _hotfixOptionalData[locale][std::make_pair(tableHash, recordId)].push_back(std::move(optionalData));
1849 hotfixOptionalDataCount++;
1850 } while (result->NextRow());
1851
1852 TC_LOG_INFO("server.loading", ">> Loaded {} hotfix optional data records in {} ms", hotfixOptionalDataCount, GetMSTimeDiffToNow(oldMSTime));
1853}
1854
1856{
1857 return _hotfixData.size();
1858}
1859
1861{
1862 return _hotfixData;
1863}
1864
1865std::vector<uint8> const* DB2Manager::GetHotfixBlobData(uint32 tableHash, int32 recordId, LocaleConstant locale) const
1866{
1867 ASSERT(IsValidLocale(locale), "Locale %u is invalid locale", uint32(locale));
1868
1869 return Trinity::Containers::MapGetValuePtr(_hotfixBlob[locale], std::make_pair(tableHash, recordId));
1870}
1871
1872std::vector<DB2Manager::HotfixOptionalData> const* DB2Manager::GetHotfixOptionalData(uint32 tableHash, int32 recordId, LocaleConstant locale) const
1873{
1874 ASSERT(IsValidLocale(locale), "Locale %u is invalid locale", uint32(locale));
1875
1876 return Trinity::Containers::MapGetValuePtr(_hotfixOptionalData[locale], std::make_pair(tableHash, recordId));
1877}
1878
1880{
1881 return sAnimationDataStore.GetNumRows();
1882}
1883
1885{
1886 HotfixRecord hotfixRecord;
1887 hotfixRecord.TableHash = tableHash;
1888 hotfixRecord.RecordID = recordId;
1889 hotfixRecord.ID.PushID = ++_maxHotfixId;
1890 hotfixRecord.ID.UniqueID = rand32();
1891 hotfixRecord.AvailableLocalesMask = 0xDFF;
1892
1893 HotfixPush& push = _hotfixData[hotfixRecord.ID.PushID];
1894 push.Records.push_back(hotfixRecord);
1895 push.AvailableLocalesMask |= hotfixRecord.AvailableLocalesMask;
1896}
1897
1898std::vector<uint32> DB2Manager::GetAreasForGroup(uint32 areaGroupId) const
1899{
1900 auto itr = _areaGroupMembers.find(areaGroupId);
1901 if (itr != _areaGroupMembers.end())
1902 return itr->second;
1903
1904 return std::vector<uint32>();
1905}
1906
1907bool DB2Manager::IsInArea(uint32 objectAreaId, uint32 areaId)
1908{
1909 do
1910 {
1911 if (objectAreaId == areaId)
1912 return true;
1913
1914 AreaTableEntry const* objectArea = sAreaTableStore.LookupEntry(objectAreaId);
1915 if (!objectArea)
1916 break;
1917
1918 objectAreaId = objectArea->ParentAreaID;
1919 } while (objectAreaId);
1920
1921 return false;
1922}
1923
1925{
1926 if (!areaEntry)
1927 return nullptr;
1928
1929 // Get ContentTuning for the area
1930 if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(areaEntry->ContentTuningID))
1931 return contentTuning;
1932
1933 // If there is no data for the current area and it has a parent area, get data from the last (recursive)
1934 if (AreaTableEntry const* parentAreaEntry = sAreaTableStore.LookupEntry(areaEntry->ParentAreaID))
1935 return GetContentTuningForArea(parentAreaEntry);
1936
1937 return nullptr;
1938}
1939
1940std::vector<ArtifactPowerEntry const*> DB2Manager::GetArtifactPowers(uint8 artifactId) const
1941{
1942 auto itr = _artifactPowers.find(artifactId);
1943 if (itr != _artifactPowers.end())
1944 return itr->second;
1945
1946 return std::vector<ArtifactPowerEntry const*>{};
1947}
1948
1949std::vector<uint32> const* DB2Manager::GetArtifactPowerLinks(uint32 artifactPowerId) const
1950{
1951 return Trinity::Containers::MapGetValuePtr(_artifactPowerLinks, artifactPowerId);
1952}
1953
1955{
1956 return Trinity::Containers::MapGetValuePtr(_artifactPowerRanks, { artifactPowerId, rank });
1957}
1958
1960{
1961 return Trinity::Containers::MapGetValuePtr(_azeriteEmpoweredItems, itemId);
1962}
1963
1965{
1966 return std::find_if(sAzeriteItemStore.begin(), sAzeriteItemStore.end(),
1967 [&](AzeriteItemEntry const* azeriteItem) { return azeriteItem->ItemID == int32(itemId); }) != sAzeriteItemStore.end();
1968}
1969
1971{
1972 return Trinity::Containers::MapGetValuePtr(_azeriteEssencePowersByIdAndRank, std::make_pair(azeriteEssenceId, rank));
1973}
1974
1975std::vector<AzeriteItemMilestonePowerEntry const*> const& DB2Manager::GetAzeriteItemMilestonePowers() const
1976{
1977 return _azeriteItemMilestonePowers;
1978}
1979
1981{
1982 ASSERT(slot < MAX_AZERITE_ESSENCE_SLOT, "Slot %u must be lower than MAX_AZERITE_ESSENCE_SLOT (%u)", uint32(slot), MAX_AZERITE_ESSENCE_SLOT);
1983 return _azeriteItemMilestonePowerByEssenceSlot[slot];
1984}
1985
1986std::vector<AzeritePowerSetMemberEntry const*> const* DB2Manager::GetAzeritePowers(uint32 itemId) const
1987{
1988 if (AzeriteEmpoweredItemEntry const* azeriteEmpoweredItem = GetAzeriteEmpoweredItem(itemId))
1989 return Trinity::Containers::MapGetValuePtr(_azeritePowers, azeriteEmpoweredItem->AzeritePowerSetID);
1990
1991 return nullptr;
1992}
1993
1995{
1997 if (std::array<uint8, MAX_AZERITE_EMPOWERED_TIER> const* levels = Trinity::Containers::MapGetValuePtr(_azeriteTierUnlockLevels, std::make_pair(azeriteUnlockSetId, context)))
1998 return (*levels)[tier];
1999
2000 AzeriteTierUnlockSetEntry const* azeriteTierUnlockSet = sAzeriteTierUnlockSetStore.LookupEntry(azeriteUnlockSetId);
2001 if (azeriteTierUnlockSet && azeriteTierUnlockSet->Flags & AZERITE_TIER_UNLOCK_SET_FLAG_DEFAULT)
2002 if (std::array<uint8, MAX_AZERITE_EMPOWERED_TIER> const* levels = Trinity::Containers::MapGetValuePtr(_azeriteTierUnlockLevels, std::make_pair(azeriteUnlockSetId, ItemContext::NONE)))
2003 return (*levels)[tier];
2004
2005 return sAzeriteLevelInfoStore.GetNumRows();
2006}
2007
2008char const* DB2Manager::GetBroadcastTextValue(BroadcastTextEntry const* broadcastText, LocaleConstant locale /*= DEFAULT_LOCALE*/, uint8 gender /*= GENDER_MALE*/, bool forceGender /*= false*/)
2009{
2010 if ((gender == GENDER_FEMALE || gender == GENDER_NONE) && (forceGender || broadcastText->Text1[DEFAULT_LOCALE][0] != '\0'))
2011 {
2012 if (broadcastText->Text1[locale][0] != '\0')
2013 return broadcastText->Text1[locale];
2014
2015 return broadcastText->Text1[DEFAULT_LOCALE];
2016 }
2017
2018 if (broadcastText->Text[locale][0] != '\0')
2019 return broadcastText->Text[locale];
2020
2021 return broadcastText->Text[DEFAULT_LOCALE];
2022}
2023
2024int32 const* DB2Manager::GetBroadcastTextDuration(int32 broadcastTextId, LocaleConstant locale /*= DEFAULT_LOCALE*/) const
2025{
2026 return Trinity::Containers::MapGetValuePtr(_broadcastTextDurations, { broadcastTextId, WowLocaleToCascLocaleBit[locale] });
2027}
2028
2030{
2031 ASSERT(unitClass < MAX_CLASSES);
2032 return _uiDisplayByClass[unitClass];
2033}
2034
2035char const* DB2Manager::GetClassName(uint8 class_, LocaleConstant locale /*= DEFAULT_LOCALE*/)
2036{
2037 ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_);
2038 if (!classEntry)
2039 return "";
2040
2041 if (classEntry->Name[locale][0] != '\0')
2042 return classEntry->Name[locale];
2043
2044 return classEntry->Name[DEFAULT_LOCALE];
2045}
2046
2048{
2049 return _powersByClass[classId][power];
2050}
2051
2052std::vector<ChrCustomizationChoiceEntry const*> const* DB2Manager::GetCustomiztionChoices(uint32 chrCustomizationOptionId) const
2053{
2054 return Trinity::Containers::MapGetValuePtr(_chrCustomizationChoicesByOption, chrCustomizationOptionId);
2055}
2056
2057std::vector<ChrCustomizationOptionEntry const*> const* DB2Manager::GetCustomiztionOptions(uint8 race, uint8 gender) const
2058{
2059 return Trinity::Containers::MapGetValuePtr(_chrCustomizationOptionsByRaceAndGender, { race,gender });
2060}
2061
2062std::vector<std::pair<uint32, std::vector<uint32>>> const* DB2Manager::GetRequiredCustomizationChoices(uint32 chrCustomizationReqId) const
2063{
2064 return Trinity::Containers::MapGetValuePtr(_chrCustomizationRequiredChoices, chrCustomizationReqId);
2065}
2066
2068{
2069 return Trinity::Containers::MapGetValuePtr(_chrModelsByRaceAndGender, { race, gender });
2070}
2071
2073{
2074 return Trinity::Containers::MapGetValuePtr(_conditionalChrModelsByChrModelId, chrModelId);
2075}
2076
2077char const* DB2Manager::GetChrRaceName(uint8 race, LocaleConstant locale /*= DEFAULT_LOCALE*/)
2078{
2079 ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race);
2080 if (!raceEntry)
2081 return "";
2082
2083 if (raceEntry->Name[locale][0] != '\0')
2084 return raceEntry->Name[locale];
2085
2086 return raceEntry->Name[DEFAULT_LOCALE];
2087}
2088
2090{
2091 return _chrSpecializationsByIndex[class_][index];
2092}
2093
2095{
2097}
2098
2100{
2101 for (auto [_, conditionalContentTuning] : Trinity::Containers::MapEqualRange(_conditionalContentTuning, contentTuningId))
2102 if (conditionalContentTuning->RedirectFlag & redirectFlag)
2103 return conditionalContentTuning->RedirectContentTuningID;
2104
2105 return contentTuningId;
2106}
2107
2108Optional<ContentTuningLevels> DB2Manager::GetContentTuningData(uint32 contentTuningId, uint32 redirectFlag, bool forItem /*= false*/) const
2109{
2110 ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(GetRedirectedContentTuningId(contentTuningId, redirectFlag));
2111 if (!contentTuning)
2112 return {};
2113
2114 if (forItem && contentTuning->GetFlags().HasFlag(ContentTuningFlag::DisabledForItem))
2115 return {};
2116
2117 auto getLevelAdjustment = [](ContentTuningCalcType type) -> int32
2118 {
2119 switch (type)
2120 {
2122 return 1;
2124 return GetMaxLevelForExpansion(sWorld->getIntConfig(CONFIG_EXPANSION));
2125 default:
2126 break;
2127 }
2128
2129 return 0;
2130 };
2131
2132 ContentTuningLevels levels;
2133 levels.MinLevel = contentTuning->MinLevel + getLevelAdjustment(static_cast<ContentTuningCalcType>(contentTuning->MinLevelType));
2134 levels.MaxLevel = contentTuning->MaxLevel + getLevelAdjustment(static_cast<ContentTuningCalcType>(contentTuning->MaxLevelType));
2135 levels.MinLevelWithDelta = std::clamp<int32>(levels.MinLevel + contentTuning->TargetLevelDelta, 1, MAX_LEVEL);
2136 levels.MaxLevelWithDelta = std::clamp<int32>(levels.MaxLevel + contentTuning->TargetLevelMaxDelta, 1, MAX_LEVEL);
2137
2138 // clamp after calculating levels with delta (delta can bring "overflown" level back into correct range)
2139 levels.MinLevel = std::clamp<int32>(levels.MinLevel, 1, MAX_LEVEL);
2140 levels.MaxLevel = std::clamp<int32>(levels.MaxLevel, 1, MAX_LEVEL);
2141
2142 if (contentTuning->TargetLevelMin)
2143 levels.TargetLevelMin = contentTuning->TargetLevelMin;
2144 else
2145 levels.TargetLevelMin = levels.MinLevelWithDelta;
2146
2147 if (contentTuning->TargetLevelMax)
2148 levels.TargetLevelMax = contentTuning->TargetLevelMax;
2149 else
2150 levels.TargetLevelMax = levels.MaxLevelWithDelta;
2151
2152 return levels;
2153}
2154
2155bool DB2Manager::HasContentTuningLabel(uint32 contentTuningId, int32 label) const
2156{
2157 return _contentTuningLabels.contains({ contentTuningId, label });
2158}
2159
2161{
2162 if (!petfamily)
2163 return nullptr;
2164
2165 CreatureFamilyEntry const* petFamily = sCreatureFamilyStore.LookupEntry(petfamily);
2166 if (!petFamily)
2167 return nullptr;
2168
2169 return petFamily->Name[locale][0] != '\0' ? petFamily->Name[locale] : nullptr;
2170}
2171
2173{
2174 for (std::pair<uint32 const, CurrencyContainerEntry const*> const& p : Trinity::Containers::MapEqualRange(_currencyContainers, currencyId))
2175 if (quantity >= p.second->MinAmount && (!p.second->MaxAmount || quantity <= p.second->MaxAmount))
2176 return p.second;
2177
2178 return nullptr;
2179}
2180
2181std::pair<float, float> DB2Manager::GetCurveXAxisRange(uint32 curveId) const
2182{
2183 if (std::vector<DBCPosition2D> const* points = Trinity::Containers::MapGetValuePtr(_curvePoints, curveId))
2184 return { points->front().X, points->back().X };
2185
2186 return { 0.0f, 0.0f };
2187}
2188
2189static CurveInterpolationMode DetermineCurveType(CurveEntry const* curve, std::vector<DBCPosition2D> const& points)
2190{
2191 switch (curve->Type)
2192 {
2193 case 1:
2195 case 2:
2196 {
2197 switch (points.size())
2198 {
2199 case 1:
2201 case 2:
2203 case 3:
2205 case 4:
2207 default:
2208 break;
2209 }
2211 }
2212 case 3:
2214 default:
2215 break;
2216 }
2217
2219}
2220
2221float DB2Manager::GetCurveValueAt(uint32 curveId, float x) const
2222{
2223 auto itr = _curvePoints.find(curveId);
2224 if (itr == _curvePoints.end())
2225 return 0.0f;
2226
2227 CurveEntry const* curve = sCurveStore.AssertEntry(curveId);
2228 std::vector<DBCPosition2D> const& points = itr->second;
2229 if (points.empty())
2230 return 0.0f;
2231
2232 return GetCurveValueAt(DetermineCurveType(curve, points), points, x);
2233}
2234
2235float DB2Manager::GetCurveValueAt(CurveInterpolationMode mode, std::span<DBCPosition2D const> points, float x) const
2236{
2237 switch (mode)
2238 {
2240 {
2241 std::size_t pointIndex = 0;
2242 while (pointIndex < points.size() && points[pointIndex].X <= x)
2243 ++pointIndex;
2244 if (!pointIndex)
2245 return points[0].Y;
2246 if (pointIndex >= points.size())
2247 return points.back().Y;
2248 float xDiff = points[pointIndex].X - points[pointIndex - 1].X;
2249 if (xDiff == 0.0)
2250 return points[pointIndex].Y;
2251 return (((x - points[pointIndex - 1].X) / xDiff) * (points[pointIndex].Y - points[pointIndex - 1].Y)) + points[pointIndex - 1].Y;
2252 }
2254 {
2255 std::size_t pointIndex = 0;
2256 while (pointIndex < points.size() && points[pointIndex].X <= x)
2257 ++pointIndex;
2258 if (!pointIndex)
2259 return points[0].Y;
2260 if (pointIndex >= points.size())
2261 return points.back().Y;
2262 float xDiff = points[pointIndex].X - points[pointIndex - 1].X;
2263 if (xDiff == 0.0)
2264 return points[pointIndex].Y;
2265 return ((points[pointIndex].Y - points[pointIndex - 1].Y) * (1.0f - std::cos((x - points[pointIndex - 1].X) / xDiff * float(M_PI))) * 0.5f) + points[pointIndex - 1].Y;
2266 }
2268 {
2269 std::size_t pointIndex = 1;
2270 while (pointIndex < points.size() && points[pointIndex].X <= x)
2271 ++pointIndex;
2272 if (pointIndex == 1)
2273 return points[1].Y;
2274 if (pointIndex >= points.size() - 1)
2275 return points[points.size() - 2].Y;
2276 float xDiff = points[pointIndex].X - points[pointIndex - 1].X;
2277 if (xDiff == 0.0)
2278 return points[pointIndex].Y;
2279
2280 float mu = (x - points[pointIndex - 1].X) / xDiff;
2281 float a0 = -0.5f * points[pointIndex - 2].Y + 1.5f * points[pointIndex - 1].Y - 1.5f * points[pointIndex].Y + 0.5f * points[pointIndex + 1].Y;
2282 float a1 = points[pointIndex - 2].Y - 2.5f * points[pointIndex - 1].Y + 2.0f * points[pointIndex].Y - 0.5f * points[pointIndex + 1].Y;
2283 float a2 = -0.5f * points[pointIndex - 2].Y + 0.5f * points[pointIndex].Y;
2284 float a3 = points[pointIndex - 1].Y;
2285
2286 return a0 * mu * mu * mu + a1 * mu * mu + a2 * mu + a3;
2287 }
2289 {
2290 float xDiff = points[2].X - points[0].X;
2291 if (xDiff == 0.0)
2292 return points[1].Y;
2293 float mu = (x - points[0].X) / xDiff;
2294 return ((1.0f - mu) * (1.0f - mu) * points[0].Y) + (1.0f - mu) * 2.0f * mu * points[1].Y + mu * mu * points[2].Y;
2295 }
2297 {
2298 float xDiff = points[3].X - points[0].X;
2299 if (xDiff == 0.0)
2300 return points[1].Y;
2301 float mu = (x - points[0].X) / xDiff;
2302 return (1.0f - mu) * (1.0f - mu) * (1.0f - mu) * points[0].Y
2303 + 3.0f * mu * (1.0f - mu) * (1.0f - mu) * points[1].Y
2304 + 3.0f * mu * mu * (1.0f - mu) * points[2].Y
2305 + mu * mu * mu * points[3].Y;
2306 }
2308 {
2309 float xDiff = points.back().X - points[0].X;
2310 if (xDiff == 0.0f)
2311 return points.back().Y;
2312
2313 std::vector<float> tmp(points.size());
2314 for (std::size_t i = 0; i < points.size(); ++i)
2315 tmp[i] = points[i].Y;
2316
2317 float mu = (x - points[0].X) / xDiff;
2318 int32 i = int32(points.size()) - 1;
2319 while (i > 0)
2320 {
2321 for (int32 k = 0; k < i; ++k)
2322 {
2323 float val = tmp[k] + mu * (tmp[k + 1] - tmp[k]);
2324 tmp[k] = val;
2325 }
2326 --i;
2327 }
2328 return tmp[0];
2329 }
2331 return points[0].Y;
2332 default:
2333 break;
2334 }
2335
2336 return 0.0f;
2337}
2338
2340{
2341 if (EmotesTextSoundEntry const* emotesTextSound = Trinity::Containers::MapGetValuePtr(_emoteTextSounds, { emote, race, gender, class_ }))
2342 return emotesTextSound;
2343
2344 if (EmotesTextSoundEntry const* emotesTextSound = Trinity::Containers::MapGetValuePtr(_emoteTextSounds, { emote, race, gender, uint8(0) }))
2345 return emotesTextSound;
2346
2347 return nullptr;
2348}
2349
2350template<float(ExpectedStatModEntry::*field)>
2352{
2353 explicit ExpectedStatModReducer(int32 mythicPlusMilestoneSeason) : ActiveMilestoneSeason(mythicPlusMilestoneSeason) { }
2354
2355 float operator()(float mod, ContentTuningXExpectedEntry const* contentTuningXExpected) const
2356 {
2357 if (!contentTuningXExpected)
2358 return mod;
2359
2360 if (contentTuningXExpected->MinMythicPlusSeasonID)
2361 if (MythicPlusSeasonEntry const* mythicPlusSeason = sMythicPlusSeasonStore.LookupEntry(contentTuningXExpected->MinMythicPlusSeasonID))
2362 if (ActiveMilestoneSeason < mythicPlusSeason->MilestoneSeason)
2363 return mod;
2364
2365 if (contentTuningXExpected->MaxMythicPlusSeasonID)
2366 if (MythicPlusSeasonEntry const* mythicPlusSeason = sMythicPlusSeasonStore.LookupEntry(contentTuningXExpected->MaxMythicPlusSeasonID))
2367 if (ActiveMilestoneSeason >= mythicPlusSeason->MilestoneSeason)
2368 return mod;
2369
2370 return mod * sExpectedStatModStore.AssertEntry(contentTuningXExpected->ExpectedStatModID)->*field;
2371 }
2372
2374};
2375
2376float DB2Manager::EvaluateExpectedStat(ExpectedStatType stat, uint32 level, int32 expansion, uint32 contentTuningId, Classes unitClass, int32 mythicPlusMilestoneSeason) const
2377{
2378 auto expectedStatItr = _expectedStatsByLevel.find(std::make_pair(level, expansion));
2379 if (expectedStatItr == _expectedStatsByLevel.end())
2380 expectedStatItr = _expectedStatsByLevel.find(std::make_pair(level, -2));
2381
2382 if (expectedStatItr == _expectedStatsByLevel.end())
2383 return 1.0f;
2384
2385 ExpectedStatModEntry const* classMod = nullptr;
2386 switch (unitClass)
2387 {
2388 case CLASS_WARRIOR:
2389 classMod = sExpectedStatModStore.LookupEntry(4);
2390 break;
2391 case CLASS_PALADIN:
2392 classMod = sExpectedStatModStore.LookupEntry(2);
2393 break;
2394 case CLASS_ROGUE:
2395 classMod = sExpectedStatModStore.LookupEntry(3);
2396 break;
2397 case CLASS_MAGE:
2398 classMod = sExpectedStatModStore.LookupEntry(1);
2399 break;
2400 default:
2401 break;
2402 }
2403
2404 std::vector<ContentTuningXExpectedEntry const*> const* contentTuningMods = Trinity::Containers::MapGetValuePtr(_expectedStatModsByContentTuning, contentTuningId);
2405 float value = 0.0f;
2406 switch (stat)
2407 {
2409 value = expectedStatItr->second->CreatureHealth;
2410 if (contentTuningMods)
2411 value *= std::accumulate(contentTuningMods->begin(), contentTuningMods->end(), 1.0f,
2413 if (classMod)
2414 value *= classMod->CreatureHealthMod;
2415 break;
2417 value = expectedStatItr->second->PlayerHealth;
2418 if (contentTuningMods)
2419 value *= std::accumulate(contentTuningMods->begin(), contentTuningMods->end(), 1.0f,
2421 if (classMod)
2422 value *= classMod->PlayerHealthMod;
2423 break;
2425 value = expectedStatItr->second->CreatureAutoAttackDps;
2426 if (contentTuningMods)
2427 value *= std::accumulate(contentTuningMods->begin(), contentTuningMods->end(), 1.0f,
2429 if (classMod)
2430 value *= classMod->CreatureAutoAttackDPSMod;
2431 break;
2433 value = expectedStatItr->second->CreatureArmor;
2434 if (contentTuningMods)
2435 value *= std::accumulate(contentTuningMods->begin(), contentTuningMods->end(), 1.0f,
2437 if (classMod)
2438 value *= classMod->CreatureArmorMod;
2439 break;
2441 value = expectedStatItr->second->PlayerMana;
2442 if (contentTuningMods)
2443 value *= std::accumulate(contentTuningMods->begin(), contentTuningMods->end(), 1.0f,
2445 if (classMod)
2446 value *= classMod->PlayerManaMod;
2447 break;
2449 value = expectedStatItr->second->PlayerPrimaryStat;
2450 if (contentTuningMods)
2451 value *= std::accumulate(contentTuningMods->begin(), contentTuningMods->end(), 1.0f,
2453 if (classMod)
2454 value *= classMod->PlayerPrimaryStatMod;
2455 break;
2457 value = expectedStatItr->second->PlayerSecondaryStat;
2458 if (contentTuningMods)
2459 value *= std::accumulate(contentTuningMods->begin(), contentTuningMods->end(), 1.0f,
2461 if (classMod)
2462 value *= classMod->PlayerSecondaryStatMod;
2463 break;
2465 value = expectedStatItr->second->ArmorConstant;
2466 if (contentTuningMods)
2467 value *= std::accumulate(contentTuningMods->begin(), contentTuningMods->end(), 1.0f,
2469 if (classMod)
2470 value *= classMod->ArmorConstantMod;
2471 break;
2473 break;
2475 value = expectedStatItr->second->CreatureSpellDamage;
2476 if (contentTuningMods)
2477 value *= std::accumulate(contentTuningMods->begin(), contentTuningMods->end(), 1.0f,
2479 if (classMod)
2480 value *= classMod->CreatureSpellDamageMod;
2481 break;
2482 default:
2483 break;
2484 }
2485
2486 return value;
2487}
2488
2489std::vector<uint32> const* DB2Manager::GetFactionTeamList(uint32 faction) const
2490{
2491 return Trinity::Containers::MapGetValuePtr(_factionTeams, faction);
2492}
2493
2495{
2496 return Trinity::Containers::MapGetValuePtr(_friendshipRepReactions, friendshipRepID);
2497}
2498
2500{
2501 for (GlobalCurveEntry const* globalCurveEntry : sGlobalCurveStore)
2502 if (GlobalCurve(globalCurveEntry->Type) == globalCurveType)
2503 return globalCurveEntry->CurveID;
2504
2505 return 0;
2506}
2507
2508std::vector<uint32> const* DB2Manager::GetGlyphBindableSpells(uint32 glyphPropertiesId) const
2509{
2510 return Trinity::Containers::MapGetValuePtr(_glyphBindableSpells, glyphPropertiesId);
2511}
2512
2513std::vector<ChrSpecialization> const* DB2Manager::GetGlyphRequiredSpecs(uint32 glyphPropertiesId) const
2514{
2515 return Trinity::Containers::MapGetValuePtr(_glyphRequiredSpecs, glyphPropertiesId);
2516}
2517
2519{
2520 return Trinity::Containers::MapGetValuePtr(_heirlooms, itemId);
2521}
2522
2524{
2525 return Trinity::Containers::MapGetValuePtr(_itemChildEquipment, itemId);
2526}
2527
2529{
2530 return _itemClassByOldEnum[itemClass];
2531}
2532
2534{
2535 return _itemsWithCurrencyCost.count(itemId) > 0;
2536}
2537
2538std::vector<ItemLimitCategoryConditionEntry const*> const* DB2Manager::GetItemLimitCategoryConditions(uint32 categoryId) const
2539{
2540 return Trinity::Containers::MapGetValuePtr(_itemCategoryConditions, categoryId);
2541}
2542
2543uint32 DB2Manager::GetItemDisplayId(uint32 itemId, uint32 appearanceModId) const
2544{
2545 if (ItemModifiedAppearanceEntry const* modifiedAppearance = GetItemModifiedAppearance(itemId, appearanceModId))
2546 if (ItemAppearanceEntry const* itemAppearance = sItemAppearanceStore.LookupEntry(modifiedAppearance->ItemAppearanceID))
2547 return itemAppearance->ItemDisplayInfoID;
2548
2549 return 0;
2550}
2551
2553{
2554 auto itr = _itemModifiedAppearancesByItem.find(itemId | (appearanceModId << 24));
2555 if (itr != _itemModifiedAppearancesByItem.end())
2556 return itr->second;
2557
2558 // Fall back to unmodified appearance
2559 if (appearanceModId)
2560 {
2561 itr = _itemModifiedAppearancesByItem.find(itemId);
2562 if (itr != _itemModifiedAppearancesByItem.end())
2563 return itr->second;
2564 }
2565
2566 return nullptr;
2567}
2568
2570{
2571 return Trinity::Containers::MapGetValuePtr(_itemModifiedAppearancesByItem, itemId);
2572}
2573
2574std::vector<ItemSetSpellEntry const*> const* DB2Manager::GetItemSetSpells(uint32 itemSetId) const
2575{
2576 return Trinity::Containers::MapGetValuePtr(_itemSetSpells, itemSetId);
2577}
2578
2579std::vector<ItemSpecOverrideEntry const*> const* DB2Manager::GetItemSpecOverrides(uint32 itemId) const
2580{
2581 return Trinity::Containers::MapGetValuePtr(_itemSpecOverrides, itemId);
2582}
2583
2585{
2586 if (index < _journalTiersByIndex.size())
2587 return _journalTiersByIndex[index];
2588 return nullptr;
2589}
2590
2592{
2593 for (LFGDungeonsEntry const* dungeon : sLFGDungeonsStore)
2594 if (dungeon->MapID == int32(mapId) && Difficulty(dungeon->DifficultyID) == difficulty)
2595 return dungeon;
2596
2597 return nullptr;
2598}
2599
2601{
2602 for (int32 i = sLightStore.GetNumRows(); i >= 0; --i)
2603 {
2604 LightEntry const* light = sLightStore.LookupEntry(uint32(i));
2605 if (!light)
2606 continue;
2607
2608 if (light->ContinentID == int32(mapId) && light->GameCoords.X == 0.0f && light->GameCoords.Y == 0.0f && light->GameCoords.Z == 0.0f)
2609 return uint32(i);
2610 }
2611
2612 return 0;
2613}
2614
2616{
2617 if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
2618 return 1 << liq->SoundBank;
2619
2620 return 0;
2621}
2622
2623MapDifficultyEntry const* DB2Manager::GetDefaultMapDifficulty(uint32 mapId, Difficulty* difficulty /*= nullptr*/) const
2624{
2625 auto itr = _mapDifficulties.find(mapId);
2626 if (itr == _mapDifficulties.end())
2627 return nullptr;
2628
2629 if (itr->second.empty())
2630 return nullptr;
2631
2632 for (auto& p : itr->second)
2633 {
2634 DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(p.first);
2635 if (!difficultyEntry)
2636 continue;
2637
2638 if (difficultyEntry->Flags & DIFFICULTY_FLAG_DEFAULT)
2639 {
2640 if (difficulty)
2641 *difficulty = Difficulty(p.first);
2642
2643 return p.second;
2644 }
2645 }
2646
2647 if (difficulty)
2648 *difficulty = Difficulty(itr->second.begin()->first);
2649
2650 return itr->second.begin()->second;
2651}
2652
2654{
2655 auto itr = _mapDifficulties.find(mapId);
2656 if (itr == _mapDifficulties.end())
2657 return nullptr;
2658
2659 auto diffItr = itr->second.find(difficulty);
2660 if (diffItr == itr->second.end())
2661 return nullptr;
2662
2663 return diffItr->second;
2664}
2665
2667{
2668 DifficultyEntry const* diffEntry = sDifficultyStore.LookupEntry(difficulty);
2669 if (!diffEntry)
2670 return GetDefaultMapDifficulty(mapId, &difficulty);
2671
2672 uint32 tmpDiff = difficulty;
2673 MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff));
2674 while (!mapDiff)
2675 {
2676 tmpDiff = diffEntry->FallbackDifficultyID;
2677 diffEntry = sDifficultyStore.LookupEntry(tmpDiff);
2678 if (!diffEntry)
2679 return GetDefaultMapDifficulty(mapId, &difficulty);
2680
2681 // pull new data
2682 mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // we are 10 normal or 25 normal
2683 }
2684
2685 difficulty = Difficulty(tmpDiff);
2686 return mapDiff;
2687}
2688
2690{
2691 return Trinity::Containers::MapGetValuePtr(_mapDifficultyConditions, mapDifficultyId);
2692}
2693
2695{
2696 return Trinity::Containers::MapGetValuePtr(_mountsBySpellId, spellId);
2697}
2698
2700{
2701 return sMountStore.LookupEntry(id);
2702}
2703
2705{
2706 return Trinity::Containers::MapGetValuePtr(_mountCapabilitiesByType, mountType);
2707}
2708
2710{
2711 return Trinity::Containers::MapGetValuePtr(_mountDisplays, mountId);
2712}
2713
2714std::string DB2Manager::GetNameGenEntry(uint8 race, uint8 gender) const
2715{
2716 ASSERT(gender < GENDER_NONE);
2717 auto ritr = _nameGenData.find(race);
2718 if (ritr == _nameGenData.end())
2719 return "";
2720
2721 if (ritr->second[gender].empty())
2722 return "";
2723
2724 return Trinity::Containers::SelectRandomContainerElement(ritr->second[gender])->Name;
2725}
2726
2727ResponseCodes DB2Manager::ValidateName(std::wstring const& name, LocaleConstant locale) const
2728{
2729 for (Trinity::wregex const& regex : _nameValidators[locale])
2730 if (Trinity::regex_search(name, regex))
2731 return CHAR_NAME_PROFANE;
2732
2733 // regexes at TOTAL_LOCALES are loaded from NamesReserved which is not locale specific
2734 for (Trinity::wregex const& regex : _nameValidators[TOTAL_LOCALES])
2735 if (Trinity::regex_search(name, regex))
2736 return CHAR_NAME_RESERVED;
2737
2738 return CHAR_NAME_SUCCESS;
2739}
2740
2742{
2743 NumTalentsAtLevelEntry const* numTalentsAtLevel = sNumTalentsAtLevelStore.LookupEntry(level);
2744 if (!numTalentsAtLevel)
2745 numTalentsAtLevel = sNumTalentsAtLevelStore.LookupEntry(sNumTalentsAtLevelStore.GetNumRows() - 1);
2746
2747 if (numTalentsAtLevel)
2748 {
2749 switch (playerClass)
2750 {
2751 case CLASS_DEATH_KNIGHT:
2752 return numTalentsAtLevel->NumTalentsDeathKnight;
2753 case CLASS_DEMON_HUNTER:
2754 return numTalentsAtLevel->NumTalentsDemonHunter;
2755 default:
2756 return numTalentsAtLevel->NumTalents;
2757 }
2758 }
2759
2760 return 0;
2761}
2762
2764{
2765 return Trinity::Containers::MapGetValuePtr(_paragonReputations, factionId);
2766}
2767
2769{
2770 PVPDifficultyEntry const* maxEntry = nullptr; // used for level > max listed level case
2771 for (PVPDifficultyEntry const* entry : sPVPDifficultyStore)
2772 {
2773 // skip unrelated and too-high brackets
2774 if (entry->MapID != mapid || entry->MinLevel > level)
2775 continue;
2776
2777 // exactly fit
2778 if (entry->MaxLevel >= level)
2779 return entry;
2780
2781 // remember for possible out-of-range case (search higher from existed)
2782 if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel)
2783 maxEntry = entry;
2784 }
2785
2786 return maxEntry;
2787}
2788
2790{
2791 for (PVPDifficultyEntry const* entry : sPVPDifficultyStore)
2792 if (entry->MapID == mapid && entry->GetBracketId() == id)
2793 return entry;
2794
2795 return nullptr;
2796}
2797
2799{
2801 if (_pvpTalentSlotUnlock[slot])
2802 {
2803 switch (class_)
2804 {
2805 case CLASS_DEATH_KNIGHT:
2806 return _pvpTalentSlotUnlock[slot]->DeathKnightLevelRequired;
2807 case CLASS_DEMON_HUNTER:
2808 return _pvpTalentSlotUnlock[slot]->DemonHunterLevelRequired;
2809 default:
2810 break;
2811 }
2812 return _pvpTalentSlotUnlock[slot]->LevelRequired;
2813 }
2814
2815 return 0;
2816}
2817
2819{
2820 int32 slots = 0;
2821 for (uint8 slot = 0; slot < MAX_PVP_TALENT_SLOTS; ++slot)
2822 if (level >= GetRequiredLevelForPvpTalentSlot(slot, class_))
2823 ++slots;
2824
2825 return slots;
2826}
2827
2828std::vector<QuestLineXQuestEntry const*> const* DB2Manager::GetQuestsForQuestLine(uint32 questLineId) const
2829{
2830 return Trinity::Containers::MapGetValuePtr(_questsByQuestLine, questLineId);
2831}
2832
2833std::vector<QuestPackageItemEntry const*> const* DB2Manager::GetQuestPackageItems(uint32 questPackageID) const
2834{
2835 auto itr = _questPackages.find(questPackageID);
2836 if (itr != _questPackages.end())
2837 return &itr->second.first;
2838
2839 return nullptr;
2840}
2841
2842std::vector<QuestPackageItemEntry const*> const* DB2Manager::GetQuestPackageItemsFallback(uint32 questPackageID) const
2843{
2844 auto itr = _questPackages.find(questPackageID);
2845 if (itr != _questPackages.end())
2846 return &itr->second.second;
2847
2848 return nullptr;
2849}
2850
2852{
2853 QuestV2Entry const* v2 = sQuestV2Store.LookupEntry(questId);
2854 if (!v2)
2855 return 0;
2856
2857 return v2->UniqueBitFlag;
2858}
2859
2860std::vector<uint32> const* DB2Manager::GetPhasesForGroup(uint32 group) const
2861{
2862 return Trinity::Containers::MapGetValuePtr(_phasesByGroup, group);
2863}
2864
2866{
2867 ASSERT(power < MAX_POWERS);
2868 return _powerTypes[power];
2869}
2870
2871PowerTypeEntry const* DB2Manager::GetPowerTypeByName(std::string const& name) const
2872{
2873 for (PowerTypeEntry const* powerType : sPowerTypeStore)
2874 {
2875 std::string powerName = powerType->NameGlobalStringTag;
2876 strToLower(powerName);
2877 if (powerName == name)
2878 return powerType;
2879
2880 powerName.erase(std::remove(powerName.begin(), powerName.end(), '_'), powerName.end());
2881 if (powerName == name)
2882 return powerType;
2883 }
2884
2885 return nullptr;
2886}
2887
2889{
2890 auto itr = _pvpItemBonus.find(itemId);
2891 if (itr != _pvpItemBonus.end())
2892 return itr->second;
2893
2894 return 0;
2895}
2896
2897std::vector<RewardPackXCurrencyTypeEntry const*> const* DB2Manager::GetRewardPackCurrencyTypesByRewardID(uint32 rewardPackID) const
2898{
2899 return Trinity::Containers::MapGetValuePtr(_rewardPackCurrencyTypes, rewardPackID);
2900}
2901
2902std::vector<RewardPackXItemEntry const*> const* DB2Manager::GetRewardPackItemsByRewardID(uint32 rewardPackID) const
2903{
2904 return Trinity::Containers::MapGetValuePtr(_rewardPackItems, rewardPackID);
2905}
2906
2908{
2909 return Trinity::Containers::MapGetValuePtr(_chrCustomizationChoicesForShapeshifts, { race, gender, form });
2910}
2911
2912std::vector<SkillLineEntry const*> const* DB2Manager::GetSkillLinesForParentSkill(uint32 parentSkillId) const
2913{
2914 return Trinity::Containers::MapGetValuePtr(_skillLinesByParentSkillLine, parentSkillId);
2915}
2916
2917std::vector<SkillLineAbilityEntry const*> const* DB2Manager::GetSkillLineAbilitiesBySkill(uint32 skillId) const
2918{
2919 return Trinity::Containers::MapGetValuePtr(_skillLineAbilitiesBySkillupSkill, skillId);
2920}
2921
2923{
2924 for (auto&& [_, skllRaceClassInfo] : Trinity::Containers::MapEqualRange(_skillRaceClassInfoBySkill, skill))
2925 {
2926 if (!skllRaceClassInfo->RaceMask.IsEmpty() && !(skllRaceClassInfo->RaceMask.HasRace(race)))
2927 continue;
2928 if (skllRaceClassInfo->ClassMask && !(skllRaceClassInfo->ClassMask & (1 << (class_ - 1))))
2929 continue;
2930
2931 return skllRaceClassInfo;
2932 }
2933
2934 return nullptr;
2935}
2936
2937std::vector<SkillRaceClassInfoEntry const*> DB2Manager::GetSkillRaceClassInfo(uint32 skill) const
2938{
2939 std::vector<SkillRaceClassInfoEntry const*> result;
2940 for (auto const& [_, skillRaceClassInfo] : Trinity::Containers::MapEqualRange(_skillRaceClassInfoBySkill, skill))
2941 result.push_back(skillRaceClassInfo);
2942
2943 return result;
2944}
2945
2947{
2948 return Trinity::Containers::MapGetValuePtr(_soulbindConduitRanks, { soulbindConduitId, rank });
2949}
2950
2951std::vector<SpecializationSpellsEntry const*> const* DB2Manager::GetSpecializationSpells(uint32 specId) const
2952{
2953 return Trinity::Containers::MapGetValuePtr(_specializationSpellsBySpec, specId);
2954}
2955
2956bool DB2Manager::IsSpecSetMember(int32 specSetId, uint32 specId) const
2957{
2958 return _specsBySpecSet.count(std::make_pair(specSetId, specId)) > 0;
2959}
2960
2962{
2963 return _spellFamilyNames.count(family) > 0;
2964}
2965
2966std::vector<SpellProcsPerMinuteModEntry const*> DB2Manager::GetSpellProcsPerMinuteMods(uint32 spellprocsPerMinuteId) const
2967{
2968 auto itr = _spellProcsPerMinuteMods.find(spellprocsPerMinuteId);
2969 if (itr != _spellProcsPerMinuteMods.end())
2970 return itr->second;
2971
2972 return std::vector<SpellProcsPerMinuteModEntry const*>();
2973}
2974
2975std::vector<SpellVisualMissileEntry const*> const* DB2Manager::GetSpellVisualMissiles(int32 spellVisualMissileSetId) const
2976{
2977 return Trinity::Containers::MapGetValuePtr(_spellVisualMissilesBySet, spellVisualMissileSetId);
2978}
2979
2980std::vector<TalentEntry const*> const& DB2Manager::GetTalentsByPosition(uint32 class_, uint32 tier, uint32 column) const
2981{
2982 return _talentsByPosition[class_][tier][column];
2983}
2984
2986{
2987 return Trinity::Containers::MapGetValuePtr(_taxiPaths, { from, to });
2988}
2989
2990bool DB2Manager::IsTotemCategoryCompatibleWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId, bool requireAllTotems /*= true*/)
2991{
2992 if (requiredTotemCategoryId == 0)
2993 return true;
2994 if (itemTotemCategoryId == 0)
2995 return false;
2996
2997 TotemCategoryEntry const* itemEntry = sTotemCategoryStore.LookupEntry(itemTotemCategoryId);
2998 if (!itemEntry)
2999 return false;
3000 TotemCategoryEntry const* reqEntry = sTotemCategoryStore.LookupEntry(requiredTotemCategoryId);
3001 if (!reqEntry)
3002 return false;
3003
3004 if (itemEntry->TotemCategoryType != reqEntry->TotemCategoryType)
3005 return false;
3006
3007 int32 sharedMask = itemEntry->TotemCategoryMask & reqEntry->TotemCategoryMask;
3008 return requireAllTotems ? sharedMask == reqEntry->TotemCategoryMask : sharedMask != 0;
3009}
3010
3012{
3013 return _toys.count(toy) > 0;
3014}
3015
3017{
3018 return Trinity::Containers::MapGetValuePtr(_transmogIllusionsByEnchantmentId, spellItemEnchantmentId);
3019}
3020
3021std::vector<TransmogSetEntry const*> const* DB2Manager::GetTransmogSetsForItemModifiedAppearance(uint32 itemModifiedAppearanceId) const
3022{
3023 return Trinity::Containers::MapGetValuePtr(_transmogSetsByItemModifiedAppearance, itemModifiedAppearanceId);
3024}
3025
3026std::vector<TransmogSetItemEntry const*> const* DB2Manager::GetTransmogSetItems(uint32 transmogSetId) const
3027{
3028 return Trinity::Containers::MapGetValuePtr(_transmogSetItemsByTransmogSet, transmogSetId);
3029}
3030
3032{
3034 // distances if inside
3035 struct
3036 {
3037 float DistanceToRegionCenterSquared = std::numeric_limits<float>::max();
3038 float DistanceToRegionBottom = std::numeric_limits<float>::max();
3040
3041 // distances if outside
3042 struct
3043 {
3044 float DistanceToRegionEdgeSquared = std::numeric_limits<float>::max();
3045 float DistanceToRegionTop = std::numeric_limits<float>::max();
3046 float DistanceToRegionBottom = std::numeric_limits<float>::max();
3048
3052
3053 bool IsInside() const
3054 {
3055 return Outside.DistanceToRegionEdgeSquared < std::numeric_limits<float>::epsilon() &&
3056 std::abs(Outside.DistanceToRegionTop) < std::numeric_limits<float>::epsilon() &&
3057 std::abs(Outside.DistanceToRegionBottom) < std::numeric_limits<float>::epsilon();
3058 }
3059};
3060
3061static bool operator<(UiMapAssignmentStatus const& left, UiMapAssignmentStatus const& right)
3062{
3063 bool leftInside = left.IsInside();
3064 bool rightInside = right.IsInside();
3065 if (leftInside != rightInside)
3066 return leftInside;
3067
3068 if (left.UiMapAssignment && right.UiMapAssignment &&
3072
3073 if (left.WmoPriority != right.WmoPriority)
3074 return left.WmoPriority < right.WmoPriority;
3075
3076 if (left.AreaPriority != right.AreaPriority)
3077 return left.AreaPriority < right.AreaPriority;
3078
3079 if (left.MapPriority != right.MapPriority)
3080 return left.MapPriority < right.MapPriority;
3081
3082 if (leftInside)
3083 {
3086
3087 float leftUiSizeX = left.UiMapAssignment ? (left.UiMapAssignment->UiMax.X - left.UiMapAssignment->UiMin.X) : 0.0f;
3088 float rightUiSizeX = right.UiMapAssignment ? (right.UiMapAssignment->UiMax.X - right.UiMapAssignment->UiMin.X) : 0.0f;
3089
3090 if (leftUiSizeX > std::numeric_limits<float>::epsilon() && rightUiSizeX > std::numeric_limits<float>::epsilon())
3091 {
3092 float leftScale = (left.UiMapAssignment->Region[1].X - left.UiMapAssignment->Region[0].X) / leftUiSizeX;
3093 float rightScale = (right.UiMapAssignment->Region[1].X - right.UiMapAssignment->Region[0].X) / rightUiSizeX;
3094 if (leftScale != rightScale)
3095 return leftScale < rightScale;
3096 }
3097
3100 }
3101 else
3102 {
3105
3108
3111 }
3112
3113 return true;
3114}
3115
3116static bool CheckUiMapAssignmentStatus(float x, float y, float z, int32 mapId, int32 areaId, int32 wmoDoodadPlacementId, int32 wmoGroupId,
3117 UiMapAssignmentEntry const* uiMapAssignment, UiMapAssignmentStatus* status)
3118{
3119 status->UiMapAssignment = uiMapAssignment;
3120 // x,y not in region
3121 if (x < uiMapAssignment->Region[0].X || x > uiMapAssignment->Region[1].X || y < uiMapAssignment->Region[0].Y || y > uiMapAssignment->Region[1].Y)
3122 {
3123 float xDiff, yDiff;
3124 if (x >= uiMapAssignment->Region[0].X)
3125 {
3126 xDiff = 0.0f;
3127 if (x > uiMapAssignment->Region[1].X)
3128 xDiff = x - uiMapAssignment->Region[0].X;
3129 }
3130 else
3131 xDiff = uiMapAssignment->Region[0].X - x;
3132
3133 if (y >= uiMapAssignment->Region[0].Y)
3134 {
3135 yDiff = 0.0f;
3136 if (y > uiMapAssignment->Region[1].Y)
3137 yDiff = y - uiMapAssignment->Region[0].Y;
3138 }
3139 else
3140 yDiff = uiMapAssignment->Region[0].Y - y;
3141
3142 status->Outside.DistanceToRegionEdgeSquared = xDiff * xDiff + yDiff * yDiff;
3143 }
3144 else
3145 {
3147 (x - (uiMapAssignment->Region[0].X + uiMapAssignment->Region[1].X) * 0.5f) * (x - (uiMapAssignment->Region[0].X + uiMapAssignment->Region[1].X) * 0.5f)
3148 + (y - (uiMapAssignment->Region[0].Y + uiMapAssignment->Region[1].Y) * 0.5f) * (y - (uiMapAssignment->Region[0].Y + uiMapAssignment->Region[1].Y) * 0.5f);
3149 status->Outside.DistanceToRegionEdgeSquared = 0.0f;
3150 }
3151
3152 // z not in region
3153 if (z < uiMapAssignment->Region[0].Z || z > uiMapAssignment->Region[1].Z)
3154 {
3155 if (z < uiMapAssignment->Region[1].Z)
3156 {
3157 if (z < uiMapAssignment->Region[0].Z)
3158 status->Outside.DistanceToRegionBottom = std::min(uiMapAssignment->Region[0].Z - z, 10000.0f);
3159 }
3160 else
3161 status->Outside.DistanceToRegionTop = std::min(z - uiMapAssignment->Region[1].Z, 10000.0f);
3162 }
3163 else
3164 {
3165 status->Outside.DistanceToRegionTop = 0.0f;
3166 status->Outside.DistanceToRegionBottom = 0.0f;
3167 status->Inside.DistanceToRegionBottom = std::min(uiMapAssignment->Region[0].Z - z, 10000.0f);
3168 }
3169
3170 if (areaId && uiMapAssignment->AreaID)
3171 {
3172 int8 areaPriority = 0;
3173 while (areaId != uiMapAssignment->AreaID)
3174 {
3175 if (AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(areaId))
3176 {
3177 areaId = areaEntry->ParentAreaID;
3178 ++areaPriority;
3179 }
3180 else
3181 return false;
3182 }
3183
3184 status->AreaPriority = areaPriority;
3185 }
3186
3187 if (mapId >= 0 && uiMapAssignment->MapID >= 0)
3188 {
3189 if (mapId != uiMapAssignment->MapID)
3190 {
3191 if (MapEntry const* mapEntry = sMapStore.LookupEntry(mapId))
3192 {
3193 if (mapEntry->ParentMapID == uiMapAssignment->MapID)
3194 status->MapPriority = 1;
3195 else if (mapEntry->CosmeticParentMapID == uiMapAssignment->MapID)
3196 status->MapPriority = 2;
3197 else
3198 return false;
3199 }
3200 else
3201 return false;
3202 }
3203 else
3204 status->MapPriority = 0;
3205 }
3206
3207 if (wmoGroupId || wmoDoodadPlacementId)
3208 {
3209 if (uiMapAssignment->WmoGroupID || uiMapAssignment->WmoDoodadPlacementID)
3210 {
3211 bool hasDoodadPlacement = false;
3212 if (wmoDoodadPlacementId && uiMapAssignment->WmoDoodadPlacementID)
3213 {
3214 if (wmoDoodadPlacementId != uiMapAssignment->WmoDoodadPlacementID)
3215 return false;
3216
3217 hasDoodadPlacement = true;
3218 }
3219
3220 if (wmoGroupId && uiMapAssignment->WmoGroupID)
3221 {
3222 if (wmoGroupId != uiMapAssignment->WmoGroupID)
3223 return false;
3224
3225 if (hasDoodadPlacement)
3226 status->WmoPriority = 0;
3227 else
3228 status->WmoPriority = 2;
3229 }
3230 else if (hasDoodadPlacement)
3231 status->WmoPriority = 1;
3232 }
3233 }
3234
3235 return true;
3236}
3237
3238static UiMapAssignmentEntry const* FindNearestMapAssignment(float x, float y, float z, int32 mapId, int32 areaId, int32 wmoDoodadPlacementId, int32 wmoGroupId, UiMapSystem system)
3239{
3240 UiMapAssignmentStatus nearestMapAssignment;
3241 auto iterateUiMapAssignments = [&](std::unordered_multimap<int32, UiMapAssignmentEntry const*> const& assignments, int32 id)
3242 {
3243 for (auto assignment : Trinity::Containers::MapEqualRange(assignments, id))
3244 {
3245 UiMapAssignmentStatus status;
3246 if (CheckUiMapAssignmentStatus(x, y, z, mapId, areaId, wmoDoodadPlacementId, wmoGroupId, assignment.second, &status))
3247 if (status < nearestMapAssignment)
3248 nearestMapAssignment = status;
3249 }
3250 };
3251
3252 iterateUiMapAssignments(_uiMapAssignmentByWmoGroup[system], wmoGroupId);
3253 iterateUiMapAssignments(_uiMapAssignmentByWmoDoodadPlacement[system], wmoDoodadPlacementId);
3254
3255 AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(areaId);
3256 while (areaEntry)
3257 {
3258 iterateUiMapAssignments(_uiMapAssignmentByArea[system], areaEntry->ID);
3259 areaEntry = sAreaTableStore.LookupEntry(areaEntry->ParentAreaID);
3260 }
3261
3262 if (MapEntry const* mapEntry = sMapStore.LookupEntry(mapId))
3263 {
3264 iterateUiMapAssignments(_uiMapAssignmentByMap[system], mapEntry->ID);
3265 if (mapEntry->ParentMapID >= 0)
3266 iterateUiMapAssignments(_uiMapAssignmentByMap[system], mapEntry->ParentMapID);
3267 if (mapEntry->CosmeticParentMapID >= 0)
3268 iterateUiMapAssignments(_uiMapAssignmentByMap[system], mapEntry->CosmeticParentMapID);
3269 }
3270
3271 return nearestMapAssignment.UiMapAssignment;
3272}
3273
3275{
3276 UiMapEntry const* uiMap = sUiMapStore.LookupEntry(uiMapID);
3277 while (uiMap)
3278 {
3279 if (uiMap->Type <= UI_MAP_TYPE_CONTINENT)
3280 break;
3281
3282 UiMapBounds const* bounds = Trinity::Containers::MapGetValuePtr(_uiMapBounds, uiMap->ID);
3283 if (!bounds || !bounds->IsUiAssignment)
3284 break;
3285
3286 uiPosition.X = ((1.0 - uiPosition.X) * bounds->Bounds[1]) + (bounds->Bounds[3] * uiPosition.X);
3287 uiPosition.Y = ((1.0 - uiPosition.Y) * bounds->Bounds[0]) + (bounds->Bounds[2] * uiPosition.Y);
3288
3289 uiMap = sUiMapStore.LookupEntry(uiMap->ParentUiMapID);
3290 }
3291
3292 return uiPosition;
3293}
3294
3295bool DB2Manager::GetUiMapPosition(float x, float y, float z, int32 mapId, int32 areaId, int32 wmoDoodadPlacementId, int32 wmoGroupId, UiMapSystem system, bool local,
3296 int32* uiMapId /*= nullptr*/, DBCPosition2D* newPos /*= nullptr*/)
3297{
3298 if (uiMapId)
3299 *uiMapId = -1;
3300
3301 if (newPos)
3302 {
3303 newPos->X = 0.0f;
3304 newPos->Y = 0.0f;
3305 }
3306
3307 UiMapAssignmentEntry const* uiMapAssignment = FindNearestMapAssignment(x, y, z, mapId, areaId, wmoDoodadPlacementId, wmoGroupId, system);
3308 if (!uiMapAssignment)
3309 return false;
3310
3311 if (uiMapId)
3312 *uiMapId = uiMapAssignment->UiMapID;
3313
3314 DBCPosition2D relativePosition{ 0.5f, 0.5f };
3315 DBCPosition2D regionSize{ uiMapAssignment->Region[1].X - uiMapAssignment->Region[0].X, uiMapAssignment->Region[1].Y - uiMapAssignment->Region[0].Y };
3316 if (regionSize.X > 0.0f)
3317 relativePosition.X = (x - uiMapAssignment->Region[0].X) / regionSize.X;
3318 if (regionSize.Y > 0.0f)
3319 relativePosition.Y = (y - uiMapAssignment->Region[0].Y) / regionSize.Y;
3320
3321 DBCPosition2D uiPosition
3322 {
3323 // x and y are swapped
3324 ((1.0f - (1.0f - relativePosition.Y)) * uiMapAssignment->UiMin.X) + ((1.0f - relativePosition.Y) * uiMapAssignment->UiMax.X),
3325 ((1.0f - (1.0f - relativePosition.X)) * uiMapAssignment->UiMin.Y) + ((1.0f - relativePosition.X) * uiMapAssignment->UiMax.Y)
3326 };
3327
3328 if (!local)
3329 uiPosition = CalculateGlobalUiMapPosition(uiMapAssignment->UiMapID, uiPosition);
3330
3331 if (newPos)
3332 *newPos = uiPosition;
3333
3334 return true;
3335}
3336
3337bool DB2Manager::Zone2MapCoordinates(uint32 areaId, float& x, float& y) const
3338{
3339 AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(areaId);
3340 if (!areaEntry)
3341 return false;
3342
3343 for (auto assignment : Trinity::Containers::MapEqualRange(_uiMapAssignmentByArea[UI_MAP_SYSTEM_WORLD], areaId))
3344 {
3345 if (assignment.second->MapID >= 0 && assignment.second->MapID != areaEntry->ContinentID)
3346 continue;
3347
3348 float tmpY = (y - assignment.second->UiMax.Y) / (assignment.second->UiMin.Y - assignment.second->UiMax.Y);
3349 float tmpX = (x - assignment.second->UiMax.X) / (assignment.second->UiMin.X - assignment.second->UiMax.X);
3350 x = assignment.second->Region[0].X + tmpY * (assignment.second->Region[1].X - assignment.second->Region[0].X);
3351 y = assignment.second->Region[0].Y + tmpX * (assignment.second->Region[1].Y - assignment.second->Region[0].Y);
3352
3353 return true;
3354 }
3355
3356 return false;
3357}
3358
3359void DB2Manager::Map2ZoneCoordinates(uint32 areaId, float& x, float& y) const
3360{
3361 DBCPosition2D zoneCoords;
3362 if (!GetUiMapPosition(x, y, 0.0f, -1, areaId, 0, 0, UI_MAP_SYSTEM_WORLD, true, nullptr, &zoneCoords))
3363 return;
3364
3365 x = zoneCoords.Y * 100.0f;
3366 y = zoneCoords.X * 100.0f;
3367}
3368
3370{
3371 return _uiMapPhases.find(phaseId) != _uiMapPhases.end();
3372}
3373
3375{
3376 return Trinity::Containers::MapGetValuePtr(_wmoAreaTableLookup, WMOAreaTableKey(int16(rootId), int8(adtId), groupId));
3377}
3378
3379std::unordered_set<uint32> const* DB2Manager::GetPVPStatIDsForMap(uint32 mapId) const
3380{
3381 return Trinity::Containers::MapGetValuePtr(_pvpStatIdsByMap, mapId);
3382}
3383
3384bool ChrClassesXPowerTypesEntryComparator::Compare(ChrClassesXPowerTypesEntry const* left, ChrClassesXPowerTypesEntry const* right)
3385{
3386 if (left->ClassID != right->ClassID)
3387 return left->ClassID < right->ClassID;
3388 return left->PowerType < right->PowerType;
3389}
3390
3392{
3393 if (sTaxiNodesStore.GetNumRows())
3394 {
3395 _data.resize(((sTaxiNodesStore.GetNumRows() - 1) / (sizeof(value_type) * 64) + 1) * 8, 0);
3396 ASSERT((_data.size() % 8) == 0, "TaxiMask size must be aligned to a multiple of uint64");
3397 }
3398}
3399
3400bool DB2Manager::FriendshipRepReactionEntryComparator::Compare(FriendshipRepReactionEntry const* left, FriendshipRepReactionEntry const* right)
3401{
3402 return left->ReactionThreshold < right->ReactionThreshold;
3403}
3404
3405bool DB2Manager::MountTypeXCapabilityEntryComparator::Compare(MountTypeXCapabilityEntry const* left, MountTypeXCapabilityEntry const* right)
3406{
3407 if (left->MountTypeID == right->MountTypeID)
3408 return left->OrderIndex < right->OrderIndex;
3409 return left->MountTypeID < right->MountTypeID;
3410}
char const * localeNames[TOTAL_LOCALES]
Definition: Common.cpp:20
LocaleConstant GetLocaleByName(std::string_view name)
Definition: Common.cpp:36
CascLocaleBit WowLocaleToCascLocaleBit[TOTAL_LOCALES]
Definition: Common.cpp:45
LocaleConstant
Definition: Common.h:48
@ LOCALE_none
Definition: Common.h:58
@ TOTAL_LOCALES
Definition: Common.h:62
@ LOCALE_enUS
Definition: Common.h:49
@ LOCALE_koKR
Definition: Common.h:50
constexpr bool IsValidLocale(LocaleConstant locale)
Definition: Common.h:95
CascLocaleBit
Definition: Common.h:69
#define DEFAULT_LOCALE
Definition: Common.h:66
#define M_PI
Definition: Common.h:115
DB2Storage< UISplashScreenEntry > sUISplashScreenStore("UISplashScreen.db2", &UiSplashScreenLoadInfo::Instance)
DB2Storage< LightEntry > sLightStore("Light.db2", &LightLoadInfo::Instance)
DB2Storage< AzeritePowerSetMemberEntry > sAzeritePowerSetMemberStore("AzeritePowerSetMember.db2", &AzeritePowerSetMemberLoadInfo::Instance)
DB2Storage< QuestFactionRewardEntry > sQuestFactionRewardStore("QuestFactionReward.db2", &QuestFactionRewardLoadInfo::Instance)
DB2Storage< PhaseEntry > sPhaseStore("Phase.db2", &PhaseLoadInfo::Instance)
DB2Storage< ArtifactAppearanceEntry > sArtifactAppearanceStore("ArtifactAppearance.db2", &ArtifactAppearanceLoadInfo::Instance)
DB2Storage< BankBagSlotPricesEntry > sBankBagSlotPricesStore("BankBagSlotPrices.db2", &BankBagSlotPricesLoadInfo::Instance)
DB2Storage< SkillRaceClassInfoEntry > sSkillRaceClassInfoStore("SkillRaceClassInfo.db2", &SkillRaceClassInfoLoadInfo::Instance)
DB2Storage< ItemNameDescriptionEntry > sItemNameDescriptionStore("ItemNameDescription.db2", &ItemNameDescriptionLoadInfo::Instance)
DB2Storage< ChrRaceXChrModelEntry > sChrRaceXChrModelStore("ChrRaceXChrModel.db2", &ChrRaceXChrModelLoadInfo::Instance)
DB2Storage< ItemLimitCategoryEntry > sItemLimitCategoryStore("ItemLimitCategory.db2", &ItemLimitCategoryLoadInfo::Instance)
DB2Storage< DifficultyEntry > sDifficultyStore("Difficulty.db2", &DifficultyLoadInfo::Instance)
DB2Storage< WorldMapOverlayEntry > sWorldMapOverlayStore("WorldMapOverlay.db2", &WorldMapOverlayLoadInfo::Instance)
ChrSpecializationEntry const * ChrSpecializationByIndexContainer[MAX_CLASSES+1][MAX_SPECIALIZATIONS]
Definition: DB2Stores.cpp:392
DB2Storage< ItemModifiedAppearanceExtraEntry > sItemModifiedAppearanceExtraStore("ItemModifiedAppearanceExtra.db2", &ItemModifiedAppearanceExtraLoadInfo::Instance)
DB2Storage< ItemDamageTwoHandCasterEntry > sItemDamageTwoHandCasterStore("ItemDamageTwoHandCaster.db2", &ItemDamageTwoHandCasterLoadInfo::Instance)
DB2Storage< ItemLevelSelectorEntry > sItemLevelSelectorStore("ItemLevelSelector.db2", &ItemLevelSelectorLoadInfo::Instance)
DB2Storage< NamesReservedEntry > sNamesReservedStore("NamesReserved.db2", &NamesReservedLoadInfo::Instance)
DB2Storage< GameObjectDisplayInfoEntry > sGameObjectDisplayInfoStore("GameObjectDisplayInfo.db2", &GameobjectDisplayInfoLoadInfo::Instance)
DB2Storage< SceneScriptEntry > sSceneScriptStore("SceneScript.db2", &SceneScriptLoadInfo::Instance)
DB2Storage< CharacterLoadoutEntry > sCharacterLoadoutStore("CharacterLoadout.db2", &CharacterLoadoutLoadInfo::Instance)
DB2Storage< SpellVisualEntry > sSpellVisualStore("SpellVisual.db2", &SpellVisualLoadInfo::Instance)
DB2Storage< PVPItemEntry > sPVPItemStore("PVPItem.db2", &PvpItemLoadInfo::Instance)
DB2Storage< ItemEntry > sItemStore("Item.db2", &ItemLoadInfo::Instance)
DB2Storage< Achievement_CategoryEntry > sAchievementCategoryStore("Achievement_Category.db2", &AchievementCategoryLoadInfo::Instance)
DB2Storage< ItemSearchNameEntry > sItemSearchNameStore("ItemSearchName.db2", &ItemSearchNameLoadInfo::Instance)
DB2Storage< PhaseXPhaseGroupEntry > sPhaseXPhaseGroupStore("PhaseXPhaseGroup.db2", &PhaseXPhaseGroupLoadInfo::Instance)
std::unordered_map< uint32, std::unordered_map< uint32, MapDifficultyEntry const * > > MapDifficultyContainer
Definition: DB2Stores.cpp:405
DB2Storage< BattlemasterListEntry > sBattlemasterListStore("BattlemasterList.db2", &BattlemasterListLoadInfo::Instance)
TaxiMask sAllianceTaxiNodesMask
Definition: DB2Stores.cpp:382
std::unordered_map< uint32, std::vector< DBCPosition2D > > CurvePointsContainer
Definition: DB2Stores.cpp:393
DB2Storage< AzeriteEssencePowerEntry > sAzeriteEssencePowerStore("AzeriteEssencePower.db2", &AzeriteEssencePowerLoadInfo::Instance)
DB2Storage< SpellInterruptsEntry > sSpellInterruptsStore("SpellInterrupts.db2", &SpellInterruptsLoadInfo::Instance)
DB2Storage< TraitCurrencySourceEntry > sTraitCurrencySourceStore("TraitCurrencySource.db2", &TraitCurrencySourceLoadInfo::Instance)
DB2Storage< SkillLineEntry > sSkillLineStore("SkillLine.db2", &SkillLineLoadInfo::Instance)
DB2Storage< TraitTreeXTraitCostEntry > sTraitTreeXTraitCostStore("TraitTreeXTraitCost.db2", &TraitTreeXTraitCostLoadInfo::Instance)
DB2Storage< OverrideSpellDataEntry > sOverrideSpellDataStore("OverrideSpellData.db2", &OverrideSpellDataLoadInfo::Instance)
DB2Storage< AnimationDataEntry > sAnimationDataStore("AnimationData.db2", &AnimationDataLoadInfo::Instance)
DB2Storage< FriendshipReputationEntry > sFriendshipReputationStore("FriendshipReputation.db2", &FriendshipReputationLoadInfo::Instance)
DB2Storage< BattlePetBreedQualityEntry > sBattlePetBreedQualityStore("BattlePetBreedQuality.db2", &BattlePetBreedQualityLoadInfo::Instance)
DB2Storage< EmotesTextEntry > sEmotesTextStore("EmotesText.db2", &EmotesTextLoadInfo::Instance)
DB2Storage< ArtifactEntry > sArtifactStore("Artifact.db2", &ArtifactLoadInfo::Instance)
DB2Storage< ArtifactPowerPickerEntry > sArtifactPowerPickerStore("ArtifactPowerPicker.db2", &ArtifactPowerPickerLoadInfo::Instance)
DB2Storage< TraitNodeGroupXTraitCondEntry > sTraitNodeGroupXTraitCondStore("TraitNodeGroupXTraitCond.db2", &TraitNodeGroupXTraitCondLoadInfo::Instance)
std::unordered_map< uint32, HeirloomEntry const * > HeirloomItemsContainer
Definition: DB2Stores.cpp:396
DB2Storage< ArtifactQuestXPEntry > sArtifactQuestXPStore("ArtifactQuestXP.db2", &ArtifactQuestXpLoadInfo::Instance)
DB2Storage< JournalEncounterSectionEntry > sJournalEncounterSectionStore("JournalEncounterSection.db2", &JournalEncounterSectionLoadInfo::Instance)
DB2Storage< BattlePetBreedStateEntry > sBattlePetBreedStateStore("BattlePetBreedState.db2", &BattlePetBreedStateLoadInfo::Instance)
DB2Storage< PVPStatEntry > sPVPStatStore("PVPStat.db2", &PvpStatLoadInfo::Instance)
std::unordered_map< uint32, ItemChildEquipmentEntry const * > ItemChildEquipmentContainer
Definition: DB2Stores.cpp:399
DB2Storage< PvpTalentCategoryEntry > sPvpTalentCategoryStore("PvpTalentCategory.db2", &PvpTalentCategoryLoadInfo::Instance)
DB2Storage< ItemBonusTreeEntry > sItemBonusTreeStore("ItemBonusTree.db2", &ItemBonusTreeLoadInfo::Instance)
DB2Storage< RandPropPointsEntry > sRandPropPointsStore("RandPropPoints.db2", &RandPropPointsLoadInfo::Instance)
DB2Storage< ItemBagFamilyEntry > sItemBagFamilyStore("ItemBagFamily.db2", &ItemBagFamilyLoadInfo::Instance)
DB2Storage< GameObjectsEntry > sGameObjectsStore("GameObjects.db2", &GameobjectsLoadInfo::Instance)
DB2Storage< SpellAuraOptionsEntry > sSpellAuraOptionsStore("SpellAuraOptions.db2", &SpellAuraOptionsLoadInfo::Instance)
std::unordered_map< uint32, std::unordered_map< uint32, std::vector< SpellPowerEntry const * > > > SpellPowerDifficultyContainer
Definition: DB2Stores.cpp:416
DB2Storage< TraitNodeGroupXTraitNodeEntry > sTraitNodeGroupXTraitNodeStore("TraitNodeGroupXTraitNode.db2", &TraitNodeGroupXTraitNodeLoadInfo::Instance)
DB2Storage< SpellCategoryEntry > sSpellCategoryStore("SpellCategory.db2", &SpellCategoryLoadInfo::Instance)
DB2Storage< AchievementEntry > sAchievementStore("Achievement.db2", &AchievementLoadInfo::Instance)
DB2Storage< ImportPriceWeaponEntry > sImportPriceWeaponStore("ImportPriceWeapon.db2", &ImportPriceWeaponLoadInfo::Instance)
DB2Storage< FriendshipRepReactionEntry > sFriendshipRepReactionStore("FriendshipRepReaction.db2", &FriendshipRepReactionLoadInfo::Instance)
DB2Storage< GarrMissionEntry > sGarrMissionStore("GarrMission.db2", &GarrMissionLoadInfo::Instance)
std::array< ItemClassEntry const *, 20 > ItemClassByOldEnumContainer
Definition: DB2Stores.cpp:400
DB2Storage< SpellNameEntry > sSpellNameStore("SpellName.db2", &SpellNameLoadInfo::Instance)
DB2Storage< CurveEntry > sCurveStore("Curve.db2", &CurveLoadInfo::Instance)
DB2Storage< PvpSeasonEntry > sPvpSeasonStore("PvpSeason.db2", &PvpSeasonLoadInfo::Instance)
DB2Storage< MapEntry > sMapStore("Map.db2", &MapLoadInfo::Instance)
DB2Storage< TraitNodeEntry > sTraitNodeStore("TraitNode.db2", &TraitNodeLoadInfo::Instance)
DB2Storage< TaxiNodesEntry > sTaxiNodesStore("TaxiNodes.db2", &TaxiNodesLoadInfo::Instance)
std::unordered_map< uint32, ItemModifiedAppearanceEntry const * > ItemModifiedAppearanceByItemContainer
Definition: DB2Stores.cpp:402
DB2Storage< CreatureModelDataEntry > sCreatureModelDataStore("CreatureModelData.db2", &CreatureModelDataLoadInfo::Instance)
DB2Storage< LiquidTypeEntry > sLiquidTypeStore("LiquidType.db2", &LiquidTypeLoadInfo::Instance)
DB2Storage< ConditionalChrModelEntry > sConditionalChrModelStore("ConditionalChrModel.db2", &ConditionalChrModelLoadInfo::Instance)
DB2Storage< CreatureFamilyEntry > sCreatureFamilyStore("CreatureFamily.db2", &CreatureFamilyLoadInfo::Instance)
std::map< uint32, DB2StorageBase * > StorageMap
Definition: DB2Stores.cpp:387
DB2Storage< CurvePointEntry > sCurvePointStore("CurvePoint.db2", &CurvePointLoadInfo::Instance)
DB2Storage< SpellXSpellVisualEntry > sSpellXSpellVisualStore("SpellXSpellVisual.db2", &SpellXSpellVisualLoadInfo::Instance)
DB2Storage< CharacterLoadoutItemEntry > sCharacterLoadoutItemStore("CharacterLoadoutItem.db2", &CharacterLoadoutItemLoadInfo::Instance)
DB2Storage< AnimKitEntry > sAnimKitStore("AnimKit.db2", &AnimKitLoadInfo::Instance)
DB2Storage< MapDifficultyEntry > sMapDifficultyStore("MapDifficulty.db2", &MapDifficultyLoadInfo::Instance)
DB2Storage< SpellEquippedItemsEntry > sSpellEquippedItemsStore("SpellEquippedItems.db2", &SpellEquippedItemsLoadInfo::Instance)
DB2Storage< ItemBonusEntry > sItemBonusStore("ItemBonus.db2", &ItemBonusLoadInfo::Instance)
DB2Storage< UiMapLinkEntry > sUiMapLinkStore("UiMapLink.db2", &UiMapLinkLoadInfo::Instance)
static UiMapAssignmentEntry const * FindNearestMapAssignment(float x, float y, float z, int32 mapId, int32 areaId, int32 wmoDoodadPlacementId, int32 wmoGroupId, UiMapSystem system)
Definition: DB2Stores.cpp:3238
static bool CheckUiMapAssignmentStatus(float x, float y, float z, int32 mapId, int32 areaId, int32 wmoDoodadPlacementId, int32 wmoGroupId, UiMapAssignmentEntry const *uiMapAssignment, UiMapAssignmentStatus *status)
Definition: DB2Stores.cpp:3116
DB2Storage< UnitPowerBarEntry > sUnitPowerBarStore("UnitPowerBar.db2", &UnitPowerBarLoadInfo::Instance)
TaxiMask sTaxiNodesMask
Definition: DB2Stores.cpp:379
DB2Storage< SpellReagentsEntry > sSpellReagentsStore("SpellReagents.db2", &SpellReagentsLoadInfo::Instance)
DB2Storage< LanguageWordsEntry > sLanguageWordsStore("LanguageWords.db2", &LanguageWordsLoadInfo::Instance)
DB2Storage< SkillLineXTraitTreeEntry > sSkillLineXTraitTreeStore("SkillLineXTraitTree.db2", &SkillLineXTraitTreeLoadInfo::Instance)
std::unordered_map< uint32, std::vector< uint32 > > ArtifactPowerLinksContainer
Definition: DB2Stores.cpp:390
DB2Storage< TraitCostEntry > sTraitCostStore("TraitCost.db2", &TraitCostLoadInfo::Instance)
DB2Storage< ArtifactCategoryEntry > sArtifactCategoryStore("ArtifactCategory.db2", &ArtifactCategoryLoadInfo::Instance)
DB2Storage< ServerMessagesEntry > sServerMessagesStore("ServerMessages.db2", &ServerMessagesLoadInfo::Instance)
DB2Storage< ItemChildEquipmentEntry > sItemChildEquipmentStore("ItemChildEquipment.db2", &ItemChildEquipmentLoadInfo::Instance)
DB2Storage< SpecSetMemberEntry > sSpecSetMemberStore("SpecSetMember.db2", &SpecSetMemberLoadInfo::Instance)
DB2Storage< GarrBuildingPlotInstEntry > sGarrBuildingPlotInstStore("GarrBuildingPlotInst.db2", &GarrBuildingPlotInstLoadInfo::Instance)
DB2Storage< ItemBonusTreeNodeEntry > sItemBonusTreeNodeStore("ItemBonusTreeNode.db2", &ItemBonusTreeNodeLoadInfo::Instance)
DB2Storage< ChrCustomizationOptionEntry > sChrCustomizationOptionStore("ChrCustomizationOption.db2", &ChrCustomizationOptionLoadInfo::Instance)
DB2Storage< ItemSpecOverrideEntry > sItemSpecOverrideStore("ItemSpecOverride.db2", &ItemSpecOverrideLoadInfo::Instance)
DB2Storage< CreatureTypeEntry > sCreatureTypeStore("CreatureType.db2", &CreatureTypeLoadInfo::Instance)
DB2Storage< DurabilityQualityEntry > sDurabilityQualityStore("DurabilityQuality.db2", &DurabilityQualityLoadInfo::Instance)
DB2Storage< ChrCustomizationElementEntry > sChrCustomizationElementStore("ChrCustomizationElement.db2", &ChrCustomizationElementLoadInfo::Instance)
DB2Storage< SpellPowerDifficultyEntry > sSpellPowerDifficultyStore("SpellPowerDifficulty.db2", &SpellPowerDifficultyLoadInfo::Instance)
DB2Storage< ArtifactPowerEntry > sArtifactPowerStore("ArtifactPower.db2", &ArtifactPowerLoadInfo::Instance)
DB2Storage< TraitTreeLoadoutEntry > sTraitTreeLoadoutStore("TraitTreeLoadout.db2", &TraitTreeLoadoutLoadInfo::Instance)
DB2Storage< CriteriaEntry > sCriteriaStore("Criteria.db2", &CriteriaLoadInfo::Instance)
TaxiPathNodesByPath sTaxiPathNodesByPath
Definition: DB2Stores.cpp:383
DB2Storage< ChallengeModeItemBonusOverrideEntry > sChallengeModeItemBonusOverrideStore("ChallengeModeItemBonusOverride.db2", &ChallengeModeItemBonusOverrideLoadInfo::Instance)
DB2Storage< AzeriteItemMilestonePowerEntry > sAzeriteItemMilestonePowerStore("AzeriteItemMilestonePower.db2", &AzeriteItemMilestonePowerLoadInfo::Instance)
std::pair< uint32, int32 > HotfixBlobKey
Definition: DB2Stores.cpp:422
DB2Storage< QuestMoneyRewardEntry > sQuestMoneyRewardStore("QuestMoneyReward.db2", &QuestMoneyRewardLoadInfo::Instance)
DB2Storage< ItemXItemEffectEntry > sItemXItemEffectStore("ItemXItemEffect.db2", &ItemXItemEffectLoadInfo::Instance)
DB2Storage< ScenarioEntry > sScenarioStore("Scenario.db2", &ScenarioLoadInfo::Instance)
DB2Storage< TraitNodeXTraitNodeEntryEntry > sTraitNodeXTraitNodeEntryStore("TraitNodeXTraitNodeEntry.db2", &TraitNodeXTraitNodeEntryLoadInfo::Instance)
std::unordered_map< uint32, std::vector< ChrSpecialization > > GlyphRequiredSpecsContainer
Definition: DB2Stores.cpp:398
DB2Storage< JournalInstanceEntry > sJournalInstanceStore("JournalInstance.db2", &JournalInstanceLoadInfo::Instance)
DB2Storage< ItemDamageOneHandEntry > sItemDamageOneHandStore("ItemDamageOneHand.db2", &ItemDamageOneHandLoadInfo::Instance)
DB2Storage< TransmogIllusionEntry > sTransmogIllusionStore("TransmogIllusion.db2", &TransmogIllusionLoadInfo::Instance)
std::unordered_map< uint32, std::vector< ItemSpecOverrideEntry const * > > ItemSpecOverridesContainer
Definition: DB2Stores.cpp:404
static CurveInterpolationMode DetermineCurveType(CurveEntry const *curve, std::vector< DBCPosition2D > const &points)
Definition: DB2Stores.cpp:2189
DB2Storage< TransmogSetEntry > sTransmogSetStore("TransmogSet.db2", &TransmogSetLoadInfo::Instance)
DB2Storage< GuildColorEmblemEntry > sGuildColorEmblemStore("GuildColorEmblem.db2", &GuildColorEmblemLoadInfo::Instance)
DB2Storage< GarrBuildingEntry > sGarrBuildingStore("GarrBuilding.db2", &GarrBuildingLoadInfo::Instance)
DB2Storage< TraitNodeGroupXTraitCostEntry > sTraitNodeGroupXTraitCostStore("TraitNodeGroupXTraitCost.db2", &TraitNodeGroupXTraitCostLoadInfo::Instance)
DB2Storage< AzeriteKnowledgeMultiplierEntry > sAzeriteKnowledgeMultiplierStore("AzeriteKnowledgeMultiplier.db2", &AzeriteKnowledgeMultiplierLoadInfo::Instance)
DB2Storage< SpecializationSpellsEntry > sSpecializationSpellsStore("SpecializationSpells.db2", &SpecializationSpellsLoadInfo::Instance)
std::map< WMOAreaTableKey, WMOAreaTableEntry const * > WMOAreaTableLookupContainer
Definition: DB2Stores.cpp:421
std::unordered_map< uint32, DB2Manager::MountTypeXCapabilitySet > MountCapabilitiesByTypeContainer
Definition: DB2Stores.cpp:406
DB2Storage< GarrFollowerXAbilityEntry > sGarrFollowerXAbilityStore("GarrFollowerXAbility.db2", &GarrFollowerXAbilityLoadInfo::Instance)
DB2Storage< QuestInfoEntry > sQuestInfoStore("QuestInfo.db2", &QuestInfoLoadInfo::Instance)
DB2Storage< ItemArmorTotalEntry > sItemArmorTotalStore("ItemArmorTotal.db2", &ItemArmorTotalLoadInfo::Instance)
DB2Storage< ChrModelEntry > sChrModelStore("ChrModel.db2", &ChrModelLoadInfo::Instance)
std::unordered_map< uint32, std::vector< SpecializationSpellsEntry const * > > SpecializationSpellsContainer
Definition: DB2Stores.cpp:414
DB2Storage< TraitTreeEntry > sTraitTreeStore("TraitTree.db2", &TraitTreeLoadInfo::Instance)
DB2Storage< GarrTalentTreeEntry > sGarrTalentTreeStore("GarrTalentTree.db2", &GarrTalentTreeLoadInfo::Instance)
DB2Storage< TransportRotationEntry > sTransportRotationStore("TransportRotation.db2", &TransportRotationLoadInfo::Instance)
DB2Storage< SpellRangeEntry > sSpellRangeStore("SpellRange.db2", &SpellRangeLoadInfo::Instance)
DB2Storage< ItemLevelSelectorQualityEntry > sItemLevelSelectorQualityStore("ItemLevelSelectorQuality.db2", &ItemLevelSelectorQualityLoadInfo::Instance)
DB2Storage< RewardPackXItemEntry > sRewardPackXItemStore("RewardPackXItem.db2", &RewardPackXItemLoadInfo::Instance)
DB2Storage< EmotesTextSoundEntry > sEmotesTextSoundStore("EmotesTextSound.db2", &EmotesTextSoundLoadInfo::Instance)
std::array< PowerTypeEntry const *, MAX_POWERS > PowerTypesContainer
Definition: DB2Stores.cpp:411
bool ValidateBroadcastTextTactKeyOptionalData(std::vector< uint8 > const &data)
Definition: DB2Stores.cpp:1773
DB2Storage< ChrClassesEntry > sChrClassesStore("ChrClasses.db2", &ChrClassesLoadInfo::Instance)
DB2Storage< SpellShapeshiftFormEntry > sSpellShapeshiftFormStore("SpellShapeshiftForm.db2", &SpellShapeshiftFormLoadInfo::Instance)
DB2Storage< ItemPriceBaseEntry > sItemPriceBaseStore("ItemPriceBase.db2", &ItemPriceBaseLoadInfo::Instance)
DB2Storage< GlobalCurveEntry > sGlobalCurveStore("GlobalCurve.db2", &GlobalCurveLoadInfo::Instance)
DB2Storage< ModifierTreeEntry > sModifierTreeStore("ModifierTree.db2", &ModifierTreeLoadInfo::Instance)
std::unordered_map< uint32, std::vector< uint32 > > FactionTeamContainer
Definition: DB2Stores.cpp:395
DB2Storage< SpellAuraRestrictionsEntry > sSpellAuraRestrictionsStore("SpellAuraRestrictions.db2", &SpellAuraRestrictionsLoadInfo::Instance)
DB2Storage< MountEntry > sMountStore("Mount.db2", &MountLoadInfo::Instance)
DB2Storage< VehicleSeatEntry > sVehicleSeatStore("VehicleSeat.db2", &VehicleSeatLoadInfo::Instance)
DB2Storage< ChrCustomizationDisplayInfoEntry > sChrCustomizationDisplayInfoStore("ChrCustomizationDisplayInfo.db2", &ChrCustomizationDisplayInfoLoadInfo::Instance)
std::unordered_map< uint32, std::vector< SpellProcsPerMinuteModEntry const * > > SpellProcsPerMinuteModContainer
Definition: DB2Stores.cpp:417
DB2Storage< ArtifactPowerRankEntry > sArtifactPowerRankStore("ArtifactPowerRank.db2", &ArtifactPowerRankLoadInfo::Instance)
DB2Storage< DestructibleModelDataEntry > sDestructibleModelDataStore("DestructibleModelData.db2", &DestructibleModelDataLoadInfo::Instance)
DB2Storage< SpellShapeshiftEntry > sSpellShapeshiftStore("SpellShapeshift.db2", &SpellShapeshiftLoadInfo::Instance)
DB2Storage< GarrSiteLevelPlotInstEntry > sGarrSiteLevelPlotInstStore("GarrSiteLevelPlotInst.db2", &GarrSiteLevelPlotInstLoadInfo::Instance)
TaxiMask sOldContinentsNodesMask
Definition: DB2Stores.cpp:380
DB2Storage< SpellVisualEffectNameEntry > sSpellVisualEffectNameStore("SpellVisualEffectName.db2", &SpellVisualEffectNameLoadInfo::Instance)
DB2Storage< SpellMiscEntry > sSpellMiscStore("SpellMisc.db2", &SpellMiscLoadInfo::Instance)
DB2Storage< WorldStateExpressionEntry > sWorldStateExpressionStore("WorldStateExpression.db2", &WorldStateExpressionLoadInfo::Instance)
DB2Storage< GarrPlotInstanceEntry > sGarrPlotInstanceStore("GarrPlotInstance.db2", &GarrPlotInstanceLoadInfo::Instance)
DB2Storage< LockEntry > sLockStore("Lock.db2", &LockLoadInfo::Instance)
DB2Storage< NamesProfanityEntry > sNamesProfanityStore("NamesProfanity.db2", &NamesProfanityLoadInfo::Instance)
DB2Storage< CharTitlesEntry > sCharTitlesStore("CharTitles.db2", &CharTitlesLoadInfo::Instance)
DB2Storage< GlyphRequiredSpecEntry > sGlyphRequiredSpecStore("GlyphRequiredSpec.db2", &GlyphRequiredSpecLoadInfo::Instance)
DB2Storage< ExpectedStatEntry > sExpectedStatStore("ExpectedStat.db2", &ExpectedStatLoadInfo::Instance)
DB2Storage< BattlePetSpeciesStateEntry > sBattlePetSpeciesStateStore("BattlePetSpeciesState.db2", &BattlePetSpeciesStateLoadInfo::Instance)
DB2Storage< NumTalentsAtLevelEntry > sNumTalentsAtLevelStore("NumTalentsAtLevel.db2", &NumTalentsAtLevelLoadInfo::Instance)
std::map< std::tuple< uint32, uint8, uint8, uint8 >, EmotesTextSoundEntry const * > EmotesTextSoundContainer
Definition: DB2Stores.cpp:394
DB2Storage< ArtifactUnlockEntry > sArtifactUnlockStore("ArtifactUnlock.db2", &ArtifactUnlockLoadInfo::Instance)
DB2Storage< QuestLineXQuestEntry > sQuestLineXQuestStore("QuestLineXQuest.db2", &QuestLineXQuestLoadInfo::Instance)
DB2Storage< TraitCondEntry > sTraitCondStore("TraitCond.db2", &TraitCondLoadInfo::Instance)
DB2Storage< TransportAnimationEntry > sTransportAnimationStore("TransportAnimation.db2", &TransportAnimationLoadInfo::Instance)
std::vector< TalentEntry const * > TalentsByPosition[MAX_CLASSES][MAX_TALENT_TIERS][MAX_TALENT_COLUMNS]
Definition: DB2Stores.cpp:418
DB2Storage< ContentTuningXExpectedEntry > sContentTuningXExpectedStore("ContentTuningXExpected.db2", &ContentTuningXExpectedLoadInfo::Instance)
DB2Storage< ConditionalContentTuningEntry > sConditionalContentTuningStore("ConditionalContentTuning.db2", &ConditionalContentTuningLoadInfo::Instance)
DB2Storage< WMOAreaTableEntry > sWMOAreaTableStore("WMOAreaTable.db2", &WmoAreaTableLoadInfo::Instance)
DB2Storage< TraitTreeXTraitCurrencyEntry > sTraitTreeXTraitCurrencyStore("TraitTreeXTraitCurrency.db2", &TraitTreeXTraitCurrencyLoadInfo::Instance)
DB2Storage< ItemXBonusTreeEntry > sItemXBonusTreeStore("ItemXBonusTree.db2", &ItemXBonusTreeLoadInfo::Instance)
DB2Storage< ChrSpecializationEntry > sChrSpecializationStore("ChrSpecialization.db2", &ChrSpecializationLoadInfo::Instance)
DB2Storage< Cfg_CategoriesEntry > sCfgCategoriesStore("Cfg_Categories.db2", &CfgCategoriesLoadInfo::Instance)
DB2Storage< ExpectedStatModEntry > sExpectedStatModStore("ExpectedStatMod.db2", &ExpectedStatModLoadInfo::Instance)
DB2Storage< PrestigeLevelInfoEntry > sPrestigeLevelInfoStore("PrestigeLevelInfo.db2", &PrestigeLevelInfoLoadInfo::Instance)
DB2Storage< ChrClassesXPowerTypesEntry > sChrClassesXPowerTypesStore("ChrClassesXPowerTypes.db2", &ChrClassesXPowerTypesLoadInfo::Instance)
DB2Storage< GarrPlotBuildingEntry > sGarrPlotBuildingStore("GarrPlotBuilding.db2", &GarrPlotBuildingLoadInfo::Instance)
DB2Storage< SceneScriptTextEntry > sSceneScriptTextStore("SceneScriptText.db2", &SceneScriptTextLoadInfo::Instance)
DB2Storage< ChrCustomizationReqChoiceEntry > sChrCustomizationReqChoiceStore("ChrCustomizationReqChoice.db2", &ChrCustomizationReqChoiceLoadInfo::Instance)
DB2Storage< GossipNPCOptionEntry > sGossipNPCOptionStore("GossipNPCOption.db2", &GossipNpcOptionLoadInfo::Instance)
DB2Storage< PowerTypeEntry > sPowerTypeStore("PowerType.db2", &PowerTypeLoadInfo::Instance)
DB2Storage< ItemSetEntry > sItemSetStore("ItemSet.db2", &ItemSetLoadInfo::Instance)
DB2Storage< TraitNodeEntryEntry > sTraitNodeEntryStore("TraitNodeEntry.db2", &TraitNodeEntryLoadInfo::Instance)
DB2Storage< QuestSortEntry > sQuestSortStore("QuestSort.db2", &QuestSortLoadInfo::Instance)
DB2Storage< GarrSiteLevelEntry > sGarrSiteLevelStore("GarrSiteLevel.db2", &GarrSiteLevelLoadInfo::Instance)
DB2Storage< SceneScriptPackageEntry > sSceneScriptPackageStore("SceneScriptPackage.db2", &SceneScriptPackageLoadInfo::Instance)
DB2Storage< CreatureDisplayInfoExtraEntry > sCreatureDisplayInfoExtraStore("CreatureDisplayInfoExtra.db2", &CreatureDisplayInfoExtraLoadInfo::Instance)
DB2Storage< TotemCategoryEntry > sTotemCategoryStore("TotemCategory.db2", &TotemCategoryLoadInfo::Instance)
DB2Storage< SpellLevelsEntry > sSpellLevelsStore("SpellLevels.db2", &SpellLevelsLoadInfo::Instance)
DB2Storage< SpellVisualKitEntry > sSpellVisualKitStore("SpellVisualKit.db2", &SpellVisualKitLoadInfo::Instance)
DB2Storage< AdventureMapPOIEntry > sAdventureMapPOIStore("AdventureMapPOI.db2", &AdventureMapPoiLoadInfo::Instance)
DB2Storage< PvpTalentEntry > sPvpTalentStore("PvpTalent.db2", &PvpTalentLoadInfo::Instance)
DB2Storage< ScenarioStepEntry > sScenarioStepStore("ScenarioStep.db2", &ScenarioStepLoadInfo::Instance)
DB2Storage< JournalTierEntry > sJournalTierStore("JournalTier.db2", &JournalTierLoadInfo::Instance)
DB2Storage< BattlePetAbilityEntry > sBattlePetAbilityStore("BattlePetAbility.db2", &BattlePetAbilityLoadInfo::Instance)
DB2Storage< SpellVisualMissileEntry > sSpellVisualMissileStore("SpellVisualMissile.db2", &SpellVisualMissileLoadInfo::Instance)
DB2Storage< ItemEffectEntry > sItemEffectStore("ItemEffect.db2", &ItemEffectLoadInfo::Instance)
std::unordered_map< uint32, std::vector< ArtifactPowerEntry const * > > ArtifactPowersContainer
Definition: DB2Stores.cpp:389
DB2Storage< BarberShopStyleEntry > sBarberShopStyleStore("BarberShopStyle.db2", &BarberShopStyleLoadInfo::Instance)
std::unordered_multimap< uint32, SkillRaceClassInfoEntry const * > SkillRaceClassInfoContainer
Definition: DB2Stores.cpp:413
DB2Storage< ChatChannelsEntry > sChatChannelsStore("ChatChannels.db2", &ChatChannelsLoadInfo::Instance)
std::pair< uint32, bool(*)(std::vector< uint8 > const &data) > AllowedHotfixOptionalData
Definition: DB2Stores.cpp:424
DB2Storage< MawPowerEntry > sMawPowerStore("MawPower.db2", &MawPowerLoadInfo::Instance)
DB2Storage< ToyEntry > sToyStore("Toy.db2", &ToyLoadInfo::Instance)
DB2Storage< CriteriaTreeEntry > sCriteriaTreeStore("CriteriaTree.db2", &CriteriaTreeLoadInfo::Instance)
DB2Storage< ChrClassUIDisplayEntry > sChrClassUIDisplayStore("ChrClassUIDisplay.db2", &ChrClassUiDisplayLoadInfo::Instance)
DB2Storage< TraitDefinitionEffectPointsEntry > sTraitDefinitionEffectPointsStore("TraitDefinitionEffectPoints.db2", &TraitDefinitionEffectPointsLoadInfo::Instance)
DB2Storage< CorruptionEffectsEntry > sCorruptionEffectsStore("CorruptionEffects.db2", &CorruptionEffectsLoadInfo::Instance)
DB2Storage< ImportPriceShieldEntry > sImportPriceShieldStore("ImportPriceShield.db2", &ImportPriceShieldLoadInfo::Instance)
DB2Storage< BattlePetSpeciesEntry > sBattlePetSpeciesStore("BattlePetSpecies.db2", &BattlePetSpeciesLoadInfo::Instance)
DB2Storage< ItemArmorShieldEntry > sItemArmorShieldStore("ItemArmorShield.db2", &ItemArmorShieldLoadInfo::Instance)
DB2Storage< AreaTriggerEntry > sAreaTriggerStore("AreaTrigger.db2", &AreaTriggerLoadInfo::Instance)
DB2Storage< SpellDurationEntry > sSpellDurationStore("SpellDuration.db2", &SpellDurationLoadInfo::Instance)
DB2Storage< SpellLearnSpellEntry > sSpellLearnSpellStore("SpellLearnSpell.db2", &SpellLearnSpellLoadInfo::Instance)
DB2Storage< ConversationLineEntry > sConversationLineStore("ConversationLine.db2", &ConversationLineLoadInfo::Instance)
DB2Storage< SpellCooldownsEntry > sSpellCooldownsStore("SpellCooldowns.db2", &SpellCooldownsLoadInfo::Instance)
DB2Storage< MountTypeXCapabilityEntry > sMountTypeXCapabilityStore("MountTypeXCapability.db2", &MountTypeXCapabilityLoadInfo::Instance)
DB2Storage< AdventureJournalEntry > sAdventureJournalStore("AdventureJournal.db2", &AdventureJournalLoadInfo::Instance)
void LoadDB2(std::bitset< TOTAL_LOCALES > &availableDb2Locales, std::vector< std::string > &errlist, StorageMap &stores, DB2StorageBase *storage, std::string const &db2Path, LocaleConstant defaultLocale, std::size_t cppRecordSize)
Definition: DB2Stores.cpp:523
DB2Storage< MapDifficultyXConditionEntry > sMapDifficultyXConditionStore("MapDifficultyXCondition.db2", &MapDifficultyXConditionLoadInfo::Instance)
DB2Storage< BannedAddonsEntry > sBannedAddonsStore("BannedAddons.db2", &BannedAddonsLoadInfo::Instance)
std::tuple< uint16, uint8, int32 > WMOAreaTableKey
Definition: DB2Stores.cpp:420
DB2Storage< ItemArmorQualityEntry > sItemArmorQualityStore("ItemArmorQuality.db2", &ItemArmorQualityLoadInfo::Instance)
DB2Storage< UnitConditionEntry > sUnitConditionStore("UnitCondition.db2", &UnitConditionLoadInfo::Instance)
std::unordered_map< uint32, std::vector< uint32 > > AreaGroupMemberContainer
Definition: DB2Stores.cpp:388
DB2Storage< ItemDamageAmmoEntry > sItemDamageAmmoStore("ItemDamageAmmo.db2", &ItemDamageAmmoLoadInfo::Instance)
DB2Storage< ArtifactTierEntry > sArtifactTierStore("ArtifactTier.db2", &ArtifactTierLoadInfo::Instance)
std::unordered_map< uint32, std::vector< uint32 > > GlyphBindableSpellsContainer
Definition: DB2Stores.cpp:397
DB2Storage< ItemModifiedAppearanceEntry > sItemModifiedAppearanceStore("ItemModifiedAppearance.db2", &ItemModifiedAppearanceLoadInfo::Instance)
DB2Storage< MailTemplateEntry > sMailTemplateStore("MailTemplate.db2", &MailTemplateLoadInfo::Instance)
DB2Storage< EmotesEntry > sEmotesStore("Emotes.db2", &EmotesLoadInfo::Instance)
std::unordered_map< uint32, std::vector< ItemSetSpellEntry const * > > ItemSetSpellContainer
Definition: DB2Stores.cpp:403
DB2Storage< ItemSetSpellEntry > sItemSetSpellStore("ItemSetSpell.db2", &ItemSetSpellLoadInfo::Instance)
DB2Storage< Cfg_RegionsEntry > sCfgRegionsStore("Cfg_Regions.db2", &CfgRegionsLoadInfo::Instance)
DB2Storage< UiMapEntry > sUiMapStore("UiMap.db2", &UiMapLoadInfo::Instance)
DB2Storage< SkillLineAbilityEntry > sSkillLineAbilityStore("SkillLineAbility.db2", &SkillLineAbilityLoadInfo::Instance)
DB2Storage< CurrencyContainerEntry > sCurrencyContainerStore("CurrencyContainer.db2", &CurrencyContainerLoadInfo::Instance)
DB2Storage< ItemDisenchantLootEntry > sItemDisenchantLootStore("ItemDisenchantLoot.db2", &ItemDisenchantLootLoadInfo::Instance)
DB2Storage< KeychainEntry > sKeychainStore("Keychain.db2", &KeychainLoadInfo::Instance)
std::unordered_map< uint32, std::pair< std::vector< QuestPackageItemEntry const * >, std::vector< QuestPackageItemEntry const * > > > QuestPackageItemContainer
Definition: DB2Stores.cpp:412
DB2Storage< TraitEdgeEntry > sTraitEdgeStore("TraitEdge.db2", &TraitEdgeLoadInfo::Instance)
DB2Storage< AzeriteUnlockMappingEntry > sAzeriteUnlockMappingStore("AzeriteUnlockMapping.db2", &AzeriteUnlockMappingLoadInfo::Instance)
DB2Storage< AzeriteTierUnlockEntry > sAzeriteTierUnlockStore("AzeriteTierUnlock.db2", &AzeriteTierUnlockLoadInfo::Instance)
DB2Storage< SummonPropertiesEntry > sSummonPropertiesStore("SummonProperties.db2", &SummonPropertiesLoadInfo::Instance)
DB2Storage< SpellReagentsCurrencyEntry > sSpellReagentsCurrencyStore("SpellReagentsCurrency.db2", &SpellReagentsCurrencyLoadInfo::Instance)
DB2Storage< GuildPerkSpellsEntry > sGuildPerkSpellsStore("GuildPerkSpells.db2", &GuildPerkSpellsLoadInfo::Instance)
DB2Storage< TraitDefinitionEntry > sTraitDefinitionStore("TraitDefinition.db2", &TraitDefinitionLoadInfo::Instance)
DB2Storage< AzeriteLevelInfoEntry > sAzeriteLevelInfoStore("AzeriteLevelInfo.db2", &AzeriteLevelInfoLoadInfo::Instance)
DB2Storage< LFGDungeonsEntry > sLFGDungeonsStore("LFGDungeons.db2", &LfgDungeonsLoadInfo::Instance)
DB2Storage< TaxiPathNodeEntry > sTaxiPathNodeStore("TaxiPathNode.db2", &TaxiPathNodeLoadInfo::Instance)
DB2Storage< SpellFocusObjectEntry > sSpellFocusObjectStore("SpellFocusObject.db2", &SpellFocusObjectLoadInfo::Instance)
DB2Storage< TactKeyEntry > sTactKeyStore("TactKey.db2", &TactKeyLoadInfo::Instance)
DB2Storage< NamesReservedLocaleEntry > sNamesReservedLocaleStore("NamesReservedLocale.db2", &NamesReservedLocaleLoadInfo::Instance)
DB2Storage< ImportPriceQualityEntry > sImportPriceQualityStore("ImportPriceQuality.db2", &ImportPriceQualityLoadInfo::Instance)
DB2Storage< PvpTierEntry > sPvpTierStore("PvpTier.db2", &PvpTierLoadInfo::Instance)
DB2Storage< ItemContextPickerEntryEntry > sItemContextPickerEntryStore("ItemContextPickerEntry.db2", &ItemContextPickerEntryLoadInfo::Instance)
DB2Storage< MountXDisplayEntry > sMountXDisplayStore("MountXDisplay.db2", &MountXDisplayLoadInfo::Instance)
DB2Storage< NameGenEntry > sNameGenStore("NameGen.db2", &NameGenLoadInfo::Instance)
DB2Storage< BroadcastTextEntry > sBroadcastTextStore("BroadcastText.db2", &BroadcastTextLoadInfo::Instance)
DB2Storage< SpellCastingRequirementsEntry > sSpellCastingRequirementsStore("SpellCastingRequirements.db2", &SpellCastingRequirementsLoadInfo::Instance)
std::unordered_map< uint32, std::vector< ItemLimitCategoryConditionEntry const * > > ItemLimitCategoryConditionContainer
Definition: DB2Stores.cpp:401
DB2Storage< MythicPlusSeasonEntry > sMythicPlusSeasonStore("MythicPlusSeason.db2", &MythicPlusSeasonLoadInfo::Instance)
DB2Storage< GameObjectArtKitEntry > sGameObjectArtKitStore("GameObjectArtKit.db2", &GameobjectArtKitLoadInfo::Instance)
DB2Storage< ItemLimitCategoryConditionEntry > sItemLimitCategoryConditionStore("ItemLimitCategoryCondition.db2", &ItemLimitCategoryConditionLoadInfo::Instance)
DB2Storage< ItemExtendedCostEntry > sItemExtendedCostStore("ItemExtendedCost.db2", &ItemExtendedCostLoadInfo::Instance)
DB2Storage< SpellEffectEntry > sSpellEffectStore("SpellEffect.db2", &SpellEffectLoadInfo::Instance)
DB2Storage< ContentTuningXLabelEntry > sContentTuningXLabelStore("ContentTuningXLabel.db2", &ContentTuningXLabelLoadInfo::Instance)
std::array< std::vector< Trinity::wregex >, TOTAL_LOCALES+1 > NameValidationRegexContainer
Definition: DB2Stores.cpp:409
DB2Storage< GuildColorBackgroundEntry > sGuildColorBackgroundStore("GuildColorBackground.db2", &GuildColorBackgroundLoadInfo::Instance)
DB2Storage< PVPDifficultyEntry > sPVPDifficultyStore("PVPDifficulty.db2", &PvpDifficultyLoadInfo::Instance)
std::map< HotfixBlobKey, std::vector< uint8 > > HotfixBlobMap
Definition: DB2Stores.cpp:423
DB2Storage< TraitNodeEntryXTraitCondEntry > sTraitNodeEntryXTraitCondStore("TraitNodeEntryXTraitCond.db2", &TraitNodeEntryXTraitCondLoadInfo::Instance)
DB2Storage< QuestV2Entry > sQuestV2Store("QuestV2.db2", &QuestV2LoadInfo::Instance)
DB2Storage< AzeriteEmpoweredItemEntry > sAzeriteEmpoweredItemStore("AzeriteEmpoweredItem.db2", &AzeriteEmpoweredItemLoadInfo::Instance)
DB2Storage< VignetteEntry > sVignetteStore("Vignette.db2", &VignetteLoadInfo::Instance)
DB2Storage< CurrencyTypesEntry > sCurrencyTypesStore("CurrencyTypes.db2", &CurrencyTypesLoadInfo::Instance)
DB2Storage< LanguagesEntry > sLanguagesStore("Languages.db2", &LanguagesLoadInfo::Instance)
DB2Storage< MapChallengeModeEntry > sMapChallengeModeStore("MapChallengeMode.db2", &MapChallengeModeLoadInfo::Instance)
DB2Storage< SpellRadiusEntry > sSpellRadiusStore("SpellRadius.db2", &SpellRadiusLoadInfo::Instance)
DB2Storage< TraitCurrencyEntry > sTraitCurrencyStore("TraitCurrency.db2", &TraitCurrencyLoadInfo::Instance)
DB2Storage< AzeriteTierUnlockSetEntry > sAzeriteTierUnlockSetStore("AzeriteTierUnlockSet.db2", &AzeriteTierUnlockSetLoadInfo::Instance)
DB2Storage< GemPropertiesEntry > sGemPropertiesStore("GemProperties.db2", &GemPropertiesLoadInfo::Instance)
DB2Storage< ItemBonusListLevelDeltaEntry > sItemBonusListLevelDeltaStore("ItemBonusListLevelDelta.db2", &ItemBonusListLevelDeltaLoadInfo::Instance)
DB2Storage< ItemBonusListGroupEntryEntry > sItemBonusListGroupEntryStore("ItemBonusListGroupEntry.db2", &ItemBonusListGroupEntryLoadInfo::Instance)
DB2Storage< HeirloomEntry > sHeirloomStore("Heirloom.db2", &HeirloomLoadInfo::Instance)
DB2Storage< QuestXPEntry > sQuestXPStore("QuestXP.db2", &QuestXpLoadInfo::Instance)
DB2Storage< UiMapXMapArtEntry > sUiMapXMapArtStore("UiMapXMapArt.db2", &UiMapXMapArtLoadInfo::Instance)
DB2Storage< GlyphPropertiesEntry > sGlyphPropertiesStore("GlyphProperties.db2", &GlyphPropertiesLoadInfo::Instance)
DB2Storage< WorldEffectEntry > sWorldEffectStore("WorldEffect.db2", &WorldEffectLoadInfo::Instance)
std::unordered_map< uint32, std::vector< uint32 > > PhaseGroupContainer
Definition: DB2Stores.cpp:410
DB2Storage< DungeonEncounterEntry > sDungeonEncounterStore("DungeonEncounter.db2", &DungeonEncounterLoadInfo::Instance)
DB2Storage< PvpTalentSlotUnlockEntry > sPvpTalentSlotUnlockStore("PvpTalentSlotUnlock.db2", &PvpTalentSlotUnlockLoadInfo::Instance)
DB2Storage< SpellTargetRestrictionsEntry > sSpellTargetRestrictionsStore("SpellTargetRestrictions.db2", &SpellTargetRestrictionsLoadInfo::Instance)
DB2Storage< ChrRacesEntry > sChrRacesStore("ChrRaces.db2", &ChrRacesLoadInfo::Instance)
DB2Storage< TraitNodeXTraitCostEntry > sTraitNodeXTraitCostStore("TraitNodeXTraitCost.db2", &TraitNodeXTraitCostLoadInfo::Instance)
DB2Storage< ParagonReputationEntry > sParagonReputationStore("ParagonReputation.db2", &ParagonReputationLoadInfo::Instance)
DB2Storage< QuestPackageItemEntry > sQuestPackageItemStore("QuestPackageItem.db2", &QuestPackageItemLoadInfo::Instance)
std::unordered_map< std::pair< uint32, uint8 >, ArtifactPowerRankEntry const * > ArtifactPowerRanksContainer
Definition: DB2Stores.cpp:391
DB2Storage< PlayerConditionEntry > sPlayerConditionStore("PlayerCondition.db2", &PlayerConditionLoadInfo::Instance)
DB2Storage< GlyphBindableSpellEntry > sGlyphBindableSpellStore("GlyphBindableSpell.db2", &GlyphBindableSpellLoadInfo::Instance)
DB2Storage< TransmogSetItemEntry > sTransmogSetItemStore("TransmogSetItem.db2", &TransmogSetItemLoadInfo::Instance)
DB2Storage< RewardPackXCurrencyTypeEntry > sRewardPackXCurrencyTypeStore("RewardPackXCurrencyType.db2", &RewardPackXCurrencyTypeLoadInfo::Instance)
std::unordered_map< uint32, std::vector< SpellPowerEntry const * > > SpellPowerContainer
Definition: DB2Stores.cpp:415
DB2Storage< ArtifactPowerLinkEntry > sArtifactPowerLinkStore("ArtifactPowerLink.db2", &ArtifactPowerLinkLoadInfo::Instance)
DB2Storage< ChrCustomizationReqEntry > sChrCustomizationReqStore("ChrCustomizationReq.db2", &ChrCustomizationReqLoadInfo::Instance)
DB2Storage< ImportPriceArmorEntry > sImportPriceArmorStore("ImportPriceArmor.db2", &ImportPriceArmorLoadInfo::Instance)
DB2Storage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore("CreatureDisplayInfo.db2", &CreatureDisplayInfoLoadInfo::Instance)
DB2Storage< ContentTuningEntry > sContentTuningStore("ContentTuning.db2", &ContentTuningLoadInfo::Instance)
DB2Storage< ItemLevelSelectorQualitySetEntry > sItemLevelSelectorQualitySetStore("ItemLevelSelectorQualitySet.db2", &ItemLevelSelectorQualitySetLoadInfo::Instance)
DB2Storage< TraitNodeXTraitCondEntry > sTraitNodeXTraitCondStore("TraitNodeXTraitCond.db2", &TraitNodeXTraitCondLoadInfo::Instance)
DB2Storage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore("SpellItemEnchantment.db2", &SpellItemEnchantmentLoadInfo::Instance)
DB2Storage< SpellClassOptionsEntry > sSpellClassOptionsStore("SpellClassOptions.db2", &SpellClassOptionsLoadInfo::Instance)
DB2Storage< AzeritePowerEntry > sAzeritePowerStore("AzeritePower.db2", &AzeritePowerLoadInfo::Instance)
DB2Storage< PowerDisplayEntry > sPowerDisplayStore("PowerDisplay.db2", &PowerDisplayLoadInfo::Instance)
DB2Storage< KeystoneAffixEntry > sKeystoneAffixStore("KeystoneAffix.db2", &KeystoneAffixLoadInfo::Instance)
DB2Storage< SoulbindConduitRankEntry > sSoulbindConduitRankStore("SoulbindConduitRank.db2", &SoulbindConduitRankLoadInfo::Instance)
DB2Storage< HolidaysEntry > sHolidaysStore("Holidays.db2", &HolidaysLoadInfo::Instance)
DB2Storage< ArmorLocationEntry > sArmorLocationStore("ArmorLocation.db2", &ArmorLocationLoadInfo::Instance)
DB2Storage< TransmogHolidayEntry > sTransmogHolidayStore("TransmogHoliday.db2", &TransmogHolidayLoadInfo::Instance)
DB2Storage< TalentEntry > sTalentStore("Talent.db2", &TalentLoadInfo::Instance)
DB2Storage< MovieEntry > sMovieStore("Movie.db2", &MovieLoadInfo::Instance)
DB2Storage< ItemCurrencyCostEntry > sItemCurrencyCostStore("ItemCurrencyCost.db2", &ItemCurrencyCostLoadInfo::Instance)
std::unordered_map< uint32, std::array< std::vector< NameGenEntry const * >, 2 > > NameGenContainer
Definition: DB2Stores.cpp:408
DB2Storage< ItemAppearanceEntry > sItemAppearanceStore("ItemAppearance.db2", &ItemAppearanceLoadInfo::Instance)
DB2Storage< TransmogSetGroupEntry > sTransmogSetGroupStore("TransmogSetGroup.db2", &TransmogSetGroupLoadInfo::Instance)
DB2Storage< ItemSparseEntry > sItemSparseStore("ItemSparse.db2", &ItemSparseLoadInfo::Instance)
DB2Storage< TraitNodeGroupEntry > sTraitNodeGroupStore("TraitNodeGroup.db2", &TraitNodeGroupLoadInfo::Instance)
DB2Storage< FactionTemplateEntry > sFactionTemplateStore("FactionTemplate.db2", &FactionTemplateLoadInfo::Instance)
DB2Storage< ItemDamageTwoHandEntry > sItemDamageTwoHandStore("ItemDamageTwoHand.db2", &ItemDamageTwoHandLoadInfo::Instance)
DB2Storage< AuctionHouseEntry > sAuctionHouseStore("AuctionHouse.db2", &AuctionHouseLoadInfo::Instance)
DB2Storage< SpellProcsPerMinuteModEntry > sSpellProcsPerMinuteModStore("SpellProcsPerMinuteMod.db2", &SpellProcsPerMinuteModLoadInfo::Instance)
DB2Storage< MountCapabilityEntry > sMountCapabilityStore("MountCapability.db2", &MountCapabilityLoadInfo::Instance)
DB2Storage< SoundKitEntry > sSoundKitStore("SoundKit.db2", &SoundKitLoadInfo::Instance)
DB2Storage< ChrCustomizationChoiceEntry > sChrCustomizationChoiceStore("ChrCustomizationChoice.db2", &ChrCustomizationChoiceLoadInfo::Instance)
DB2Storage< AzeriteItemEntry > sAzeriteItemStore("AzeriteItem.db2", &AzeriteItemLoadInfo::Instance)
DB2Storage< ItemClassEntry > sItemClassStore("ItemClass.db2", &ItemClassLoadInfo::Instance)
DB2Storage< TraitNodeEntryXTraitCostEntry > sTraitNodeEntryXTraitCostStore("TraitNodeEntryXTraitCost.db2", &TraitNodeEntryXTraitCostLoadInfo::Instance)
DB2Storage< ItemSpecEntry > sItemSpecStore("ItemSpec.db2", &ItemSpecLoadInfo::Instance)
DB2Storage< AzeriteEssenceEntry > sAzeriteEssenceStore("AzeriteEssence.db2", &AzeriteEssenceLoadInfo::Instance)
DB2Storage< ItemDamageOneHandCasterEntry > sItemDamageOneHandCasterStore("ItemDamageOneHandCaster.db2", &ItemDamageOneHandCasterLoadInfo::Instance)
DB2Storage< SpellKeyboundOverrideEntry > sSpellKeyboundOverrideStore("SpellKeyboundOverride.db2", &SpellKeyboundOverrideLoadInfo::Instance)
std::unordered_map< uint32, DB2Manager::MountXDisplayContainer > MountDisplaysCointainer
Definition: DB2Stores.cpp:407
DB2Storage< SpellTotemsEntry > sSpellTotemsStore("SpellTotems.db2", &SpellTotemsLoadInfo::Instance)
DB2Storage< TraitTreeLoadoutEntryEntry > sTraitTreeLoadoutEntryStore("TraitTreeLoadoutEntry.db2", &TraitTreeLoadoutEntryLoadInfo::Instance)
DB2Storage< GarrClassSpecEntry > sGarrClassSpecStore("GarrClassSpec.db2", &GarrClassSpecLoadInfo::Instance)
DB2Storage< SpellCategoriesEntry > sSpellCategoriesStore("SpellCategories.db2", &SpellCategoriesLoadInfo::Instance)
DB2Storage< BroadcastTextDurationEntry > sBroadcastTextDurationStore("BroadcastTextDuration.db2", &BroadcastTextDurationLoadInfo::Instance)
DB2Storage< AreaGroupMemberEntry > sAreaGroupMemberStore("AreaGroupMember.db2", &AreaGroupMemberLoadInfo::Instance)
DB2Storage< SceneScriptGlobalTextEntry > sSceneScriptGlobalTextStore("SceneScriptGlobalText.db2", &SceneScriptGlobalTextLoadInfo::Instance)
DB2Storage< SpellLabelEntry > sSpellLabelStore("SpellLabel.db2", &SpellLabelLoadInfo::Instance)
DB2Storage< AreaTableEntry > sAreaTableStore("AreaTable.db2", &AreaTableLoadInfo::Instance)
DB2Storage< SpellProcsPerMinuteEntry > sSpellProcsPerMinuteStore("SpellProcsPerMinute.db2", &SpellProcsPerMinuteLoadInfo::Instance)
DB2Storage< TaxiPathEntry > sTaxiPathStore("TaxiPath.db2", &TaxiPathLoadInfo::Instance)
static bool operator<(UiMapAssignmentStatus const &left, UiMapAssignmentStatus const &right)
Definition: DB2Stores.cpp:3061
std::unordered_set< uint32 > ToyItemIdsContainer
Definition: DB2Stores.cpp:419
DB2Storage< SpellPowerEntry > sSpellPowerStore("SpellPower.db2", &SpellPowerLoadInfo::Instance)
DB2Storage< GarrFollowerEntry > sGarrFollowerStore("GarrFollower.db2", &GarrFollowerLoadInfo::Instance)
DB2Storage< ArtifactAppearanceSetEntry > sArtifactAppearanceSetStore("ArtifactAppearanceSet.db2", &ArtifactAppearanceSetLoadInfo::Instance)
DB2Storage< UiMapAssignmentEntry > sUiMapAssignmentStore("UiMapAssignment.db2", &UiMapAssignmentLoadInfo::Instance)
DB2Storage< RewardPackEntry > sRewardPackStore("RewardPack.db2", &RewardPackLoadInfo::Instance)
DB2Storage< FactionEntry > sFactionStore("Faction.db2", &FactionLoadInfo::Instance)
DB2Storage< DurabilityCostsEntry > sDurabilityCostsStore("DurabilityCosts.db2", &DurabilityCostsLoadInfo::Instance)
DB2Storage< VehicleEntry > sVehicleStore("Vehicle.db2", &VehicleLoadInfo::Instance)
DB2Storage< CinematicSequencesEntry > sCinematicSequencesStore("CinematicSequences.db2", &CinematicSequencesLoadInfo::Instance)
TaxiMask sHordeTaxiNodesMask
Definition: DB2Stores.cpp:381
DB2Storage< GuildColorBorderEntry > sGuildColorBorderStore("GuildColorBorder.db2", &GuildColorBorderLoadInfo::Instance)
DB2Storage< SpellItemEnchantmentConditionEntry > sSpellItemEnchantmentConditionStore("SpellItemEnchantmentCondition.db2", &SpellItemEnchantmentConditionLoadInfo::Instance)
DB2Storage< CinematicCameraEntry > sCinematicCameraStore("CinematicCamera.db2", &CinematicCameraLoadInfo::Instance)
DB2Storage< SpellCastTimesEntry > sSpellCastTimesStore("SpellCastTimes.db2", &SpellCastTimesLoadInfo::Instance)
DB2Storage< GarrAbilityEntry > sGarrAbilityStore("GarrAbility.db2", &GarrAbilityLoadInfo::Instance)
DB2Storage< GarrPlotEntry > sGarrPlotStore("GarrPlot.db2", &GarrPlotLoadInfo::Instance)
DB2Storage< SpellScalingEntry > sSpellScalingStore("SpellScaling.db2", &SpellScalingLoadInfo::Instance)
DB2Storage< JournalEncounterEntry > sJournalEncounterStore("JournalEncounter.db2", &JournalEncounterLoadInfo::Instance)
static DBCPosition2D CalculateGlobalUiMapPosition(int32 uiMapID, DBCPosition2D uiPosition)
Definition: DB2Stores.cpp:3274
std::vector< TaxiPathNodeList > TaxiPathNodesByPath
Definition: DB2Stores.h:333
#define DEFINE_DB2_SET_COMPARATOR(structure)
Definition: DB2Stores.h:341
CurveInterpolationMode
Definition: DBCEnums.h:862
@ AZERITE_TIER_UNLOCK_SET_FLAG_DEFAULT
Definition: DBCEnums.h:214
UiMapSystem
Definition: DBCEnums.h:2278
@ UI_MAP_SYSTEM_ADVENTURE
Definition: DBCEnums.h:2281
@ MAX_UI_MAP_SYSTEM
Definition: DBCEnums.h:2283
@ UI_MAP_SYSTEM_WORLD
Definition: DBCEnums.h:2279
@ UI_MAP_SYSTEM_TAXI
Definition: DBCEnums.h:2280
#define MAX_AZERITE_EMPOWERED_TIER
Definition: DBCEnums.h:200
@ MAX_LEVEL
Definition: DBCEnums.h:51
@ UI_MAP_TYPE_CONTINENT
Definition: DBCEnums.h:2290
Difficulty
Definition: DBCEnums.h:873
AzeriteItemMilestoneType
Definition: DBCEnums.h:206
GlobalCurve
Definition: DBCEnums.h:968
@ DIFFICULTY_FLAG_DEFAULT
Definition: DBCEnums.h:917
@ NoWorldPositions
ItemContext
Definition: DBCEnums.h:1063
constexpr size_t PLAYER_EXPLORED_ZONES_SIZE
Definition: DBCEnums.h:166
#define MAX_PVP_TALENT_SLOTS
Definition: DBCEnums.h:2134
#define MAX_TALENT_TIERS
Definition: DBCEnums.h:2132
ContentTuningCalcType
Definition: DBCEnums.h:401
ChrSpecialization
Definition: DBCEnums.h:357
ExpectedStatType
Definition: DBCEnums.h:927
#define MAX_TALENT_COLUMNS
Definition: DBCEnums.h:2133
BattlegroundBracketId
Definition: DBCEnums.h:59
@ MAX_BATTLEGROUND_BRACKETS
Definition: DBCEnums.h:64
#define MAX_AZERITE_ESSENCE_SLOT
Definition: DBCEnums.h:202