Get ItemType from LootItemType
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:
Which generates the following chat output (for e.g. "Jute"): Code:
lootItemType = 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) :D Klingo |
GetLootItemLink needs the lootId, not index:
Lua Code:
|
Oops :O
You're absolutely right. If I use the lootId and change the for-loop to start at 1, it is working exactly as expected. Thanks a lot for pointing that out! Lua Code:
|
All times are GMT -6. The time now is 04:43 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI