[implemented] get enchantment from equipment itemlink
I just noticed that there is no proper way to get the applied enchantment of an item. Right now there is only a function GetItemLinkEnchantInfo which returns true if the enchantment has charges and the localized name and description. If possible I'd like to have an additional return (or a separate function) which gives me the itemlink for the applied glyph.
From what I have seen the itemlink already contains the glyph id and quality for items enchanted by the player, but loot that is dropped in the world seems to use some sort of default enchantment which is not specified there (enchantment item id is 0), so I cannot just build the link myself. For my use case I need a way to get the ENCHANTMENT_SEARCH_CATEGORY_* from an item link, so if GetItemLinkEnchantInfo returned that in addition, it would be even easier for me. |
We can add GetItemLinkEnchantSearchCategoryType(itemlink) - search category.
|
Any objections to still get a way to retrieve this enchant id from an item link?
|
Quote:
Lua Code:
I also noticed there are no enchant search categories for the prismatic glyphs. They show up in ENCHANTMENT_SEARCH_CATEGORY_OTHER at the moment and since the ability altering equipment no longer uses enchantments, it would probably make sense to remove the "other" category in favor of two new ones for the prismatic glyphs. And I agree with what Kyoma said. A way to get the default glyph on dropped equipment would still be nice for other use cases. |
We added:
GetItemLinkDefaultEnchantId GetItemLinkAppliedEnchantId GetItemLinkFinalEnchantId GetEnchantSearchCategoryType GetEnchantProcAbilityId We'll see if we have time to do the data work required to split those enchantments out. |
That sounds great! Thanks a lot! :)
Just wondering, does GetItemLinkFinalEnchantId return some new kind of enchant id? If so, how would one get a glyph itemlink from this id? |
Final is Applied if it exists, otherwise Default.
This returns an enchant id. You want a glyph item that has that enchant id as its default enchant id. |
Hurray \o/
Question: When an enchant is applied to something that had a default enchant, will it remain retrievable with the default function or will it return 0 from that point on? |
Quote:
|
Quote:
|
Quote:
|
Quote:
Lua Code:
Maybe you could just change the methods to give us the link, like this: Lua Code:
Or maybe I am just mistaken? |
You are mistaken. There is no item for a default enchant. Its power is based off of the item quality and level. Applied enchants do have an item. You can find those by searching through all items and finding one with a matching default enchant id. Their power is based off of the enchant item's quality and level.
|
Ok. I was just confused because the items I tested with did show that the default enchant corresponds to a glyph with the same level and quality as the item.
|
All times are GMT -6. The time now is 08:24 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI