1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 11:47:45 +00:00

Update event scripts to use tables, since passing params now gets dropped into a Vec<u32> on the rust side.

This commit is contained in:
The Dax 2025-06-27 21:07:16 -04:00 committed by Joshua Goins
parent 53748c33f0
commit ee3a7c54bb
22 changed files with 33 additions and 34 deletions

View file

@ -11,7 +11,7 @@ SCENE_SHOW_MENU = 00002
SCENE_HAVE_AETHERNET_ACCESS = 00003 SCENE_HAVE_AETHERNET_ACCESS = 00003
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, SCENE_SHOW_MENU, 8192, 0) player:play_scene(target, EVENT_ID, SCENE_SHOW_MENU, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -11,8 +11,7 @@ SCENE_SHOW_MENU = 00000
SCENE_HAVE_AETHERNET_ACCESS = 00003 SCENE_HAVE_AETHERNET_ACCESS = 00003
function onTalk(target, player) function onTalk(target, player)
--- param has to be 1 for the menu to even show up player:play_scene(target, EVENT_ID, SCENE_SHOW_MENU, 8192, {0})
player:play_scene(target, EVENT_ID, SCENE_SHOW_MENU, 8192, 1)
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -7,7 +7,7 @@
function onTalk(target, player) function onTalk(target, player)
-- "You must progress further through the <expansion name> main scenario in order to access this vendor's wares." -- "You must progress further through the <expansion name> main scenario in order to access this vendor's wares."
player:play_scene(target, EVENT_ID, 00003, 8192, 0) player:play_scene(target, EVENT_ID, 00003, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -1,7 +1,7 @@
-- TODO: actually implement hunt currency and possible opcodes for doing the transactions -- TODO: actually implement hunt currency and possible opcodes for doing the transactions
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -1,7 +1,7 @@
-- TODO: actually implement this menu -- TODO: actually implement this menu
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -3,7 +3,7 @@
-- Scene 1000 - despawns player, angles camera upward, softlocks -- Scene 1000 - despawns player, angles camera upward, softlocks
-- Scene 1001 - same as 1000 -- Scene 1001 - same as 1000
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -20,7 +20,7 @@ WAKE_UP_ANIM = 00100
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, SHOW_MENU, HIDE_HOTBAR, 0) player:play_scene(target, EVENT_ID, SHOW_MENU, HIDE_HOTBAR, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)
@ -29,13 +29,13 @@ function onReturn(scene, results, player)
-- nothing -- nothing
elseif results[1] == 2 then elseif results[1] == 2 then
-- Dreamfitting partially implemented. It works completely when played in onTalk, but does not trigger in onReturn. Unsure why. -- Dreamfitting partially implemented. It works completely when played in onTalk, but does not trigger in onReturn. Unsure why.
player:play_scene(player.id, EVENT_ID, DREAMFITTING, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) player:play_scene(player.id, EVENT_ID, DREAMFITTING, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, {0})
elseif results[1] == 3 then -- log out elseif results[1] == 3 then -- log out
player:play_scene(player.id, EVENT_ID, SLEEP_ANIM, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) player:play_scene(player.id, EVENT_ID, SLEEP_ANIM, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, {0})
player:begin_log_out() player:begin_log_out()
return return
elseif results[1] == 4 then -- exit game elseif results[1] == 4 then -- exit game
player:play_scene(player.id, EVENT_ID, SLEEP_ANIM, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) player:play_scene(player.id, EVENT_ID, SLEEP_ANIM, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, {0})
player:begin_log_out() player:begin_log_out()
return return
end end
@ -43,11 +43,11 @@ function onReturn(scene, results, player)
player:finish_event(EVENT_ID) player:finish_event(EVENT_ID)
elseif scene == SLEEP_ANIM then elseif scene == SLEEP_ANIM then
-- play log out scene -- play log out scene
player:play_scene(player.id, EVENT_ID, LOG_OUT, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) player:play_scene(player.id, EVENT_ID, LOG_OUT, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, {0})
elseif scene == LOG_OUT then elseif scene == LOG_OUT then
player:finish_event(EVENT_ID) player:finish_event(EVENT_ID)
elseif scene == DREAMFITTING then elseif scene == DREAMFITTING then
player:play_scene(player.id, EVENT_ID, WAKE_UP_ANIM, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) player:play_scene(player.id, EVENT_ID, WAKE_UP_ANIM, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, {0})
elseif scene == WAKE_UP_ANIM then -- wake up anim elseif scene == WAKE_UP_ANIM then -- wake up anim
player:finish_event(EVENT_ID) player:finish_event(EVENT_ID)
end end

View file

@ -16,21 +16,21 @@ SET_BASE = 0xF8400EFB
-- Scene 00003: End of using bell where aesthetician has rushed past the player with his scissors animation, then walks off -- Scene 00003: End of using bell where aesthetician has rushed past the player with his scissors animation, then walks off
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, 00000, HIDE_HOTBAR, 0) player:play_scene(target, EVENT_ID, 00000, HIDE_HOTBAR, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)
if scene == 0 then if scene == 0 then
-- results[1] is 1 if you want to summon, otherwise 0 -- results[1] is 1 if you want to summon, otherwise 0
if results[1] == 1 then if results[1] == 1 then
player:play_scene(player.id, EVENT_ID, 00001, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) player:play_scene(player.id, EVENT_ID, 00001, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, {0})
return return
end end
elseif scene == 1 then elseif scene == 1 then
player:play_scene(player.id, EVENT_ID, 00002, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) player:play_scene(player.id, EVENT_ID, 00002, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, {0})
return return
elseif scene == 2 then elseif scene == 2 then
player:play_scene(player.id, EVENT_ID, 00003, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) player:play_scene(player.id, EVENT_ID, 00003, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, {0})
return return
end end
player:finish_event(EVENT_ID) player:finish_event(EVENT_ID)

View file

@ -2,11 +2,11 @@
POS_START = 2299848 POS_START = 2299848
function Scene00000(player) function Scene00000(player)
player:play_scene(EVENT_ID, 00000, 4959237, 1) player:play_scene(EVENT_ID, 00000, 4959237, {0})
end end
function Scene00001(player) function Scene00001(player)
player:play_scene(EVENT_ID, 00001, 4959237, 1) player:play_scene(EVENT_ID, 00001, 4959237, {0})
end end
function onEnterTerritory(player, zone) function onEnterTerritory(player, zone)

View file

@ -2,11 +2,11 @@
POS_START = 4101800 POS_START = 4101800
function Scene00000(player) function Scene00000(player)
player:play_scene(EVENT_ID, 00000, 4959237, 1) player:play_scene(EVENT_ID, 00000, 4959237, {0})
end end
function Scene00001(player) function Scene00001(player)
player:play_scene(EVENT_ID, 00001, 4959237, 1) player:play_scene(EVENT_ID, 00001, 4959237, {0})
end end
function onEnterTerritory(player, zone) function onEnterTerritory(player, zone)

View file

@ -2,11 +2,11 @@
POS_START = 4101669 POS_START = 4101669
function Scene00000(player) function Scene00000(player)
player:play_scene(EVENT_ID, 00000, 4959237, 1) player:play_scene(EVENT_ID, 00000, 4959237, {0})
end end
function Scene00001(player) function Scene00001(player)
player:play_scene(EVENT_ID, 00001, 4959237, 1) player:play_scene(EVENT_ID, 00001, 4959237, {0})
end end
function onEnterTerritory(player, zone) function onEnterTerritory(player, zone)

View file

@ -3,7 +3,7 @@
-- TODO: actually implement this menu, attempting to open the "Remove an item." softlocks for now -- TODO: actually implement this menu, attempting to open the "Remove an item." softlocks for now
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -2,7 +2,7 @@
function onTalk(target, player) function onTalk(target, player)
-- unable to hire -- unable to hire
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -1,5 +1,5 @@
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -5,7 +5,7 @@
function onTalk(target, player) function onTalk(target, player)
-- You have not yet unlocked the glamour dresser. -- You have not yet unlocked the glamour dresser.
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -5,7 +5,7 @@
function onTalk(target, player) function onTalk(target, player)
-- In expansion towns, this will display text such as "The Clan Hunt board is covered in bills showing the details of wanted monsters. However, you are unable to accept any of the bills posted at present." -- In expansion towns, this will display text such as "The Clan Hunt board is covered in bills showing the details of wanted monsters. However, you are unable to accept any of the bills posted at present."
-- In the ARR capitals it will still open an empty buggy hunt bill list. Presumably they work differently and hide the board entirely when you're unable to participate in The Hunt. -- In the ARR capitals it will still open an empty buggy hunt bill list. Presumably they work differently and hide the board entirely when you're unable to participate in The Hunt.
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -1,7 +1,7 @@
-- TODO: actually implement this menu; you can open it and push buttons but nothing responds, of course -- TODO: actually implement this menu; you can open it and push buttons but nothing responds, of course
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -4,7 +4,7 @@
-- Scene 00001 opens the playlist editor, but right now, closing it softlocks, and trying to edit anything says you are not authorized to use the estate's orchestrion -- Scene 00001 opens the playlist editor, but right now, closing it softlocks, and trying to edit anything says you are not authorized to use the estate's orchestrion
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -12,7 +12,7 @@
-- Scene 01003 - Unknown, does nothing right now -- Scene 01003 - Unknown, does nothing right now
function onTalk(target, player) function onTalk(target, player)
player:play_scene(target, EVENT_ID, 01000, 0, 0) player:play_scene(target, EVENT_ID, 01000, 0, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -4,7 +4,7 @@
function onTalk(target, player) function onTalk(target, player)
-- You have not yet unlocked any mini-games. -- You have not yet unlocked any mini-games.
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -2,7 +2,7 @@
function onTalk(target, player) function onTalk(target, player)
-- you cannot consult, which is good because we don't know how to implement this anyway -- you cannot consult, which is good because we don't know how to implement this anyway
player:play_scene(target, EVENT_ID, 00000, 8192, 0) player:play_scene(target, EVENT_ID, 00000, 8192, {0})
end end
function onReturn(scene, results, player) function onReturn(scene, results, player)

View file

@ -1,6 +1,6 @@
function onTalk(target, player) function onTalk(target, player)
-- has inn access -- has inn access
player:play_scene(target, EVENT_ID, 00001, 8192, 0) player:play_scene(target, EVENT_ID, 00001, 8192, {0})
-- doesn't have inn access -- doesn't have inn access
--player:play_scene(actorId, EVENT_ID, 00002, 8192, 0) --player:play_scene(actorId, EVENT_ID, 00002, 8192, 0)