Core/DataStores: Updated db2 structures to 9.0.5

Port From (https://github.com/TrinityCore/TrinityCore/commit/34a8baba85bdd86f07730e387144954dd64372ad)
This commit is contained in:
hondacrx
2021-04-12 14:11:12 -04:00
parent 13631f6b4c
commit 084dc44a39
9 changed files with 63 additions and 30 deletions
+7 -7
View File
@@ -1091,7 +1091,7 @@ namespace Game.Entities
public byte GetGemCountWithID(uint GemID)
{
var list = (List<SocketedGem>)m_itemData.Gems.GetEnumerator();
var list = (List<SocketedGem>)m_itemData.Gems;
return (byte)list.Count(gemData => gemData.ItemId == GemID);
}
@@ -1804,7 +1804,7 @@ namespace Game.Entities
return Math.Min(Math.Max(itemLevel, 1), 1300);
}
public int GetItemStatValue(uint index, Player owner)
public float GetItemStatValue(uint index, Player owner)
{
Cypher.Assert(index < ItemConst.MaxStats);
switch ((ItemModType)GetItemStatType(index))
@@ -1817,18 +1817,18 @@ namespace Game.Entities
}
uint itemLevel = GetItemLevel(owner);
uint randomPropPoints = ItemEnchantmentManager.GetRandomPropertyPoints(itemLevel, GetQuality(), GetTemplate().GetInventoryType(), GetTemplate().GetSubClass());
float randomPropPoints = ItemEnchantmentManager.GetRandomPropertyPoints(itemLevel, GetQuality(), GetTemplate().GetInventoryType(), GetTemplate().GetSubClass());
if (randomPropPoints != 0)
{
float statValue = (_bonusData.StatPercentEditor[index] * randomPropPoints) * 0.0001f;
float statValue = _bonusData.StatPercentEditor[index] * randomPropPoints * 0.0001f;
GtItemSocketCostPerLevelRecord gtCost = CliDB.ItemSocketCostPerLevelGameTable.GetRow(itemLevel);
if (gtCost != null)
statValue -= (_bonusData.ItemStatSocketCostMultiplier[index] * gtCost.SocketCost);
statValue -= _bonusData.ItemStatSocketCostMultiplier[index] * gtCost.SocketCost;
return (int)(Math.Floor(statValue + 0.5f));
return statValue;
}
return 0;
return 0f;
}
public ItemDisenchantLootRecord GetDisenchantLoot(Player owner)
+4 -4
View File
@@ -91,7 +91,7 @@ namespace Game.Entities
return tab.BonusListIDs.SelectRandomElementByWeight(x => (float)tab.Chances[tab.BonusListIDs.IndexOf(x)]);
}
public static uint GetRandomPropertyPoints(uint itemLevel, ItemQuality quality, InventoryType inventoryType, uint subClass)
public static float GetRandomPropertyPoints(uint itemLevel, ItemQuality quality, InventoryType inventoryType, uint subClass)
{
uint propIndex;
@@ -147,14 +147,14 @@ namespace Game.Entities
switch (quality)
{
case ItemQuality.Uncommon:
return randPropPointsEntry.Good[propIndex];
return randPropPointsEntry.GoodF[propIndex];
case ItemQuality.Rare:
case ItemQuality.Heirloom:
return randPropPointsEntry.Superior[propIndex];
return randPropPointsEntry.SuperiorF[propIndex];
case ItemQuality.Epic:
case ItemQuality.Legendary:
case ItemQuality.Artifact:
return randPropPointsEntry.Epic[propIndex];
return randPropPointsEntry.EpicF[propIndex];
}
return 0;