diff --git a/Source/Game/DataStorage/CliDB.cs b/Source/Game/DataStorage/CliDB.cs index c2fef5a06..5b9cbfb21 100644 --- a/Source/Game/DataStorage/CliDB.cs +++ b/Source/Game/DataStorage/CliDB.cs @@ -20,274 +20,289 @@ using Framework.Database; using System; using System.Collections.Generic; using System.Linq; +using System.Collections; +using System.IO; namespace Game.DataStorage { public class CliDB { - internal static int LoadedFileCount; - internal static string DataPath; - - public static void LoadStores(string dataPath, Locale defaultLocale) + public static BitSet LoadStores(string dataPath, Locale defaultLocale) { uint oldMSTime = Time.GetMSTime(); - LoadedFileCount = 0; - DataPath = dataPath + "/dbc/" + defaultLocale + "/"; + string db2Path = dataPath + "/dbc"; - AchievementStorage = DBReader.Read("Achievement.db2", HotfixStatements.SEL_ACHIEVEMENT, HotfixStatements.SEL_ACHIEVEMENT_LOCALE); - //AnimationDataStorage = DBReader.Read("AnimationData.db2", HotfixStatements.SEL_ANIMATION_DATA); - AnimKitStorage = DBReader.Read("AnimKit.db2", HotfixStatements.SEL_ANIM_KIT); - AreaGroupMemberStorage = DBReader.Read("AreaGroupMember.db2", HotfixStatements.SEL_AREA_GROUP_MEMBER); - AreaTableStorage = DBReader.Read("AreaTable.db2", HotfixStatements.SEL_AREA_TABLE, HotfixStatements.SEL_AREA_TABLE_LOCALE); - AreaTriggerStorage = DBReader.Read("AreaTrigger.db2", HotfixStatements.SEL_AREA_TRIGGER); - ArmorLocationStorage = DBReader.Read("ArmorLocation.db2", HotfixStatements.SEL_ARMOR_LOCATION); - ArtifactStorage = DBReader.Read("Artifact.db2", HotfixStatements.SEL_ARTIFACT, HotfixStatements.SEL_ARTIFACT_APPEARANCE_LOCALE); - ArtifactAppearanceStorage = DBReader.Read("ArtifactAppearance.db2", HotfixStatements.SEL_ARTIFACT_APPEARANCE, HotfixStatements.SEL_ARTIFACT_APPEARANCE_LOCALE); - ArtifactAppearanceSetStorage = DBReader.Read("ArtifactAppearanceSet.db2", HotfixStatements.SEL_ARTIFACT_APPEARANCE_SET, HotfixStatements.SEL_ARTIFACT_APPEARANCE_SET_LOCALE); - ArtifactCategoryStorage = DBReader.Read("ArtifactCategory.db2", HotfixStatements.SEL_ARTIFACT_CATEGORY); - ArtifactPowerStorage = DBReader.Read("ArtifactPower.db2", HotfixStatements.SEL_ARTIFACT_POWER); - ArtifactPowerLinkStorage = DBReader.Read("ArtifactPowerLink.db2", HotfixStatements.SEL_ARTIFACT_POWER_LINK); - ArtifactPowerPickerStorage = DBReader.Read("ArtifactPowerPicker.db2", HotfixStatements.SEL_ARTIFACT_POWER_PICKER); - ArtifactPowerRankStorage = DBReader.Read("ArtifactPowerRank.db2", HotfixStatements.SEL_ARTIFACT_POWER_RANK); - //ArtifactQuestXPStorage = DBReader.Read("ArtifactQuestXP.db2", HotfixStatements.SEL_ARTIFACT_QUEST_XP); - ArtifactTierStorage = DBReader.Read("ArtifactTier.db2", HotfixStatements.SEL_ARTIFACT_TIER); - ArtifactUnlockStorage = DBReader.Read("ArtifactUnlock.db2", HotfixStatements.SEL_ARTIFACT_UNLOCK); - AuctionHouseStorage = DBReader.Read("AuctionHouse.db2", HotfixStatements.SEL_AUCTION_HOUSE, HotfixStatements.SEL_AUCTION_HOUSE_LOCALE); - AzeriteEmpoweredItemStorage = DBReader.Read("AzeriteEmpoweredItem.db2", HotfixStatements.SEL_AZERITE_EMPOWERED_ITEM); - AzeriteEssenceStorage = DBReader.Read("AzeriteEssence.db2", HotfixStatements.SEL_AZERITE_ESSENCE, HotfixStatements.SEL_AZERITE_ESSENCE_LOCALE); - AzeriteEssencePowerStorage = DBReader.Read("AzeriteEssencePower.db2", HotfixStatements.SEL_AZERITE_ESSENCE_POWER, HotfixStatements.SEL_AZERITE_ESSENCE_POWER_LOCALE); - AzeriteItemStorage = DBReader.Read("AzeriteItem.db2", HotfixStatements.SEL_AZERITE_ITEM); - AzeriteItemMilestonePowerStorage = DBReader.Read("AzeriteItemMilestonePower.db2", HotfixStatements.SEL_AZERITE_ITEM_MILESTONE_POWER); - AzeriteKnowledgeMultiplierStorage = DBReader.Read("AzeriteKnowledgeMultiplier.db2", HotfixStatements.SEL_AZERITE_KNOWLEDGE_MULTIPLIER); - AzeriteLevelInfoStorage = DBReader.Read("AzeriteLevelInfo.db2", HotfixStatements.SEL_AZERITE_LEVEL_INFO); - AzeritePowerStorage = DBReader.Read("AzeritePower.db2", HotfixStatements.SEL_AZERITE_POWER); - AzeritePowerSetMemberStorage = DBReader.Read ("AzeritePowerSetMember.db2", HotfixStatements.SEL_AZERITE_POWER_SET_MEMBER); - AzeriteTierUnlockStorage = DBReader.Read ("AzeriteTierUnlock.db2", HotfixStatements.SEL_AZERITE_TIER_UNLOCK); - AzeriteTierUnlockSetStorage = DBReader.Read ("AzeriteTierUnlockSet.db2", HotfixStatements.SEL_AZERITE_TIER_UNLOCK_SET); - AzeriteUnlockMappingStorage = DBReader.Read ("AzeriteUnlockMapping.db2", HotfixStatements.SEL_AZERITE_UNLOCK_MAPPING); - BankBagSlotPricesStorage = DBReader.Read("BankBagSlotPrices.db2", HotfixStatements.SEL_BANK_BAG_SLOT_PRICES); - //BannedAddOnsStorage = DBReader.Read("BannedAddons.db2", HotfixStatements.SEL_BANNED_ADDONS); - BarberShopStyleStorage = DBReader.Read("BarberShopStyle.db2", HotfixStatements.SEL_BARBER_SHOP_STYLE, HotfixStatements.SEL_BARBER_SHOP_STYLE_LOCALE); - BattlePetBreedQualityStorage = DBReader.Read("BattlePetBreedQuality.db2", HotfixStatements.SEL_BATTLE_PET_BREED_QUALITY); - BattlePetBreedStateStorage = DBReader.Read("BattlePetBreedState.db2", HotfixStatements.SEL_BATTLE_PET_BREED_STATE); - BattlePetSpeciesStorage = DBReader.Read("BattlePetSpecies.db2", HotfixStatements.SEL_BATTLE_PET_SPECIES, HotfixStatements.SEL_BATTLE_PET_SPECIES_LOCALE); - BattlePetSpeciesStateStorage = DBReader.Read("BattlePetSpeciesState.db2", HotfixStatements.SEL_BATTLE_PET_SPECIES_STATE); - BattlemasterListStorage = DBReader.Read("BattlemasterList.db2", HotfixStatements.SEL_BATTLEMASTER_LIST, HotfixStatements.SEL_BATTLEMASTER_LIST_LOCALE); - BroadcastTextStorage = DBReader.Read("BroadcastText.db2", HotfixStatements.SEL_BROADCAST_TEXT, HotfixStatements.SEL_BROADCAST_TEXT_LOCALE); - CfgRegionsStorage = DBReader.Read("Cfg_Regions.db2", HotfixStatements.SEL_CFG_REGIONS); - CharacterFacialHairStylesStorage = DBReader.Read("CharacterFacialHairStyles.db2", HotfixStatements.SEL_CHARACTER_FACIAL_HAIR_STYLES); - CharBaseSectionStorage = DBReader.Read("CharBaseSection.db2", HotfixStatements.SEL_CHAR_BASE_SECTION); - CharSectionsStorage = DBReader.Read("CharSections.db2", HotfixStatements.SEL_CHAR_SECTIONS); - CharStartOutfitStorage = DBReader.Read("CharStartOutfit.db2", HotfixStatements.SEL_CHAR_START_OUTFIT); - CharTitlesStorage = DBReader.Read("CharTitles.db2", HotfixStatements.SEL_CHAR_TITLES, HotfixStatements.SEL_CHAR_TITLES_LOCALE); - ChatChannelsStorage = DBReader.Read("ChatChannels.db2", HotfixStatements.SEL_CHAT_CHANNELS, HotfixStatements.SEL_CHAT_CHANNELS_LOCALE); - ChrClassesStorage = DBReader.Read("ChrClasses.db2", HotfixStatements.SEL_CHR_CLASSES, HotfixStatements.SEL_CHR_CLASSES_LOCALE); - ChrClassesXPowerTypesStorage = DBReader.Read("ChrClassesXPowerTypes.db2", HotfixStatements.SEL_CHR_CLASSES_X_POWER_TYPES); - ChrRacesStorage = DBReader.Read("ChrRaces.db2", HotfixStatements.SEL_CHR_RACES, HotfixStatements.SEL_CHR_RACES_LOCALE); - ChrSpecializationStorage = DBReader.Read("ChrSpecialization.db2", HotfixStatements.SEL_CHR_SPECIALIZATION, HotfixStatements.SEL_CHR_SPECIALIZATION_LOCALE); - CinematicCameraStorage = DBReader.Read("CinematicCamera.db2", HotfixStatements.SEL_CINEMATIC_CAMERA); - CinematicSequencesStorage = DBReader.Read("CinematicSequences.db2", HotfixStatements.SEL_CINEMATIC_SEQUENCES); - ContentTuningStorage = DBReader.Read("ContentTuning.db2", HotfixStatements.SEL_CONTENT_TUNING); - ContentTuningXExpectedStorage = DBReader.Read("ContentTuningXExpected.db2", HotfixStatements.SEL_CONTENT_TUNING_X_EXPECTED); - ConversationLineStorage = DBReader.Read("ConversationLine.db2", HotfixStatements.SEL_CONVERSATION_LINE); - CorruptionEffectsStorage = DBReader.Read("CorruptionEffects.db2", HotfixStatements.SEL_CORRUPTION_EFFECTS); - CreatureDisplayInfoStorage = DBReader.Read("CreatureDisplayInfo.db2", HotfixStatements.SEL_CREATURE_DISPLAY_INFO); - CreatureDisplayInfoExtraStorage = DBReader.Read("CreatureDisplayInfoExtra.db2", HotfixStatements.SEL_CREATURE_DISPLAY_INFO_EXTRA); - CreatureFamilyStorage = DBReader.Read("CreatureFamily.db2", HotfixStatements.SEL_CREATURE_FAMILY, HotfixStatements.SEL_CREATURE_FAMILY_LOCALE); - CreatureModelDataStorage = DBReader.Read("CreatureModelData.db2", HotfixStatements.SEL_CREATURE_MODEL_DATA); - CreatureTypeStorage = DBReader.Read("CreatureType.db2", HotfixStatements.SEL_CREATURE_TYPE, HotfixStatements.SEL_CREATURE_TYPE_LOCALE); - CriteriaStorage = DBReader.Read("Criteria.db2", HotfixStatements.SEL_CRITERIA); - CriteriaTreeStorage = DBReader.Read("CriteriaTree.db2", HotfixStatements.SEL_CRITERIA_TREE, HotfixStatements.SEL_CRITERIA_TREE_LOCALE); - CurrencyTypesStorage = DBReader.Read("CurrencyTypes.db2", HotfixStatements.SEL_CURRENCY_TYPES, HotfixStatements.SEL_CURRENCY_TYPES_LOCALE); - CurveStorage = DBReader.Read("Curve.db2", HotfixStatements.SEL_CURVE); - CurvePointStorage = DBReader.Read("CurvePoint.db2", HotfixStatements.SEL_CURVE_POINT); - DestructibleModelDataStorage = DBReader.Read("DestructibleModelData.db2", HotfixStatements.SEL_DESTRUCTIBLE_MODEL_DATA); - DifficultyStorage = DBReader.Read("Difficulty.db2", HotfixStatements.SEL_DIFFICULTY, HotfixStatements.SEL_DIFFICULTY_LOCALE); - DungeonEncounterStorage = DBReader.Read("DungeonEncounter.db2", HotfixStatements.SEL_DUNGEON_ENCOUNTER, HotfixStatements.SEL_DUNGEON_ENCOUNTER_LOCALE); - DurabilityCostsStorage = DBReader.Read("DurabilityCosts.db2", HotfixStatements.SEL_DURABILITY_COSTS); - DurabilityQualityStorage = DBReader.Read("DurabilityQuality.db2", HotfixStatements.SEL_DURABILITY_QUALITY); - EmotesStorage = DBReader.Read("Emotes.db2", HotfixStatements.SEL_EMOTES); - EmotesTextStorage = DBReader.Read("EmotesText.db2", HotfixStatements.SEL_EMOTES_TEXT); - EmotesTextSoundStorage = DBReader.Read("EmotesTextSound.db2", HotfixStatements.SEL_EMOTES_TEXT_SOUND); - ExpectedStatStorage = DBReader.Read("ExpectedStat.db2", HotfixStatements.SEL_EXPECTED_STAT); - ExpectedStatModStorage = DBReader.Read("ExpectedStatMod.db2", HotfixStatements.SEL_EXPECTED_STAT_MOD); - FactionStorage = DBReader.Read("Faction.db2", HotfixStatements.SEL_FACTION, HotfixStatements.SEL_FACTION_LOCALE); - FactionTemplateStorage = DBReader.Read("FactionTemplate.db2", HotfixStatements.SEL_FACTION_TEMPLATE); - GameObjectDisplayInfoStorage = DBReader.Read("GameObjectDisplayInfo.db2", HotfixStatements.SEL_GAMEOBJECT_DISPLAY_INFO); - GameObjectsStorage = DBReader.Read("GameObjects.db2", HotfixStatements.SEL_GAMEOBJECTS, HotfixStatements.SEL_GAMEOBJECTS_LOCALE); - GarrAbilityStorage = DBReader.Read("GarrAbility.db2", HotfixStatements.SEL_GARR_ABILITY, HotfixStatements.SEL_GARR_ABILITY_LOCALE); - GarrBuildingStorage = DBReader.Read("GarrBuilding.db2", HotfixStatements.SEL_GARR_BUILDING, HotfixStatements.SEL_GARR_BUILDING_LOCALE); - GarrBuildingPlotInstStorage = DBReader.Read("GarrBuildingPlotInst.db2", HotfixStatements.SEL_GARR_BUILDING_PLOT_INST); - GarrClassSpecStorage = DBReader.Read("GarrClassSpec.db2", HotfixStatements.SEL_GARR_CLASS_SPEC, HotfixStatements.SEL_GARR_CLASS_SPEC_LOCALE); - GarrFollowerStorage = DBReader.Read("GarrFollower.db2", HotfixStatements.SEL_GARR_FOLLOWER, HotfixStatements.SEL_GARR_FOLLOWER_LOCALE); - GarrFollowerXAbilityStorage = DBReader.Read("GarrFollowerXAbility.db2", HotfixStatements.SEL_GARR_FOLLOWER_X_ABILITY); - GarrPlotStorage = DBReader.Read("GarrPlot.db2", HotfixStatements.SEL_GARR_PLOT); - GarrPlotBuildingStorage = DBReader.Read("GarrPlotBuilding.db2", HotfixStatements.SEL_GARR_PLOT_BUILDING); - GarrPlotInstanceStorage = DBReader.Read("GarrPlotInstance.db2", HotfixStatements.SEL_GARR_PLOT_INSTANCE); - GarrSiteLevelStorage = DBReader.Read("GarrSiteLevel.db2", HotfixStatements.SEL_GARR_SITE_LEVEL); - GarrSiteLevelPlotInstStorage = DBReader.Read("GarrSiteLevelPlotInst.db2", HotfixStatements.SEL_GARR_SITE_LEVEL_PLOT_INST); - GemPropertiesStorage = DBReader.Read("GemProperties.db2", HotfixStatements.SEL_GEM_PROPERTIES); - GlyphBindableSpellStorage = DBReader.Read("GlyphBindableSpell.db2", HotfixStatements.SEL_GLYPH_BINDABLE_SPELL); - GlyphPropertiesStorage = DBReader.Read("GlyphProperties.db2", HotfixStatements.SEL_GLYPH_PROPERTIES); - GlyphRequiredSpecStorage = DBReader.Read("GlyphRequiredSpec.db2", HotfixStatements.SEL_GLYPH_REQUIRED_SPEC); - GuildColorBackgroundStorage = DBReader.Read("GuildColorBackground.db2", HotfixStatements.SEL_GUILD_COLOR_BACKGROUND); - GuildColorBorderStorage = DBReader.Read("GuildColorBorder.db2", HotfixStatements.SEL_GUILD_COLOR_BORDER); - GuildColorEmblemStorage = DBReader.Read("GuildColorEmblem.db2", HotfixStatements.SEL_GUILD_COLOR_EMBLEM); - GuildPerkSpellsStorage = DBReader.Read("GuildPerkSpells.db2", HotfixStatements.SEL_GUILD_PERK_SPELLS); - HeirloomStorage = DBReader.Read("Heirloom.db2", HotfixStatements.SEL_HEIRLOOM, HotfixStatements.SEL_HEIRLOOM_LOCALE); - HolidaysStorage = DBReader.Read("Holidays.db2", HotfixStatements.SEL_HOLIDAYS); - ImportPriceArmorStorage = DBReader.Read("ImportPriceArmor.db2", HotfixStatements.SEL_IMPORT_PRICE_ARMOR); - ImportPriceQualityStorage = DBReader.Read("ImportPriceQuality.db2", HotfixStatements.SEL_IMPORT_PRICE_QUALITY); - ImportPriceShieldStorage = DBReader.Read("ImportPriceShield.db2", HotfixStatements.SEL_IMPORT_PRICE_SHIELD); - ImportPriceWeaponStorage = DBReader.Read("ImportPriceWeapon.db2", HotfixStatements.SEL_IMPORT_PRICE_WEAPON); - ItemAppearanceStorage = DBReader.Read("ItemAppearance.db2", HotfixStatements.SEL_ITEM_APPEARANCE); - ItemArmorQualityStorage = DBReader.Read("ItemArmorQuality.db2", HotfixStatements.SEL_ITEM_ARMOR_QUALITY); - ItemArmorShieldStorage = DBReader.Read("ItemArmorShield.db2", HotfixStatements.SEL_ITEM_ARMOR_SHIELD); - ItemArmorTotalStorage = DBReader.Read("ItemArmorTotal.db2", HotfixStatements.SEL_ITEM_ARMOR_TOTAL); - //ItemBagFamilyStorage = DBReader.Read("ItemBagFamily.db2", HotfixStatements.SEL_ITEM_BAG_FAMILY, HotfixStatements.SEL_ITEM_BAG_FAMILY_LOCALE); - ItemBonusStorage = DBReader.Read("ItemBonus.db2", HotfixStatements.SEL_ITEM_BONUS); - ItemBonusListLevelDeltaStorage = DBReader.Read("ItemBonusListLevelDelta.db2", HotfixStatements.SEL_ITEM_BONUS_LIST_LEVEL_DELTA); - ItemBonusTreeNodeStorage = DBReader.Read("ItemBonusTreeNode.db2", HotfixStatements.SEL_ITEM_BONUS_TREE_NODE); - ItemChildEquipmentStorage = DBReader.Read("ItemChildEquipment.db2", HotfixStatements.SEL_ITEM_CHILD_EQUIPMENT); - ItemClassStorage = DBReader.Read("ItemClass.db2", HotfixStatements.SEL_ITEM_CLASS, HotfixStatements.SEL_ITEM_CLASS_LOCALE); - ItemCurrencyCostStorage = DBReader.Read("ItemCurrencyCost.db2", HotfixStatements.SEL_ITEM_CURRENCY_COST); - ItemDamageAmmoStorage = DBReader.Read("ItemDamageAmmo.db2", HotfixStatements.SEL_ITEM_DAMAGE_AMMO); - ItemDamageOneHandStorage = DBReader.Read("ItemDamageOneHand.db2", HotfixStatements.SEL_ITEM_DAMAGE_ONE_HAND); - ItemDamageOneHandCasterStorage = DBReader.Read("ItemDamageOneHandCaster.db2", HotfixStatements.SEL_ITEM_DAMAGE_ONE_HAND_CASTER); - ItemDamageTwoHandStorage = DBReader.Read("ItemDamageTwoHand.db2", HotfixStatements.SEL_ITEM_DAMAGE_TWO_HAND); - ItemDamageTwoHandCasterStorage = DBReader.Read("ItemDamageTwoHandCaster.db2", HotfixStatements.SEL_ITEM_DAMAGE_TWO_HAND_CASTER); - ItemDisenchantLootStorage = DBReader.Read("ItemDisenchantLoot.db2", HotfixStatements.SEL_ITEM_DISENCHANT_LOOT); - ItemEffectStorage = DBReader.Read("ItemEffect.db2", HotfixStatements.SEL_ITEM_EFFECT); - ItemStorage = DBReader.Read("Item.db2", HotfixStatements.SEL_ITEM); - ItemExtendedCostStorage = DBReader.Read("ItemExtendedCost.db2", HotfixStatements.SEL_ITEM_EXTENDED_COST); - ItemLevelSelectorStorage = DBReader.Read("ItemLevelSelector.db2", HotfixStatements.SEL_ITEM_LEVEL_SELECTOR); - ItemLevelSelectorQualityStorage = DBReader.Read("ItemLevelSelectorQuality.db2", HotfixStatements.SEL_ITEM_LEVEL_SELECTOR_QUALITY); - ItemLevelSelectorQualitySetStorage = DBReader.Read("ItemLevelSelectorQualitySet.db2", HotfixStatements.SEL_ITEM_LEVEL_SELECTOR_QUALITY_SET); - ItemLimitCategoryStorage = DBReader.Read("ItemLimitCategory.db2", HotfixStatements.SEL_ITEM_LIMIT_CATEGORY, HotfixStatements.SEL_ITEM_LIMIT_CATEGORY_LOCALE); - ItemLimitCategoryConditionStorage = DBReader.Read("ItemLimitCategoryCondition.db2", HotfixStatements.SEL_ITEM_LIMIT_CATEGORY_CONDITION); - ItemModifiedAppearanceStorage = DBReader.Read("ItemModifiedAppearance.db2", HotfixStatements.SEL_ITEM_MODIFIED_APPEARANCE); - ItemNameDescriptionStorage = DBReader.Read("ItemNameDescription.db2", HotfixStatements.SEL_ITEM_NAME_DESCRIPTION, HotfixStatements.SEL_ITEM_NAME_DESCRIPTION_LOCALE); - ItemPriceBaseStorage = DBReader.Read("ItemPriceBase.db2", HotfixStatements.SEL_ITEM_PRICE_BASE); - ItemSearchNameStorage = DBReader.Read("ItemSearchName.db2", HotfixStatements.SEL_ITEM_SEARCH_NAME, HotfixStatements.SEL_ITEM_SEARCH_NAME_LOCALE); - ItemSetStorage = DBReader.Read("ItemSet.db2", HotfixStatements.SEL_ITEM_SET, HotfixStatements.SEL_ITEM_SET_LOCALE); - ItemSetSpellStorage = DBReader.Read("ItemSetSpell.db2", HotfixStatements.SEL_ITEM_SET_SPELL); - ItemSparseStorage = DBReader.Read("ItemSparse.db2", HotfixStatements.SEL_ITEM_SPARSE, HotfixStatements.SEL_ITEM_SPARSE_LOCALE); - ItemSpecStorage = DBReader.Read("ItemSpec.db2", HotfixStatements.SEL_ITEM_SPEC); - ItemSpecOverrideStorage = DBReader.Read("ItemSpecOverride.db2", HotfixStatements.SEL_ITEM_SPEC_OVERRIDE); - ItemXBonusTreeStorage = DBReader.Read("ItemXBonusTree.db2", HotfixStatements.SEL_ITEM_X_BONUS_TREE); - //KeyChainStorage = DBReader.Read("KeyChain.db2", HotfixStatements.SEL_KEYCHAIN); - LFGDungeonsStorage = DBReader.Read("LFGDungeons.db2", HotfixStatements.SEL_LFG_DUNGEONS, HotfixStatements.SEL_LFG_DUNGEONS_LOCALE); - LightStorage = DBReader.Read("Light.db2", HotfixStatements.SEL_LIGHT); - LiquidTypeStorage = DBReader.Read("LiquidType.db2", HotfixStatements.SEL_LIQUID_TYPE); - LockStorage = DBReader.Read("Lock.db2", HotfixStatements.SEL_LOCK); - MailTemplateStorage = DBReader.Read("MailTemplate.db2", HotfixStatements.SEL_MAIL_TEMPLATE, HotfixStatements.SEL_MAIL_TEMPLATE_LOCALE); - MapStorage = DBReader.Read("Map.db2", HotfixStatements.SEL_MAP, HotfixStatements.SEL_MAP_LOCALE); - MapDifficultyStorage = DBReader.Read("MapDifficulty.db2", HotfixStatements.SEL_MAP_DIFFICULTY, HotfixStatements.SEL_MAP_DIFFICULTY_LOCALE); - ModifierTreeStorage = DBReader.Read("ModifierTree.db2", HotfixStatements.SEL_MODIFIER_TREE); - MountCapabilityStorage = DBReader.Read("MountCapability.db2", HotfixStatements.SEL_MOUNT_CAPABILITY); - MountStorage = DBReader.Read("Mount.db2", HotfixStatements.SEL_MOUNT, HotfixStatements.SEL_MOUNT_LOCALE); - MountTypeXCapabilityStorage = DBReader.Read("MountTypeXCapability.db2", HotfixStatements.SEL_MOUNT_TYPE_X_CAPABILITY); - MountXDisplayStorage = DBReader.Read("MountXDisplay.db2", HotfixStatements.SEL_MOUNT_X_DISPLAY); - MovieStorage = DBReader.Read("Movie.db2", HotfixStatements.SEL_MOVIE); - NameGenStorage = DBReader.Read("NameGen.db2", HotfixStatements.SEL_NAME_GEN); - NamesProfanityStorage = DBReader.Read("NamesProfanity.db2", HotfixStatements.SEL_NAMES_PROFANITY); - NamesReservedStorage = DBReader.Read("NamesReserved.db2", HotfixStatements.SEL_NAMES_RESERVED, HotfixStatements.SEL_NAMES_RESERVED_LOCALE); - NamesReservedLocaleStorage = DBReader.Read("NamesReservedLocale.db2", HotfixStatements.SEL_NAMES_RESERVED_LOCALE); - NumTalentsAtLevelStorage = DBReader.Read("NumTalentsAtLevel.db2", HotfixStatements.SEL_NUM_TALENTS_AT_LEVEL); - OverrideSpellDataStorage = DBReader.Read("OverrideSpellData.db2", HotfixStatements.SEL_OVERRIDE_SPELL_DATA); - PhaseStorage = DBReader.Read("Phase.db2", HotfixStatements.SEL_PHASE); - PhaseXPhaseGroupStorage = DBReader.Read("PhaseXPhaseGroup.db2", HotfixStatements.SEL_PHASE_X_PHASE_GROUP); - PlayerConditionStorage = DBReader.Read("PlayerCondition.db2", HotfixStatements.SEL_PLAYER_CONDITION, HotfixStatements.SEL_PLAYER_CONDITION_LOCALE); - PowerDisplayStorage = DBReader.Read("PowerDisplay.db2", HotfixStatements.SEL_POWER_DISPLAY); - PowerTypeStorage = DBReader.Read("PowerType.db2", HotfixStatements.SEL_POWER_TYPE); - PrestigeLevelInfoStorage = DBReader.Read("PrestigeLevelInfo.db2", HotfixStatements.SEL_PRESTIGE_LEVEL_INFO, HotfixStatements.SEL_PRESTIGE_LEVEL_INFO_LOCALE); - PvpDifficultyStorage = DBReader.Read("PVPDifficulty.db2", HotfixStatements.SEL_PVP_DIFFICULTY); - PvpItemStorage = DBReader.Read("PVPItem.db2", HotfixStatements.SEL_PVP_ITEM); - PvpTalentStorage = DBReader.Read("PvpTalent.db2", HotfixStatements.SEL_PVP_TALENT, HotfixStatements.SEL_PVP_TALENT_LOCALE); - PvpTalentCategoryStorage = DBReader.Read("PvpTalentCategory.db2", HotfixStatements.SEL_PVP_TALENT_CATEGORY); - PvpTalentSlotUnlockStorage = DBReader.Read("PvpTalentSlotUnlock.db2", HotfixStatements.SEL_PVP_TALENT_SLOT_UNLOCK); - QuestFactionRewardStorage = DBReader.Read("QuestFactionReward.db2", HotfixStatements.SEL_QUEST_FACTION_REWARD); - QuestMoneyRewardStorage = DBReader.Read("QuestMoneyReward.db2", HotfixStatements.SEL_QUEST_MONEY_REWARD); - QuestPackageItemStorage = DBReader.Read("QuestPackageItem.db2", HotfixStatements.SEL_QUEST_PACKAGE_ITEM); - QuestSortStorage = DBReader.Read("QuestSort.db2", HotfixStatements.SEL_QUEST_SORT, HotfixStatements.SEL_QUEST_SORT_LOCALE); - QuestV2Storage = DBReader.Read("QuestV2.db2", HotfixStatements.SEL_QUEST_V2); - QuestXPStorage = DBReader.Read("QuestXP.db2", HotfixStatements.SEL_QUEST_XP); - RandPropPointsStorage = DBReader.Read("RandPropPoints.db2", HotfixStatements.SEL_RAND_PROP_POINTS); - RewardPackStorage = DBReader.Read("RewardPack.db2", HotfixStatements.SEL_REWARD_PACK); - RewardPackXCurrencyTypeStorage = DBReader.Read("RewardPackXCurrencyType.db2", HotfixStatements.SEL_REWARD_PACK_X_CURRENCY_TYPE); - RewardPackXItemStorage = DBReader.Read("RewardPackXItem.db2", HotfixStatements.SEL_REWARD_PACK_X_ITEM); - ScalingStatDistributionStorage = DBReader.Read("ScalingStatDistribution.db2", HotfixStatements.SEL_SCALING_STAT_DISTRIBUTION); - ScenarioStorage = DBReader.Read("Scenario.db2", HotfixStatements.SEL_SCENARIO, HotfixStatements.SEL_SCENARIO_LOCALE); - ScenarioStepStorage = DBReader.Read("ScenarioStep.db2", HotfixStatements.SEL_SCENARIO_STEP, HotfixStatements.SEL_SCENARIO_STEP_LOCALE); - //SceneScriptStorage = DBReader.Read("SceneScript.db2", HotfixStatements.SEL_SCENE_SCRIPT); - SceneScriptGlobalTextStorage = DBReader.Read("SceneScriptGlobalText.db2", HotfixStatements.SEL_SCENE_SCRIPT_GLOBAL_TEXT); - SceneScriptPackageStorage = DBReader.Read("SceneScriptPackage.db2", HotfixStatements.SEL_SCENE_SCRIPT_PACKAGE); - SceneScriptTextStorage = DBReader.Read("SceneScriptText.db2", HotfixStatements.SEL_SCENE_SCRIPT_TEXT); - SkillLineStorage = DBReader.Read("SkillLine.db2", HotfixStatements.SEL_SKILL_LINE, HotfixStatements.SEL_SKILL_LINE_LOCALE); - SkillLineAbilityStorage = DBReader.Read("SkillLineAbility.db2", HotfixStatements.SEL_SKILL_LINE_ABILITY); - SkillRaceClassInfoStorage = DBReader.Read("SkillRaceClassInfo.db2", HotfixStatements.SEL_SKILL_RACE_CLASS_INFO); - SoundKitStorage = DBReader.Read("SoundKit.db2", HotfixStatements.SEL_SOUND_KIT); - SpecializationSpellsStorage = DBReader.Read("SpecializationSpells.db2", HotfixStatements.SEL_SPECIALIZATION_SPELLS, HotfixStatements.SEL_SPECIALIZATION_SPELLS_LOCALE); - SpecSetMemberStorage = DBReader.Read("SpecSetMember.db2", HotfixStatements.SEL_SPEC_SET_MEMBER); - SpellNameStorage = DBReader.Read("SpellName.db2", HotfixStatements.SEL_SPELL_NAME, HotfixStatements.SEL_SPELL_NAME_LOCALE); - SpellAuraOptionsStorage = DBReader.Read("SpellAuraOptions.db2", HotfixStatements.SEL_SPELL_AURA_OPTIONS); - SpellAuraRestrictionsStorage = DBReader.Read("SpellAuraRestrictions.db2", HotfixStatements.SEL_SPELL_AURA_RESTRICTIONS); - SpellCastTimesStorage = DBReader.Read("SpellCastTimes.db2", HotfixStatements.SEL_SPELL_CAST_TIMES); - SpellCastingRequirementsStorage = DBReader.Read("SpellCastingRequirements.db2", HotfixStatements.SEL_SPELL_CASTING_REQUIREMENTS); - SpellCategoriesStorage = DBReader.Read("SpellCategories.db2", HotfixStatements.SEL_SPELL_CATEGORIES); - SpellCategoryStorage = DBReader.Read("SpellCategory.db2", HotfixStatements.SEL_SPELL_CATEGORY, HotfixStatements.SEL_SPELL_CATEGORY_LOCALE); - SpellClassOptionsStorage = DBReader.Read("SpellClassOptions.db2", HotfixStatements.SEL_SPELL_CLASS_OPTIONS); - SpellCooldownsStorage = DBReader.Read("SpellCooldowns.db2", HotfixStatements.SEL_SPELL_COOLDOWNS); - SpellDurationStorage = DBReader.Read("SpellDuration.db2", HotfixStatements.SEL_SPELL_DURATION); - SpellEffectStorage = DBReader.Read("SpellEffect.db2", HotfixStatements.SEL_SPELL_EFFECT); - SpellEquippedItemsStorage = DBReader.Read("SpellEquippedItems.db2", HotfixStatements.SEL_SPELL_EQUIPPED_ITEMS); - SpellFocusObjectStorage = DBReader.Read("SpellFocusObject.db2", HotfixStatements.SEL_SPELL_FOCUS_OBJECT, HotfixStatements.SEL_SPELL_FOCUS_OBJECT_LOCALE); - SpellInterruptsStorage = DBReader.Read("SpellInterrupts.db2", HotfixStatements.SEL_SPELL_INTERRUPTS); - SpellItemEnchantmentStorage = DBReader.Read("SpellItemEnchantment.db2", HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT, HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT_LOCALE); - SpellItemEnchantmentConditionStorage = DBReader.Read("SpellItemEnchantmentCondition.db2", HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT_CONDITION); - SpellLearnSpellStorage = DBReader.Read("SpellLearnSpell.db2", HotfixStatements.SEL_SPELL_LEARN_SPELL); - SpellLevelsStorage = DBReader.Read("SpellLevels.db2", HotfixStatements.SEL_SPELL_LEVELS); - SpellMiscStorage = DBReader.Read("SpellMisc.db2", HotfixStatements.SEL_SPELL_MISC); - SpellPowerStorage = DBReader.Read("SpellPower.db2", HotfixStatements.SEL_SPELL_POWER); - SpellPowerDifficultyStorage = DBReader.Read("SpellPowerDifficulty.db2", HotfixStatements.SEL_SPELL_POWER_DIFFICULTY); - SpellProcsPerMinuteStorage = DBReader.Read("SpellProcsPerMinute.db2", HotfixStatements.SEL_SPELL_PROCS_PER_MINUTE); - SpellProcsPerMinuteModStorage = DBReader.Read("SpellProcsPerMinuteMod.db2", HotfixStatements.SEL_SPELL_PROCS_PER_MINUTE_MOD); - SpellRadiusStorage = DBReader.Read("SpellRadius.db2", HotfixStatements.SEL_SPELL_RADIUS); - SpellRangeStorage = DBReader.Read("SpellRange.db2", HotfixStatements.SEL_SPELL_RANGE, HotfixStatements.SEL_SPELL_RANGE_LOCALE); - SpellReagentsStorage = DBReader.Read("SpellReagents.db2", HotfixStatements.SEL_SPELL_REAGENTS); - SpellScalingStorage = DBReader.Read("SpellScaling.db2", HotfixStatements.SEL_SPELL_SCALING); - SpellShapeshiftStorage = DBReader.Read("SpellShapeshift.db2", HotfixStatements.SEL_SPELL_SHAPESHIFT); - SpellShapeshiftFormStorage = DBReader.Read("SpellShapeshiftForm.db2", HotfixStatements.SEL_SPELL_SHAPESHIFT_FORM, HotfixStatements.SEL_SPELL_SHAPESHIFT_FORM_LOCALE); - SpellTargetRestrictionsStorage = DBReader.Read("SpellTargetRestrictions.db2", HotfixStatements.SEL_SPELL_TARGET_RESTRICTIONS); - SpellTotemsStorage = DBReader.Read("SpellTotems.db2", HotfixStatements.SEL_SPELL_TOTEMS); - SpellVisualKitStorage = DBReader.Read("SpellVisualKit.db2", HotfixStatements.SEL_SPELL_VISUAL_KIT); - SpellXSpellVisualStorage = DBReader.Read("SpellXSpellVisual.db2", HotfixStatements.SEL_SPELL_X_SPELL_VISUAL); - SummonPropertiesStorage = DBReader.Read("SummonProperties.db2", HotfixStatements.SEL_SUMMON_PROPERTIES); - //TactKeyStorage = DBReader.Read("TactKey.db2", HotfixStatements.SEL_TACT_KEY); - TalentStorage = DBReader.Read("Talent.db2", HotfixStatements.SEL_TALENT, HotfixStatements.SEL_TALENT_LOCALE); - TaxiNodesStorage = DBReader.Read("TaxiNodes.db2", HotfixStatements.SEL_TAXI_NODES, HotfixStatements.SEL_TAXI_NODES_LOCALE); - TaxiPathStorage = DBReader.Read("TaxiPath.db2", HotfixStatements.SEL_TAXI_PATH); - TaxiPathNodeStorage = DBReader.Read("TaxiPathNode.db2", HotfixStatements.SEL_TAXI_PATH_NODE); - TotemCategoryStorage = DBReader.Read("TotemCategory.db2", HotfixStatements.SEL_TOTEM_CATEGORY, HotfixStatements.SEL_TOTEM_CATEGORY_LOCALE); - ToyStorage = DBReader.Read("Toy.db2", HotfixStatements.SEL_TOY, HotfixStatements.SEL_TOY_LOCALE); - TransmogHolidayStorage = DBReader.Read("TransmogHoliday.db2", HotfixStatements.SEL_TRANSMOG_HOLIDAY); - TransmogSetStorage = DBReader.Read("TransmogSet.db2", HotfixStatements.SEL_TRANSMOG_SET, HotfixStatements.SEL_TRANSMOG_SET_LOCALE); - TransmogSetGroupStorage = DBReader.Read("TransmogSetGroup.db2", HotfixStatements.SEL_TRANSMOG_SET_GROUP, HotfixStatements.SEL_TRANSMOG_SET_GROUP_LOCALE); - TransmogSetItemStorage = DBReader.Read("TransmogSetItem.db2", HotfixStatements.SEL_TRANSMOG_SET_ITEM); - TransportAnimationStorage = DBReader.Read("TransportAnimation.db2", HotfixStatements.SEL_TRANSPORT_ANIMATION); - TransportRotationStorage = DBReader.Read("TransportRotation.db2", HotfixStatements.SEL_TRANSPORT_ROTATION); - UiMapStorage = DBReader.Read("UiMap.db2", HotfixStatements.SEL_UI_MAP, HotfixStatements.SEL_UI_MAP_LOCALE); - UiMapAssignmentStorage = DBReader.Read("UiMapAssignment.db2", HotfixStatements.SEL_UI_MAP_ASSIGNMENT); - UiMapLinkStorage = DBReader.Read("UiMapLink.db2", HotfixStatements.SEL_UI_MAP_LINK); - UiMapXMapArtStorage = DBReader.Read("UiMapXMapArt.db2", HotfixStatements.SEL_UI_MAP_X_MAP_ART); - UnitPowerBarStorage = DBReader.Read("UnitPowerBar.db2", HotfixStatements.SEL_UNIT_POWER_BAR, HotfixStatements.SEL_UNIT_POWER_BAR_LOCALE); - VehicleStorage = DBReader.Read("Vehicle.db2", HotfixStatements.SEL_VEHICLE); - VehicleSeatStorage = DBReader.Read("VehicleSeat.db2", HotfixStatements.SEL_VEHICLE_SEAT); - WMOAreaTableStorage = DBReader.Read("WMOAreaTable.db2", HotfixStatements.SEL_WMO_AREA_TABLE, HotfixStatements.SEL_WMO_AREA_TABLE_LOCALE); - WorldEffectStorage = DBReader.Read("WorldEffect.db2", HotfixStatements.SEL_WORLD_EFFECT); - WorldMapOverlayStorage = DBReader.Read("WorldMapOverlay.db2", HotfixStatements.SEL_WORLD_MAP_OVERLAY); - WorldStateExpressionStorage = DBReader.Read("WorldStateExpression.db2", HotfixStatements.SEL_WORLD_STATE_EXPRESSION); + BitSet availableDb2Locales = new BitSet((int)Locale.Total); + foreach (var dir in Directory.GetDirectories(db2Path)) + { + Locale locale = Path.GetFileName(dir).ToEnum(); + if (SharedConst.IsValidLocale(locale)) + availableDb2Locales[(int)locale] = true; + } + + if (!availableDb2Locales[(int)defaultLocale]) + return null; + + uint loadedFileCount = 0; + DB6Storage ReadDB2(string fileName, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale = 0) where T : new() + { + return DBReader.Read(availableDb2Locales, $"{db2Path}/{defaultLocale}/", fileName, preparedStatement, preparedStatementLocale, ref loadedFileCount); + } + + AchievementStorage = ReadDB2("Achievement.db2", HotfixStatements.SEL_ACHIEVEMENT, HotfixStatements.SEL_ACHIEVEMENT_LOCALE); + //AnimationDataStorage = ReadDB2("AnimationData.db2", HotfixStatements.SEL_ANIMATION_DATA); + AnimKitStorage = ReadDB2("AnimKit.db2", HotfixStatements.SEL_ANIM_KIT); + AreaGroupMemberStorage = ReadDB2("AreaGroupMember.db2", HotfixStatements.SEL_AREA_GROUP_MEMBER); + AreaTableStorage = ReadDB2("AreaTable.db2", HotfixStatements.SEL_AREA_TABLE, HotfixStatements.SEL_AREA_TABLE_LOCALE); + AreaTriggerStorage = ReadDB2("AreaTrigger.db2", HotfixStatements.SEL_AREA_TRIGGER); + ArmorLocationStorage = ReadDB2("ArmorLocation.db2", HotfixStatements.SEL_ARMOR_LOCATION); + ArtifactStorage = ReadDB2("Artifact.db2", HotfixStatements.SEL_ARTIFACT, HotfixStatements.SEL_ARTIFACT_APPEARANCE_LOCALE); + ArtifactAppearanceStorage = ReadDB2("ArtifactAppearance.db2", HotfixStatements.SEL_ARTIFACT_APPEARANCE, HotfixStatements.SEL_ARTIFACT_APPEARANCE_LOCALE); + ArtifactAppearanceSetStorage = ReadDB2("ArtifactAppearanceSet.db2", HotfixStatements.SEL_ARTIFACT_APPEARANCE_SET, HotfixStatements.SEL_ARTIFACT_APPEARANCE_SET_LOCALE); + ArtifactCategoryStorage = ReadDB2("ArtifactCategory.db2", HotfixStatements.SEL_ARTIFACT_CATEGORY); + ArtifactPowerStorage = ReadDB2("ArtifactPower.db2", HotfixStatements.SEL_ARTIFACT_POWER); + ArtifactPowerLinkStorage = ReadDB2("ArtifactPowerLink.db2", HotfixStatements.SEL_ARTIFACT_POWER_LINK); + ArtifactPowerPickerStorage = ReadDB2("ArtifactPowerPicker.db2", HotfixStatements.SEL_ARTIFACT_POWER_PICKER); + ArtifactPowerRankStorage = ReadDB2("ArtifactPowerRank.db2", HotfixStatements.SEL_ARTIFACT_POWER_RANK); + //ArtifactQuestXPStorage = ReadDB2("ArtifactQuestXP.db2", HotfixStatements.SEL_ARTIFACT_QUEST_XP); + ArtifactTierStorage = ReadDB2("ArtifactTier.db2", HotfixStatements.SEL_ARTIFACT_TIER); + ArtifactUnlockStorage = ReadDB2("ArtifactUnlock.db2", HotfixStatements.SEL_ARTIFACT_UNLOCK); + AuctionHouseStorage = ReadDB2("AuctionHouse.db2", HotfixStatements.SEL_AUCTION_HOUSE, HotfixStatements.SEL_AUCTION_HOUSE_LOCALE); + AzeriteEmpoweredItemStorage = ReadDB2("AzeriteEmpoweredItem.db2", HotfixStatements.SEL_AZERITE_EMPOWERED_ITEM); + AzeriteEssenceStorage = ReadDB2("AzeriteEssence.db2", HotfixStatements.SEL_AZERITE_ESSENCE, HotfixStatements.SEL_AZERITE_ESSENCE_LOCALE); + AzeriteEssencePowerStorage = ReadDB2("AzeriteEssencePower.db2", HotfixStatements.SEL_AZERITE_ESSENCE_POWER, HotfixStatements.SEL_AZERITE_ESSENCE_POWER_LOCALE); + AzeriteItemStorage = ReadDB2("AzeriteItem.db2", HotfixStatements.SEL_AZERITE_ITEM); + AzeriteItemMilestonePowerStorage = ReadDB2("AzeriteItemMilestonePower.db2", HotfixStatements.SEL_AZERITE_ITEM_MILESTONE_POWER); + AzeriteKnowledgeMultiplierStorage = ReadDB2("AzeriteKnowledgeMultiplier.db2", HotfixStatements.SEL_AZERITE_KNOWLEDGE_MULTIPLIER); + AzeriteLevelInfoStorage = ReadDB2("AzeriteLevelInfo.db2", HotfixStatements.SEL_AZERITE_LEVEL_INFO); + AzeritePowerStorage = ReadDB2("AzeritePower.db2", HotfixStatements.SEL_AZERITE_POWER); + AzeritePowerSetMemberStorage = ReadDB2 ("AzeritePowerSetMember.db2", HotfixStatements.SEL_AZERITE_POWER_SET_MEMBER); + AzeriteTierUnlockStorage = ReadDB2 ("AzeriteTierUnlock.db2", HotfixStatements.SEL_AZERITE_TIER_UNLOCK); + AzeriteTierUnlockSetStorage = ReadDB2 ("AzeriteTierUnlockSet.db2", HotfixStatements.SEL_AZERITE_TIER_UNLOCK_SET); + AzeriteUnlockMappingStorage = ReadDB2 ("AzeriteUnlockMapping.db2", HotfixStatements.SEL_AZERITE_UNLOCK_MAPPING); + BankBagSlotPricesStorage = ReadDB2("BankBagSlotPrices.db2", HotfixStatements.SEL_BANK_BAG_SLOT_PRICES); + //BannedAddOnsStorage = ReadDB2("BannedAddons.db2", HotfixStatements.SEL_BANNED_ADDONS); + BarberShopStyleStorage = ReadDB2("BarberShopStyle.db2", HotfixStatements.SEL_BARBER_SHOP_STYLE, HotfixStatements.SEL_BARBER_SHOP_STYLE_LOCALE); + BattlePetBreedQualityStorage = ReadDB2("BattlePetBreedQuality.db2", HotfixStatements.SEL_BATTLE_PET_BREED_QUALITY); + BattlePetBreedStateStorage = ReadDB2("BattlePetBreedState.db2", HotfixStatements.SEL_BATTLE_PET_BREED_STATE); + BattlePetSpeciesStorage = ReadDB2("BattlePetSpecies.db2", HotfixStatements.SEL_BATTLE_PET_SPECIES, HotfixStatements.SEL_BATTLE_PET_SPECIES_LOCALE); + BattlePetSpeciesStateStorage = ReadDB2("BattlePetSpeciesState.db2", HotfixStatements.SEL_BATTLE_PET_SPECIES_STATE); + BattlemasterListStorage = ReadDB2("BattlemasterList.db2", HotfixStatements.SEL_BATTLEMASTER_LIST, HotfixStatements.SEL_BATTLEMASTER_LIST_LOCALE); + BroadcastTextStorage = ReadDB2("BroadcastText.db2", HotfixStatements.SEL_BROADCAST_TEXT, HotfixStatements.SEL_BROADCAST_TEXT_LOCALE); + CfgRegionsStorage = ReadDB2("Cfg_Regions.db2", HotfixStatements.SEL_CFG_REGIONS); + CharacterFacialHairStylesStorage = ReadDB2("CharacterFacialHairStyles.db2", HotfixStatements.SEL_CHARACTER_FACIAL_HAIR_STYLES); + CharBaseSectionStorage = ReadDB2("CharBaseSection.db2", HotfixStatements.SEL_CHAR_BASE_SECTION); + CharSectionsStorage = ReadDB2("CharSections.db2", HotfixStatements.SEL_CHAR_SECTIONS); + CharStartOutfitStorage = ReadDB2("CharStartOutfit.db2", HotfixStatements.SEL_CHAR_START_OUTFIT); + CharTitlesStorage = ReadDB2("CharTitles.db2", HotfixStatements.SEL_CHAR_TITLES, HotfixStatements.SEL_CHAR_TITLES_LOCALE); + ChatChannelsStorage = ReadDB2("ChatChannels.db2", HotfixStatements.SEL_CHAT_CHANNELS, HotfixStatements.SEL_CHAT_CHANNELS_LOCALE); + ChrClassesStorage = ReadDB2("ChrClasses.db2", HotfixStatements.SEL_CHR_CLASSES, HotfixStatements.SEL_CHR_CLASSES_LOCALE); + ChrClassesXPowerTypesStorage = ReadDB2("ChrClassesXPowerTypes.db2", HotfixStatements.SEL_CHR_CLASSES_X_POWER_TYPES); + ChrRacesStorage = ReadDB2("ChrRaces.db2", HotfixStatements.SEL_CHR_RACES, HotfixStatements.SEL_CHR_RACES_LOCALE); + ChrSpecializationStorage = ReadDB2("ChrSpecialization.db2", HotfixStatements.SEL_CHR_SPECIALIZATION, HotfixStatements.SEL_CHR_SPECIALIZATION_LOCALE); + CinematicCameraStorage = ReadDB2("CinematicCamera.db2", HotfixStatements.SEL_CINEMATIC_CAMERA); + CinematicSequencesStorage = ReadDB2("CinematicSequences.db2", HotfixStatements.SEL_CINEMATIC_SEQUENCES); + ContentTuningStorage = ReadDB2("ContentTuning.db2", HotfixStatements.SEL_CONTENT_TUNING); + ContentTuningXExpectedStorage = ReadDB2("ContentTuningXExpected.db2", HotfixStatements.SEL_CONTENT_TUNING_X_EXPECTED); + ConversationLineStorage = ReadDB2("ConversationLine.db2", HotfixStatements.SEL_CONVERSATION_LINE); + CorruptionEffectsStorage = ReadDB2("CorruptionEffects.db2", HotfixStatements.SEL_CORRUPTION_EFFECTS); + CreatureDisplayInfoStorage = ReadDB2("CreatureDisplayInfo.db2", HotfixStatements.SEL_CREATURE_DISPLAY_INFO); + CreatureDisplayInfoExtraStorage = ReadDB2("CreatureDisplayInfoExtra.db2", HotfixStatements.SEL_CREATURE_DISPLAY_INFO_EXTRA); + CreatureFamilyStorage = ReadDB2("CreatureFamily.db2", HotfixStatements.SEL_CREATURE_FAMILY, HotfixStatements.SEL_CREATURE_FAMILY_LOCALE); + CreatureModelDataStorage = ReadDB2("CreatureModelData.db2", HotfixStatements.SEL_CREATURE_MODEL_DATA); + CreatureTypeStorage = ReadDB2("CreatureType.db2", HotfixStatements.SEL_CREATURE_TYPE, HotfixStatements.SEL_CREATURE_TYPE_LOCALE); + CriteriaStorage = ReadDB2("Criteria.db2", HotfixStatements.SEL_CRITERIA); + CriteriaTreeStorage = ReadDB2("CriteriaTree.db2", HotfixStatements.SEL_CRITERIA_TREE, HotfixStatements.SEL_CRITERIA_TREE_LOCALE); + CurrencyTypesStorage = ReadDB2("CurrencyTypes.db2", HotfixStatements.SEL_CURRENCY_TYPES, HotfixStatements.SEL_CURRENCY_TYPES_LOCALE); + CurveStorage = ReadDB2("Curve.db2", HotfixStatements.SEL_CURVE); + CurvePointStorage = ReadDB2("CurvePoint.db2", HotfixStatements.SEL_CURVE_POINT); + DestructibleModelDataStorage = ReadDB2("DestructibleModelData.db2", HotfixStatements.SEL_DESTRUCTIBLE_MODEL_DATA); + DifficultyStorage = ReadDB2("Difficulty.db2", HotfixStatements.SEL_DIFFICULTY, HotfixStatements.SEL_DIFFICULTY_LOCALE); + DungeonEncounterStorage = ReadDB2("DungeonEncounter.db2", HotfixStatements.SEL_DUNGEON_ENCOUNTER, HotfixStatements.SEL_DUNGEON_ENCOUNTER_LOCALE); + DurabilityCostsStorage = ReadDB2("DurabilityCosts.db2", HotfixStatements.SEL_DURABILITY_COSTS); + DurabilityQualityStorage = ReadDB2("DurabilityQuality.db2", HotfixStatements.SEL_DURABILITY_QUALITY); + EmotesStorage = ReadDB2("Emotes.db2", HotfixStatements.SEL_EMOTES); + EmotesTextStorage = ReadDB2("EmotesText.db2", HotfixStatements.SEL_EMOTES_TEXT); + EmotesTextSoundStorage = ReadDB2("EmotesTextSound.db2", HotfixStatements.SEL_EMOTES_TEXT_SOUND); + ExpectedStatStorage = ReadDB2("ExpectedStat.db2", HotfixStatements.SEL_EXPECTED_STAT); + ExpectedStatModStorage = ReadDB2("ExpectedStatMod.db2", HotfixStatements.SEL_EXPECTED_STAT_MOD); + FactionStorage = ReadDB2("Faction.db2", HotfixStatements.SEL_FACTION, HotfixStatements.SEL_FACTION_LOCALE); + FactionTemplateStorage = ReadDB2("FactionTemplate.db2", HotfixStatements.SEL_FACTION_TEMPLATE); + GameObjectDisplayInfoStorage = ReadDB2("GameObjectDisplayInfo.db2", HotfixStatements.SEL_GAMEOBJECT_DISPLAY_INFO); + GameObjectsStorage = ReadDB2("GameObjects.db2", HotfixStatements.SEL_GAMEOBJECTS, HotfixStatements.SEL_GAMEOBJECTS_LOCALE); + GarrAbilityStorage = ReadDB2("GarrAbility.db2", HotfixStatements.SEL_GARR_ABILITY, HotfixStatements.SEL_GARR_ABILITY_LOCALE); + GarrBuildingStorage = ReadDB2("GarrBuilding.db2", HotfixStatements.SEL_GARR_BUILDING, HotfixStatements.SEL_GARR_BUILDING_LOCALE); + GarrBuildingPlotInstStorage = ReadDB2("GarrBuildingPlotInst.db2", HotfixStatements.SEL_GARR_BUILDING_PLOT_INST); + GarrClassSpecStorage = ReadDB2("GarrClassSpec.db2", HotfixStatements.SEL_GARR_CLASS_SPEC, HotfixStatements.SEL_GARR_CLASS_SPEC_LOCALE); + GarrFollowerStorage = ReadDB2("GarrFollower.db2", HotfixStatements.SEL_GARR_FOLLOWER, HotfixStatements.SEL_GARR_FOLLOWER_LOCALE); + GarrFollowerXAbilityStorage = ReadDB2("GarrFollowerXAbility.db2", HotfixStatements.SEL_GARR_FOLLOWER_X_ABILITY); + GarrPlotStorage = ReadDB2("GarrPlot.db2", HotfixStatements.SEL_GARR_PLOT); + GarrPlotBuildingStorage = ReadDB2("GarrPlotBuilding.db2", HotfixStatements.SEL_GARR_PLOT_BUILDING); + GarrPlotInstanceStorage = ReadDB2("GarrPlotInstance.db2", HotfixStatements.SEL_GARR_PLOT_INSTANCE); + GarrSiteLevelStorage = ReadDB2("GarrSiteLevel.db2", HotfixStatements.SEL_GARR_SITE_LEVEL); + GarrSiteLevelPlotInstStorage = ReadDB2("GarrSiteLevelPlotInst.db2", HotfixStatements.SEL_GARR_SITE_LEVEL_PLOT_INST); + GemPropertiesStorage = ReadDB2("GemProperties.db2", HotfixStatements.SEL_GEM_PROPERTIES); + GlyphBindableSpellStorage = ReadDB2("GlyphBindableSpell.db2", HotfixStatements.SEL_GLYPH_BINDABLE_SPELL); + GlyphPropertiesStorage = ReadDB2("GlyphProperties.db2", HotfixStatements.SEL_GLYPH_PROPERTIES); + GlyphRequiredSpecStorage = ReadDB2("GlyphRequiredSpec.db2", HotfixStatements.SEL_GLYPH_REQUIRED_SPEC); + GuildColorBackgroundStorage = ReadDB2("GuildColorBackground.db2", HotfixStatements.SEL_GUILD_COLOR_BACKGROUND); + GuildColorBorderStorage = ReadDB2("GuildColorBorder.db2", HotfixStatements.SEL_GUILD_COLOR_BORDER); + GuildColorEmblemStorage = ReadDB2("GuildColorEmblem.db2", HotfixStatements.SEL_GUILD_COLOR_EMBLEM); + GuildPerkSpellsStorage = ReadDB2("GuildPerkSpells.db2", HotfixStatements.SEL_GUILD_PERK_SPELLS); + HeirloomStorage = ReadDB2("Heirloom.db2", HotfixStatements.SEL_HEIRLOOM, HotfixStatements.SEL_HEIRLOOM_LOCALE); + HolidaysStorage = ReadDB2("Holidays.db2", HotfixStatements.SEL_HOLIDAYS); + ImportPriceArmorStorage = ReadDB2("ImportPriceArmor.db2", HotfixStatements.SEL_IMPORT_PRICE_ARMOR); + ImportPriceQualityStorage = ReadDB2("ImportPriceQuality.db2", HotfixStatements.SEL_IMPORT_PRICE_QUALITY); + ImportPriceShieldStorage = ReadDB2("ImportPriceShield.db2", HotfixStatements.SEL_IMPORT_PRICE_SHIELD); + ImportPriceWeaponStorage = ReadDB2("ImportPriceWeapon.db2", HotfixStatements.SEL_IMPORT_PRICE_WEAPON); + ItemAppearanceStorage = ReadDB2("ItemAppearance.db2", HotfixStatements.SEL_ITEM_APPEARANCE); + ItemArmorQualityStorage = ReadDB2("ItemArmorQuality.db2", HotfixStatements.SEL_ITEM_ARMOR_QUALITY); + ItemArmorShieldStorage = ReadDB2("ItemArmorShield.db2", HotfixStatements.SEL_ITEM_ARMOR_SHIELD); + ItemArmorTotalStorage = ReadDB2("ItemArmorTotal.db2", HotfixStatements.SEL_ITEM_ARMOR_TOTAL); + //ItemBagFamilyStorage = ReadDB2("ItemBagFamily.db2", HotfixStatements.SEL_ITEM_BAG_FAMILY, HotfixStatements.SEL_ITEM_BAG_FAMILY_LOCALE); + ItemBonusStorage = ReadDB2("ItemBonus.db2", HotfixStatements.SEL_ITEM_BONUS); + ItemBonusListLevelDeltaStorage = ReadDB2("ItemBonusListLevelDelta.db2", HotfixStatements.SEL_ITEM_BONUS_LIST_LEVEL_DELTA); + ItemBonusTreeNodeStorage = ReadDB2("ItemBonusTreeNode.db2", HotfixStatements.SEL_ITEM_BONUS_TREE_NODE); + ItemChildEquipmentStorage = ReadDB2("ItemChildEquipment.db2", HotfixStatements.SEL_ITEM_CHILD_EQUIPMENT); + ItemClassStorage = ReadDB2("ItemClass.db2", HotfixStatements.SEL_ITEM_CLASS, HotfixStatements.SEL_ITEM_CLASS_LOCALE); + ItemCurrencyCostStorage = ReadDB2("ItemCurrencyCost.db2", HotfixStatements.SEL_ITEM_CURRENCY_COST); + ItemDamageAmmoStorage = ReadDB2("ItemDamageAmmo.db2", HotfixStatements.SEL_ITEM_DAMAGE_AMMO); + ItemDamageOneHandStorage = ReadDB2("ItemDamageOneHand.db2", HotfixStatements.SEL_ITEM_DAMAGE_ONE_HAND); + ItemDamageOneHandCasterStorage = ReadDB2("ItemDamageOneHandCaster.db2", HotfixStatements.SEL_ITEM_DAMAGE_ONE_HAND_CASTER); + ItemDamageTwoHandStorage = ReadDB2("ItemDamageTwoHand.db2", HotfixStatements.SEL_ITEM_DAMAGE_TWO_HAND); + ItemDamageTwoHandCasterStorage = ReadDB2("ItemDamageTwoHandCaster.db2", HotfixStatements.SEL_ITEM_DAMAGE_TWO_HAND_CASTER); + ItemDisenchantLootStorage = ReadDB2("ItemDisenchantLoot.db2", HotfixStatements.SEL_ITEM_DISENCHANT_LOOT); + ItemEffectStorage = ReadDB2("ItemEffect.db2", HotfixStatements.SEL_ITEM_EFFECT); + ItemStorage = ReadDB2("Item.db2", HotfixStatements.SEL_ITEM); + ItemExtendedCostStorage = ReadDB2("ItemExtendedCost.db2", HotfixStatements.SEL_ITEM_EXTENDED_COST); + ItemLevelSelectorStorage = ReadDB2("ItemLevelSelector.db2", HotfixStatements.SEL_ITEM_LEVEL_SELECTOR); + ItemLevelSelectorQualityStorage = ReadDB2("ItemLevelSelectorQuality.db2", HotfixStatements.SEL_ITEM_LEVEL_SELECTOR_QUALITY); + ItemLevelSelectorQualitySetStorage = ReadDB2("ItemLevelSelectorQualitySet.db2", HotfixStatements.SEL_ITEM_LEVEL_SELECTOR_QUALITY_SET); + ItemLimitCategoryStorage = ReadDB2("ItemLimitCategory.db2", HotfixStatements.SEL_ITEM_LIMIT_CATEGORY, HotfixStatements.SEL_ITEM_LIMIT_CATEGORY_LOCALE); + ItemLimitCategoryConditionStorage = ReadDB2("ItemLimitCategoryCondition.db2", HotfixStatements.SEL_ITEM_LIMIT_CATEGORY_CONDITION); + ItemModifiedAppearanceStorage = ReadDB2("ItemModifiedAppearance.db2", HotfixStatements.SEL_ITEM_MODIFIED_APPEARANCE); + ItemNameDescriptionStorage = ReadDB2("ItemNameDescription.db2", HotfixStatements.SEL_ITEM_NAME_DESCRIPTION, HotfixStatements.SEL_ITEM_NAME_DESCRIPTION_LOCALE); + ItemPriceBaseStorage = ReadDB2("ItemPriceBase.db2", HotfixStatements.SEL_ITEM_PRICE_BASE); + ItemSearchNameStorage = ReadDB2("ItemSearchName.db2", HotfixStatements.SEL_ITEM_SEARCH_NAME, HotfixStatements.SEL_ITEM_SEARCH_NAME_LOCALE); + ItemSetStorage = ReadDB2("ItemSet.db2", HotfixStatements.SEL_ITEM_SET, HotfixStatements.SEL_ITEM_SET_LOCALE); + ItemSetSpellStorage = ReadDB2("ItemSetSpell.db2", HotfixStatements.SEL_ITEM_SET_SPELL); + ItemSparseStorage = ReadDB2("ItemSparse.db2", HotfixStatements.SEL_ITEM_SPARSE, HotfixStatements.SEL_ITEM_SPARSE_LOCALE); + ItemSpecStorage = ReadDB2("ItemSpec.db2", HotfixStatements.SEL_ITEM_SPEC); + ItemSpecOverrideStorage = ReadDB2("ItemSpecOverride.db2", HotfixStatements.SEL_ITEM_SPEC_OVERRIDE); + ItemXBonusTreeStorage = ReadDB2("ItemXBonusTree.db2", HotfixStatements.SEL_ITEM_X_BONUS_TREE); + //KeyChainStorage = ReadDB2("KeyChain.db2", HotfixStatements.SEL_KEYCHAIN); + LFGDungeonsStorage = ReadDB2("LFGDungeons.db2", HotfixStatements.SEL_LFG_DUNGEONS, HotfixStatements.SEL_LFG_DUNGEONS_LOCALE); + LightStorage = ReadDB2("Light.db2", HotfixStatements.SEL_LIGHT); + LiquidTypeStorage = ReadDB2("LiquidType.db2", HotfixStatements.SEL_LIQUID_TYPE); + LockStorage = ReadDB2("Lock.db2", HotfixStatements.SEL_LOCK); + MailTemplateStorage = ReadDB2("MailTemplate.db2", HotfixStatements.SEL_MAIL_TEMPLATE, HotfixStatements.SEL_MAIL_TEMPLATE_LOCALE); + MapStorage = ReadDB2("Map.db2", HotfixStatements.SEL_MAP, HotfixStatements.SEL_MAP_LOCALE); + MapDifficultyStorage = ReadDB2("MapDifficulty.db2", HotfixStatements.SEL_MAP_DIFFICULTY, HotfixStatements.SEL_MAP_DIFFICULTY_LOCALE); + ModifierTreeStorage = ReadDB2("ModifierTree.db2", HotfixStatements.SEL_MODIFIER_TREE); + MountCapabilityStorage = ReadDB2("MountCapability.db2", HotfixStatements.SEL_MOUNT_CAPABILITY); + MountStorage = ReadDB2("Mount.db2", HotfixStatements.SEL_MOUNT, HotfixStatements.SEL_MOUNT_LOCALE); + MountTypeXCapabilityStorage = ReadDB2("MountTypeXCapability.db2", HotfixStatements.SEL_MOUNT_TYPE_X_CAPABILITY); + MountXDisplayStorage = ReadDB2("MountXDisplay.db2", HotfixStatements.SEL_MOUNT_X_DISPLAY); + MovieStorage = ReadDB2("Movie.db2", HotfixStatements.SEL_MOVIE); + NameGenStorage = ReadDB2("NameGen.db2", HotfixStatements.SEL_NAME_GEN); + NamesProfanityStorage = ReadDB2("NamesProfanity.db2", HotfixStatements.SEL_NAMES_PROFANITY); + NamesReservedStorage = ReadDB2("NamesReserved.db2", HotfixStatements.SEL_NAMES_RESERVED, HotfixStatements.SEL_NAMES_RESERVED_LOCALE); + NamesReservedLocaleStorage = ReadDB2("NamesReservedLocale.db2", HotfixStatements.SEL_NAMES_RESERVED_LOCALE); + NumTalentsAtLevelStorage = ReadDB2("NumTalentsAtLevel.db2", HotfixStatements.SEL_NUM_TALENTS_AT_LEVEL); + OverrideSpellDataStorage = ReadDB2("OverrideSpellData.db2", HotfixStatements.SEL_OVERRIDE_SPELL_DATA); + PhaseStorage = ReadDB2("Phase.db2", HotfixStatements.SEL_PHASE); + PhaseXPhaseGroupStorage = ReadDB2("PhaseXPhaseGroup.db2", HotfixStatements.SEL_PHASE_X_PHASE_GROUP); + PlayerConditionStorage = ReadDB2("PlayerCondition.db2", HotfixStatements.SEL_PLAYER_CONDITION, HotfixStatements.SEL_PLAYER_CONDITION_LOCALE); + PowerDisplayStorage = ReadDB2("PowerDisplay.db2", HotfixStatements.SEL_POWER_DISPLAY); + PowerTypeStorage = ReadDB2("PowerType.db2", HotfixStatements.SEL_POWER_TYPE); + PrestigeLevelInfoStorage = ReadDB2("PrestigeLevelInfo.db2", HotfixStatements.SEL_PRESTIGE_LEVEL_INFO, HotfixStatements.SEL_PRESTIGE_LEVEL_INFO_LOCALE); + PvpDifficultyStorage = ReadDB2("PVPDifficulty.db2", HotfixStatements.SEL_PVP_DIFFICULTY); + PvpItemStorage = ReadDB2("PVPItem.db2", HotfixStatements.SEL_PVP_ITEM); + PvpTalentStorage = ReadDB2("PvpTalent.db2", HotfixStatements.SEL_PVP_TALENT, HotfixStatements.SEL_PVP_TALENT_LOCALE); + PvpTalentCategoryStorage = ReadDB2("PvpTalentCategory.db2", HotfixStatements.SEL_PVP_TALENT_CATEGORY); + PvpTalentSlotUnlockStorage = ReadDB2("PvpTalentSlotUnlock.db2", HotfixStatements.SEL_PVP_TALENT_SLOT_UNLOCK); + QuestFactionRewardStorage = ReadDB2("QuestFactionReward.db2", HotfixStatements.SEL_QUEST_FACTION_REWARD); + QuestMoneyRewardStorage = ReadDB2("QuestMoneyReward.db2", HotfixStatements.SEL_QUEST_MONEY_REWARD); + QuestPackageItemStorage = ReadDB2("QuestPackageItem.db2", HotfixStatements.SEL_QUEST_PACKAGE_ITEM); + QuestSortStorage = ReadDB2("QuestSort.db2", HotfixStatements.SEL_QUEST_SORT, HotfixStatements.SEL_QUEST_SORT_LOCALE); + QuestV2Storage = ReadDB2("QuestV2.db2", HotfixStatements.SEL_QUEST_V2); + QuestXPStorage = ReadDB2("QuestXP.db2", HotfixStatements.SEL_QUEST_XP); + RandPropPointsStorage = ReadDB2("RandPropPoints.db2", HotfixStatements.SEL_RAND_PROP_POINTS); + RewardPackStorage = ReadDB2("RewardPack.db2", HotfixStatements.SEL_REWARD_PACK); + RewardPackXCurrencyTypeStorage = ReadDB2("RewardPackXCurrencyType.db2", HotfixStatements.SEL_REWARD_PACK_X_CURRENCY_TYPE); + RewardPackXItemStorage = ReadDB2("RewardPackXItem.db2", HotfixStatements.SEL_REWARD_PACK_X_ITEM); + ScalingStatDistributionStorage = ReadDB2("ScalingStatDistribution.db2", HotfixStatements.SEL_SCALING_STAT_DISTRIBUTION); + ScenarioStorage = ReadDB2("Scenario.db2", HotfixStatements.SEL_SCENARIO, HotfixStatements.SEL_SCENARIO_LOCALE); + ScenarioStepStorage = ReadDB2("ScenarioStep.db2", HotfixStatements.SEL_SCENARIO_STEP, HotfixStatements.SEL_SCENARIO_STEP_LOCALE); + //SceneScriptStorage = ReadDB2("SceneScript.db2", HotfixStatements.SEL_SCENE_SCRIPT); + SceneScriptGlobalTextStorage = ReadDB2("SceneScriptGlobalText.db2", HotfixStatements.SEL_SCENE_SCRIPT_GLOBAL_TEXT); + SceneScriptPackageStorage = ReadDB2("SceneScriptPackage.db2", HotfixStatements.SEL_SCENE_SCRIPT_PACKAGE); + SceneScriptTextStorage = ReadDB2("SceneScriptText.db2", HotfixStatements.SEL_SCENE_SCRIPT_TEXT); + SkillLineStorage = ReadDB2("SkillLine.db2", HotfixStatements.SEL_SKILL_LINE, HotfixStatements.SEL_SKILL_LINE_LOCALE); + SkillLineAbilityStorage = ReadDB2("SkillLineAbility.db2", HotfixStatements.SEL_SKILL_LINE_ABILITY); + SkillRaceClassInfoStorage = ReadDB2("SkillRaceClassInfo.db2", HotfixStatements.SEL_SKILL_RACE_CLASS_INFO); + SoundKitStorage = ReadDB2("SoundKit.db2", HotfixStatements.SEL_SOUND_KIT); + SpecializationSpellsStorage = ReadDB2("SpecializationSpells.db2", HotfixStatements.SEL_SPECIALIZATION_SPELLS, HotfixStatements.SEL_SPECIALIZATION_SPELLS_LOCALE); + SpecSetMemberStorage = ReadDB2("SpecSetMember.db2", HotfixStatements.SEL_SPEC_SET_MEMBER); + SpellNameStorage = ReadDB2("SpellName.db2", HotfixStatements.SEL_SPELL_NAME, HotfixStatements.SEL_SPELL_NAME_LOCALE); + SpellAuraOptionsStorage = ReadDB2("SpellAuraOptions.db2", HotfixStatements.SEL_SPELL_AURA_OPTIONS); + SpellAuraRestrictionsStorage = ReadDB2("SpellAuraRestrictions.db2", HotfixStatements.SEL_SPELL_AURA_RESTRICTIONS); + SpellCastTimesStorage = ReadDB2("SpellCastTimes.db2", HotfixStatements.SEL_SPELL_CAST_TIMES); + SpellCastingRequirementsStorage = ReadDB2("SpellCastingRequirements.db2", HotfixStatements.SEL_SPELL_CASTING_REQUIREMENTS); + SpellCategoriesStorage = ReadDB2("SpellCategories.db2", HotfixStatements.SEL_SPELL_CATEGORIES); + SpellCategoryStorage = ReadDB2("SpellCategory.db2", HotfixStatements.SEL_SPELL_CATEGORY, HotfixStatements.SEL_SPELL_CATEGORY_LOCALE); + SpellClassOptionsStorage = ReadDB2("SpellClassOptions.db2", HotfixStatements.SEL_SPELL_CLASS_OPTIONS); + SpellCooldownsStorage = ReadDB2("SpellCooldowns.db2", HotfixStatements.SEL_SPELL_COOLDOWNS); + SpellDurationStorage = ReadDB2("SpellDuration.db2", HotfixStatements.SEL_SPELL_DURATION); + SpellEffectStorage = ReadDB2("SpellEffect.db2", HotfixStatements.SEL_SPELL_EFFECT); + SpellEquippedItemsStorage = ReadDB2("SpellEquippedItems.db2", HotfixStatements.SEL_SPELL_EQUIPPED_ITEMS); + SpellFocusObjectStorage = ReadDB2("SpellFocusObject.db2", HotfixStatements.SEL_SPELL_FOCUS_OBJECT, HotfixStatements.SEL_SPELL_FOCUS_OBJECT_LOCALE); + SpellInterruptsStorage = ReadDB2("SpellInterrupts.db2", HotfixStatements.SEL_SPELL_INTERRUPTS); + SpellItemEnchantmentStorage = ReadDB2("SpellItemEnchantment.db2", HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT, HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT_LOCALE); + SpellItemEnchantmentConditionStorage = ReadDB2("SpellItemEnchantmentCondition.db2", HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT_CONDITION); + SpellLearnSpellStorage = ReadDB2("SpellLearnSpell.db2", HotfixStatements.SEL_SPELL_LEARN_SPELL); + SpellLevelsStorage = ReadDB2("SpellLevels.db2", HotfixStatements.SEL_SPELL_LEVELS); + SpellMiscStorage = ReadDB2("SpellMisc.db2", HotfixStatements.SEL_SPELL_MISC); + SpellPowerStorage = ReadDB2("SpellPower.db2", HotfixStatements.SEL_SPELL_POWER); + SpellPowerDifficultyStorage = ReadDB2("SpellPowerDifficulty.db2", HotfixStatements.SEL_SPELL_POWER_DIFFICULTY); + SpellProcsPerMinuteStorage = ReadDB2("SpellProcsPerMinute.db2", HotfixStatements.SEL_SPELL_PROCS_PER_MINUTE); + SpellProcsPerMinuteModStorage = ReadDB2("SpellProcsPerMinuteMod.db2", HotfixStatements.SEL_SPELL_PROCS_PER_MINUTE_MOD); + SpellRadiusStorage = ReadDB2("SpellRadius.db2", HotfixStatements.SEL_SPELL_RADIUS); + SpellRangeStorage = ReadDB2("SpellRange.db2", HotfixStatements.SEL_SPELL_RANGE, HotfixStatements.SEL_SPELL_RANGE_LOCALE); + SpellReagentsStorage = ReadDB2("SpellReagents.db2", HotfixStatements.SEL_SPELL_REAGENTS); + SpellScalingStorage = ReadDB2("SpellScaling.db2", HotfixStatements.SEL_SPELL_SCALING); + SpellShapeshiftStorage = ReadDB2("SpellShapeshift.db2", HotfixStatements.SEL_SPELL_SHAPESHIFT); + SpellShapeshiftFormStorage = ReadDB2("SpellShapeshiftForm.db2", HotfixStatements.SEL_SPELL_SHAPESHIFT_FORM, HotfixStatements.SEL_SPELL_SHAPESHIFT_FORM_LOCALE); + SpellTargetRestrictionsStorage = ReadDB2("SpellTargetRestrictions.db2", HotfixStatements.SEL_SPELL_TARGET_RESTRICTIONS); + SpellTotemsStorage = ReadDB2("SpellTotems.db2", HotfixStatements.SEL_SPELL_TOTEMS); + SpellVisualKitStorage = ReadDB2("SpellVisualKit.db2", HotfixStatements.SEL_SPELL_VISUAL_KIT); + SpellXSpellVisualStorage = ReadDB2("SpellXSpellVisual.db2", HotfixStatements.SEL_SPELL_X_SPELL_VISUAL); + SummonPropertiesStorage = ReadDB2("SummonProperties.db2", HotfixStatements.SEL_SUMMON_PROPERTIES); + //TactKeyStorage = ReadDB2("TactKey.db2", HotfixStatements.SEL_TACT_KEY); + TalentStorage = ReadDB2("Talent.db2", HotfixStatements.SEL_TALENT, HotfixStatements.SEL_TALENT_LOCALE); + TaxiNodesStorage = ReadDB2("TaxiNodes.db2", HotfixStatements.SEL_TAXI_NODES, HotfixStatements.SEL_TAXI_NODES_LOCALE); + TaxiPathStorage = ReadDB2("TaxiPath.db2", HotfixStatements.SEL_TAXI_PATH); + TaxiPathNodeStorage = ReadDB2("TaxiPathNode.db2", HotfixStatements.SEL_TAXI_PATH_NODE); + TotemCategoryStorage = ReadDB2("TotemCategory.db2", HotfixStatements.SEL_TOTEM_CATEGORY, HotfixStatements.SEL_TOTEM_CATEGORY_LOCALE); + ToyStorage = ReadDB2("Toy.db2", HotfixStatements.SEL_TOY, HotfixStatements.SEL_TOY_LOCALE); + TransmogHolidayStorage = ReadDB2("TransmogHoliday.db2", HotfixStatements.SEL_TRANSMOG_HOLIDAY); + TransmogSetStorage = ReadDB2("TransmogSet.db2", HotfixStatements.SEL_TRANSMOG_SET, HotfixStatements.SEL_TRANSMOG_SET_LOCALE); + TransmogSetGroupStorage = ReadDB2("TransmogSetGroup.db2", HotfixStatements.SEL_TRANSMOG_SET_GROUP, HotfixStatements.SEL_TRANSMOG_SET_GROUP_LOCALE); + TransmogSetItemStorage = ReadDB2("TransmogSetItem.db2", HotfixStatements.SEL_TRANSMOG_SET_ITEM); + TransportAnimationStorage = ReadDB2("TransportAnimation.db2", HotfixStatements.SEL_TRANSPORT_ANIMATION); + TransportRotationStorage = ReadDB2("TransportRotation.db2", HotfixStatements.SEL_TRANSPORT_ROTATION); + UiMapStorage = ReadDB2("UiMap.db2", HotfixStatements.SEL_UI_MAP, HotfixStatements.SEL_UI_MAP_LOCALE); + UiMapAssignmentStorage = ReadDB2("UiMapAssignment.db2", HotfixStatements.SEL_UI_MAP_ASSIGNMENT); + UiMapLinkStorage = ReadDB2("UiMapLink.db2", HotfixStatements.SEL_UI_MAP_LINK); + UiMapXMapArtStorage = ReadDB2("UiMapXMapArt.db2", HotfixStatements.SEL_UI_MAP_X_MAP_ART); + UnitPowerBarStorage = ReadDB2("UnitPowerBar.db2", HotfixStatements.SEL_UNIT_POWER_BAR, HotfixStatements.SEL_UNIT_POWER_BAR_LOCALE); + VehicleStorage = ReadDB2("Vehicle.db2", HotfixStatements.SEL_VEHICLE); + VehicleSeatStorage = ReadDB2("VehicleSeat.db2", HotfixStatements.SEL_VEHICLE_SEAT); + WMOAreaTableStorage = ReadDB2("WMOAreaTable.db2", HotfixStatements.SEL_WMO_AREA_TABLE, HotfixStatements.SEL_WMO_AREA_TABLE_LOCALE); + WorldEffectStorage = ReadDB2("WorldEffect.db2", HotfixStatements.SEL_WORLD_EFFECT); + WorldMapOverlayStorage = ReadDB2("WorldMapOverlay.db2", HotfixStatements.SEL_WORLD_MAP_OVERLAY); + WorldStateExpressionStorage = ReadDB2("WorldStateExpression.db2", HotfixStatements.SEL_WORLD_STATE_EXPRESSION); Global.DB2Mgr.LoadStores(); @@ -350,30 +365,37 @@ namespace Game.DataStorage Global.WorldMgr.ShutdownServ(10, ShutdownMask.Force, ShutdownExitCode.Error); } - Log.outInfo(LogFilter.ServerLoading, "Initialized {0} DB2 data storages in {1} ms", LoadedFileCount, Time.GetMSTimeDiffToNow(oldMSTime)); + Log.outInfo(LogFilter.ServerLoading, "Initialized {0} DB2 data storages in {1} ms", loadedFileCount, Time.GetMSTimeDiffToNow(oldMSTime)); + + return availableDb2Locales; } public static void LoadGameTables(string dataPath) { uint oldMSTime = Time.GetMSTime(); - LoadedFileCount = 0; - DataPath = dataPath + "/gt/"; + string gtPath = dataPath + "/gt/"; - ArtifactKnowledgeMultiplierGameTable = GameTableReader.Read("ArtifactKnowledgeMultiplier.txt"); - ArtifactLevelXPGameTable = GameTableReader.Read("artifactLevelXP.txt"); - BarberShopCostBaseGameTable = GameTableReader.Read("BarberShopCostBase.txt"); - BaseMPGameTable = GameTableReader.Read("BaseMp.txt"); - CombatRatingsGameTable = GameTableReader.Read("CombatRatings.txt"); - CombatRatingsMultByILvlGameTable = GameTableReader.Read("CombatRatingsMultByILvl.txt"); - ItemSocketCostPerLevelGameTable = GameTableReader.Read("ItemSocketCostPerLevel.txt"); - HpPerStaGameTable = GameTableReader.Read("HpPerSta.txt"); - NpcManaCostScalerGameTable = GameTableReader.Read("NPCManaCostScaler.txt"); - SpellScalingGameTable = GameTableReader.Read("SpellScaling.txt"); - StaminaMultByILvlGameTable = GameTableReader.Read("StaminaMultByILvl.txt"); - XpGameTable = GameTableReader.Read("xp.txt"); + uint loadedFileCount = 0; + GameTable ReadGameTable(string fileName) where T : new() + { + return GameTableReader.Read(gtPath, fileName, ref loadedFileCount); + } - Log.outInfo(LogFilter.ServerLoading, "Initialized {0} DBC GameTables data stores in {1} ms", LoadedFileCount, Time.GetMSTimeDiffToNow(oldMSTime)); + ArtifactKnowledgeMultiplierGameTable = ReadGameTable("ArtifactKnowledgeMultiplier.txt"); + ArtifactLevelXPGameTable = ReadGameTable("artifactLevelXP.txt"); + BarberShopCostBaseGameTable = ReadGameTable("BarberShopCostBase.txt"); + BaseMPGameTable = ReadGameTable("BaseMp.txt"); + CombatRatingsGameTable = ReadGameTable("CombatRatings.txt"); + CombatRatingsMultByILvlGameTable = ReadGameTable("CombatRatingsMultByILvl.txt"); + ItemSocketCostPerLevelGameTable = ReadGameTable("ItemSocketCostPerLevel.txt"); + HpPerStaGameTable = ReadGameTable("HpPerSta.txt"); + NpcManaCostScalerGameTable = ReadGameTable("NPCManaCostScaler.txt"); + SpellScalingGameTable = ReadGameTable("SpellScaling.txt"); + StaminaMultByILvlGameTable = ReadGameTable("StaminaMultByILvl.txt"); + XpGameTable = ReadGameTable("xp.txt"); + + Log.outInfo(LogFilter.ServerLoading, "Initialized {0} DBC GameTables data stores in {1} ms", loadedFileCount, Time.GetMSTimeDiffToNow(oldMSTime)); } #region Main Collections diff --git a/Source/Game/DataStorage/ClientReader/DB6Storage.cs b/Source/Game/DataStorage/ClientReader/DB6Storage.cs index 4905b6e43..907f5d053 100644 --- a/Source/Game/DataStorage/ClientReader/DB6Storage.cs +++ b/Source/Game/DataStorage/ClientReader/DB6Storage.cs @@ -23,6 +23,7 @@ using Framework.IO; using System; using System.Collections.Generic; using System.Reflection; +using System.Collections; namespace Game.DataStorage { @@ -38,7 +39,7 @@ namespace Game.DataStorage [Serializable] public class DB6Storage : Dictionary, IDB2Storage where T : new() { - public void LoadData(int indexField, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale) + public void LoadData(int indexField, BitSet availableDb2Locales, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale) { SQLResult result = DB.Hotfix.Query(DB.Hotfix.GetPreparedStatement(preparedStatement)); if (!result.IsEmpty()) @@ -193,7 +194,7 @@ namespace Game.DataStorage for (Locale locale = 0; locale < Locale.Total; ++locale) { - if (Global.WorldMgr.GetDefaultDbcLocale() == locale || locale == Locale.None) + if (Global.WorldMgr.GetDefaultDbcLocale() == locale || !availableDb2Locales[(int)locale]) continue; PreparedStatement stmt = DB.Hotfix.GetPreparedStatement(preparedStatementLocale); diff --git a/Source/Game/DataStorage/ClientReader/DBReader.cs b/Source/Game/DataStorage/ClientReader/DBReader.cs index c970f0f1f..2a191a863 100644 --- a/Source/Game/DataStorage/ClientReader/DBReader.cs +++ b/Source/Game/DataStorage/ClientReader/DBReader.cs @@ -27,26 +27,26 @@ using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; +using System.Collections; namespace Game.DataStorage { class DBReader { - private const int HeaderSize = 72; private const uint WDC3FmtSig = 0x33434457; // WDC3 - public static DB6Storage Read(string fileName, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale = 0) where T : new() + public static DB6Storage Read(BitSet availableDb2Locales, string db2Path, string fileName, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale, ref uint loadedFileCount) where T : new() { DB6Storage storage = new DB6Storage(); - if (!File.Exists(CliDB.DataPath + fileName)) + if (!File.Exists(db2Path + fileName)) { Log.outError(LogFilter.ServerLoading, $"File {fileName} not found."); return storage; } DBReader reader = new DBReader(); - using (var stream = new FileStream(CliDB.DataPath + fileName, FileMode.Open)) + using (var stream = new FileStream(db2Path + fileName, FileMode.Open)) { if (!reader.Load(stream)) { @@ -58,10 +58,10 @@ namespace Game.DataStorage foreach (var b in reader._records) storage.Add((uint)b.Key, b.Value.As()); - storage.LoadData(reader.Header.IdIndex, preparedStatement, preparedStatementLocale); + storage.LoadData(reader.Header.IdIndex, availableDb2Locales, preparedStatement, preparedStatementLocale); Global.DB2Mgr.AddDB2(reader.Header.TableHash, storage); - CliDB.LoadedFileCount++; + loadedFileCount++; return storage; } diff --git a/Source/Game/DataStorage/ClientReader/GameTables.cs b/Source/Game/DataStorage/ClientReader/GameTables.cs index a86215059..e5d053234 100644 --- a/Source/Game/DataStorage/ClientReader/GameTables.cs +++ b/Source/Game/DataStorage/ClientReader/GameTables.cs @@ -24,16 +24,16 @@ namespace Game.DataStorage { public class GameTableReader { - internal static GameTable Read(string fileName) where T : new() + internal static GameTable Read(string path, string fileName, ref uint loadedFileCount) where T : new() { GameTable storage = new GameTable(); - if (!File.Exists(CliDB.DataPath + fileName)) + if (!File.Exists(path + fileName)) { Log.outError(LogFilter.ServerLoading, "File {0} not found.", fileName); return storage; } - using (var reader = new StreamReader(CliDB.DataPath + fileName)) + using (var reader = new StreamReader(path + fileName)) { string headers = reader.ReadLine(); if (headers.IsEmpty()) @@ -73,7 +73,7 @@ namespace Game.DataStorage storage.SetData(data); } - CliDB.LoadedFileCount++; + loadedFileCount++; return storage; } } diff --git a/Source/Game/DataStorage/DB2Manager.cs b/Source/Game/DataStorage/DB2Manager.cs index 48a4d6f4d..96d2a8f9d 100644 --- a/Source/Game/DataStorage/DB2Manager.cs +++ b/Source/Game/DataStorage/DB2Manager.cs @@ -22,6 +22,7 @@ using Game.Networking; using System; using System.Collections.Generic; using System.Linq; +using System.Collections; namespace Game.DataStorage { @@ -658,13 +659,10 @@ namespace Game.DataStorage if (!deleted && !_storage.ContainsKey(tableHash)) { var key = Tuple.Create(tableHash, recordId); - foreach (var dic in _hotfixBlob) + if (!_hotfixBlob.Any(p => p.ContainsKey(key))) { - if (!dic.ContainsKey(key)) - { - Log.outError(LogFilter.Sql, $"Table `hotfix_data` references unknown DB2 store by hash 0x{tableHash:X} and has no reference to `hotfix_blob` in hotfix id {id} with RecordID: {recordId}"); - continue; - } + Log.outError(LogFilter.Sql, $"Table `hotfix_data` references unknown DB2 store by hash 0x{tableHash:X} and has no reference to `hotfix_blob` in hotfix id {id} with RecordID: {recordId}"); + continue; } } @@ -691,7 +689,7 @@ namespace Game.DataStorage Log.outInfo(LogFilter.Server, "Loaded {0} hotfix info entries in {1} ms", count, Time.GetMSTimeDiffToNow(oldMSTime)); } - public void LoadHotfixBlob() + public void LoadHotfixBlob(BitSet availableDb2Locales) { uint oldMSTime = Time.GetMSTime(); @@ -723,7 +721,10 @@ namespace Game.DataStorage continue; } - _hotfixBlob[(int)locale][Tuple.Create(tableHash, recordId)] = result.Read(2); + if (!availableDb2Locales[(int)locale]) + continue; + + _hotfixBlob[(int)locale][Tuple.Create(tableHash, recordId)] = result.Read(3); hotfixBlobCount++; } while (result.NextRow()); diff --git a/Source/Game/Server/WorldManager.cs b/Source/Game/Server/WorldManager.cs index 0ee30c179..d4da4922e 100644 --- a/Source/Game/Server/WorldManager.cs +++ b/Source/Game/Server/WorldManager.cs @@ -30,6 +30,7 @@ using Game.Networking; using Game.Networking.Packets; using Game.Spells; using System; +using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; @@ -340,10 +341,15 @@ namespace Game Log.outInfo(LogFilter.ServerLoading, "Initialize DataStorage..."); // Load DB2s - CliDB.LoadStores(_dataPath, m_defaultDbcLocale); + m_availableDbcLocaleMask = CliDB.LoadStores(_dataPath, m_defaultDbcLocale); + if (!m_availableDbcLocaleMask[(int)m_defaultDbcLocale]) + { + Log.outFatal(LogFilter.ServerLoading, $"Unable to load db2 files for {m_defaultDbcLocale} locale specified in DBC.Locale config!"); + ShutdownServ(1, ShutdownMask.Force, ShutdownExitCode.Error); + } Log.outInfo(LogFilter.ServerLoading, "Loading hotfix blobs..."); - Global.DB2Mgr.LoadHotfixBlob(); + Global.DB2Mgr.LoadHotfixBlob(m_availableDbcLocaleMask); Log.outInfo(LogFilter.ServerLoading, "Loading hotfix info..."); Global.DB2Mgr.LoadHotfixData(); @@ -2274,9 +2280,9 @@ namespace Game public Locale GetAvailableDbcLocale(Locale locale) { - //if (m_availableDbcLocaleMask & (1 << locale)) - //return locale; - //else + if (m_availableDbcLocaleMask[(int)locale]) + return locale; + else return m_defaultDbcLocale; } @@ -2321,6 +2327,7 @@ namespace Game uint m_playerLimit; AccountTypes m_allowedSecurityLevel; Locale m_defaultDbcLocale; // from config for one from loaded DBC locales + BitSet m_availableDbcLocaleMask; // by loaded DBC List m_motd = new List(); // scheduled reset times