API

lib:AddRecipe (recipeId, spellId, itemId)

Register a recipe

Parameters:

  • recipeId: Id of the recipe
  • spellId: Id of the spell learned
  • itemId: Id of the item created by casting the spell

Usage:

-- item:2553  Recipe: Elixir of Minor Agility 
-- spell:3230 Elixir of Minor Agility
-- item:2457 Elixir of Minor Agility
LibStub("LibRecipes-3.0"):AddRecipe(2553, 3230, 2457)

Return value:

    nil

lib:GetItemInfo (itemId)

Retrieves the recipe and spell id related to the specified item; repeats in case of multiple recipes (recipe1, spell1, recipe2, spell2, ...)

Parameters:

  • itemId: Id of the item that is created by a recipe spell

Usage:

local recipeId, spellId = LibStub("LibRecipes-3.0"):GetItemInfo(2457) 
-- recipeId = 2553
-- spellId = 3230

Return values:

  1. Id of the recipe that learns the spell that creates the item
  2. Id of the spell that creates the item

lib:GetRecipeInfo (recipeId)

Retrieves the spell and item id related to the specified recipe; repeats in case of multiple spells (spell1, item1, spell2, item2, ...)

Parameters:

  • recipeId: Id of the recipe

Usage:

local spellId, itemId = LibStub("LibRecipes-3.0"):GetRecipeInfo(2553) 
-- spellId = 3230
-- itemId = 2457

Return values:

  1. Id of the spell that is learned
  2. Id of the item that is created by the spell or nil if not applicable

lib:GetSpellInfo (spellId)

Retrieves the recipe and item id related to the specified spell; repeats in case of multiple recipes (recipe1, item1, recipe2, item2, ...)

Parameters:

  • spellId: Id of the spell

Usage:

local recipeId, itemId = LibStub("LibRecipes-3.0"):GetSpellInfo(3230) 
-- recipeId = 2553
-- itemId = 2457

Return values:

  1. Id of the recipe that learns the spell
  2. Id of the item that is created by the spell or nil if not applicable

lib:TaughtBy (spellId, recipeId)

Determines if a spell is taught by a recipe

Parameters:

  • spellId: Id of the spell
  • recipeId: Id of the recipe

Usage:

local taughtBy = LibStub("LibRecipes-3.0"):TaughtBy(3230, 2553) 
-- taughtBy = true

Return value:

    true if the recipe teaches the spell; otherwise false

lib:Teaches (recipeId, spellId)

Determines if a recipe teaches a spell

Parameters:

  • recipeId: Id of the recipe
  • spellId: Id of the spell

Usage:

local teaches = LibStub("LibRecipes-3.0"):Teaches(2553, 3230) 
-- teaches = true

Return value:

    true if the spell is taught by the recipe; otherwise false