comparison Modules/Crafting.lua @ 110:cf160210433c

Updated Total Cost in /ia crafting to include the AH cut based on the price column. This will also reduce the profit column to consider the additional cost.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Mon, 30 Aug 2010 12:02:17 -0700
parents 89663c9dd772
children 44be3f350c9e
comparison
equal deleted inserted replaced
109:c59d22fac6d1 110:cf160210433c
439 recipeLink = recipeLink, 439 recipeLink = recipeLink,
440 recipeID = Utils.GetItemID(recipeLink), 440 recipeID = Utils.GetItemID(recipeLink),
441 link = itemLink, 441 link = itemLink,
442 name = itemName, 442 name = itemName,
443 count = count, 443 count = count,
444 price = (self:GetAuctionPrice(itemLink) or 0), 444 price = price,
445 cost = totalCost, 445 cost = totalCost,
446 profit = (self:GetAuctionPrice(itemLink) or 0) - totalCost, 446 profit = price - totalCost,
447 reagents = reagents, 447 reagents = reagents,
448 count = count, 448 count = count,
449 tradeSkillIndex = i, 449 tradeSkillIndex = i,
450 queue = 0, 450 queue = 0,
451 winner = "", 451 winner = "",
457 but this should not go below 0 457 but this should not go below 0
458 ]] 458 ]]
459 if data.queue > 0 then 459 if data.queue > 0 then
460 data.queue = max(0, data.queue - count) 460 data.queue = max(0, data.queue - count)
461 end 461 end
462
463 local price = (self:GetAuctionPrice(itemLink) or 0)
464 totalCost = totalCost + (price * ItemAuditor:GetAHCut())
462 465
463 -- If a tradeskill makes 5 at a time and something asks for 9, we should only 466 -- If a tradeskill makes 5 at a time and something asks for 9, we should only
464 -- craft twice to get 10. 467 -- craft twice to get 10.
465 data.queue = ceil(data.queue / GetTradeSkillNumMade(i)) 468 data.queue = ceil(data.queue / GetTradeSkillNumMade(i))
466 469