Mercurial > wow > reagentmaker
comparison data.lua @ 108:618163a6d970 v1.0beta13
Always show counts and bypass all filtering and searches
| author | contrebasse | 
|---|---|
| date | Thu, 02 Jun 2011 14:12:06 +0200 | 
| parents | b980c00affcd | 
| children | d60d6b4cab0c | 
   comparison
  equal
  deleted
  inserted
  replaced
| 107:d64a19e5a47d | 108:618163a6d970 | 
|---|---|
| 7 | 7 | 
| 8 do | 8 do | 
| 9 -- lua functions | 9 -- lua functions | 
| 10 local print = print | 10 local print = print | 
| 11 local ipairs = ipairs | 11 local ipairs = ipairs | 
| 12 local pairs = pairs | |
| 12 local tinsert = tinsert | 13 local tinsert = tinsert | 
| 13 local select = select | 14 local select = select | 
| 14 | 15 | 
| 15 -- Wow functions | 16 -- Wow functions | 
| 16 local GetNumTradeSkills = GetNumTradeSkills | 17 local GetNumTradeSkills = GetNumTradeSkills | 
| 36 -- Has to have recipes and begin with a header | 37 -- Has to have recipes and begin with a header | 
| 37 local NRecipes = GetNumTradeSkills() | 38 local NRecipes = GetNumTradeSkills() | 
| 38 if NRecipes==0 or select(2,GetTradeSkillInfo(1))~="header" then | 39 if NRecipes==0 or select(2,GetTradeSkillInfo(1))~="header" then | 
| 39 return | 40 return | 
| 40 end | 41 end | 
| 41 | 42 | 
| 42 tradeskillName = GetTradeSkillLine() | 43 local tradeskillName = GetTradeSkillLine() | 
| 43 | 44 | 
| 44 -- Check if the pseudo tradeskills have to be added | 45 -- Check if the pseudo tradeskills have to be added | 
| 45 if tradeskillName == GetSpellInfo(25229) then -- Jewelcrafting | 46 if tradeskillName == GetSpellInfo(25229) then -- Jewelcrafting | 
| 46 if not A.ProspectingDataLoaded then | 47 if not A.ProspectingDataLoaded then | 
| 47 for itemID,data in pairs(A.ProspectingData) do | 48 for itemID,data in pairs(A.ProspectingData) do | 
| 74 local reagentID, reagentCount | 75 local reagentID, reagentCount | 
| 75 if numReagents==1 then | 76 if numReagents==1 then | 
| 76 -- reagent ID | 77 -- reagent ID | 
| 77 reagentID = A.link2ID(GetTradeSkillReagentItemLink(i, 1)) | 78 reagentID = A.link2ID(GetTradeSkillReagentItemLink(i, 1)) | 
| 78 | 79 | 
| 79 | |
| 80 -- reagent number needed | 80 -- reagent number needed | 
| 81 reagentCount = select(3,GetTradeSkillReagentInfo(i, 1)) | 81 reagentCount = select(3,GetTradeSkillReagentInfo(i, 1)) | 
| 82 else | |
| 83 -- no reagentID | |
| 84 | |
| 85 -- contains data for the whole reagents | |
| 86 reagentCount = {} | |
| 87 for j = 1,numReagents do | |
| 88 tinsert(reagentCount,{A.link2ID(GetTradeSkillReagentItemLink(i, j)), select(3,GetTradeSkillReagentInfo(i, j))}) | |
| 89 end | |
| 82 end | 90 end | 
| 83 | 91 | 
| 84 -- number of reagent created by the recipe | 92 -- number of reagent created by the recipe | 
| 85 local minMade, maxMade = GetTradeSkillNumMade(i) | 93 local minMade, maxMade = GetTradeSkillNumMade(i) | 
| 86 | 94 | 
| 107 addSpell = nil | 115 addSpell = nil | 
| 108 break | 116 break | 
| 109 end -- if | 117 end -- if | 
| 110 end -- for | 118 end -- for | 
| 111 end -- if | 119 end -- if | 
| 112 | 120 | 
| 113 -- Cache the data | 121 -- Cache the data | 
| 114 if addSpell then | 122 if addSpell then | 
| 115 local spell = {reagentID,reagentCount,minMade,maxMade} | 123 local spell = {reagentID,reagentCount,minMade,maxMade} | 
| 116 spell.spellName = tradeskillName | 124 spell.spellName = tradeskillName | 
| 117 spell.spellLink = recipeLink | 125 spell.spellLink = recipeLink | 
