LUA function for getting item enchants
Is there a way in the API to check the enchants on an item that I currently have equipped? I've been unable to find one so far...
|
To check for an enchant, you need to parse the itemstring.
You can get an itemlink for a slot in your inventory with GetInventoryItemLink: lua Code:
|
Ooh, I didn't know you could get that sort of info out of an item link... thanks :)
[edit] I can't find anything about what these enchant/ gem numbers mean though, including in Bimbo... they aren't spell IDs nor item IDs. |
Well, there's this page: http://www.wowpedia.org/EnchantId
It doesn't look very updated. Not sure what the best practice is for dealing with enchantIds. |
Forgive the Necro but this thread shows up in searches and I don't want people to get the wring idea: The above discussion does NOT apply to the buffs Shaman put on their weapon.
Aside from parsing Tooltips and/or monitoring logs to see when Windfury etc were applied, there is no way of knowing the enchant put on a Shaman's weapon. In the case of Shaman's, you will get a 0 (zero) in the colon separated string list. |
Well, if this thread has already been resurrected...
I eventually solved the problem by creating an item link for a stat-less item with the given enchant ID and parsing its tooltip, and would like to thank the author of this add-on for the idea (and most of the implementation). As for shamans, I used GetWeaponEnchantInfo to see if a weapon enchant exists, but this indeed does not tell me what the enchant is. |
Quote:
|
Quote:
|
I think the best method is if you really want to find all enchants for weapons is that you scan the mainhand/offhand weapons tooltip with the enchant id's localized name.
|
... that's what I just said? :confused:
|
Quote:
|
Since 6.0 you can get the temporary enchant ids from GetWeaponEnchantInfo():
Lua Code:
The issue now, is that you don't know the duration of the enchants. But you can filter the fishing lure enchants or fall back to 3600 like this: Lua Code:
|
All times are GMT -6. The time now is 08:43 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI