--Load out of combat
CHAT_MSG_LOOT
function(_,msg)
	local who = string.match(msg, "%a+")
	local what = string.match(msg, "%[(.+)%]")
	local itemQuality = select(3, GetItemInfo(what)) or ""
	local itemType = select(6, GetItemInfo(what)) or ""
	local itemSubType = select(7, GetItemInfo(what)) or ""
	if itemType == "Armor" then
		aura_env.who[aura_env.pointer] = who
		aura_env.what[aura_env.pointer] = what
		aura_env.itemQuality[aura_env.pointer] = itemQuality
		aura_env.itemSubType[aura_env.pointer] = itemSubType
		aura_env.pointer = aura_env.pointer + 1
	end
end

DISPLAY
function()
	local output = ""
	local qualityColor = "|cFFFFFFFF"
	local classColor = "|cFFFFFFFF"
	if aura_env.pointer > 1 then
		for i = 1, aura_env.pointer - 1 do
			if aura_env.who[i] ~= "You" then
				local playerClass = UnitClass(aura_env.who[i])
			else
				playerClass = UnitClass("player")
			end
			if aura_env.itemQuality[i] == 0 then qualityColor = "|cFF9D9D9D" elseif 
			aura_env.itemQuality[i] == 2 then qualityColor = "|cFF1EFF00" elseif 
			aura_env.itemQuality[i] == 3 then qualityColor = "|cFF0070DD" elseif 
			aura_env.itemQuality[i] == 4 then qualityColor = "|cFFA335EE" elseif
			aura_env.itemQuality[i] == 5 then qualityColor = "|cFFFF8000" 
			end
			if playerClass == "Death Knight" then classColor = "|cFFC41F3B" 
			elseif playerClass == "Demon Hunter" then classColor = "|cFFA330C9" 
			elseif playerClass == "Druid" then classColor = "|cFFFF7D0A" 
			elseif playerClass == "Hunter" then classColor = "|cFFABD473" 
			elseif playerClass == "Mage" then classColor = "|cFF40C7EB" 
			elseif playerClass == "Monk" then classColor = "|cFF00FF96" 
			elseif playerClass == "Paladin" then classColor = "|cFFF58CBA" 
			elseif playerClass == "Priest" then classColor = "|cFFFFFFFF"  
			elseif playerClass == "Rogue" then classColor = "|cFFFFF569"  
			elseif playerClass == "Shaman" then classColor = "|cFF0070DE" 
			elseif playerClass == "Warlock" then classColor = "|cFF8787ED" 
			elseif playerClass == "Warrior" then classColor = "|cFFC79C6E" 
			end
			output = output .. classColor .. aura_env.who[i] .. " " .. "|cFFFFFFFF" .. aura_env.itemSubType[i] .. " " .. qualityColor .. "%[" .. aura_env.what[i] .. "%]" .. "\n"
		end
	end
	return output
end

ON HIDE
aura_env.pointer = 1
aura_env.who = {}
aura_env.what = {}
aura_env.itemQuality = {}
aura_env.itemSubType = {}