1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 11:47:45 +00:00
kawari/resources/scripts/common/GenericAethernetShard.lua
The Dax feb0ffb869 Implement the aethernet for aetherytes and ensure both aetherytes and aethernet shards
do better about not yeeting you into invalid zones, crashing the client, or softlocking
2025-06-24 19:17:18 -04:00

32 lines
1.2 KiB
Lua

-- generic aetheryte, use this for all of the aethernet shards
--- scene 00000 - does nothing
--- scene 00001 - does nothing
--- scene 00002 - aetheryte menu
--- scene 00003 - "you have aethernet access" message and vfx
--- scene 00100 - "According to the message engraved in the base, special permission is required to use this aetheryte." (Eulmore-specific)
--- scene 00200 - "The aetheryte has ceased functioning." (Eulmore-specific)
SCENE_SHOW_MENU = 00002
SCENE_HAVE_AETHERNET_ACCESS = 00003
function onTalk(target, player)
player:play_scene(target, EVENT_ID, SCENE_SHOW_MENU, 8192, 0)
end
function onReturn(scene, results, player)
local AETHERNET_MENU_CANCEL = 0
local destination = results[1]
if scene == SCENE_SHOW_MENU then
if destination ~= AETHERNET_MENU_CANCEL then
player:finish_event(EVENT_ID) -- Need to finish the event here, because warping does not return to this callback (the game will crash or softlock otherwise)
player:warp_aetheryte(destination)
return
end
--elseif scene == HAVE_AETHERNET_ACCESS then
-- TODO: attunement logic
end
player:finish_event(EVENT_ID)
end