Mercurial > wow > reagentmaker
comparison ReagentMaker.lua @ 21:25b9f98f9bba
The default is now to craft enough reagents to be able to craft one more item
| author | contrebasse |
|---|---|
| date | Sun, 10 Apr 2011 21:31:10 +0200 |
| parents | 4ea38bae4174 |
| children | 8acb6dc1ff9e |
comparison
equal
deleted
inserted
replaced
| 20:4ea38bae4174 | 21:25b9f98f9bba |
|---|---|
| 150 function A.craft(reagentID,reagentRecipeIndex,reagentIndex,numReagentMakable,chooseNumber) | 150 function A.craft(reagentID,reagentRecipeIndex,reagentIndex,numReagentMakable,chooseNumber) |
| 151 -- Look at how many we need to make one item for the selected recipe | 151 -- Look at how many we need to make one item for the selected recipe |
| 152 local numToMake = 1 | 152 local numToMake = 1 |
| 153 local selectedIndex = GetTradeSkillSelectionIndex() | 153 local selectedIndex = GetTradeSkillSelectionIndex() |
| 154 local skillName, skillType, numAvailable, isExpanded, serviceType, numSkillUps = GetTradeSkillInfo(selectedIndex) | 154 local skillName, skillType, numAvailable, isExpanded, serviceType, numSkillUps = GetTradeSkillInfo(selectedIndex) |
| 155 if numAvailable==0 then | 155 --if numAvailable==0 then |
| 156 local reagentName, reagentTexture, reagentCount, playerReagentCount = GetTradeSkillReagentInfo(selectedIndex, reagentRecipeIndex) | 156 local reagentName, reagentTexture, reagentCount, playerReagentCount = GetTradeSkillReagentInfo(selectedIndex, reagentRecipeIndex) |
| 157 numToMake = math.min(reagentCount - playerReagentCount,numReagentMakable) | 157 -- make enough reagents to craft one more item |
| 158 end -- if | 158 numToMake = math.min(reagentCount*(1+numAvailable) - playerReagentCount,numReagentMakable) |
| 159 --end -- if | |
| 159 | 160 |
| 160 -- Choose number or craft directly | 161 -- Choose number or craft directly |
| 161 if chooseNumber and numReagentMakable>1 then | 162 if chooseNumber and numReagentMakable>1 then |
| 162 -- the dialog window is linked to the reagent button | 163 -- the dialog window is linked to the reagent button |
| 163 local btn = _G["TradeSkillReagent"..reagentRecipeIndex] | 164 local btn = _G["TradeSkillReagent"..reagentRecipeIndex] |
