Skip to content

Commit

Permalink
Fill previous gems
Browse files Browse the repository at this point in the history
  • Loading branch information
1337LutZ committed Jun 15, 2024
1 parent 191ab67 commit 9d9c3bc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ExportStructures/ItemSpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,29 @@ function ItemSpecMeta:FillFromItemLink(itemLink)
self.id = tonumber(itemId)
self.enchant = tonumber(enchantId)
if self._structure.gems then
if not isGem(gemId1) and isGem(gemId2) or isGem(gemId3) or isGem(gemId4) then
gemId1 = 0
end
if not isGem(gemId2) and isGem(gemId3) or isGem(gemId4) then
gemId2 = 0
end
if not isGem(gemId3) and isGem(gemId4) then
gemId3 = 0
end
self.gems = { tonumber(gemId1), tonumber(gemId2), tonumber(gemId3), tonumber(gemId4) }
end
if self._structure.random_suffix then
self.random_suffix = tonumber(suffixId)
end
end

---Returns if gemID string is a gem.
---@param gemId string
function isGem(gemId)
if gemId == '' then return false end
return true
end

---Set rune spell from an item in a slot, if item has a rune engraved.
---@param slotId integer
---@param bagId integer|nil If not nil check bag items instead of equipped items.
Expand Down

0 comments on commit 9d9c3bc

Please sign in to comment.