From ESOUI Wiki
This function returns multiple values indicating information about the item in a specified bag slot, and whether that item can be "gemified" (i.e. whether the player can extract Crown Crate Gems from it, destroying it in the process).
- A number representing the bag to check; it must be one of the built-in Bag values.
- The numeric index of the slot in that bag which should be checked. For most bags, this is a number ranging from 1 to the size of the bag.
- The player must have at least this many of the item in order to gemify it. Every time the player gemifies this bag slot, they will lose this many of the item.
- The player would receive this many gems by gemifying the item. To clarify, this is the number of gems awarded per (itemsRequired) items destroyed.
function CanGemifyItem(bagId, slotIndex) if IsItemFromCrownCrate(bagId, slotIndex) and not IsItemPlayerLocked(bagId, slotIndex) then local itemsRequired, gemsAwarded = GetNumCrownGemsFromItemManualGemification(bagId, slotIndex) return gemsAwarded > 0 and itemsRequired > 0 end return false end