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
@@ -233,7 +233,7 @@ namespace Framework.Database
// ChrCustomizationElement.db2 // ChrCustomizationElement.db2
PrepareStatement(HotfixStatements.SEL_CHR_CUSTOMIZATION_ELEMENT, "SELECT ID, ChrCustomizationChoiceID, RelatedChrCustomizationChoiceID, " + PrepareStatement(HotfixStatements.SEL_CHR_CUSTOMIZATION_ELEMENT, "SELECT ID, ChrCustomizationChoiceID, RelatedChrCustomizationChoiceID, " +
"ChrCustomizationGeosetID, ChrCustomizationSkinnedModelID, ChrCustomizationMaterialID, ChrCustomizationBoneSetID, " + "ChrCustomizationGeosetID, ChrCustomizationSkinnedModelID, ChrCustomizationMaterialID, ChrCustomizationBoneSetID, " +
"ChrCustomizationCondModelID, ChrCustomizationDisplayInfoID FROM chr_customization_element"); "ChrCustomizationCondModelID, ChrCustomizationDisplayInfoID, ChrCustItemGeoModifyID FROM chr_customization_element");
// ChrCustomizationOption.db2 // ChrCustomizationOption.db2
PrepareStatement(HotfixStatements.SEL_CHR_CUSTOMIZATION_OPTION, "SELECT Name, ID, SecondaryID, Flags, ChrModelID, SortIndex, ChrCustomizationCategoryID, " + PrepareStatement(HotfixStatements.SEL_CHR_CUSTOMIZATION_OPTION, "SELECT Name, ID, SecondaryID, Flags, ChrModelID, SortIndex, ChrCustomizationCategoryID, " +
@@ -546,8 +546,8 @@ namespace Framework.Database
PrepareStatement(HotfixStatements.SEL_ITEM_BONUS_LIST_LEVEL_DELTA, "SELECT ItemLevelDelta, ID FROM item_bonus_list_level_delta"); PrepareStatement(HotfixStatements.SEL_ITEM_BONUS_LIST_LEVEL_DELTA, "SELECT ItemLevelDelta, ID FROM item_bonus_list_level_delta");
// ItemBonusTreeNode.db2 // ItemBonusTreeNode.db2
PrepareStatement(HotfixStatements.SEL_ITEM_BONUS_TREE_NODE, "SELECT ID, ItemContext, ChildItemBonusTreeID, ChildItemBonusListID, ChildItemLevelSelectorID, " + PrepareStatement(HotfixStatements.SEL_ITEM_BONUS_TREE_NODE, "SELECT ID, ItemContext, ChildItemBonusTreeID, ChildItemBonusListID, ChildItemLevelSelectorID, " +
"ParentItemBonusTreeID FROM item_bonus_tree_node"); "ItemBonusListGroupID, ParentItemBonusTreeNodeID, ParentItemBonusTreeID FROM item_bonus_tree_node");
// ItemChildEquipment.db2 // ItemChildEquipment.db2
PrepareStatement(HotfixStatements.SEL_ITEM_CHILD_EQUIPMENT, "SELECT ID, ParentItemID, ChildItemID, ChildItemEquipSlot FROM item_child_equipment"); PrepareStatement(HotfixStatements.SEL_ITEM_CHILD_EQUIPMENT, "SELECT ID, ParentItemID, ChildItemID, ChildItemEquipSlot FROM item_child_equipment");
@@ -837,8 +837,9 @@ namespace Framework.Database
"Difficulty8, Difficulty9, Difficulty10 FROM quest_xp"); "Difficulty8, Difficulty9, Difficulty10 FROM quest_xp");
// RandPropPoints.db2 // RandPropPoints.db2
PrepareStatement(HotfixStatements.SEL_RAND_PROP_POINTS, "SELECT ID, DamageReplaceStat, DamageSecondary, Epic1, Epic2, Epic3, Epic4, Epic5, Superior1, " + PrepareStatement(HotfixStatements.SEL_RAND_PROP_POINTS, "SELECT ID, DamageReplaceStatF, DamageSecondaryF, DamageReplaceStat, DamageSecondary, EpicF1, " +
"Superior2, Superior3, Superior4, Superior5, Good1, Good2, Good3, Good4, Good5 FROM rand_prop_points"); "EpicF2, EpicF3, EpicF4, EpicF5, SuperiorF1, SuperiorF2, SuperiorF3, SuperiorF4, SuperiorF5, GoodF1, GoodF2, GoodF3, GoodF4, GoodF5, Epic1, " +
"Epic2, Epic3, Epic4, Epic5, Superior1, Superior2, Superior3, Superior4, Superior5, Good1, Good2, Good3, Good4, Good5 FROM rand_prop_points");
// RewardPack.db2 // RewardPack.db2
PrepareStatement(HotfixStatements.SEL_REWARD_PACK, "SELECT ID, CharTitleID, Money, ArtifactXPDifficulty, ArtifactXPMultiplier, ArtifactXPCategoryID, " + PrepareStatement(HotfixStatements.SEL_REWARD_PACK, "SELECT ID, CharTitleID, Money, ArtifactXPDifficulty, ArtifactXPMultiplier, ArtifactXPCategoryID, " +
@@ -157,6 +157,7 @@ namespace Game.DataStorage
public int ChrCustomizationBoneSetID; public int ChrCustomizationBoneSetID;
public int ChrCustomizationCondModelID; public int ChrCustomizationCondModelID;
public int ChrCustomizationDisplayInfoID; public int ChrCustomizationDisplayInfoID;
public int ChrCustItemGeoModifyID;
} }
public sealed class ChrCustomizationOptionRecord public sealed class ChrCustomizationOptionRecord
@@ -139,6 +139,8 @@ namespace Game.DataStorage
public ushort ChildItemBonusTreeID; public ushort ChildItemBonusTreeID;
public ushort ChildItemBonusListID; public ushort ChildItemBonusListID;
public ushort ChildItemLevelSelectorID; public ushort ChildItemLevelSelectorID;
public int ItemBonusListGroupID;
public int ParentItemBonusTreeNodeID;
public uint ParentItemBonusTreeID; public uint ParentItemBonusTreeID;
} }
@@ -20,8 +20,13 @@ namespace Game.DataStorage
public sealed class RandPropPointsRecord public sealed class RandPropPointsRecord
{ {
public uint Id; public uint Id;
public float DamageReplaceStatF;
public float DamageSecondaryF;
public int DamageReplaceStat; public int DamageReplaceStat;
public int DamageSecondary; public int DamageSecondary;
public float[] EpicF = new float[5];
public float[] SuperiorF = new float[5];
public float[] GoodF = new float[5];
public uint[] Epic = new uint[5]; public uint[] Epic = new uint[5];
public uint[] Superior = new uint[5]; public uint[] Superior = new uint[5];
public uint[] Good = new uint[5]; public uint[] Good = new uint[5];
+7 -7
View File
@@ -1091,7 +1091,7 @@ namespace Game.Entities
public byte GetGemCountWithID(uint GemID) 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); return (byte)list.Count(gemData => gemData.ItemId == GemID);
} }
@@ -1804,7 +1804,7 @@ namespace Game.Entities
return Math.Min(Math.Max(itemLevel, 1), 1300); 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); Cypher.Assert(index < ItemConst.MaxStats);
switch ((ItemModType)GetItemStatType(index)) switch ((ItemModType)GetItemStatType(index))
@@ -1817,18 +1817,18 @@ namespace Game.Entities
} }
uint itemLevel = GetItemLevel(owner); 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) 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); GtItemSocketCostPerLevelRecord gtCost = CliDB.ItemSocketCostPerLevelGameTable.GetRow(itemLevel);
if (gtCost != null) 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) 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)]); 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; uint propIndex;
@@ -147,14 +147,14 @@ namespace Game.Entities
switch (quality) switch (quality)
{ {
case ItemQuality.Uncommon: case ItemQuality.Uncommon:
return randPropPointsEntry.Good[propIndex]; return randPropPointsEntry.GoodF[propIndex];
case ItemQuality.Rare: case ItemQuality.Rare:
case ItemQuality.Heirloom: case ItemQuality.Heirloom:
return randPropPointsEntry.Superior[propIndex]; return randPropPointsEntry.SuperiorF[propIndex];
case ItemQuality.Epic: case ItemQuality.Epic:
case ItemQuality.Legendary: case ItemQuality.Legendary:
case ItemQuality.Artifact: case ItemQuality.Artifact:
return randPropPointsEntry.Epic[propIndex]; return randPropPointsEntry.EpicF[propIndex];
} }
return 0; return 0;
+13 -13
View File
@@ -3625,7 +3625,7 @@ namespace Game.Entities
if (statType == -1) if (statType == -1)
continue; continue;
int val = item.GetItemStatValue(i, this); float val = item.GetItemStatValue(i, this);
if (val == 0) if (val == 0)
continue; continue;
@@ -3692,16 +3692,16 @@ namespace Game.Entities
ApplyRatingMod(CombatRating.CritSpell, (int)(val * combatRatingMultiplier), apply); ApplyRatingMod(CombatRating.CritSpell, (int)(val * combatRatingMultiplier), apply);
break; break;
case ItemModType.CritTakenRangedRating: case ItemModType.CritTakenRangedRating:
ApplyRatingMod(CombatRating.CritRanged, val, apply); ApplyRatingMod(CombatRating.CritRanged, (int)val, apply);
break; break;
case ItemModType.HasteMeleeRating: case ItemModType.HasteMeleeRating:
ApplyRatingMod(CombatRating.HasteMelee, val, apply); ApplyRatingMod(CombatRating.HasteMelee, (int)val, apply);
break; break;
case ItemModType.HasteRangedRating: case ItemModType.HasteRangedRating:
ApplyRatingMod(CombatRating.HasteRanged, val, apply); ApplyRatingMod(CombatRating.HasteRanged, (int)val, apply);
break; break;
case ItemModType.HasteSpellRating: case ItemModType.HasteSpellRating:
ApplyRatingMod(CombatRating.HasteSpell, val, apply); ApplyRatingMod(CombatRating.HasteSpell, (int)val, apply);
break; break;
case ItemModType.HitRating: case ItemModType.HitRating:
ApplyRatingMod(CombatRating.HitMelee, (int)(val * combatRatingMultiplier), apply); ApplyRatingMod(CombatRating.HitMelee, (int)(val * combatRatingMultiplier), apply);
@@ -3737,19 +3737,19 @@ namespace Game.Entities
ApplyRatingMod(CombatRating.VersatilityHealingDone, (int)(val * combatRatingMultiplier), apply); ApplyRatingMod(CombatRating.VersatilityHealingDone, (int)(val * combatRatingMultiplier), apply);
break; break;
case ItemModType.ManaRegeneration: case ItemModType.ManaRegeneration:
ApplyManaRegenBonus(val, apply); ApplyManaRegenBonus((int)val, apply);
break; break;
case ItemModType.ArmorPenetrationRating: case ItemModType.ArmorPenetrationRating:
ApplyRatingMod(CombatRating.ArmorPenetration, val, apply); ApplyRatingMod(CombatRating.ArmorPenetration, (int)val, apply);
break; break;
case ItemModType.SpellPower: case ItemModType.SpellPower:
ApplySpellPowerBonus(val, apply); ApplySpellPowerBonus((int)val, apply);
break; break;
case ItemModType.HealthRegen: case ItemModType.HealthRegen:
ApplyHealthRegenBonus(val, apply); ApplyHealthRegenBonus((int)val, apply);
break; break;
case ItemModType.SpellPenetration: case ItemModType.SpellPenetration:
ApplySpellPenetrationBonus(val, apply); ApplySpellPenetrationBonus((int)val, apply);
break; break;
case ItemModType.MasteryRating: case ItemModType.MasteryRating:
ApplyRatingMod(CombatRating.Mastery, (int)(val * combatRatingMultiplier), apply); ApplyRatingMod(CombatRating.Mastery, (int)(val * combatRatingMultiplier), apply);
@@ -3776,13 +3776,13 @@ namespace Game.Entities
HandleStatFlatModifier(UnitMods.ResistanceArcane, UnitModifierFlatType.Base, (float)val, apply); HandleStatFlatModifier(UnitMods.ResistanceArcane, UnitModifierFlatType.Base, (float)val, apply);
break; break;
case ItemModType.PvpPower: case ItemModType.PvpPower:
ApplyRatingMod(CombatRating.PvpPower, val, apply); ApplyRatingMod(CombatRating.PvpPower, (int)val, apply);
break; break;
case ItemModType.Corruption: case ItemModType.Corruption:
ApplyRatingMod(CombatRating.Corruption, val, apply); ApplyRatingMod(CombatRating.Corruption, (int)val, apply);
break; break;
case ItemModType.CorruptionResistance: case ItemModType.CorruptionResistance:
ApplyRatingMod(CombatRating.CorruptionResistance, val, apply); ApplyRatingMod(CombatRating.CorruptionResistance, (int)val, apply);
break; break;
case ItemModType.CrSpeed: case ItemModType.CrSpeed:
ApplyRatingMod(CombatRating.Speed, (int)(val * combatRatingMultiplier), apply); ApplyRatingMod(CombatRating.Speed, (int)(val * combatRatingMultiplier), apply);
+1 -1
View File
@@ -3929,7 +3929,7 @@ namespace Game.Spells
if (randPropPoints == null) if (randPropPoints == null)
randPropPoints = CliDB.RandPropPointsStorage.LookupByKey(CliDB.RandPropPointsStorage.Count - 1); randPropPoints = CliDB.RandPropPointsStorage.LookupByKey(CliDB.RandPropPointsStorage.Count - 1);
tempValue = _spellInfo.Scaling._Class == -8 ? randPropPoints.DamageReplaceStat : randPropPoints.DamageSecondary; tempValue = _spellInfo.Scaling._Class == -8 ? randPropPoints.DamageReplaceStatF : randPropPoints.DamageSecondaryF;
} }
else else
tempValue = ItemEnchantmentManager.GetRandomPropertyPoints(effectiveItemLevel, ItemQuality.Rare, InventoryType.Chest, 0); tempValue = ItemEnchantmentManager.GetRandomPropertyPoints(effectiveItemLevel, ItemQuality.Rare, InventoryType.Chest, 0);
@@ -0,0 +1,24 @@
ALTER TABLE `chr_customization_element` ADD `ChrCustItemGeoModifyID` int(11) NOT NULL DEFAULT '0' AFTER `ChrCustomizationDisplayInfoID`;
ALTER TABLE `item_bonus_tree_node`
ADD `ItemBonusListGroupID` int(11) NOT NULL DEFAULT '0' AFTER `ChildItemLevelSelectorID`,
ADD `ParentItemBonusTreeNodeID` int(11) NOT NULL DEFAULT '0' AFTER `ItemBonusListGroupID`;
ALTER TABLE `rand_prop_points`
ADD `DamageReplaceStatF` float NOT NULL DEFAULT '0' AFTER `ID`,
ADD `DamageSecondaryF` float NOT NULL DEFAULT '0' AFTER `DamageReplaceStatF`,
ADD `EpicF1` float NOT NULL DEFAULT '0' AFTER `DamageSecondary`,
ADD `EpicF2` float NOT NULL DEFAULT '0' AFTER `EpicF1`,
ADD `EpicF3` float NOT NULL DEFAULT '0' AFTER `EpicF2`,
ADD `EpicF4` float NOT NULL DEFAULT '0' AFTER `EpicF3`,
ADD `EpicF5` float NOT NULL DEFAULT '0' AFTER `EpicF4`,
ADD `SuperiorF1` float NOT NULL DEFAULT '0' AFTER `Epic5`,
ADD `SuperiorF2` float NOT NULL DEFAULT '0' AFTER `SuperiorF1`,
ADD `SuperiorF3` float NOT NULL DEFAULT '0' AFTER `SuperiorF2`,
ADD `SuperiorF4` float NOT NULL DEFAULT '0' AFTER `SuperiorF3`,
ADD `SuperiorF5` float NOT NULL DEFAULT '0' AFTER `SuperiorF4`,
ADD `GoodF1` float NOT NULL DEFAULT '0' AFTER `SuperiorF5`,
ADD `GoodF2` float NOT NULL DEFAULT '0' AFTER `GoodF1`,
ADD `GoodF3` float NOT NULL DEFAULT '0' AFTER `GoodF2`,
ADD `GoodF4` float NOT NULL DEFAULT '0' AFTER `GoodF3`,
ADD `GoodF5` float NOT NULL DEFAULT '0' AFTER `GoodF4`;