Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
function FRC_AuctioneerItemPrice(itemLink)
local itemID, randomProp, enchant, uniqID, name = Auctioneer_BreakLink(itemLink);
local itemKey = itemID..":"..randomProp..":"..enchant;
local medianPrice, medianCount = Auctioneer_GetUsableMedian(itemKey, name);
if (medianPrice == nil) then
medianPrice, medianCount = Auctioneer_GetItemHistoricalMedianBuyout(itemKey, name);
end
if (medianCount == nil) then medianCount = 0 end
local buyFromVendorPrice = 0;
local sellToVendorPrice = 0;
if (FRC_VendorPrices[itemID]) then
buyFromVendorPrice = FRC_VendorPrices[itemID].b;
sellToVendorPrice = FRC_VendorPrices[itemID].s;
end
if (sellToVendorPrice == 0) then
if Auctioneer_GetVendorSellPrice then
sellToVendorPrice = Auctioneer_GetVendorSellPrice(itemID) or 0;
elseif Auctioneer_BasePrices
and Auctioneer_BasePrices[itemID]
and Auctioneer_BasePrices[itemID].s then
sellToVendorPrice = Auctioneer_BasePrices[itemID].s or 0;
end
end
if (buyFromVendorPrice > 0) then
return buyFromVendorPrice, -1; -- FRC_VendorPrices lists only the primarily-vendor-bought tradeskill items
elseif (medianCount == 0 or medianPrice == nil) then
return sellToVendorPrice * 3, 0; -- generally a good guess for auction price if we don't have real auction data
else
return medianPrice, math.floor((math.min(medianCount, MIN_SCANS) / MIN_SCANS) * 1000) / 10;
end
end
1 to 1 of 1