How do I get a spec's weapon skills?
I'm trying to make an addon to help equip gearSets, and it seems to work, except that it will try to equip items that the current spec can't actually equip. For armor, I'm just getting the subclass of the item with GetItemInfo(itemId) and comparing it to a kind of comparison table. I only did it that way because I was trying to get a working prototype, but I don't think that method is viable when it comes to weapon subtypes vs spec.
Does anyone have a solution for me, please? I suppose the underlying question here is, how do I check if an item is actually able to be equipped by the player with the current class and spec? |
IsEquippableItem() will tell you if you can equip something.
|
Hmmm... That sort of solves part of my problem, but not completely.
According to this https://wowpedia.fandom.com/wiki/API_IsEquippableItem An that will return true even if you're on a class that doesn't meet the requirements. So like a piece of plate armor is technically an equippable item, but you can't actually equip it if you're a druid. |
Well that's just a dumb api call then.
You can use the item subclassID from GetItemInfo() on weapons too, if you go the way of building hard coded comparison tables as the 13th output from that call does output a valid ID number to use with Enum.ItemWeaponSubclass |
haha damn. I was afraid it would come to that.
|
This one looks interesting but might be for a specific use
https://wowpedia.fandom.com/wiki/API...ValidForPlayer And this one sounds useful and might be what you need https://wowpedia.fandom.com/wiki/API...cToPlayerClass This function is used on Weekly Rewards by Blizzard https://github.com/Gethe/wow-ui-sour...wards.lua#L347 Might be easier than building a database of data up .. but if you have already done that keep this for your next code overhaul :) |
I made my big ol table ��and then went to sleep. But I'll play around with those. Thanks!
How does the game decide whether that item you have will actually get equipped when you click it? These are the results. Not sure whether I can use them. I'm testing whether a paladin can equip a plat helm that is already equipped. Lua Code:
This might be the solution to my problem. Neeeds more testing Lua Code:
Far as I can tell this only show true for armor + back (but haven't tried with weapons yet.) |
All times are GMT -6. The time now is 01:04 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI