From 22f8b721c760cbb53349ddb30b85126964d292cf Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 22 Mar 2026 18:17:21 -0700 Subject: [PATCH] feat: show sell price on item tooltips in gold/silver/copper format Item tooltips now display the vendor sell price at the bottom, formatted as "Sell Price: 12g 50s 30c". Uses the vendorPrice field from GetItemInfo (field 11, sourced from SMSG_ITEM_QUERY_SINGLE_RESPONSE sellPrice). Helps players quickly assess item value when looting or sorting bags. --- src/addons/lua_engine.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/addons/lua_engine.cpp b/src/addons/lua_engine.cpp index f7549aa3..3bb293ef 100644 --- a/src/addons/lua_engine.cpp +++ b/src/addons/lua_engine.cpp @@ -5372,6 +5372,17 @@ void LuaEngine::registerCoreAPI() { " -- Flavor text\n" " if data.description then self:AddLine('\"'..data.description..'\"', 1, 0.82, 0) end\n" " end\n" + " -- Sell price from GetItemInfo\n" + " if sellPrice and sellPrice > 0 then\n" + " local gold = math.floor(sellPrice / 10000)\n" + " local silver = math.floor((sellPrice % 10000) / 100)\n" + " local copper = sellPrice % 100\n" + " local parts = {}\n" + " if gold > 0 then table.insert(parts, gold..'g') end\n" + " if silver > 0 then table.insert(parts, silver..'s') end\n" + " if copper > 0 then table.insert(parts, copper..'c') end\n" + " if #parts > 0 then self:AddLine('Sell Price: '..table.concat(parts, ' '), 1, 1, 1) end\n" + " end\n" " self.__itemId = itemId\n" " return true\n" "end\n"