mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-27 01:00:13 +00:00
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.
This commit is contained in:
parent
a20984ada2
commit
4f28187661
1 changed files with 24 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue