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.
This commit is contained in:
Kelsi 2026-03-23 03:27:45 -07:00
parent 6c873622dc
commit 2b582f8a20

View file

@ -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<int>(luaL_optnumber(L, 1, 1));
int mx = static_cast<int>(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);