Mercurial > wow > reagentmaker
comparison utils.lua @ 25:578b9c9479c9
Remove errors for hidden recipes and show a '?' when count isn't available
| author | contrebasse | 
|---|---|
| date | Thu, 28 Apr 2011 19:31:01 +0200 | 
| parents | 5f3a5b88fb19 | 
| children | aa2f6965c0f6 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 24:5f3a5b88fb19 | 25:578b9c9479c9 | 
|---|---|
| 32 | 32 | 
| 33 -- Gives the number of craftable objects | 33 -- Gives the number of craftable objects | 
| 34 function A.numMakable(reagentID) | 34 function A.numMakable(reagentID) | 
| 35 -- Look for the recipe to make the item | 35 -- Look for the recipe to make the item | 
| 36 local reagentIndex = A.findSkillIndex(reagentID) | 36 local reagentIndex = A.findSkillIndex(reagentID) | 
| 37 if not reagentIndex then return 0 end | 37 if not reagentIndex then return end | 
| 38 | 38 | 
| 39 -- Check how many items we can craft | 39 -- Check how many items we can craft | 
| 40 local skillName, skillType, numReagentMakable, isExpanded, serviceType, numSkillUps = GetTradeSkillInfo(reagentIndex) | 40 local skillName, skillType, numReagentMakable, isExpanded, serviceType, numSkillUps = GetTradeSkillInfo(reagentIndex) | 
| 41 return numReagentMakable or 0, reagentIndex | 41 return numReagentMakable, reagentIndex | 
| 42 end | 42 end | 
| 43 | 43 | 
| 44 -- Find the first tradeskill index of the recipe to make an item | 44 -- Find the first tradeskill index of the recipe to make an item | 
| 45 function A.findSkillIndex(itemID) | 45 function A.findSkillIndex(itemID) | 
| 46 for i = 1,GetNumTradeSkills() do | 46 for i = 1,GetNumTradeSkills() do | 
