1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 11:47:45 +00:00
kawari/resources/scripts/events/common/GenericAethernetShard.lua
thedax 6d99bef66c
Refactor and reorganize numerous Lua systems: (#63)
-Global.lua is no longer a catch-all dumping ground for registering actions and events
Instead, Global.lua will actually contain useful global constants and functions

-Init.lua will take over the role of being the initial script run when doing reloads or booting the servers
-Actions.lua will take over registering all actions
-Items.lua will take over registering all items
-Commands.lua will take over registering all text commands

-Events.lua will take over registering all warps, openings/quests, aetherytes, etc.
To this end, event ids now live in organized tables to reduce error-prone copy paste clutter

If we get enough actions, items or commands, we can move those to tables too.
2025-06-25 13:25:48 -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