From 2b582f8a20136bb47e56f1a63df961dec6e5304a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 23 Mar 2026 03:27:45 -0700 Subject: [PATCH] feat: add Logout, CancelLogout, RandomRoll, FollowUnit Logout() sends logout request to server. CancelLogout() cancels a pending logout. RandomRoll(min, max) sends /roll (defaults 1-100). FollowUnit() is a stub (requires movement system). Backed by existing requestLogout, cancelLogout, randomRoll methods. --- src/addons/lua_engine.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/addons/lua_engine.cpp b/src/addons/lua_engine.cpp index 9ee134dd..42dac796 100644 --- a/src/addons/lua_engine.cpp +++ b/src/addons/lua_engine.cpp @@ -5182,6 +5182,28 @@ void LuaEngine::registerCoreAPI() { if (gh) gh->requestPvpLog(); return 0; }}, + // --- System Commands --- + {"Logout", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + if (gh) gh->requestLogout(); + return 0; + }}, + {"CancelLogout", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + if (gh) gh->cancelLogout(); + return 0; + }}, + {"RandomRoll", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + int mn = static_cast(luaL_optnumber(L, 1, 1)); + int mx = static_cast(luaL_optnumber(L, 2, 100)); + if (gh) gh->randomRoll(mn, mx); + return 0; + }}, + {"FollowUnit", [](lua_State* L) -> int { + (void)L; // Follow requires movement system integration + return 0; + }}, // --- Party/Group Management --- {"InviteUnit", [](lua_State* L) -> int { auto* gh = getGameHandler(L);