View Single Post
05/09/14, 04:36 AM   #20
Flagrick
 
Flagrick's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 24
Post

Originally Posted by Flagrick View Post
Sadly, it seems, it doesn't work with this events.
But i have found something else.
I'm testing. I ll give more info later.
so, it's the code, and it seems to work except in rare case (no icon in the quest inventory with a loot event)
I'm playing this code in a loot event.
I ve got the text name of the item quest, and then i find the icon that match with the name
Code:
function LootDrop:FindAndPrintAllIconFromQuestTools(text)
	local icon=[[/esoui/art/icons/icon_missing.dds]]
	local found=false
	local countQuests=GetNumJournalQuests()
	for i = 0, countQuests do
		local countTools=GetQuestToolCount(i)
		for j = 0, countTools do
			local iconFilename, stackCount, isUsable, name = GetQuestToolInfo(i, j)
			found = (name==text)
			if (found) then
				icon=iconFilename
				break
			end
		end
		if (found) then 
			break 
		end
	end
	return icon
end
  Reply With Quote