From d9d42ec956d44aa5042eb69b8e185b5e595fcf5e Mon Sep 17 00:00:00 2001 From: Shane McGovern Date: Sun, 2 Aug 2026 21:49:56 +0100 Subject: [PATCH] Play rival encounter music when rival leaves Oak's Lab after battle The parcel scene in Oak's Lab plays Music_MeetRival on both the rival's arrival and departure (lines 144-146 in oaks_lab.lua), but the post-battle onStep exit sequence only played the fanfare when the rival approached (fixed in #596). It was missing when the rival walks out after the battle. Add stop_music + play_music Music_MeetRival before the rival's exit walk-out in both oaks_lab.lua and oaks_lab_yellow.lua, matching the parcel scene's double-fanfare pattern from the original ROM. Fixes #683 --- data/scripts/oaks_lab.lua | 7 ++++++- data/scripts/oaks_lab_yellow.lua | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/data/scripts/oaks_lab.lua b/data/scripts/oaks_lab.lua index fe2602ff..afc9fc4c 100644 --- a/data/scripts/oaks_lab.lua +++ b/data/scripts/oaks_lab.lua @@ -325,9 +325,14 @@ return { table.insert(rows, { "jump_if_false", base + 6 }) table.insert(rows, { "show_text", "_OaksLabRivalIPickedTheWrongPokemonText" }) table.insert(rows, { "show_text", "_OaksLabRivalSmellYouLaterText" }) + -- OaksLabRivalStartsExitScript: parting shot, rival exit fanfare, then + -- walk out past the player. The fanfare was dropped here (#683) -- the + -- parcel scene above already plays Music_MeetRival on both arrival and + -- departure (lines 144-146), and this exit should match (#596). + table.insert(rows, { "stop_music" }) + table.insert(rows, { "play_music", "Music_MeetRival" }) table.insert(rows, { "move_npc_to", 1, 4, 11 }) table.insert(rows, { "hide_object", "OAKS_LAB", "OAKSLAB_RIVAL" }) - -- restore the lab theme once he's walked out, same as the Yellow port table.insert(rows, { "play_music", "Music_OaksLab" }) ow.runner:run(rows, { npc = rival }) return true diff --git a/data/scripts/oaks_lab_yellow.lua b/data/scripts/oaks_lab_yellow.lua index e3a663a1..8f4ac856 100644 --- a/data/scripts/oaks_lab_yellow.lua +++ b/data/scripts/oaks_lab_yellow.lua @@ -287,10 +287,12 @@ return { table.insert(rows, { "label", "lost_lab" }) table.insert(rows, { "set_field", "rivalStarter", 3 }) table.insert(rows, { "label", "exit" }) - -- OaksLabRivalStartsExitScript: parting shot, walk out past the - -- player, restore the lab theme + -- OaksLabRivalStartsExitScript: parting shot, rival exit fanfare, then + -- walk out past the player (#683). table.insert(rows, { "wait", 20 }) table.insert(rows, { "show_text", "_OaksLabRivalSmellYouLaterText" }) + table.insert(rows, { "stop_music" }) + table.insert(rows, { "play_music", "Music_MeetRival" }) table.insert(rows, { "move_npc_to", RIVAL, 4, 11 }) table.insert(rows, { "hide_object", "OAKS_LAB", "OAKSLAB_RIVAL" }) table.insert(rows, { "play_music", "Music_OaksLab" })