Hi
I was looking for a way to figure out what type of items are lootable from any given container.
With [EVENT_LOOT_UPDATED] I know exactly when the loot window opens and I can also loop through all lootable items. With "GetLootItemInfo()" I then can get the LootItemType, which for clothing materials etc. is always [LOOT_TYPE_ANY]. But what I actually would want to have is the real itemType, which in case for e.g. "Jute" would be [ITEMTYPE_CLOTHIER_RAW_MATERIAL].
Since "GetLootItemInfo()" was no success, I thought it might be possible to use the "GetItemLinkItemType()" method and then get the information via the itemLink from the lootItem... but this also just returns the LootItemType [LOOT_TYPE_ANY].
This is my code example:
Lua Code:
local lootCount = GetNumLootItems()
for i = 0, lootCount - 1 do
local _, name, _, _, _, _, _, _, lootItemType = GetLootItemInfo(i)
CHAT_SYSTEM:AddMessage("lootItemType = " .. lootItemType)
local link = GetLootItemLink(i)
local itemType = GetItemLinkItemType(link)
CHAT_SYSTEM:AddMessage("itemType = " .. itemType)
end
Which generates the following chat output (for e.g. "Jute"):
Code:
lootItemType = 0
itemType = 0
Is it even possible to know what ItemType a lootable item is... before looting it?
I mean in a reasonable way and not with hundreds of lines of code to check for every possible name of the item (although that would work)
Klingo