From ESOUI Wiki
Hopefully, this will help anyone who wants to make a crafting addon.
- EVENT_CRAFTING_STATION_INTERACT (number eventCode, number craftSkill, boolean sameStation)
- EVENT_CRAFT_COMPLETED (number eventCode, number craftSkill)
- EVENT_CRAFT_FAILED (number eventCode, number tradeskillResult)
- EVENT_CRAFT_STARTED (number eventCode, number craftSkill)
- EVENT_END_CRAFTING_STATION_INTERACT (number eventCode, number craftSkill)
- ITEM_TRAIT_TYPE_ARMOR_DIVINES, etc.
- Returns: number TradeskillType currentCraftingInteraction
- Returns: boolean isCrafting
The Following functions work only while at a Blacksmithing, Clothier, or Woodworking station.
- CraftSmithingItem(number patternIndex, number materialIndex, number materialQuantity, number itemStyleId, number traitIndex, boolean useUniversalStyleItem)
- GetSmithingPatternResultLink(number patternIndex, number materialIndex, number materialQuantity, number itemStyleId, number traitIndex, number LinkStyle linkStyle)
- Returns: string link
patternIndex is the variable that determines what piece of equipment is crafted. For example, if the player is at a blacksmithing station and the patternIndex is 1, then an Axe will be crafted. Blacksmithing, 1-7 are weapons, 8-14 is armour. Clothing, 1-8 is Light armour, 9-15 is medium. Woodworking, 2 is shields, and the other values are the weapons.
materialIndex is a value from 1 to 41. This number determines the type of material used. So if the materialIndex is 1, Jute, Iron Ingots, or Sanded Maple will be used, but at 41, Ancestor Silk, or Rubedite Ingots will be used. Within each range, the actual value does not matter. So a materialIndex of 3 is exactly the same as one of 5, even if you wish to make a lvl 1 or lvl 8 item. The jump points are as follows:
- 1 - 7
- 8 - 12
- 13 - 17
- 18 - 22
- 23 - 25
- 26 - 28
- 30 - 32
- 33 - 39
- 40 - 41
materialQuantity is the parameter that determines the actual level. It can be a bit tricky to get the correct value. Use the following function, with a starting point of 0 to obtain the material quantity for the lowest levelled item in the materialIndex range. Subsequent uses of the function will allow you to obtain the materialQuantity for other levels. (You might be able to change the step parameter instead)
- GetSmithingPatternNextMaterialQuantity(number patternIndex, number materialIndex, number startingPoint, number step)
- Returns: number value
The use of LibLazyCrafting allows the material index and quantity to be ignored, in favour of taking in the raw level.