Core/DataStores: Updated db2 structures to 11.0.5

Port From (https://github.com/TrinityCore/TrinityCore/commit/b0352ef78ed93e18a869652e628345bc660f252b)
This commit is contained in:
Hondacrx
2024-11-11 11:12:45 -05:00
parent 3cca83e5bd
commit 25a716db9e
9 changed files with 72 additions and 34 deletions
@@ -2215,6 +2215,41 @@ namespace Framework.Constants
Unk30 = 0x40000000, // 30
Unk31 = 0x80000000 // 31
}
public enum SpellAttr15 : uint
{
Unk0 = 0x01, // 0
Unk1 = 0x02, // 1
Unk2 = 0x04, // 2
Unk3 = 0x08, // 3
Unk4 = 0x10, // 4
Unk5 = 0x20, // 5
Unk6 = 0x40, // 6
Unk7 = 0x80, // 7
Unk8 = 0x100, // 8
Unk9 = 0x200, // 9
Unk10 = 0x400, // 10
Unk11 = 0x800, // 11
Unk12 = 0x1000, // 12
Unk13 = 0x2000, // 13
Unk14 = 0x4000, // 14
Unk15 = 0x8000, // 15
Unk16 = 0x10000, // 16
Unk17 = 0x20000, // 17
Unk18 = 0x40000, // 18
Unk19 = 0x80000, // 19
Unk20 = 0x100000, // 20
Unk21 = 0x200000, // 21
Unk22 = 0x400000, // 22
Unk23 = 0x800000, // 23
Unk24 = 0x1000000, // 24
Unk25 = 0x2000000, // 25
Unk26 = 0x4000000, // 26
Unk27 = 0x8000000, // 27
Unk28 = 0x10000000, // 28
Unk29 = 0x20000000, // 29
Unk30 = 0x40000000, // 30
Unk31 = 0x80000000 // 31
}
public enum SpellCustomAttributes
{
EnchantProc = 0x01,
@@ -212,7 +212,7 @@ namespace Framework.Database
" AND locale = ?");
// BroadcastTextDuration.db2
PrepareStatement(HotfixStatements.SEL_BROADCAST_TEXT_DURATION, "SELECT ID, BroadcastTextID, Locale, Duration FROM broadcast_text_duration" +
PrepareStatement(HotfixStatements.SEL_BROADCAST_TEXT_DURATION, "SELECT ID, Locale, Duration, BroadcastTextID FROM broadcast_text_duration" +
" WHERE (`VerifiedBuild` > 0) = ?");
// CfgCategories.db2
@@ -289,9 +289,9 @@ namespace Framework.Database
"ChrCustGeoComponentLinkID FROM chr_customization_element WHERE (`VerifiedBuild` > 0) = ?");
// ChrCustomizationOption.db2
PrepareStatement(HotfixStatements.SEL_CHR_CUSTOMIZATION_OPTION, "SELECT Name, ID, SecondaryID, Flags, ChrRacesID, Sex, ChrModelID, SortIndex, " +
"ChrCustomizationCategoryID, OptionType, BarberShopCostModifier, ChrCustomizationID, ChrCustomizationReqID, UiOrderIndex, AddedInPatch" +
" FROM chr_customization_option WHERE (`VerifiedBuild` > 0) = ?");
PrepareStatement(HotfixStatements.SEL_CHR_CUSTOMIZATION_OPTION, "SELECT Name, ID, SecondaryID, Flags, ChrModelID, SortIndex, ChrCustomizationCategoryID, " +
"OptionType, BarberShopCostModifier, ChrCustomizationID, ChrCustomizationReqID, UiOrderIndex, AddedInPatch FROM chr_customization_option" +
" WHERE (`VerifiedBuild` > 0) = ?");
PrepareStatement(HotfixStatements.SEL_CHR_CUSTOMIZATION_OPTION_LOCALE, "SELECT ID, Name_lang FROM chr_customization_option_locale" +
" WHERE (`VerifiedBuild` > 0) = ? AND locale = ?");
@@ -443,7 +443,7 @@ namespace Framework.Database
// Difficulty.db2
PrepareStatement(HotfixStatements.SEL_DIFFICULTY, "SELECT ID, Name, InstanceType, OrderIndex, OldEnumValue, FallbackDifficultyID, MinPlayers, MaxPlayers, " +
"Flags, ItemContext, ToggleDifficultyID, GroupSizeHealthCurveID, GroupSizeDmgCurveID, GroupSizeSpellPointsCurveID FROM difficulty" +
"Flags, ItemContext, ToggleDifficultyID, GroupSizeHealthCurveID, GroupSizeDmgCurveID, GroupSizeSpellPointsCurveID, Unknown1105 FROM difficulty" +
" WHERE (`VerifiedBuild` > 0) = ?");
PrepareStatement(HotfixStatements.SEL_DIFFICULTY_LOCALE, "SELECT ID, Name_lang FROM difficulty_locale WHERE (`VerifiedBuild` > 0) = ? AND locale = ?");
@@ -889,7 +889,7 @@ namespace Framework.Database
PrepareStatement(HotfixStatements.SEL_LFG_DUNGEONS, "SELECT ID, Name, Description, TypeID, Subtype, Faction, IconTextureFileID, RewardsBgTextureFileID, " +
"PopupBgTextureFileID, ExpansionLevel, MapID, DifficultyID, MinGear, GroupID, OrderIndex, RequiredPlayerConditionId, RandomID, ScenarioID, " +
"FinalEncounterID, CountTank, CountHealer, CountDamage, MinCountTank, MinCountHealer, MinCountDamage, BonusReputationAmount, MentorItemLevel, " +
"MentorCharLevel, ContentTuningID, Flags1, Flags2 FROM lfg_dungeons WHERE (`VerifiedBuild` > 0) = ?");
"MentorCharLevel, MaxPremadeGroupSize, ContentTuningID, Flags1, Flags2 FROM lfg_dungeons WHERE (`VerifiedBuild` > 0) = ?");
PrepareStatement(HotfixStatements.SEL_LFG_DUNGEONS_LOCALE, "SELECT ID, Name_lang, Description_lang FROM lfg_dungeons_locale WHERE (`VerifiedBuild` > 0) = ?" +
" AND locale = ?");
@@ -1296,7 +1296,7 @@ namespace Framework.Database
// SpellMisc.db2
PrepareStatement(HotfixStatements.SEL_SPELL_MISC, "SELECT ID, Attributes1, Attributes2, Attributes3, Attributes4, Attributes5, Attributes6, Attributes7, " +
"Attributes8, Attributes9, Attributes10, Attributes11, Attributes12, Attributes13, Attributes14, Attributes15, DifficultyID, " +
"Attributes8, Attributes9, Attributes10, Attributes11, Attributes12, Attributes13, Attributes14, Attributes15, Attributes16, DifficultyID, " +
"CastingTimeIndex, DurationIndex, PvPDurationIndex, RangeIndex, SchoolMask, Speed, LaunchDelay, MinDuration, SpellIconFileDataID, " +
"ActiveIconFileDataID, ContentTuningID, ShowFutureSpellPlayerConditionID, SpellVisualScript, ActiveSpellVisualScript, SpellID FROM spell_misc" +
" WHERE (`VerifiedBuild` > 0) = ?");
+7 -7
View File
@@ -449,14 +449,14 @@ namespace Game.DataStorage
}
// Check loaded DB2 files proper version
if (!AreaTableStorage.ContainsKey(15786) || // last area added in 11.0.2 (56647)
!CharTitlesStorage.ContainsKey(854) || // last char title added in 11.0.2 (56647)
if (!AreaTableStorage.ContainsKey(15913) || // last area added in 11.0.5 (57171)
!CharTitlesStorage.ContainsKey(871) || // last char title added in 11.0.5 (57171)
!FlightCapabilityStorage.ContainsKey(1) || // default flight capability (required)
!GemPropertiesStorage.ContainsKey(4251) || // last gem property added in 11.0.2 (56647)
!ItemStorage.ContainsKey(232498) || // last item added in 11.0.2 (56647)
!ItemExtendedCostStorage.ContainsKey(9369) || // last item extended cost added in 11.0.2 (56647)
!MapStorage.ContainsKey(2786) || // last map added in 11.0.2 (56647)
!SpellNameStorage.ContainsKey(471174)) // last spell added in 11.0.2 (56647)
!GemPropertiesStorage.ContainsKey(4251) || // last gem property added in 11.0.5 (57171)
!ItemStorage.ContainsKey(233014) || // last item added in 11.0.5 (57171)
!ItemExtendedCostStorage.ContainsKey(9647) || // last item extended cost added in 11.0.5 (57171)
!MapStorage.ContainsKey(2792) || // last map added in 11.0.5 (57171)
!SpellNameStorage.ContainsKey(474722)) // last spell added in 11.0.5 (57171)
{
Log.outFatal(LogFilter.ServerLoading, "You have _outdated_ DB2 files. Please extract correct versions from current using client.");
Environment.Exit(1);
+1 -1
View File
@@ -122,8 +122,8 @@ namespace Game.DataStorage
public sealed class BroadcastTextDurationRecord
{
public uint Id;
public uint BroadcastTextID;
public int Locale;
public int Duration;
public uint BroadcastTextID;
}
}
@@ -196,8 +196,6 @@ namespace Game.DataStorage
public uint Id;
public ushort SecondaryID;
public int Flags;
public int ChrRacesID;
public int Sex;
public uint ChrModelID;
public int SortIndex;
public int ChrCustomizationCategoryID;
@@ -48,6 +48,7 @@ namespace Game.DataStorage
public uint GroupSizeHealthCurveID;
public uint GroupSizeDmgCurveID;
public uint GroupSizeSpellPointsCurveID;
public int Unknown1105;
public bool HasFlag(DifficultyFlags difficultyFlags) { return (Flags & (ushort)difficultyFlags) != 0; }
}
@@ -53,6 +53,7 @@ namespace Game.DataStorage
public ushort BonusReputationAmount;
public ushort MentorItemLevel;
public byte MentorCharLevel;
public byte MaxPremadeGroupSize;
public uint ContentTuningID;
public LfgFlags[] Flags = new LfgFlags[2];
+1 -1
View File
@@ -446,7 +446,7 @@ namespace Game.DataStorage
public sealed class SpellMiscRecord
{
public uint Id;
public int[] Attributes = new int[15];
public int[] Attributes = new int[16];
public byte DifficultyID;
public ushort CastingTimeIndex;
public ushort DurationIndex;
+19 -16
View File
@@ -56,6 +56,7 @@ namespace Game.Spells
AttributesEx12 = (SpellAttr12)_misc.Attributes[12];
AttributesEx13 = (SpellAttr13)_misc.Attributes[13];
AttributesEx14 = (SpellAttr14)_misc.Attributes[14];
AttributesEx15 = (SpellAttr15)_misc.Attributes[15];
CastTimeEntry = CliDB.SpellCastTimesStorage.LookupByKey(_misc.CastingTimeIndex);
DurationEntry = CliDB.SpellDurationStorage.LookupByKey(_misc.DurationIndex);
RangeEntry = CliDB.SpellRangeStorage.LookupByKey(_misc.RangeIndex);
@@ -3786,22 +3787,23 @@ namespace Game.Spells
return _visuals;
}
public bool HasAttribute(SpellAttr0 attribute) { return Convert.ToBoolean(Attributes & attribute); }
public bool HasAttribute(SpellAttr1 attribute) { return Convert.ToBoolean(AttributesEx & attribute); }
public bool HasAttribute(SpellAttr2 attribute) { return Convert.ToBoolean(AttributesEx2 & attribute); }
public bool HasAttribute(SpellAttr3 attribute) { return Convert.ToBoolean(AttributesEx3 & attribute); }
public bool HasAttribute(SpellAttr4 attribute) { return Convert.ToBoolean(AttributesEx4 & attribute); }
public bool HasAttribute(SpellAttr5 attribute) { return Convert.ToBoolean(AttributesEx5 & attribute); }
public bool HasAttribute(SpellAttr6 attribute) { return Convert.ToBoolean(AttributesEx6 & attribute); }
public bool HasAttribute(SpellAttr7 attribute) { return Convert.ToBoolean(AttributesEx7 & attribute); }
public bool HasAttribute(SpellAttr8 attribute) { return Convert.ToBoolean(AttributesEx8 & attribute); }
public bool HasAttribute(SpellAttr9 attribute) { return Convert.ToBoolean(AttributesEx9 & attribute); }
public bool HasAttribute(SpellAttr10 attribute) { return Convert.ToBoolean(AttributesEx10 & attribute); }
public bool HasAttribute(SpellAttr11 attribute) { return Convert.ToBoolean(AttributesEx11 & attribute); }
public bool HasAttribute(SpellAttr12 attribute) { return Convert.ToBoolean(AttributesEx12 & attribute); }
public bool HasAttribute(SpellAttr13 attribute) { return Convert.ToBoolean(AttributesEx13 & attribute); }
public bool HasAttribute(SpellAttr14 attribute) { return Convert.ToBoolean(AttributesEx14 & attribute); }
public bool HasAttribute(SpellCustomAttributes attribute) { return Convert.ToBoolean(AttributesCu & attribute); }
public bool HasAttribute(SpellAttr0 attribute) { return (Attributes & attribute) != 0; }
public bool HasAttribute(SpellAttr1 attribute) { return (AttributesEx & attribute) != 0; }
public bool HasAttribute(SpellAttr2 attribute) { return (AttributesEx2 & attribute) != 0; }
public bool HasAttribute(SpellAttr3 attribute) { return (AttributesEx3 & attribute) != 0; }
public bool HasAttribute(SpellAttr4 attribute) { return (AttributesEx4 & attribute) != 0; }
public bool HasAttribute(SpellAttr5 attribute) { return (AttributesEx5 & attribute) != 0; }
public bool HasAttribute(SpellAttr6 attribute) { return (AttributesEx6 & attribute) != 0; }
public bool HasAttribute(SpellAttr7 attribute) { return (AttributesEx7 & attribute) != 0; }
public bool HasAttribute(SpellAttr8 attribute) { return (AttributesEx8 & attribute) != 0; }
public bool HasAttribute(SpellAttr9 attribute) { return (AttributesEx9 & attribute) != 0; }
public bool HasAttribute(SpellAttr10 attribute) { return (AttributesEx10 & attribute) != 0; }
public bool HasAttribute(SpellAttr11 attribute) { return (AttributesEx11 & attribute) != 0; }
public bool HasAttribute(SpellAttr12 attribute) { return (AttributesEx12 & attribute) != 0; }
public bool HasAttribute(SpellAttr13 attribute) { return (AttributesEx13 & attribute) != 0; }
public bool HasAttribute(SpellAttr14 attribute) { return (AttributesEx14 & attribute) != 0; }
public bool HasAttribute(SpellAttr15 attribute) { return (AttributesEx15 & attribute) != 0; }
public bool HasAttribute(SpellCustomAttributes attribute) { return (AttributesCu & attribute) != 0; }
public bool CanBeInterrupted(WorldObject interruptCaster, Unit interruptTarget, bool ignoreImmunity = false)
{
@@ -3843,6 +3845,7 @@ namespace Game.Spells
public SpellAttr12 AttributesEx12 { get; set; }
public SpellAttr13 AttributesEx13 { get; set; }
public SpellAttr14 AttributesEx14 { get; set; }
public SpellAttr15 AttributesEx15 { get; set; }
public SpellCustomAttributes AttributesCu { get; set; }
public BitSet NegativeEffects { get; set; } = new BitSet(SpellConst.MaxEffects);
public ulong Stances { get; set; }