Core/DataStores: Updated db2 structures to 8.3.0
Port From (https://github.com/TrinityCore/TrinityCore/commit/90628b7d29e041310abc25438f219a0c73c41bae)
This commit is contained in:
@@ -653,15 +653,15 @@ namespace Game.Chat
|
||||
|
||||
if (!int.TryParse(difficulty_str, out int difficulty))
|
||||
difficulty = -1;
|
||||
if (difficulty >= (int)Difficulty.Max || difficulty < -1)
|
||||
if (CliDB.DifficultyStorage.HasRecord((uint)difficulty) || difficulty < -1)
|
||||
return false;
|
||||
|
||||
if (difficulty == -1)
|
||||
{
|
||||
for (byte diff = 0; diff < (int)Difficulty.Max; ++diff)
|
||||
foreach (var diffRecord in CliDB.DifficultyStorage.Values)
|
||||
{
|
||||
if (Global.DB2Mgr.GetMapDifficultyData((uint)map, (Difficulty)diff) != null)
|
||||
Global.InstanceSaveMgr.ForceGlobalReset((uint)map, (Difficulty)diff);
|
||||
if (Global.DB2Mgr.GetMapDifficultyData((uint)map, (Difficulty)diffRecord.Id) != null)
|
||||
Global.InstanceSaveMgr.ForceGlobalReset((uint)map, (Difficulty)diffRecord.Id);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -20,6 +20,7 @@ using Framework.IO;
|
||||
using Game.Entities;
|
||||
using Game.Groups;
|
||||
using Game.Maps;
|
||||
using Game.DataStorage;
|
||||
|
||||
namespace Game.Chat
|
||||
{
|
||||
@@ -36,9 +37,9 @@ namespace Game.Chat
|
||||
string format = "map: {0} inst: {1} perm: {2} diff: {3} canReset: {4} TTR: {5}";
|
||||
|
||||
uint counter = 0;
|
||||
for (byte i = 0; i < (int)Difficulty.Max; ++i)
|
||||
foreach (var difficulty in CliDB.DifficultyStorage.Values)
|
||||
{
|
||||
var binds = player.GetBoundInstances((Difficulty)i);
|
||||
var binds = player.GetBoundInstances((Difficulty)difficulty.Id);
|
||||
foreach (var pair in binds)
|
||||
{
|
||||
InstanceSave save = pair.Value.save;
|
||||
@@ -53,9 +54,9 @@ namespace Game.Chat
|
||||
Group group = player.GetGroup();
|
||||
if (group)
|
||||
{
|
||||
for (byte i = 0; i < (int)Difficulty.Max; ++i)
|
||||
foreach (var difficulty in CliDB.DifficultyStorage.Values)
|
||||
{
|
||||
var binds = group.GetBoundInstances((Difficulty)i);
|
||||
var binds = group.GetBoundInstances((Difficulty)difficulty.Id);
|
||||
foreach (var pair in binds)
|
||||
{
|
||||
InstanceSave save = pair.Value.save;
|
||||
@@ -93,9 +94,9 @@ namespace Game.Chat
|
||||
return false;
|
||||
}
|
||||
|
||||
for (byte i = 0; i < (int)Difficulty.Max; ++i)
|
||||
foreach (var difficulty in CliDB.DifficultyStorage.Values)
|
||||
{
|
||||
var binds = player.GetBoundInstances((Difficulty)i);
|
||||
var binds = player.GetBoundInstances((Difficulty)difficulty.Id);
|
||||
foreach (var pair in binds)
|
||||
{
|
||||
InstanceSave save = pair.Value.save;
|
||||
@@ -104,7 +105,7 @@ namespace Game.Chat
|
||||
string timeleft = Time.GetTimeString(save.GetResetTime() - Time.UnixTime);
|
||||
handler.SendSysMessage("unbinding map: {0} inst: {1} perm: {2} diff: {3} canReset: {4} TTR: {5}", pair.Key, save.GetInstanceId(),
|
||||
pair.Value.perm ? "yes" : "no", save.GetDifficultyID(), save.CanReset() ? "yes" : "no", timeleft);
|
||||
player.UnbindInstance(pair.Key, (Difficulty)i);
|
||||
player.UnbindInstance(pair.Key, (Difficulty)difficulty.Id);
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,6 +148,7 @@ namespace Game.DataStorage
|
||||
public int FemaleSkeletonFileDataID;
|
||||
public int MaleSkeletonFileDataID;
|
||||
public int HelmVisFallbackRaceID;
|
||||
public int TransmogrifyDisabledSlotMask;
|
||||
public ushort FactionID;
|
||||
public ushort CinematicSequenceID;
|
||||
public short ResSicknessSpellID;
|
||||
@@ -222,6 +223,7 @@ namespace Game.DataStorage
|
||||
{
|
||||
public uint Id;
|
||||
public int ExpectedStatModID;
|
||||
public int MythicPlusSeasonID;
|
||||
public uint ContentTuningID;
|
||||
}
|
||||
|
||||
@@ -384,6 +386,8 @@ namespace Game.DataStorage
|
||||
public sbyte Quality;
|
||||
public int FactionID;
|
||||
public int ItemGroupSoundsID;
|
||||
public int ConvertToPlayerExperience;
|
||||
public int PlayerConditionID;
|
||||
}
|
||||
|
||||
public sealed class CurveRecord
|
||||
|
||||
@@ -63,7 +63,6 @@ namespace Game.DataStorage
|
||||
{
|
||||
public uint Id;
|
||||
public byte DisplayType;
|
||||
public int SubclassID;
|
||||
public uint ItemDisplayInfoID;
|
||||
public int DefaultIconFileDataID;
|
||||
public int UiOrder;
|
||||
|
||||
@@ -140,6 +140,8 @@ namespace Game.DataStorage
|
||||
public uint PlayerConditionID;
|
||||
public float MountFlyRideHeight;
|
||||
public int UiModelSceneID;
|
||||
public int MountSpecialRiderAnimKitID;
|
||||
public int MountSpecialSpellVisualKitID;
|
||||
|
||||
public bool IsSelfMount() { return (Flags & MountFlags.SelfMount) != 0; }
|
||||
}
|
||||
|
||||
@@ -537,11 +537,11 @@ namespace Game.DataStorage
|
||||
public sealed class SpellVisualKitRecord
|
||||
{
|
||||
public uint Id;
|
||||
public int Flags;
|
||||
public sbyte FallbackPriority;
|
||||
public uint FallbackSpellVisualKitId;
|
||||
public int FallbackSpellVisualKitId;
|
||||
public ushort DelayMin;
|
||||
public ushort DelayMax;
|
||||
public int[] Flags = new int[2];
|
||||
}
|
||||
|
||||
public sealed class SpellXSpellVisualRecord
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace Game.DataStorage
|
||||
public int VisibilityPlayerConditionID;
|
||||
public sbyte HelpTextPosition;
|
||||
public int BkgAtlasID;
|
||||
public int AlternateUiMapGroup;
|
||||
}
|
||||
|
||||
public sealed class UiMapAssignmentRecord
|
||||
|
||||
@@ -78,15 +78,15 @@ namespace Game.Entities
|
||||
int specIndex = 0;
|
||||
for (; specIndex < m_azeriteItemData.SelectedEssences.Size(); ++specIndex)
|
||||
{
|
||||
stmt.AddValue(4 + specIndex * 4, m_azeriteItemData.SelectedEssences[specIndex].SpecializationID);
|
||||
stmt.AddValue(4 + specIndex * 5, m_azeriteItemData.SelectedEssences[specIndex].SpecializationID);
|
||||
for (int j = 0; j < SharedConst.MaxAzeriteEssenceSlot; ++j)
|
||||
stmt.AddValue(5 + specIndex * 4 + j, m_azeriteItemData.SelectedEssences[specIndex].AzeriteEssenceID[j]);
|
||||
stmt.AddValue(5 + specIndex * 5 + j, m_azeriteItemData.SelectedEssences[specIndex].AzeriteEssenceID[j]);
|
||||
}
|
||||
for (; specIndex < PlayerConst.MaxSpecializations; ++specIndex)
|
||||
{
|
||||
stmt.AddValue(4 + specIndex * 4, 0);
|
||||
stmt.AddValue(4 + specIndex * 5, 0);
|
||||
for (int j = 0; j < SharedConst.MaxAzeriteEssenceSlot; ++j)
|
||||
stmt.AddValue(5 + specIndex * 4 + j, 0);
|
||||
stmt.AddValue(5 + specIndex * 5 + j, 0);
|
||||
}
|
||||
|
||||
trans.Append(stmt);
|
||||
|
||||
@@ -3100,7 +3100,7 @@ namespace Game.Entities
|
||||
info.AzeriteItem.SelectedAzeriteEssences[i].SpecializationId = specializationId;
|
||||
for (int j = 0; j < SharedConst.MaxAzeriteEssenceSlot; ++j)
|
||||
{
|
||||
AzeriteEssenceRecord azeriteEssence = CliDB.AzeriteEssenceStorage.LookupByKey(azeriteItemResult.Read<uint>(5 + i * 4 + j));
|
||||
AzeriteEssenceRecord azeriteEssence = CliDB.AzeriteEssenceStorage.LookupByKey(azeriteItemResult.Read<uint>(5 + i * 5 + j));
|
||||
if (azeriteEssence == null || !Global.DB2Mgr.IsSpecSetMember(azeriteEssence.SpecSetID, specializationId))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -1047,7 +1047,7 @@ namespace Game.Entities
|
||||
Log.outError(LogFilter.Player, "_LoadBoundInstances: player {0}({1}) has bind to not existed or not dungeon map {2} ({3})", GetName(), GetGUID().ToString(), mapId, mapname);
|
||||
deleteInstance = true;
|
||||
}
|
||||
else if (difficulty >= (int)Difficulty.Max)
|
||||
else if (CliDB.DifficultyStorage.HasRecord(difficulty))
|
||||
{
|
||||
Log.outError(LogFilter.Player, "_LoadBoundInstances: player {0}({1}) has bind to not existed difficulty {2} instance for map {3} ({4})", GetName(), GetGUID().ToString(), difficulty, mapId, mapname);
|
||||
deleteInstance = true;
|
||||
|
||||
@@ -5280,10 +5280,10 @@ namespace Game
|
||||
|
||||
if (dungeonEncounter.DifficultyID == 0)
|
||||
{
|
||||
for (uint i = 0; i < (int)Difficulty.Max; ++i)
|
||||
foreach (var difficulty in CliDB.DifficultyStorage.Values)
|
||||
{
|
||||
if (Global.DB2Mgr.GetMapDifficultyData((uint)dungeonEncounter.MapID, (Difficulty)i) != null)
|
||||
_dungeonEncounterStorage.Add(MathFunctions.MakePair64((uint)dungeonEncounter.MapID, i), new DungeonEncounter(dungeonEncounter, creditType, creditEntry, lastEncounterDungeon));
|
||||
if (Global.DB2Mgr.GetMapDifficultyData((uint)dungeonEncounter.MapID, (Difficulty)difficulty.Id) != null)
|
||||
_dungeonEncounterStorage.Add(MathFunctions.MakePair64((uint)dungeonEncounter.MapID, difficulty.Id), new DungeonEncounter(dungeonEncounter, creditType, creditEntry, lastEncounterDungeon));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -24,6 +24,7 @@ using Game.Maps;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using System;
|
||||
using Game.DataStorage;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
@@ -71,9 +72,9 @@ namespace Game
|
||||
packet.Events.Add(eventInfo);
|
||||
}
|
||||
|
||||
for (Difficulty i = 0; i < Difficulty.Max; ++i)
|
||||
foreach (var difficulty in CliDB.DifficultyStorage.Values)
|
||||
{
|
||||
var boundInstances = _player.GetBoundInstances(i);
|
||||
var boundInstances = _player.GetBoundInstances((Difficulty)difficulty.Id);
|
||||
if (boundInstances != null)
|
||||
{
|
||||
foreach (var boundInstance in boundInstances.Values)
|
||||
|
||||
Reference in New Issue
Block a user