WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   GetItemInfo from GetLootRollItemInfo (https://www.wowinterface.com/forums/showthread.php?t=59707)

glupikreten 11-10-23 06:14 AM

GetItemInfo from GetLootRollItemInfo
 
Hi,



I have this function:

Lua Code:
  1. local fr = CreateFrame('Frame', nil, UIParent)
  2. fr:RegisterEvent('START_LOOT_ROLL')
  3. fr:RegisterEvent('CONFIRM_LOOT_ROLL')
  4. fr:SetScript(
  5.     'OnEvent',
  6.     function(self, event, id)
  7.         if not id then
  8.             return
  9.         end
  10.         local _, name, _, quality, bop, _, _, canDE = GetLootRollItemInfo(id)
  11.         if quality == 2 and autoroll then
  12.             ConfirmLootRoll(id, canDE and 3 or 2)
  13.             ChatFrame7:AddMessage('Autoroll on item: ' .. (name))
  14.         end
  15.     end
  16. )

Is it possible to add itemLevel into it as a condition.

I tried GetItemInfo(name) but name can be used only if item is equped or in bag...

Anyone knows how to get to the item like you can do it on tooltip with :GetItem().

Is it WOTLK client.

Thank you

Xrystal 11-10-23 01:10 PM

Not sure whether this will work in wrath classic but worth a try.

https://warcraft.wiki.gg/wiki/API_GetLootRollItemLink
This function takes the same input but one of the outputs is the item id.

Which you can then use with

https://warcraft.wiki.gg/wiki/API_GetItemInfo
Which returns the itemLevel which can then use to filter out as you need.


All times are GMT -6. The time now is 12:15 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI