WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   How can I tell .. (https://www.wowinterface.com/forums/showthread.php?t=56120)

doofus 03-23-18 05:19 PM

How can I tell ..
 
1) If I can equip an item properly (eg NOT DK and cloth) - other than checking if it is leather/cloth etc and having hard-coded things like "Paladin=plate". Is there a proper API function for this?

2) Convert ItemEquipLocation (as per GetItemInfo) to slot Id as used by GetInventoryItemLink
currently using a table from https://wow.gamepedia.com/ItemEquipLoc but it'd be nicer if there were an API call for this?

Phanx 03-23-18 11:41 PM

Quote:

Originally Posted by doofus (Post 327338)
2) Convert ItemEquipLocation (as per GetItemInfo) to slot Id as used by GetInventoryItemLink
currently using a table from https://wow.gamepedia.com/ItemEquipLoc but it'd be nicer if there were an API call for this?

There are these global constants:
https://www.townlong-yak.com/framexm...stants.lua#270

GetItemInfo will give you something like "INVTYPE_HEAD", so you could replace "INVTYPE" with "INVSLOT" and look it up in _G.

That said, I don't think the slot IDs have ever changed, so there's not really any compelling reason to look them up dynamically vs. hardcoding a table.


All times are GMT -6. The time now is 10:42 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI