From 1a5f80482f66442351ad3b03565975de6db49305 Mon Sep 17 00:00:00 2001 From: thedax Date: Tue, 24 Jun 2025 14:38:16 -0400 Subject: [PATCH] Partially implement more actors (#59) - Summoning bell now tells you you're not authorized - Armoire shows prompt but "remove items" option softlocks - Crystal Bell cutscenes work slightly better but still default to not authorized - Bed now plays cutscenes with proper fade to black, and dreamfitting works when forced in onTalk --- resources/scripts/Global.lua | 2 + resources/scripts/common/GenericAetheryte.lua | 2 + resources/scripts/common/GenericWarp.lua | 2 + .../scripts/custom/000/cmndefinnbed_00020.lua | 44 +++++++++++++------ resources/scripts/tosort/Armoire.lua | 11 +++++ resources/scripts/tosort/CrystalBell.lua | 23 +++++++++- resources/scripts/tosort/GlamourDresser.lua | 3 ++ resources/scripts/tosort/Orchestrion.lua | 5 +++ resources/scripts/tosort/SummoningBell.lua | 20 +++++++++ resources/scripts/tosort/ToyChest.lua | 2 + 10 files changed, 99 insertions(+), 15 deletions(-) create mode 100644 resources/scripts/tosort/Armoire.lua create mode 100644 resources/scripts/tosort/SummoningBell.lua diff --git a/resources/scripts/Global.lua b/resources/scripts/Global.lua index c7d3d9e..57b6844 100644 --- a/resources/scripts/Global.lua +++ b/resources/scripts/Global.lua @@ -291,7 +291,9 @@ registerEvent(721028, "tosort/UnendingJourney.lua") registerEvent(721044, "tosort/CrystalBell.lua") registerEvent(721226, "tosort/Orchestrion.lua") registerEvent(721347, "tosort/GlamourDresser.lua") +registerEvent(721440, "tosort/SummoningBell.lua") registerEvent(720935, "tosort/MarketBoard.lua") +registerEvent(720978, "tosort/Armoire.lua") registerEvent(1179657, "tosort/Chocobokeep.lua") -- Chocobokeep in Central Shroud registerEvent(1245185, "opening/OpeningLimsaLominsa.lua") registerEvent(1245186, "opening/OpeningGridania.lua") diff --git a/resources/scripts/common/GenericAetheryte.lua b/resources/scripts/common/GenericAetheryte.lua index dc78cf9..d3518ac 100644 --- a/resources/scripts/common/GenericAetheryte.lua +++ b/resources/scripts/common/GenericAetheryte.lua @@ -2,6 +2,8 @@ --- scene 02 - aetheryte menu --- scene 03 - "you have aethernet access" message and vfx +--- scene 100 - "According to the message engraved in the base, special permission is required to use this aetheryte." (Eulmore-specific) +--- scene 200 - "The aetheryte has ceased functioning." (Eulmore-specific) function onTalk(target, player) --- param has to be 1 for the menu to even show up diff --git a/resources/scripts/common/GenericWarp.lua b/resources/scripts/common/GenericWarp.lua index 38e0596..853579f 100644 --- a/resources/scripts/common/GenericWarp.lua +++ b/resources/scripts/common/GenericWarp.lua @@ -1,5 +1,7 @@ -- generic warp, use this for most warps that are just a yes/no option +-- Scene 1000 - despawns player, angles camera upward, softlocks +-- Scene 1001 - same as 1000 function onTalk(target, player) player:play_scene(target, EVENT_ID, 00000, 8192, 0) end diff --git a/resources/scripts/custom/000/cmndefinnbed_00020.lua b/resources/scripts/custom/000/cmndefinnbed_00020.lua index 071974a..6f80b1c 100644 --- a/resources/scripts/custom/000/cmndefinnbed_00020.lua +++ b/resources/scripts/custom/000/cmndefinnbed_00020.lua @@ -1,36 +1,54 @@ --- TODO: find a way to hardcode it this way EVENT_ID = 720916 +-- Event flags, courtesy of Sapphire +-- https://github.com/SapphireServer/Sapphire/blob/bf3368224a00c180cbb7ba413b52395eba58ec0b/src/world/Event/EventDefs.h#L9 +FADE_OUT = 0x00000002 +HIDE_UI = 0x00000800 +HIDE_HOTBAR = 0x2000 -- 8192 +CONDITION_CUTSCENE = 0x00000400 +SET_BASE = 0xF8400EFB + +SHOW_MENU = 00000 +SLEEP_ANIM = 00001 +LOG_OUT = 00002 +DREAMFITTING = 00003 +EXIT_GAME = 00004 +WAKE_UP_ANIM = 00100 + -- TODO: in retail, there is a fade in/out between the prompt and the sleep anim? + function onTalk(target, player) - --- prompt the bed menu - player:play_scene(target, EVENT_ID, 0, 8192, 0) + player:play_scene(target, EVENT_ID, SHOW_MENU, HIDE_HOTBAR, 0) end function onReturn(scene, results, player) - if scene == 0 then -- prompt + if scene == SHOW_MENU then -- prompt if results[1] == 1 then -- nothing elseif results[1] == 2 then - -- dreamfitting not implemented - elseif results[1] == 3 then - -- play sleep animation - player:play_scene(player.id, EVENT_ID, 1, 8192, 0) + -- 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) + elseif results[1] == 3 then -- log out + player:play_scene(player.id, EVENT_ID, SLEEP_ANIM, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) player:begin_log_out() return - elseif results[1] == 4 then - -- play sleep animation - player:play_scene(player.id, EVENT_ID, 1, 8192, 0) + elseif results[1] == 4 then -- exit game + player:play_scene(player.id, EVENT_ID, SLEEP_ANIM, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) player:begin_log_out() return end player:finish_event(EVENT_ID) - elseif scene == 1 then -- sleep anim + elseif scene == SLEEP_ANIM then -- play log out scene - player:play_scene(player.id, EVENT_ID, 2, 8192, 0) - elseif scene == 2 then -- log out + player:play_scene(player.id, EVENT_ID, LOG_OUT, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) + elseif scene == LOG_OUT then + player:finish_event(EVENT_ID) + elseif scene == DREAMFITTING then + 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 player:finish_event(EVENT_ID) end end diff --git a/resources/scripts/tosort/Armoire.lua b/resources/scripts/tosort/Armoire.lua new file mode 100644 index 0000000..0f905f1 --- /dev/null +++ b/resources/scripts/tosort/Armoire.lua @@ -0,0 +1,11 @@ +-- Internally called CmnDefCabinet:720978 + +-- TODO: actually implement this menu, attempting to open the "Remove an item." softlocks for now + +function onTalk(target, player) + player:play_scene(target, EVENT_ID, 00000, 8192, 0) +end + +function onReturn(scene, results, player) + player:finish_event(EVENT_ID) +end diff --git a/resources/scripts/tosort/CrystalBell.lua b/resources/scripts/tosort/CrystalBell.lua index 6967fb2..38da618 100644 --- a/resources/scripts/tosort/CrystalBell.lua +++ b/resources/scripts/tosort/CrystalBell.lua @@ -1,10 +1,29 @@ +-- Internally called CmnDefBeautySalon:721044 + +-- Event flags, courtesy of Sapphire +-- https://github.com/SapphireServer/Sapphire/blob/bf3368224a00c180cbb7ba413b52395eba58ec0b/src/world/Event/EventDefs.h#L9 +FADE_OUT = 0x00000002 +HIDE_UI = 0x00000800 +HIDE_HOTBAR = 0x2000 -- 8192 +CONDITION_CUTSCENE = 0x00000400 +SET_BASE = 0xF8400EFB + -- TODO: actually implement this menu +-- Scene 00000: "You are not authorized to summon the aesthetician.", also seems to be the prompt cutscene, but still unsure how to get the prompt to appear +-- Scene 00001: Aesthetician appears and speaks, then scene 2 would begin to play, but it probably needs server-side help? +-- Scene 00002: Softlocks and does nothing, seems to be where you'd be taken to the makeover menus to actually change your appearance +-- Scene 00003: End of using bell where aesthetician has rushed past the player with his scissors animation, then walks off + function onTalk(target, player) - -- you are not authorized to summon the aesthetician - player:play_scene(target, EVENT_ID, 00000, 8192, 0) + player:play_scene(target, EVENT_ID, 00000, HIDE_HOTBAR, 0) end function onReturn(scene, results, player) + if scene == 1 then + player:play_scene(player.id, EVENT_ID, 00002, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) + elseif scene == 2 then + player:play_scene(player.id, EVENT_ID, 00003, FADE_OUT + HIDE_UI + CONDITION_CUTSCENE, 0) + end player:finish_event(EVENT_ID) end diff --git a/resources/scripts/tosort/GlamourDresser.lua b/resources/scripts/tosort/GlamourDresser.lua index 9ff4c5e..872a441 100644 --- a/resources/scripts/tosort/GlamourDresser.lua +++ b/resources/scripts/tosort/GlamourDresser.lua @@ -1,4 +1,7 @@ +-- Internally called CmnDefPrismBox:721347 + -- TODO: actually implement this menu +-- Cutscene 0, flags 247 ("HOW_TO_ID_2", according to Scripter) fades the screen to black for a while, then comes back after closing an invisible dialog box function onTalk(target, player) -- You have not yet unlocked the glamour dresser. diff --git a/resources/scripts/tosort/Orchestrion.lua b/resources/scripts/tosort/Orchestrion.lua index 06ebbe3..ded2ab5 100644 --- a/resources/scripts/tosort/Orchestrion.lua +++ b/resources/scripts/tosort/Orchestrion.lua @@ -1,3 +1,8 @@ +-- Internally called HouFurOrchestrion:721226 + +-- Scene 00000 opens the main player +-- 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) player:play_scene(target, EVENT_ID, 00000, 8192, 0) end diff --git a/resources/scripts/tosort/SummoningBell.lua b/resources/scripts/tosort/SummoningBell.lua new file mode 100644 index 0000000..6236255 --- /dev/null +++ b/resources/scripts/tosort/SummoningBell.lua @@ -0,0 +1,20 @@ +-- Internally called CmnDefRetainerBell:721440 + +-- TODO: actually implement this menu + +-- Scene 00000 - Unknown, softlocks +-- Scene 00001 - Unknown, does nothing right now +-- Scene 00002 - Softlocks, but brings up active help for "A Retainer's Many Tasks", so this is probably the bell's menu proper +-- Scene 00003 - Unknown, but it's mentioned in Scripter +-- Scene 01000 - You have not yet received approval to hire retainers. +-- Scene 01001 - You have not yet hired a retainer. +-- Scene 01002 - Unknown, does nothing right now +-- Scene 01003 - Unknown, does nothing right now + +function onTalk(target, player) + player:play_scene(target, EVENT_ID, 01000, 0, 0) +end + +function onReturn(scene, results, player) + player:finish_event(EVENT_ID) +end diff --git a/resources/scripts/tosort/ToyChest.lua b/resources/scripts/tosort/ToyChest.lua index 07cc6aa..cdd2796 100644 --- a/resources/scripts/tosort/ToyChest.lua +++ b/resources/scripts/tosort/ToyChest.lua @@ -1,3 +1,5 @@ +-- Internally called CmnDefMiniGame:721096 + -- TODO: actually implement this menu function onTalk(target, player)