So I've been working on a thing for new armour val...
# 🏍・custom
c
So I've been working on a thing for new armour value formulas, and have been trying to implement them (with a backup of the item_template first, of course) but have been running into some issues. Is there a way I can fix this query to not cause an 'out of range' error? I suspect it might have something to do with items under the 'ItemLevel-X' value, or results not being rounded by SQL, but I'm not sure how to fix that in either case and my googlefu isn't helping me much.
Copy code
-- Cloth Head
UPDATE Item_Template Set armor = ((((ItemLevel-40) * 1.2 + 53) * 0.9) * 0.812) + ArmorDamageModifier WHERE Class = 4 AND Subclass = 1 AND Quality = 0 AND InventoryType = 1; --  Poor
UPDATE Item_Template Set armor = ((((ItemLevel-40) * 1.2 + 53) * 0.95) * 0.812) + ArmorDamageModifier WHERE Class = 4 AND Subclass = 1 AND Quality = 1 AND InventoryType = 1; --  Common
UPDATE Item_Template Set armor = ((((ItemLevel-40) * 1.2 + 53) * 1) * 0.812) + ArmorDamageModifier WHERE Class = 4 AND Subclass = 1 AND Quality = 2 AND InventoryType = 1; --  Uncommon
UPDATE Item_Template Set armor = ((((ItemLevel-40) * 1.2 + 53) * 1.2) * 0.812) + ArmorDamageModifier WHERE Class = 4 AND Subclass = 1 AND Quality = 3 AND InventoryType = 1; --  Rare
UPDATE Item_Template Set armor = ((((ItemLevel-40) * 1.2 + 53) * 1.35) * 0.812) + ArmorDamageModifier WHERE Class = 4 AND Subclass = 1 AND Quality = 4 AND InventoryType = 1; --  Epic