comparison Modules/QuickAuctions.lua @ 77:a8fc802b42ba

Changed the QuickAuctions decider to consider the number already owned and only calculate based on what needs to be crated. Fixed the QuickAuctions decider to return the number of items to be created instead of the number of times to create. This makes a difference with things like Runescroll of Fortitude where 5 are created at once.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Sun, 01 Aug 2010 08:42:29 -0700
parents aaf9a155995b
children 88a42e00b866
comparison
equal deleted inserted replaced
76:574c154d24ab 77:a8fc802b42ba
96 if QAGroup ~= nil then 96 if QAGroup ~= nil then
97 local currentInvested, _, currentCount = ItemAuditor:GetItemCost(data.link) 97 local currentInvested, _, currentCount = ItemAuditor:GetItemCost(data.link)
98 local threshold, postCap, perAuction = QAAPI:GetGroupConfig(QAGroup) 98 local threshold, postCap, perAuction = QAAPI:GetGroupConfig(QAGroup)
99 local stackSize = postCap * perAuction 99 local stackSize = postCap * perAuction
100 100
101 stackSize = stackSize / GetTradeSkillNumMade(data.tradeSkillIndex)
102
103 -- bonus 101 -- bonus
104 stackSize = ceil(stackSize * (1+ItemAuditor.db.char.qa_extra)) 102 stackSize = ceil(stackSize * (1+ItemAuditor.db.char.qa_extra))
103 local target = stackSize
104 stackSize = stackSize - currentCount
105 105
106 local newThreshold = ((data.cost*stackSize) + currentInvested) / (currentCount + stackSize) 106 local newThreshold = ((data.cost*stackSize) + currentInvested) / (currentCount + stackSize)
107 newThreshold = calculateQAThreshold(newThreshold) 107 newThreshold = calculateQAThreshold(newThreshold)
108 108
109 if newThreshold < data.price then 109 if newThreshold < data.price then
110 return stackSize 110 return target
111 end 111 end
112 112
113 return -1 113 return -1
114 end 114 end
115 end 115 end