Originally Posted by lyravega
This event also fires when you loot an item. I am trying to move away from EVENT_LOOT_RECEIVED to this event, as it offers more flexibility and is easier to access some stuff. However, quantity number eludes me. Any way I can get the quantity numbers when you loot something, with this event?
|
Lua Code:
EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_INVENTORY_SINGLE_SLOT_UPDATE,
function(eventCode, bagIndex, slotIndex, isNewItem, itemSoundCategory, updateReason)
--you can filter out some unwanted updates, for example:
if isNewItem == false then return end
if updateReason == INVENTORY_UPDATE_REASON_DURABILITY_CHANGE then return end
if bagIndex ~= BAG_BACKPACK then return end
local icon, stackCount, sellPrice = GetItemInfo(bagIndex, slotIndex)
d(zo_strformat("Quantity: <<1>>", stackCount))
end)