Core/DataStores: Updated db2 structures to 8.2.5

Port From (https://github.com/TrinityCore/TrinityCore/commit/3ac790287aba5f7d7c3bccf79e608de9119e461a)
This commit is contained in:
hondacrx
2019-10-29 13:09:23 -04:00
parent c6e53b2ba7
commit e95115dc94
54 changed files with 4589 additions and 349 deletions
+13 -16
View File
@@ -92,9 +92,9 @@ namespace Game.Entities
if (item.GetTemplate().GetArtifactID() != 0 && artifactDataPair != null)
item.LoadArtifactData(this, artifactDataPair.Item1, artifactDataPair.Item2, artifactDataPair.Item3, artifactDataPair.Item4);
ulong counter = result.Read<ulong>(44);
ulong counter = result.Read<ulong>(43);
ObjectGuid bagGuid = counter != 0 ? ObjectGuid.Create(HighGuid.Item, counter) : ObjectGuid.Empty;
byte slot = result.Read<byte>(45);
byte slot = result.Read<byte>(44);
GetSession().GetCollectionMgr().CheckHeirloomUpgrades(item);
GetSession().GetCollectionMgr().AddItemAppearance(item);
@@ -1100,18 +1100,17 @@ namespace Game.Entities
do
{
// SELECT itemId, itemEntry, slot, creatorGuid, randomBonusListId, upgradeId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs FROM character_void_storage WHERE playerGuid = ?
// SELECT itemId, itemEntry, slot, creatorGuid, randomBonusListId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs FROM character_void_storage WHERE playerGuid = ?
ulong itemId = result.Read<ulong>(0);
uint itemEntry = result.Read<uint>(1);
byte slot = result.Read<byte>(2);
ObjectGuid creatorGuid = result.Read<ulong>(3) != 0 ? ObjectGuid.Create(HighGuid.Player, result.Read<ulong>(3)) : ObjectGuid.Empty;
uint randomBonusListId = result.Read<uint>(4);
uint upgradeId = result.Read<uint>(5);
uint fixedScalingLevel = result.Read<uint>(6);
uint artifactKnowledgeLevel = result.Read<uint>(7);
byte context = result.Read<byte>(8);
uint fixedScalingLevel = result.Read<uint>(5);
uint artifactKnowledgeLevel = result.Read<uint>(6);
byte context = result.Read<byte>(7);
List<uint> bonusListIDs = new List<uint>();
var bonusListIdTokens = new StringArray(result.Read<string>(9), ' ');
var bonusListIdTokens = new StringArray(result.Read<string>(8), ' ');
for (var i = 0; i < bonusListIdTokens.Length; ++i)
{
if (uint.TryParse(bonusListIdTokens[i], out uint id))
@@ -1136,10 +1135,9 @@ namespace Game.Entities
continue;
}
_voidStorageItems[slot] = new VoidStorageItem(itemId, itemEntry, creatorGuid, randomBonusListId, upgradeId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs);
_voidStorageItems[slot] = new VoidStorageItem(itemId, itemEntry, creatorGuid, randomBonusListId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs);
BonusData bonus = new BonusData(new ItemInstance(_voidStorageItems[slot]));
GetSession().GetCollectionMgr().AddItemAppearance(itemEntry, bonus.AppearanceModID);
}
while (result.NextRow());
@@ -1230,7 +1228,7 @@ namespace Game.Entities
}
Item item = Bag.NewItemOrBag(proto);
ObjectGuid ownerGuid = result.Read<ulong>(44) != 0 ? ObjectGuid.Create(HighGuid.Player, result.Read<ulong>(44)) : ObjectGuid.Empty;
ObjectGuid ownerGuid = result.Read<ulong>(43) != 0 ? ObjectGuid.Create(HighGuid.Player, result.Read<ulong>(43)) : ObjectGuid.Empty;
if (!item.LoadFromDB(itemGuid, ownerGuid, result.GetFields(), itemEntry))
{
Log.outError(LogFilter.Player, "Player:_LoadMailedItems - Item in mail ({0}) doesn't exist !!!! - item guid: {1}, deleted from mail", mail.messageID, itemGuid);
@@ -2249,15 +2247,14 @@ namespace Game.Entities
stmt.AddValue(3, i);
stmt.AddValue(4, _voidStorageItems[i].CreatorGuid.GetCounter());
stmt.AddValue(5, (byte)_voidStorageItems[i].RandomBonusListId);
stmt.AddValue(6, _voidStorageItems[i].ItemUpgradeId);
stmt.AddValue(7, _voidStorageItems[i].FixedScalingLevel);
stmt.AddValue(8, _voidStorageItems[i].ArtifactKnowledgeLevel);
stmt.AddValue(9, _voidStorageItems[i].Context);
stmt.AddValue(6, _voidStorageItems[i].FixedScalingLevel);
stmt.AddValue(7, _voidStorageItems[i].ArtifactKnowledgeLevel);
stmt.AddValue(8, _voidStorageItems[i].Context);
StringBuilder bonusListIDs = new StringBuilder();
foreach (uint bonusListID in _voidStorageItems[i].BonusListIDs)
bonusListIDs.AppendFormat("{0} ", bonusListID);
stmt.AddValue(10, bonusListIDs.ToString());
stmt.AddValue(9, bonusListIDs.ToString());
}
trans.Append(stmt);
+5 -7
View File
@@ -446,13 +446,12 @@ namespace Game.Entities
public class VoidStorageItem
{
public VoidStorageItem(ulong id, uint entry, ObjectGuid creator, uint randomBonusListId, uint upgradeId, uint fixedScalingLevel, uint artifactKnowledgeLevel, byte context, List<uint> bonuses)
public VoidStorageItem(ulong id, uint entry, ObjectGuid creator, uint randomBonusListId, uint fixedScalingLevel, uint artifactKnowledgeLevel, byte context, List<uint> bonuses)
{
ItemId = id;
ItemEntry = entry;
CreatorGuid = creator;
RandomBonusListId = randomBonusListId;
ItemUpgradeId = upgradeId;
FixedScalingLevel = fixedScalingLevel;
ArtifactKnowledgeLevel = artifactKnowledgeLevel;
Context = context;
@@ -465,7 +464,6 @@ namespace Game.Entities
public uint ItemEntry;
public ObjectGuid CreatorGuid;
public uint RandomBonusListId;
public uint ItemUpgradeId;
public uint FixedScalingLevel;
public uint ArtifactKnowledgeLevel;
public byte Context;
@@ -545,14 +543,14 @@ namespace Game.Entities
{
public CUFProfile()
{
BoolOptions = new BitArray((int)CUFBoolOptions.BoolOptionsCount);
BoolOptions = new BitSet((int)CUFBoolOptions.BoolOptionsCount);
}
public CUFProfile(string name, ushort frameHeight, ushort frameWidth, byte sortBy, byte healthText, uint boolOptions,
byte topPoint, byte bottomPoint, byte leftPoint, ushort topOffset, ushort bottomOffset, ushort leftOffset)
{
ProfileName = name;
BoolOptions = new BitArray(new int[] { (int)boolOptions });
BoolOptions = new BitSet(new uint[] { boolOptions });
FrameHeight = frameHeight;
FrameWidth = frameWidth;
@@ -576,7 +574,7 @@ namespace Game.Entities
}
public ulong GetUlongOptionValue()
{
int[] array = new int[1];
uint[] array = new uint[1];
BoolOptions.CopyTo(array, 0);
return (ulong)array[0];
}
@@ -597,7 +595,7 @@ namespace Game.Entities
public ushort BottomOffset;
public ushort LeftOffset;
public BitArray BoolOptions;
public BitSet BoolOptions;
// More fields can be added to BoolOptions without changing DB schema (up to 32, currently 27)
}
@@ -1275,10 +1275,6 @@ namespace Game.Entities
item.AddItemFlag(ItemFieldFlags.NewItem);
uint upgradeID = Global.DB2Mgr.GetRulesetItemUpgrade(itemId);
if (upgradeID != 0)
item.SetModifier(ItemModifier.UpgradeId, upgradeID);
item.SetContext(context);
item.SetBonuses(bonusListIDs);
+2 -2
View File
@@ -695,9 +695,9 @@ namespace Game.Entities
// If map is dungeon find linked graveyard
if (GetMap().IsDungeon())
{
WorldSafeLocsRecord entry = Global.ObjectMgr.GetClosestGraveYard(this, GetTeam(), this);
WorldSafeLocsEntry entry = Global.ObjectMgr.GetClosestGraveYard(this, GetTeam(), this);
if (entry != null)
m_bgData.joinPos = new WorldLocation(entry.MapID, entry.Loc.X, entry.Loc.Y, entry.Loc.Z, 0.0f);
m_bgData.joinPos = entry.Loc;
else
Log.outError(LogFilter.Player, "SetBattlegroundEntryPoint: Dungeon map {0} has no linked graveyard, setting home location as entry point.", GetMapId());
}
+3 -3
View File
@@ -4666,7 +4666,7 @@ namespace Game.Entities
SpawnCorpseBones();
}
WorldSafeLocsRecord ClosestGrave = null;
WorldSafeLocsEntry ClosestGrave = null;
// Special handle for Battlegroundmaps
Battleground bg = GetBattleground();
@@ -4688,11 +4688,11 @@ namespace Game.Entities
// and don't show spirit healer location
if (ClosestGrave != null)
{
TeleportTo(ClosestGrave.MapID, ClosestGrave.Loc.X, ClosestGrave.Loc.Y, ClosestGrave.Loc.Z, (ClosestGrave.Facing * MathFunctions.PI) / 180);
TeleportTo(ClosestGrave.Loc);
if (IsDead()) // not send if alive, because it used in TeleportTo()
{
DeathReleaseLoc packet = new DeathReleaseLoc();
packet.MapID = (int)ClosestGrave.MapID;
packet.MapID = (int)ClosestGrave.Loc.GetMapId();
packet.Loc = ClosestGrave.Loc;
SendPacket(packet);
}