View Single Post
02/03/18, 01:28 PM   #1
tomtomhotep
 
tomtomhotep's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2015
Posts: 21
[outdated] Need for an API function GenerateItemLink()

Hello.

I believe there is a need for a function GenerateItemLink(...) that would take all of the necessary info and return an itemLink.

The parameters could be:
  1. ITEMTYPE_xxx constant
  2. (number:nilable) Required Level (nil if #1 = ITEMTYPE_xxx_TRAIT, ITEMTYPE_xxx_BOOSTER, ITEMTYPE_xxx_ASPECT, ITEMTYPE_xxx_ESSENCE)
  3. (number:nilable) Required CP Level (nil if #1 = ITEMTYPE_xxx_TRAIT, ITEMTYPE_xxx_BOOSTER, ITEMTYPE_xxx_ASPECT, ITEMTYPE_xxx_ESSENCE)
  4. ARMORTYPE_xxx constant (ARMORTYPE_NONE if #1 not ITEMTYPE_ARMOR)
  5. EQUIP_TYPE_xxx constant (or nil if not applicable)
  6. WEAPONTYPE_xxx constant (WEAPONTYPE_NONE if #1 not ITEMTYPE_WEAPON)
  7. ITEM_QUALITY_xxx constant (or nil if not applicable)
  8. ITEM_TRAIT_TYPE_xxx constant (ITEM_TRAIT_TYPE_NONE unless #1 is ITEMTYPE_ARMOR, ITEMTYPE_WEAPON, ITEMTYPE_ARMOR_TRAIT, ITEMTYPE_WEAPON_TRAIT)
  9. (number:nilable) itemStyleId
  10. (string:nilable) setName (as would be returned by GetItemLinkSetInfo())
  11. ENCHANTMENT_SEARCH_CATEGORY_xxx constant (ENCHANTMENT_SEARCH_CATEGORY_NONE unless #1 is ITEMTYPE_ENCHANTING_RUNE_xxx or ITEMTYPE_GLYPH_xxx)


This would support these ItemTypes:

ITEMTYPE_ARMOR (params 1-10)
ITEMTYPE_WEAPON (params 1-10)
ITEMTYPE_ARMOR_TRAIT (params 1 & 8)
ITEMTYPE_WEAPON_TRAIT (params 1 & 8)
ITEMTYPE_BLACKSMITHING_BOOSTER (params 1 & 7)
ITEMTYPE_BLACKSMITHING_MATERIAL (params 1-3)
ITEMTYPE_BLACKSMITHING_RAW_MATERIAL (params 1-3)
ITEMTYPE_CLOTHIER_BOOSTER (params 1 & 7)
ITEMTYPE_CLOTHIER_MATERIAL (params 1-3)
ITEMTYPE_CLOTHIER_RAW_MATERIAL (params 1-3)
ITEMTYPE_WOODWORKING_BOOSTER (params 1 & 7)
ITEMTYPE_WOODWORKING_MATERIAL (params 1-3)
ITEMTYPE_WOODWORKING_RAW_MATERIAL (params 1-3)
ITEMTYPE_ENCHANTING_RUNE_ASPECT (params 1 & 7)
ITEMTYPE_ENCHANTING_RUNE_ESSENCE (params 1 & 11)
ITEMTYPE_ENCHANTING_RUNE_POTENCY (params 1-3 & 11)
ITEMTYPE_GLYPH_ARMOR (params 1-3 & 7 & 11)
ITEMTYPE_GLYPH_JEWELRY (params 1-3 & 7 & 11)
ITEMTYPE_GLYPH_WEAPON (params 1-3 & 7 & 11)


I believe the use-cases are many and varied. As for myself, I am writing an addon to facilitate the crafting of equipment for other people, and I would like my addon to be able to mail a confirmation/"receipt" containing the actual item links of the equipment that the "customer" requested -- before the addon user actually starts crafting the requested items.

Also, I want my addon to allow for the "customer" to provide their own mats, and it would be much better if my addon could mail the "customer" the exact item links of what mats they need to provide, rather than just the text name of the mat. (Non-crafters may see "send me 65 Rubidite Ingots" and instead send 65 Rubidite Ore, because they don't know the difference.)


I know that TraitBuddy and TinyDog's Crafting Calculator could also benefit greatly from this function, because right now, they are both hard-coding ItemID's and ItemLinks, and we all know that ItemID's can change after any major patch.

I also believe Dolgubon might like this function for writ crafter and set crafter.