Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API GetTradeSkillNumReagents

Last wiki revision 2022-08-03

Returns the number of distinct reagents required by the specified recipe. numReagents = GetTradeSkillNumReagents(tradeSkillRecipeId)

  • tradeSkillRecipeId: - The id of the trade skill recipe.
  • reagentCount: - The number of distinct reagents required to create the item.

local numReagents = GetTradeSkillNumReagents(id); local totalReagents = 0; for i=1, numReagents, 1 do local reagentName, reagentTexture, reagentCount, playerReagentCount = GetTradeSkillReagentInfo(id, i); totalReagents = totalReagents reagentCount; end;

Calculates the total number of items required by the recipe.

If a recipe calls for 2 copper tubes, 1 malachite and 2 blasting powders, GetTradeSkillNumReagents would return 3. If it required 5 linen cloths, the result would be 1.

Once you know how many distinct reagents you need, you can use GetTradeSkillReagentInfo to find out how many of each one are required.

Source

https://warcraft.wiki.gg/wiki/API_GetTradeSkillNumReagents · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.