From 4f2818766135d69a5972050f619795235bf2b847 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 23 Mar 2026 02:33:32 -0700 Subject: [PATCH] feat: add honor/arena currency, played time, and bind location GetHonorCurrency() returns honor points from update fields. GetArenaCurrency() returns arena points. GetTimePlayed() returns total time played and level time played in seconds (populated from SMSG_PLAYED_TIME). GetBindLocation() returns the hearthstone bind zone name. Used by currency displays, /played addons, and hearthstone tooltip. --- src/addons/lua_engine.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/addons/lua_engine.cpp b/src/addons/lua_engine.cpp index 079b265d..42a8176d 100644 --- a/src/addons/lua_engine.cpp +++ b/src/addons/lua_engine.cpp @@ -5182,6 +5182,30 @@ void LuaEngine::registerCoreAPI() { if (gh) gh->requestPvpLog(); return 0; }}, + // --- Player Info --- + {"GetHonorCurrency", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + lua_pushnumber(L, gh ? gh->getHonorPoints() : 0); + return 1; + }}, + {"GetArenaCurrency", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + lua_pushnumber(L, gh ? gh->getArenaPoints() : 0); + return 1; + }}, + {"GetTimePlayed", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + if (!gh) { lua_pushnumber(L, 0); lua_pushnumber(L, 0); return 2; } + lua_pushnumber(L, gh->getTotalTimePlayed()); + lua_pushnumber(L, gh->getLevelTimePlayed()); + return 2; + }}, + {"GetBindLocation", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + if (!gh) { lua_pushstring(L, "Unknown"); return 1; } + lua_pushstring(L, gh->getWhoAreaName(gh->getHomeBindZoneId()).c_str()); + return 1; + }}, // --- Instance Lockouts --- {"GetNumSavedInstances", [](lua_State* L) -> int { auto* gh = getGameHandler(L);