Updated to 8.2.0.31429 (scripts disabled atm, they still need updated)

Code Port from TrinityCore https://github.com/TrinityCore/TrinityCore
Casc from WoW-Tools https://github.com/WoW-Tools/CASCExplorer
This commit is contained in:
hondacrx
2019-08-14 11:20:42 -04:00
parent e4d500f4b5
commit 125e3b3ac7
232 changed files with 12268 additions and 14670 deletions
+11 -11
View File
@@ -76,6 +76,7 @@ namespace Game.DataStorage
CinematicCameraStorage = DBReader.Read<CinematicCameraRecord>("CinematicCamera.db2", HotfixStatements.SEL_CINEMATIC_CAMERA);
CinematicSequencesStorage = DBReader.Read<CinematicSequencesRecord>("CinematicSequences.db2", HotfixStatements.SEL_CINEMATIC_SEQUENCES);
ContentTuningStorage = DBReader.Read<ContentTuningRecord>("ContentTuning.db2", HotfixStatements.SEL_CONTENT_TUNING);
ContentTuningXExpectedStorage = DBReader.Read<ContentTuningXExpectedRecord>("ContentTuningXExpected.db2", HotfixStatements.SEL_CONTENT_TUNING_X_EXPECTED);
ConversationLineStorage = DBReader.Read<ConversationLineRecord>("ConversationLine.db2", HotfixStatements.SEL_CONVERSATION_LINE);
CreatureDisplayInfoStorage = DBReader.Read<CreatureDisplayInfoRecord>("CreatureDisplayInfo.db2", HotfixStatements.SEL_CREATURE_DISPLAY_INFO);
CreatureDisplayInfoExtraStorage = DBReader.Read<CreatureDisplayInfoExtraRecord>("CreatureDisplayInfoExtra.db2", HotfixStatements.SEL_CREATURE_DISPLAY_INFO_EXTRA);
@@ -153,8 +154,6 @@ namespace Game.DataStorage
ItemLimitCategoryConditionStorage = DBReader.Read<ItemLimitCategoryConditionRecord>("ItemLimitCategoryCondition.db2", HotfixStatements.SEL_ITEM_LIMIT_CATEGORY_CONDITION);
ItemModifiedAppearanceStorage = DBReader.Read<ItemModifiedAppearanceRecord>("ItemModifiedAppearance.db2", HotfixStatements.SEL_ITEM_MODIFIED_APPEARANCE);
ItemPriceBaseStorage = DBReader.Read<ItemPriceBaseRecord>("ItemPriceBase.db2", HotfixStatements.SEL_ITEM_PRICE_BASE);
ItemRandomPropertiesStorage = DBReader.Read<ItemRandomPropertiesRecord>("ItemRandomProperties.db2", HotfixStatements.SEL_ITEM_RANDOM_PROPERTIES, HotfixStatements.SEL_ITEM_RANDOM_PROPERTIES_LOCALE);
ItemRandomSuffixStorage = DBReader.Read<ItemRandomSuffixRecord>("ItemRandomSuffix.db2", HotfixStatements.SEL_ITEM_RANDOM_SUFFIX, HotfixStatements.SEL_ITEM_RANDOM_SUFFIX_LOCALE);
ItemSearchNameStorage = DBReader.Read<ItemSearchNameRecord>("ItemSearchName.db2", HotfixStatements.SEL_ITEM_SEARCH_NAME, HotfixStatements.SEL_ITEM_SEARCH_NAME_LOCALE);
ItemSetStorage = DBReader.Read<ItemSetRecord>("ItemSet.db2", HotfixStatements.SEL_ITEM_SET, HotfixStatements.SEL_ITEM_SET_LOCALE);
ItemSetSpellStorage = DBReader.Read<ItemSetSpellRecord>("ItemSetSpell.db2", HotfixStatements.SEL_ITEM_SET_SPELL);
@@ -324,13 +323,13 @@ namespace Game.DataStorage
}
// Check loaded DB2 files proper version
if (!AreaTableStorage.ContainsKey(10048) || // last area added in 8.0.1 (28153)
!CharTitlesStorage.ContainsKey(633) || // last char title added in 8.0.1 (28153)
!GemPropertiesStorage.ContainsKey(3745) || // last gem property added in 8.0.1 (28153)
!ItemStorage.ContainsKey(164760) || // last item added in 8.0.1 (28153)
!ItemExtendedCostStorage.ContainsKey(6448) || // last item extended cost added in 8.0.1 (28153)
!MapStorage.ContainsKey(2103) || // last map added in 8.0.1 (28153)
!SpellNameStorage.ContainsKey(281872)) // last spell added in 8.0.1 (28153)
if (!AreaTableStorage.ContainsKey(10521) || // last area added in 8.0.1 (28153)
!CharTitlesStorage.ContainsKey(649) || // last char title added in 8.0.1 (28153)
!GemPropertiesStorage.ContainsKey(3746) || // last gem property added in 8.0.1 (28153)
!ItemStorage.ContainsKey(168279) || // last item added in 8.0.1 (28153)
!ItemExtendedCostStorage.ContainsKey(6545) || // last item extended cost added in 8.0.1 (28153)
!MapStorage.ContainsKey(2178) || // last map added in 8.0.1 (28153)
!SpellNameStorage.ContainsKey(296952)) // last spell added in 8.0.1 (28153)
{
Log.outError(LogFilter.Misc, "You have _outdated_ DB2 files. Please extract correct versions from current using client.");
Global.WorldMgr.ShutdownServ(10, ShutdownMask.Force, ShutdownExitCode.Error);
@@ -420,6 +419,7 @@ namespace Game.DataStorage
public static DB6Storage<CinematicCameraRecord> CinematicCameraStorage;
public static DB6Storage<CinematicSequencesRecord> CinematicSequencesStorage;
public static DB6Storage<ContentTuningRecord> ContentTuningStorage;
public static DB6Storage<ContentTuningXExpectedRecord> ContentTuningXExpectedStorage;
public static DB6Storage<ConversationLineRecord> ConversationLineStorage;
public static DB6Storage<CreatureDisplayInfoRecord> CreatureDisplayInfoStorage;
public static DB6Storage<CreatureDisplayInfoExtraRecord> CreatureDisplayInfoExtraStorage;
@@ -497,8 +497,6 @@ namespace Game.DataStorage
public static DB6Storage<ItemLimitCategoryConditionRecord> ItemLimitCategoryConditionStorage;
public static DB6Storage<ItemModifiedAppearanceRecord> ItemModifiedAppearanceStorage;
public static DB6Storage<ItemPriceBaseRecord> ItemPriceBaseStorage;
public static DB6Storage<ItemRandomPropertiesRecord> ItemRandomPropertiesStorage;
public static DB6Storage<ItemRandomSuffixRecord> ItemRandomSuffixStorage;
public static DB6Storage<ItemSearchNameRecord> ItemSearchNameStorage;
public static DB6Storage<ItemSetRecord> ItemSetStorage;
public static DB6Storage<ItemSetSpellRecord> ItemSetSpellStorage;
@@ -725,6 +723,8 @@ namespace Game.DataStorage
return row.Health;
case -8:
return row.DamageReplaceStat;
case -9:
return row.DamageSecondary;
default:
break;
}
@@ -232,34 +232,34 @@ namespace Game.DataStorage
switch (Type.GetTypeCode(type))
{
case TypeCode.Boolean:
buffer.WriteUInt8(fieldInfo.GetValue(entry));
buffer.WriteUInt8((byte)((bool)fieldInfo.GetValue(entry) ? 1 : 0));
break;
case TypeCode.SByte:
buffer.WriteInt8(fieldInfo.GetValue(entry));
buffer.WriteInt8((sbyte)fieldInfo.GetValue(entry));
break;
case TypeCode.Byte:
buffer.WriteUInt8(fieldInfo.GetValue(entry));
buffer.WriteUInt8((byte)fieldInfo.GetValue(entry));
break;
case TypeCode.Int16:
buffer.WriteInt16(fieldInfo.GetValue(entry));
buffer.WriteInt16((short)fieldInfo.GetValue(entry));
break;
case TypeCode.UInt16:
buffer.WriteUInt16(fieldInfo.GetValue(entry));
buffer.WriteUInt16((ushort)fieldInfo.GetValue(entry));
break;
case TypeCode.Int32:
buffer.WriteInt32(fieldInfo.GetValue(entry));
buffer.WriteInt32((int)fieldInfo.GetValue(entry));
break;
case TypeCode.UInt32:
buffer.WriteUInt32(fieldInfo.GetValue(entry));
buffer.WriteUInt32((uint)fieldInfo.GetValue(entry));
break;
case TypeCode.Int64:
buffer.WriteInt64(fieldInfo.GetValue(entry));
buffer.WriteInt64((long)fieldInfo.GetValue(entry));
break;
case TypeCode.UInt64:
buffer.WriteUInt64(fieldInfo.GetValue(entry));
buffer.WriteUInt64((ulong)fieldInfo.GetValue(entry));
break;
case TypeCode.Single:
buffer.WriteFloat(fieldInfo.GetValue(entry));
buffer.WriteFloat((float)fieldInfo.GetValue(entry));
break;
case TypeCode.Object:
switch (type.Name)
@@ -294,34 +294,34 @@ namespace Game.DataStorage
switch (Type.GetTypeCode(type))
{
case TypeCode.Boolean:
buffer.WriteUInt8(array.GetValue(i));
buffer.WriteUInt8((byte)((bool)array.GetValue(i) ? 1 : 0));
break;
case TypeCode.SByte:
buffer.WriteInt8(array.GetValue(i));
buffer.WriteInt8((sbyte)array.GetValue(i));
break;
case TypeCode.Byte:
buffer.WriteUInt8(array.GetValue(i));
buffer.WriteUInt8((byte)array.GetValue(i));
break;
case TypeCode.Int16:
buffer.WriteInt16(array.GetValue(i));
buffer.WriteInt16((short)array.GetValue(i));
break;
case TypeCode.UInt16:
buffer.WriteUInt16(array.GetValue(i));
buffer.WriteUInt16((ushort)array.GetValue(i));
break;
case TypeCode.Int32:
buffer.WriteInt32(array.GetValue(i));
buffer.WriteInt32((int)array.GetValue(i));
break;
case TypeCode.UInt32:
buffer.WriteUInt32(array.GetValue(i));
buffer.WriteUInt32((uint)array.GetValue(i));
break;
case TypeCode.Int64:
buffer.WriteInt64(array.GetValue(i));
buffer.WriteInt64((long)array.GetValue(i));
break;
case TypeCode.UInt64:
buffer.WriteUInt64(array.GetValue(i));
buffer.WriteUInt64((ulong)array.GetValue(i));
break;
case TypeCode.Single:
buffer.WriteFloat(array.GetValue(i));
buffer.WriteFloat((float)array.GetValue(i));
break;
case TypeCode.String:
var str = (string)array.GetValue(i);
@@ -32,8 +32,8 @@ namespace Game.DataStorage
{
class DBReader
{
private const int HeaderSize = 72 + 1 * 36;
private const uint WDC2FmtSig = 0x32434457; // WDC2
private const int HeaderSize = 72;
private const uint WDC3FmtSig = 0x33434457; // WDC3
public static DB6Storage<T> Read<T>(string fileName, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale = 0) where T : new()
{
@@ -71,7 +71,7 @@ namespace Game.DataStorage
{
Header = new WDCHeader();
Header.Signature = reader.ReadUInt32();
if (Header.Signature != WDC2FmtSig)
if (Header.Signature != WDC3FmtSig)
return false;
Header.RecordCount = reader.ReadUInt32();
@@ -126,28 +126,41 @@ namespace Game.DataStorage
}
}
long previousStringTableSize = 0;
for (int sectionIndex = 0; sectionIndex < Header.SectionsCount; sectionIndex++)
{
if (sections[sectionIndex].TactKeyLookup != 0)// && !hasTactKeyFunc(sections[sectionIndex].TactKeyLookup))
{
previousStringTableSize += sections[sectionIndex].StringTableSize;
//Console.WriteLine("Detected db2 with encrypted section! HasKey {0}", CASC.HasKey(Sections[sectionIndex].TactKeyLookup));
continue;
}
reader.BaseStream.Position = sections[sectionIndex].FileOffset;
byte[] recordsData;
Dictionary<long, string> stringsTable = null;
List<Tuple<int, short>> offsetmap = null;
SparseEntry[] sparseEntries = null;
if (!Header.HasOffsetTable())
{
// records data
recordsData = reader.ReadBytes((int)(sections[sectionIndex].NumRecords * Header.RecordSize));
Array.Resize(ref recordsData, recordsData.Length + 8); // pad with extra zeros so we don't crash when reading
// string data
stringsTable = new Dictionary<long, string>();
long stringDataOffset = 0;
if (sectionIndex == 0)
stringDataOffset = (Header.RecordCount - sections[sectionIndex].NumRecords) * Header.RecordSize;
else
stringDataOffset = previousStringTableSize;
for (int i = 0; i < sections[sectionIndex].StringTableSize;)
{
long oldPos = reader.BaseStream.Position;
stringsTable[oldPos] = reader.ReadCString();
stringsTable[oldPos + stringDataOffset] = reader.ReadCString();
i += (int)(reader.BaseStream.Position - oldPos);
}
@@ -159,29 +172,23 @@ namespace Game.DataStorage
if (reader.BaseStream.Position != sections[sectionIndex].SparseTableOffset)
throw new Exception("reader.BaseStream.Position != sections[sectionIndex].SparseTableOffset");
offsetmap = new List<Tuple<int, short>>();
for (int i = 0; i < (Header.MaxId - Header.MinId + 1); i++)
{
int offset = reader.ReadInt32();
short length = reader.ReadInt16();
if (offset == 0 || length == 0)
continue;
offsetmap.Add(new Tuple<int, short>(offset, length));
}
}
Array.Resize(ref recordsData, recordsData.Length + 8); // pad with extra zeros so we don't crash when reading
// index data
int[] indexData = reader.ReadArray<int>((uint)(sections[sectionIndex].IndexDataSize / 4));
bool isIndexEmpty = Header.HasIndexTable() && indexData.Count(i => i == 0) == sections[sectionIndex].NumRecords;
// duplicate rows data
Dictionary<int, int> copyData = new Dictionary<int, int>();
for (int i = 0; i < sections[sectionIndex].CopyTableSize / 8; i++)
for (int i = 0; i < sections[sectionIndex].NumCopyRecords; i++)
copyData[reader.ReadInt32()] = reader.ReadInt32();
if (sections[sectionIndex].NumSparseRecords > 0)
sparseEntries = reader.ReadArray<SparseEntry>((uint)sections[sectionIndex].NumSparseRecords);
// reference data
ReferenceData refData = null;
@@ -208,24 +215,31 @@ namespace Game.DataStorage
};
}
if (sections[sectionIndex].NumSparseRecords > 0)
{
// TODO: use this shit
int[] sparseIndexData = reader.ReadArray<int>((uint)sections[sectionIndex].NumSparseRecords);
if (Header.HasIndexTable() && indexData.Length != sparseIndexData.Length)
throw new Exception("indexData.Length != sparseIndexData.Length");
//indexData = sparseIndexData;
}
BitReader bitReader = new BitReader(recordsData);
for (int i = 0; i < Header.RecordCount; ++i)
for (int i = 0; i < sections[sectionIndex].NumRecords; ++i)
{
bitReader.Position = 0;
if (offsetmap != null)
bitReader.Offset = offsetmap[i].Item1 - sections[sectionIndex].FileOffset;
if (Header.HasOffsetTable())
bitReader.Offset = sparseEntries[i].Offset - sections[sectionIndex].FileOffset;
else
bitReader.Offset = i * (int)Header.RecordSize;
bool hasRef = refData.Entries.TryGetValue(i, out int refId);
var rec = new WDC2Row(this, bitReader, sections[sectionIndex].FileOffset, sections[sectionIndex].IndexDataSize != 0 ? indexData[i] : -1, hasRef ? refId : -1, stringsTable);
if (sections[sectionIndex].IndexDataSize != 0)
_records.Add(indexData[i], rec);
else
_records.Add(rec.Id, rec);
var rec = new WDC3Row(this, bitReader, sections[sectionIndex].FileOffset, Header.HasIndexTable() ? (isIndexEmpty ? i : indexData[i]) : -1, hasRef ? refId : -1, stringsTable);
_records.Add(rec.Id, rec);
}
foreach (var copyRow in copyData)
@@ -234,6 +248,8 @@ namespace Game.DataStorage
rec.Id = copyRow.Key;
_records.Add(copyRow.Key, rec);
}
previousStringTableSize += sections[sectionIndex].StringTableSize;
}
}
@@ -246,10 +262,10 @@ namespace Game.DataStorage
internal Value32[][] PalletData;
internal Dictionary<int, Value32>[] CommonData;
Dictionary<int, WDC2Row> _records = new Dictionary<int, WDC2Row>();
Dictionary<int, WDC3Row> _records = new Dictionary<int, WDC3Row>();
}
class WDC2Row
class WDC3Row
{
private BitReader _data;
private int _dataOffset;
@@ -265,7 +281,7 @@ namespace Game.DataStorage
private Dictionary<int, Value32>[] _commonData;
private Dictionary<long, string> _stringsTable;
public WDC2Row(DBReader reader, BitReader data, int recordsOffset, int id, int refId, Dictionary<long, string> stringsTable)
public WDC3Row(DBReader reader, BitReader data, int recordsOffset, int id, int refId, Dictionary<long, string> stringsTable)
{
_data = data;
_recordsOffset = recordsOffset;
@@ -553,9 +569,9 @@ namespace Game.DataStorage
return obj;
}
public WDC2Row Clone()
public WDC3Row Clone()
{
return (WDC2Row)MemberwiseClone();
return (WDC3Row)MemberwiseClone();
}
}
@@ -669,14 +685,15 @@ namespace Game.DataStorage
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SectionHeader
{
public long TactKeyLookup;
public ulong TactKeyLookup;
public int FileOffset;
public int NumRecords;
public int StringTableSize;
public int CopyTableSize;
public int SparseTableOffset; // CatalogDataOffset, absolute value, {uint offset, ushort size}[MaxId - MinId + 1]
public int IndexDataSize; // int indexData[IndexDataSize / 4]
public int ParentLookupDataSize; // uint NumRecords, uint minId, uint maxId, {uint id, uint index}[NumRecords], questionable usefulness...
public int NumSparseRecords;
public int NumCopyRecords;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
+72 -20
View File
@@ -136,6 +136,13 @@ namespace Game.DataStorage
_defaultChrSpecializationsByClass[(uint)chrSpec.ClassID] = chrSpec;
}
foreach (ContentTuningXExpectedRecord contentTuningXExpectedStat in CliDB.ContentTuningXExpectedStorage.Values)
{
ExpectedStatModRecord expectedStatMod = CliDB.ExpectedStatModStorage.LookupByKey(contentTuningXExpectedStat.ExpectedStatModID);
if (expectedStatMod != null)
_expectedStatModsByContentTuning.Add(contentTuningXExpectedStat.ContentTuningID, expectedStatMod);
}
foreach (CurvePointRecord curvePoint in CliDB.CurvePointStorage.Values)
{
if (CliDB.CurveStorage.ContainsKey(curvePoint.CurveID))
@@ -396,6 +403,12 @@ namespace Game.DataStorage
CliDB.RulesetItemUpgradeStorage.Clear();
foreach (SkillLineRecord skill in CliDB.SkillLineStorage.Values)
{
if (skill.ParentSkillLineID != 0)
_skillLinesByParentSkillLine.Add(skill.ParentSkillLineID, skill);
}
foreach (SkillLineAbilityRecord skillLineAbility in CliDB.SkillLineAbilityStorage.Values)
_skillLineAbilitiesBySkillupSkill.Add(skillLineAbility.SkillupSkillLineID != 0 ? skillLineAbility.SkillupSkillLineID : skillLineAbility.SkillLine, skillLineAbility);
@@ -969,61 +982,93 @@ namespace Game.DataStorage
if (expectedStatRecord == null)
return 1.0f;
ExpectedStatModRecord[] mods = new ExpectedStatModRecord[3];
ContentTuningRecord contentTuning = CliDB.ContentTuningStorage.LookupByKey(contentTuningId);
if (contentTuning != null)
{
mods[0] = CliDB.ExpectedStatModStorage.LookupByKey(contentTuning.ExpectedStatModID);
mods[1] = CliDB.ExpectedStatModStorage.LookupByKey(contentTuning.DifficultyESMID);
}
ExpectedStatModRecord classMod = null;
switch (unitClass)
{
case Class.Warrior:
mods[2] = CliDB.ExpectedStatModStorage.LookupByKey(4);
classMod = CliDB.ExpectedStatModStorage.LookupByKey(4);
break;
case Class.Paladin:
mods[2] = CliDB.ExpectedStatModStorage.LookupByKey(2);
classMod = CliDB.ExpectedStatModStorage.LookupByKey(2);
break;
case Class.Rogue:
mods[2] = CliDB.ExpectedStatModStorage.LookupByKey(3);
classMod = CliDB.ExpectedStatModStorage.LookupByKey(3);
break;
case Class.Mage:
mods[2] = CliDB.ExpectedStatModStorage.LookupByKey(1);
classMod = CliDB.ExpectedStatModStorage.LookupByKey(1);
break;
default:
break;
}
List<ExpectedStatModRecord> contentTuningMods = _expectedStatModsByContentTuning.LookupByKey(contentTuningId);
float value = 0.0f;
switch (stat)
{
case ExpectedStatType.CreatureHealth:
value = mods.Sum(expectedStatMod => expectedStatRecord.CreatureHealth * (expectedStatMod != null ? expectedStatMod.CreatureHealthMod : 1.0f));
value = expectedStatRecord.CreatureHealth;
if (contentTuningMods != null)
value *= contentTuningMods.Sum(expectedStatMod => expectedStatMod != null ? expectedStatMod.CreatureHealthMod : 1.0f);
if (classMod != null)
value *= classMod.CreatureHealthMod;
break;
case ExpectedStatType.PlayerHealth:
value = mods.Sum(expectedStatMod => expectedStatRecord.PlayerHealth * (expectedStatMod != null ? expectedStatMod.PlayerHealthMod : 1.0f));
value = expectedStatRecord.PlayerHealth;
if (contentTuningMods != null)
value *= contentTuningMods.Sum(expectedStatMod => expectedStatMod != null ? expectedStatMod.PlayerHealthMod : 1.0f);
if (classMod != null)
value *= classMod.PlayerHealthMod;
break;
case ExpectedStatType.CreatureAutoAttackDps:
value = mods.Sum(expectedStatMod => expectedStatRecord.CreatureAutoAttackDps * (expectedStatMod != null ? expectedStatMod.CreatureAutoAttackDPSMod : 1.0f));
value = expectedStatRecord.CreatureAutoAttackDps;
if (contentTuningMods != null)
value *= contentTuningMods.Sum(expectedStatMod => expectedStatMod != null ? expectedStatMod.CreatureAutoAttackDPSMod : 1.0f);
if (classMod != null)
value *= classMod.CreatureAutoAttackDPSMod;
break;
case ExpectedStatType.CreatureArmor:
value = mods.Sum(expectedStatMod => expectedStatRecord.CreatureArmor * (expectedStatMod != null ? expectedStatMod.CreatureArmorMod : 1.0f));
value = expectedStatRecord.CreatureArmor;
if (contentTuningMods != null)
value *= contentTuningMods.Sum(expectedStatMod => expectedStatMod != null ? expectedStatMod.CreatureArmorMod : 1.0f);
if (classMod != null)
value *= classMod.CreatureArmorMod;
break;
case ExpectedStatType.PlayerMana:
value = mods.Sum(expectedStatMod => expectedStatRecord.PlayerMana * (expectedStatMod != null ? expectedStatMod.PlayerManaMod : 1.0f));
value = expectedStatRecord.PlayerMana;
if (contentTuningMods != null)
value *= contentTuningMods.Sum(expectedStatMod => expectedStatMod != null ? expectedStatMod.PlayerManaMod : 1.0f);
if (classMod != null)
value *= classMod.PlayerManaMod;
break;
case ExpectedStatType.PlayerPrimaryStat:
value = mods.Sum(expectedStatMod => expectedStatRecord.PlayerPrimaryStat * (expectedStatMod != null ? expectedStatMod.PlayerPrimaryStatMod : 1.0f));
value = expectedStatRecord.PlayerPrimaryStat;
if (contentTuningMods != null)
value *= contentTuningMods.Sum(expectedStatMod => expectedStatMod != null ? expectedStatMod.PlayerPrimaryStatMod : 1.0f);
if (classMod != null)
value *= classMod.PlayerPrimaryStatMod;
break;
case ExpectedStatType.PlayerSecondaryStat:
value = mods.Sum(expectedStatMod => expectedStatRecord.PlayerSecondaryStat * (expectedStatMod != null ? expectedStatMod.PlayerSecondaryStatMod : 1.0f));
value = expectedStatRecord.PlayerSecondaryStat;
if (contentTuningMods != null)
value *= contentTuningMods.Sum(expectedStatMod => expectedStatMod != null ? expectedStatMod.PlayerSecondaryStatMod : 1.0f);
if (classMod != null)
value *= classMod.PlayerSecondaryStatMod;
break;
case ExpectedStatType.ArmorConstant:
value = mods.Sum(expectedStatMod => expectedStatRecord.ArmorConstant * (expectedStatMod != null ? expectedStatMod.ArmorConstantMod : 1.0f));
value = expectedStatRecord.ArmorConstant;
if (contentTuningMods != null)
value *= contentTuningMods.Sum(expectedStatMod => expectedStatMod != null ? expectedStatMod.ArmorConstantMod : 1.0f);
if (classMod != null)
value *= classMod.ArmorConstantMod;
break;
case ExpectedStatType.None:
break;
case ExpectedStatType.CreatureSpellDamage:
value = mods.Sum(expectedStatMod => expectedStatRecord.CreatureSpellDamage * (expectedStatMod != null ? expectedStatMod.CreatureSpellDamageMod : 1.0f));
value = expectedStatRecord.CreatureSpellDamage;
if (contentTuningMods != null)
value *= contentTuningMods.Sum(expectedStatMod => expectedStatMod != null ? expectedStatMod.CreatureSpellDamageMod : 1.0f);
if (classMod != null)
value *= classMod.CreatureSpellDamageMod;
break;
default:
break;
@@ -1479,6 +1524,11 @@ namespace Game.DataStorage
return _rulesetItemUpgrade.LookupByKey(itemId);
}
public List<SkillLineRecord> GetSkillLinesForParentSkill(uint parentSkillId)
{
return _skillLinesByParentSkillLine.LookupByKey(parentSkillId);
}
public List<SkillLineAbilityRecord> GetSkillLineAbilitiesBySkill(uint skillId)
{
return _skillLineAbilitiesBySkillupSkill.LookupByKey(skillId);
@@ -1903,6 +1953,7 @@ namespace Game.DataStorage
MultiMap<uint, CurvePointRecord> _curvePoints = new MultiMap<uint, CurvePointRecord>();
Dictionary<Tuple<uint, byte, byte, byte>, EmotesTextSoundRecord> _emoteTextSounds = new Dictionary<Tuple<uint, byte, byte, byte>, EmotesTextSoundRecord>();
Dictionary<Tuple<uint, int>, ExpectedStatRecord> _expectedStatsByLevel = new Dictionary<Tuple<uint, int>, ExpectedStatRecord>();
MultiMap<uint, ExpectedStatModRecord> _expectedStatModsByContentTuning = new MultiMap<uint, ExpectedStatModRecord>();
MultiMap<uint, uint> _factionTeams = new MultiMap<uint, uint>();
Dictionary<uint, HeirloomRecord> _heirlooms = new Dictionary<uint, HeirloomRecord>();
MultiMap<uint, uint> _glyphBindableSpells = new MultiMap<uint, uint>();
@@ -1933,6 +1984,7 @@ namespace Game.DataStorage
MultiMap<uint, RewardPackXCurrencyTypeRecord> _rewardPackCurrencyTypes = new MultiMap<uint, RewardPackXCurrencyTypeRecord>();
MultiMap<uint, RewardPackXItemRecord> _rewardPackItems = new MultiMap<uint, RewardPackXItemRecord>();
Dictionary<uint, uint> _rulesetItemUpgrade = new Dictionary<uint, uint>();
MultiMap<uint, SkillLineRecord> _skillLinesByParentSkillLine = new MultiMap<uint, SkillLineRecord>();
MultiMap<uint, SkillLineAbilityRecord> _skillLineAbilitiesBySkillupSkill = new MultiMap<uint, SkillLineAbilityRecord>();
MultiMap<uint, SkillRaceClassInfoRecord> _skillRaceClassInfoBySkill = new MultiMap<uint, SkillRaceClassInfoRecord>();
MultiMap<uint, SpecializationSpellsRecord> _specializationSpellsBySpec = new MultiMap<uint, SpecializationSpellsRecord>();
+4 -2
View File
@@ -36,6 +36,7 @@ namespace Game.DataStorage
public AchievementFlags Flags;
public ushort UiOrder;
public uint IconFileID;
public int RewardItemID;
public uint CriteriaTree;
public ushort SharesCriteria;
}
@@ -43,9 +44,9 @@ namespace Game.DataStorage
public sealed class AnimationDataRecord
{
public uint Id;
public ushort Fallback;
public ushort BehaviorID;
public byte BehaviorTier;
public int BehaviorID;
public int Fallback;
public int[] Flags = new int[2];
}
@@ -161,6 +162,7 @@ namespace Game.DataStorage
public uint UiAltItemAppearanceID;
public byte Flags;
public ushort UiCameraID;
public uint UsablePlayerConditionID;
}
public sealed class ArtifactAppearanceSetRecord
+2 -2
View File
@@ -36,7 +36,7 @@ namespace Game.DataStorage
public string DisplayName;
public string Description;
public uint Id;
public byte Type; // value 0 -> hair, value 2 -> facialhair
public byte Type; // value 0 . hair, value 2 . facialhair
public float CostModifier;
public byte Race;
public byte Sex;
@@ -76,7 +76,7 @@ namespace Game.DataStorage
public sealed class BattlePetSpeciesStateRecord
{
public uint Id;
public byte BattlePetStateID;
public ushort BattlePetStateID;
public int Value;
public uint BattlePetSpeciesID;
}
+12 -1
View File
@@ -102,6 +102,7 @@ namespace Game.DataStorage
public uint IconFileDataID;
public uint LowResScreenFileDataID;
public int StartingLevel;
public uint SpellTextureBlobFileDataID;
public ushort Flags;
public ushort CinematicSequenceID;
public ushort DefaultSpec;
@@ -214,8 +215,14 @@ namespace Game.DataStorage
public int MinLevel;
public int MaxLevel;
public int Flags;
public int ExpansionID;
}
public sealed class ContentTuningXExpectedRecord
{
public uint Id;
public int ExpectedStatModID;
public int DifficultyESMID;
public uint ContentTuningID;
}
public sealed class ConversationLineRecord
@@ -322,6 +329,9 @@ namespace Game.DataStorage
public float OverrideNameScale;
public float OverrideSelectionRadius;
public float TamedPetBaseScale;
public sbyte Unknown820_1; // scale related
public float Unknown820_2; // scale related
public float[] Unknown820_3 = new float[2]; // scale related
}
public sealed class CreatureTypeRecord
@@ -373,6 +383,7 @@ namespace Game.DataStorage
public uint Flags;
public sbyte Quality;
public int FactionID;
public int ItemGroupSoundsID;
}
public sealed class CurveRecord
@@ -71,10 +71,12 @@ namespace Game.DataStorage
public short MapID;
public sbyte DifficultyID;
public int OrderIndex;
public int CompleteWorldStateID;
public sbyte Bit;
public int CreatureDisplayID;
public byte Flags;
public int SpellIconFileID;
public int Faction;
}
public sealed class DurabilityCostsRecord
+1 -1
View File
@@ -29,7 +29,7 @@ namespace Game.DataStorage
public short ReputationIndex;
public ushort ParentFactionID;
public byte Expansion;
public byte FriendshipRepID;
public uint FriendshipRepID;
public byte Flags;
public ushort ParagonFactionID;
public short[] ReputationClassMask = new short[4];
+3 -3
View File
@@ -131,8 +131,8 @@ namespace Game.DataStorage
public int AllianceCreatureID;
public byte HordeGarrFollRaceID;
public byte AllianceGarrFollRaceID;
public byte HordeGarrClassSpecID;
public byte AllianceGarrClassSpecID;
public uint HordeGarrClassSpecID;
public uint AllianceGarrClassSpecID;
public byte Quality;
public byte FollowerLevel;
public ushort ItemLevelWeapon;
@@ -232,9 +232,9 @@ namespace Game.DataStorage
{
public uint Id;
public uint SpellID;
public ushort SpellIconID;
public byte GlyphType;
public byte GlyphExclusiveCategoryID;
public uint SpellIconID;
}
public sealed class GlyphRequiredSpecRecord
@@ -166,6 +166,7 @@ namespace Game.DataStorage
public float Gem3;
public float Health;
public float DamageReplaceStat;
public float DamageSecondary;
}
public sealed class GtXpRecord
+2 -2
View File
@@ -29,8 +29,8 @@ namespace Game.DataStorage
public sbyte SourceTypeEnum;
public byte Flags;
public int LegacyItemID;
public int[] UpgradeItemID = new int[3];
public ushort[] UpgradeItemBonusListID = new ushort[3];
public int[] UpgradeItemID = new int[4];
public ushort[] UpgradeItemBonusListID = new ushort[4];
}
public sealed class HolidaysRecord
+20 -19
View File
@@ -102,16 +102,33 @@ namespace Game.DataStorage
public uint Id;
public int[] Value = new int[3];
public ushort ParentItemBonusListID;
public ItemBonusType Type;
public ItemBonusType BonusType;
public byte OrderIndex;
}
public sealed class ItemBonusListGroupEntryRecord
{
public uint Id;
public int ItemBonusListID;
public int ItemLevelSelectorID;
public int OrderIndex;
public int ItemExtendedCostID;
public int ItemBonusListGroupID;
}
public sealed class ItemBonusListLevelDeltaRecord
{
public short ItemLevelDelta;
public uint Id;
}
public sealed class ItemBonusSequenceSpellRecord
{
public uint Id;
public int SpellID;
public int ItemID;
}
public sealed class ItemBonusTreeNodeRecord
{
public uint Id;
@@ -125,9 +142,9 @@ namespace Game.DataStorage
public sealed class ItemChildEquipmentRecord
{
public uint Id;
public uint ParentItemID;
public uint ChildItemID;
public byte ChildItemEquipSlot;
public uint ParentItemID;
}
public sealed class ItemClassRecord
@@ -206,6 +223,7 @@ namespace Game.DataStorage
public uint Id;
public ushort MinItemLevel;
public ushort ItemLevelSelectorQualitySetID;
public ushort AzeriteUnlockMappingSet;
}
public sealed class ItemLevelSelectorQualityRecord
@@ -257,21 +275,6 @@ namespace Game.DataStorage
public float Weapon;
}
public sealed class ItemRandomPropertiesRecord
{
public uint Id;
public LocalizedString Name;
public ushort[] Enchantment = new ushort[ItemConst.MaxItemRandomProperties];
}
public sealed class ItemRandomSuffixRecord
{
public uint Id;
public LocalizedString Name;
public ushort[] Enchantment = new ushort[ItemConst.MaxItemRandomProperties];
public ushort[] AllocationPct = new ushort[ItemConst.MaxItemRandomProperties];
}
public sealed class ItemSearchNameRecord
{
public long AllowableRace;
@@ -345,8 +348,6 @@ namespace Game.DataStorage
public ushort InstanceBound;
public ushort ZoneBound;
public ushort ItemSet;
public ushort ItemRandomSuffixGroupID;
public ushort RandomSelect;
public ushort LockID;
public ushort StartQuestID;
public ushort PageID;
+10 -8
View File
@@ -50,6 +50,7 @@ namespace Game.DataStorage
public byte MaxPlayers;
public short WindSettingsID;
public int ZmpFileDataID;
public int WdtFileDataID;
public MapFlags[] Flags = new MapFlags[2];
// Helpers
@@ -95,14 +96,14 @@ namespace Game.DataStorage
{
public uint Id;
public LocalizedString Message; // m_message_lang (text showed when transfer to map failed)
public uint ItemContextPickerID;
public int ContentTuningID;
public byte DifficultyID;
public byte LockID;
public uint DifficultyID;
public int LockID;
public byte ResetInterval;
public byte MaxPlayers;
public byte ItemContext;
public byte Flags;
public uint MaxPlayers;
public int ItemContext;
public uint ItemContextPickerID;
public int Flags;
public int ContentTuningID;
public uint MapID;
public uint GetRaidDuration()
@@ -121,7 +122,7 @@ namespace Game.DataStorage
public uint Parent;
public sbyte Operator;
public sbyte Amount;
public byte Type;
public uint Type;
public uint Asset;
public int SecondaryAsset;
public sbyte TertiaryAsset;
@@ -154,6 +155,7 @@ namespace Game.DataStorage
public uint ReqSpellKnownID;
public uint ModSpellAuraID;
public short ReqMapID;
public int PlayerConditionID;
}
public sealed class MountTypeXCapabilityRecord
@@ -21,6 +21,7 @@ namespace Game.DataStorage
{
public uint Id;
public int DamageReplaceStat;
public int DamageSecondary;
public uint[] Epic = new uint[5];
public uint[] Superior = new uint[5];
public uint[] Good = new uint[5];
+3 -2
View File
@@ -139,7 +139,7 @@ namespace Game.DataStorage
public sealed class SoundKitRecord
{
public uint Id;
public byte SoundType;
public uint SoundType;
public float VolumeFloat;
public ushort Flags;
public float MinDistance;
@@ -331,9 +331,9 @@ namespace Game.DataStorage
public string HordeName;
public uint[] EffectArg = new uint[ItemConst.MaxItemEnchantmentEffects];
public float[] EffectScalingPoints = new float[ItemConst.MaxItemEnchantmentEffects];
public uint TransmogPlayerConditionID;
public uint TransmogCost;
public uint IconFileDataID;
public uint TransmogPlayerConditionID;
public ushort[] EffectPointsMin = new ushort[ItemConst.MaxItemEnchantmentEffects];
public ushort ItemVisual;
public EnchantmentSlotMask Flags;
@@ -392,6 +392,7 @@ namespace Game.DataStorage
public float MinDuration;
public uint SpellIconFileDataID;
public uint ActiveIconFileDataID;
public uint ContentTuningID;
public int[] Attributes = new int[14];
public uint SpellID;
}
+6 -3
View File
@@ -48,10 +48,11 @@ namespace Game.DataStorage
public Vector2 FlightMapOffset;
public uint Id;
public ushort ContinentID;
public ushort ConditionID;
public uint ConditionID;
public ushort CharacterBitNumber;
public TaxiNodeFlags Flags;
public int UiTextureKitID;
public int MinimapAtlasMemberID;
public float Facing;
public uint SpecialIconConditionID;
public uint VisibilityConditionID;
@@ -75,8 +76,8 @@ namespace Game.DataStorage
public ushort ContinentID;
public TaxiPathNodeFlags Flags;
public uint Delay;
public ushort ArrivalEventID;
public ushort DepartureEventID;
public uint ArrivalEventID;
public uint DepartureEventID;
}
public sealed class TotemCategoryRecord
@@ -112,7 +113,9 @@ namespace Game.DataStorage
public uint TransmogSetGroupID;
public int ItemNameDescriptionID;
public ushort ParentTransmogSetID;
public byte Unknown810;
public byte ExpansionID;
public int PatchID;
public short UiOrder;
}
@@ -58,6 +58,8 @@ namespace Game.DataStorage
public int ParentUiMapID;
public int OrderIndex;
public int ChildUiMapID;
public int OverrideHighlightFileDataID;
public int OverrideHighlightAtlasID;
}
public sealed class UiMapXMapArtRecord
+1 -1
View File
@@ -44,7 +44,7 @@ namespace Game.DataStorage
public uint Id;
public uint QuestFeedbackEffectID;
public byte WhenToDisplay;
public byte TargetType;
public int TargetType;
public int TargetAsset;
public uint PlayerConditionID;
public ushort CombatConditionID;