Files
wow_cyka/Weakauras/Autoloot/event.lua

31 lines
806 B
Lua

-- CHAT_MSG_ADDON
function(allstates, e, prefix, message, type, target)
if prefix ~= "CYKA_AUTOLOOT" then return end
local name, quantityS, qualityS, icon = strsplit("|", message)
local quality = tonumber(qualityS)
local quantity = tonumber(quantityS)
local formattedName = string.format("\124cff%s[%s]\124r x%s (%s)",
tostring(aura_env.QualityColors[quality+1]),
tostring(name),
tostring(quantity),
tostring(GetItemCount(name) + quantity))
allstates[#allstates + 1] = {
show = true,
changed = true,
index = GetTime(),
resort = true,
icon = icon,
name = formattedName,
progressType = "timed",
expirationTime = GetTime() + aura_env.ttl,
duration = aura_env.ttl,
autoHide = true,
}
return true
end