C_AuctionHouse.GetItemSearchResultInfo() returns the
item link from a search result, e.g. when
shift-clicking an item in the list
This (ugly example with timers) shows how you can get an item link from searching by item ID and level, while standing at the auction house
Lua Code:
function PrintAuctionItemLink(itemID, itemLevel, itemSuffix)
if AuctionHouseFrame and AuctionHouseFrame:IsShown() then
local itemKey = C_AuctionHouse.MakeItemKey(itemID, itemLevel, itemSuffix)
C_AuctionHouse.SearchForItemKeys({itemKey}, {})
C_Timer.After(0.5, function()
local firstResult = C_AuctionHouse.GetBrowseResults()[1]
AuctionHouseFrame:SelectBrowseResult(firstResult)
end)
C_Timer.After(1, function()
local info = C_AuctionHouse.GetItemSearchResultInfo(itemKey, 1)
print(info.itemLink, (info.itemLink:gsub("|", "||")))
end)
end
end
Code:
/run PrintAuctionItemLink(4711, 54) -- item level 54
> "[Glimmering Cloak]"
> "|cff1eff00|Hitem:4711::::::::120:258:512:53:1:4277:120:::|h[Glimmering Cloak]|h|r"
Code:
/run PrintAuctionItemLink(55582, 116) -- Hiri'watha Greaves, item level 116
As to how you would generate an item link straight from an item ID and level, I have no idea
There is a lot of magic involved, especially with item suffixes