Jump to content
Toggle menu
  • 17.3K articles
  • 8.2K files
  • 5 users
  • 280.7K edits
WoW Classic Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

API GetTradeSkillReagentInfo

From WoW Classic Wiki
GetTradeSkillReagentInfo -Documentation by Goldark-

Returns information on reagents for the specified trade skill.

local reagentName, reagentTexture, reagentCount, playerReagentCount = 
   GetTradeSkillReagentInfo(tradeSkillRecipeId, reagentId);

Arguments
(Number tradeSkillRecipeId, Number reagentId)
tradeSkillRecipeId
The Id of the tradeskill recipe
reagentId
The Id of the reagent (from 1 to x, where x is the result of calling GetTradeSkillNumReagents)

Returns
String reagentName, String reagentTexture, Integer reagentCount, Integer playerReagentCount
reagentName
The name of the reagent.
reagentTexture
The texture for the reagent's icon.
reagentCount
The quantity of this reagent required to make one of these items.
playerReagentCount
The quantity of this reagent in the player's inventory.

Example
local numReagents = GetTradeSkillNumReagents(id);
for i=1, numReagents, 1 do
  local reagentName, reagentTexture, reagentCount, playerReagentCount = GetTradeSkillReagentInfo(id, i);
  SetItemButtonTexture(reagent, reagentTexture);
  name:SetText(reagentName);
  -- Grayout items
  if ( playerReagentCount < reagentCount ) then
    SetItemButtonTextureVertexColor(reagent, 0.5, 0.5, 0.5);
    name:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
    creatable = nil;
  end;
end;



Template:WoW API