12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

814 Part IV ■ <strong>Reference</strong>playerReagentCount—Quantity <strong>of</strong> the reagent in the player’s possession(number)Example:-- Prints the reagent(s) required <strong>for</strong> the first trade skill-- recipe listedlocal skillIndex = GetFirstTradeSkill()local name = GetTradeSkillInfo(skillIndex)print(<strong>for</strong>mat(“%s takes the following reagent(s):“, name))<strong>for</strong> reagentIndex = 1, GetTradeSkillNumReagents(skillIndex) dolocal reagentName, _, reagentCount = iGetTradeSkillReagentInfo(skillIndex, reagentIndex)print(<strong>for</strong>mat(“ %dx %s“, reagentCount, reagentName))endGetTradeSkillReagentItemLinkReturns a hyperlink <strong>for</strong> a reagent in a tradeskill recipe.link = GetTradeSkillReagentItemLink(skillIndex, reagentIndex)Arguments:skillIndex—Index <strong>of</strong> a recipe in the trade skill list (between 1 <strong>and</strong>GetNumTradeSkills()) (number)reagentIndex—Index <strong>of</strong> a reagent in the recipe (between 1 <strong>and</strong>GetTradeSkillNumReagents()) (number)Returns:link—A hyperlink <strong>for</strong> the reagent item (string, hyperlink)GetTradeSkillRecipeLinkReturns hyperlink <strong>for</strong> a tradeskill recipe.link = GetTradeSkillRecipeLink(index)The tooltip produced when resolving the link describes the recipe itself—itsreagents <strong>and</strong> (if present) description—in addition to (if applicable) the itemcreated. For a link which only describes the created item, see GetTradeSkillItemLink().Arguments:index—Index <strong>of</strong> a recipe in the trade skill list (between 1 <strong>and</strong> GetNumTradeSkills()) (number)Returns:link—A hyperlink <strong>for</strong> the trade skill recipe (string)GetTradeSkillSelectionIndexReturns the index <strong>of</strong> the currently selected trade skill recipe.index = GetTradeSkillSelectionIndex()Selection in the recipe list is used only <strong>for</strong> display in the default UI <strong>and</strong> has noeffect on other Trade Skill APIs.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!