shithub: pokecrystal

Download patch

ref: ef452ccbc7e448a490d1d081c63088cce7b73b0b
parent: 2e8b4836b072602d1c200b1f9735e3e0c4242985
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Fri Jul 17 04:37:03 EDT 2020

return → endcallback, reloadandreturn → reloadend

--- a/docs/event_commands.md
+++ b/docs/event_commands.md
@@ -479,13 +479,13 @@
 ## `$8F`: <code>stopandsjump <i>script</i></code>
 
 
-## `$90`: `return`
+## `$90`: `endcallback`
 
 
 ## `$91`: `end`
 
 
-## `$92`: <code>reloadandreturn <i>which_method</i></code>
+## `$92`: <code>reloadend <i>which_method</i></code>
 
 
 ## `$93`: `endall`
--- a/docs/map_event_scripts.md
+++ b/docs/map_event_scripts.md
@@ -68,7 +68,7 @@
 
 .Boulders:
 	writecmdqueue .BoulderCmdQueue
-	return
+	endcallback
 
 .BoulderCmdQueue:
 	cmdqueue CMDQUEUE_STONETABLE, .BoulderTable
--- a/engine/events/poisonstep.asm
+++ b/engine/events/poisonstep.asm
@@ -115,7 +115,7 @@
 	end
 
 .whiteout
-	farsjump Script_OverworldWhiteout
+	farsjump OverworldWhiteoutScript
 
 .CheckWhitedOut:
 	xor a
--- a/engine/events/std_scripts.asm
+++ b/engine/events/std_scripts.asm
@@ -614,7 +614,7 @@
 	setevent EVENT_SAFFRON_TRAIN_STATION_POPULATION
 	setevent EVENT_INDIGO_PLATEAU_POKECENTER_RIVAL
 	setevent EVENT_INITIALIZED_EVENTS
-	return
+	endcallback
 
 AskNumber1MScript:
 	special RandomPhoneMon
--- a/engine/events/whiteout.asm
+++ b/engine/events/whiteout.asm
@@ -2,7 +2,7 @@
 	callasm BattleBGMap
 	sjump Script_Whiteout
 
-Script_OverworldWhiteout::
+OverworldWhiteoutScript::
 	refreshscreen
 	callasm OverworldBGMap
 
--- a/engine/overworld/events.asm
+++ b/engine/overworld/events.asm
@@ -975,17 +975,17 @@
 
 PlayerEventScriptPointers:
 ; entries correspond to PLAYEREVENT_* constants
-	dba Invalid_0x96c2d          ; PLAYEREVENT_NONE
-	dba SeenByTrainerScript      ; PLAYEREVENT_SEENBYTRAINER
-	dba TalkToTrainerScript      ; PLAYEREVENT_TALKTOTRAINER
-	dba FindItemInBallScript     ; PLAYEREVENT_ITEMBALL
-	dba EdgeWarpScript           ; PLAYEREVENT_CONNECTION
-	dba WarpToNewMapScript       ; PLAYEREVENT_WARP
-	dba FallIntoMapScript        ; PLAYEREVENT_FALL
-	dba Script_OverworldWhiteout ; PLAYEREVENT_WHITEOUT
-	dba HatchEggScript           ; PLAYEREVENT_HATCH
-	dba ChangeDirectionScript    ; PLAYEREVENT_JOYCHANGEFACING
-	dba Invalid_0x96c2d          ; (NUM_PLAYER_EVENTS)
+	dba Invalid_0x96c2d         ; PLAYEREVENT_NONE
+	dba SeenByTrainerScript     ; PLAYEREVENT_SEENBYTRAINER
+	dba TalkToTrainerScript     ; PLAYEREVENT_TALKTOTRAINER
+	dba FindItemInBallScript    ; PLAYEREVENT_ITEMBALL
+	dba EdgeWarpScript          ; PLAYEREVENT_CONNECTION
+	dba WarpToNewMapScript      ; PLAYEREVENT_WARP
+	dba FallIntoMapScript       ; PLAYEREVENT_FALL
+	dba OverworldWhiteoutScript ; PLAYEREVENT_WHITEOUT
+	dba HatchEggScript          ; PLAYEREVENT_HATCH
+	dba ChangeDirectionScript   ; PLAYEREVENT_JOYCHANGEFACING
+	dba Invalid_0x96c2d         ; (NUM_PLAYER_EVENTS)
 
 Invalid_0x96c2d:
 	end
@@ -1019,7 +1019,7 @@
 	end
 
 EdgeWarpScript: ; 4
-	reloadandreturn MAPSETUP_CONNECTION
+	reloadend MAPSETUP_CONNECTION
 
 ChangeDirectionScript: ; 9
 	deactivatefacing 3
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -207,9 +207,9 @@
 	dw Script_prioritysjump              ; 8d
 	dw Script_warpcheck                  ; 8e
 	dw Script_stopandsjump               ; 8f
-	dw Script_return                     ; 90
+	dw Script_endcallback                ; 90
 	dw Script_end                        ; 91
-	dw Script_reloadandreturn            ; 92
+	dw Script_reloadend                  ; 92
 	dw Script_endall                     ; 93
 	dw Script_pokemart                   ; 94
 	dw Script_elevator                   ; 95
@@ -2186,7 +2186,7 @@
 	call StopScript
 	ret
 
-Script_reloadandreturn:
+Script_reloadend:
 	call Script_newloadmap
 	jp Script_end
 
@@ -2265,7 +2265,7 @@
 	call StopScript
 	ret
 
-Script_return:
+Script_endcallback:
 	call ExitScriptSubroutine
 	jr c, .dummy
 .dummy
--- a/engine/phone/phone.asm
+++ b/engine/phone/phone.asm
@@ -380,11 +380,11 @@
 
 LoadPhoneScriptBank:
 	memcall wPhoneScriptBank
-	return
+	endcallback
 
 LoadOutOfAreaScript:
 	scall PhoneOutOfAreaScript
-	return
+	endcallback
 
 LoadCallerScript:
 	nop
--- a/macros/legacy.asm
+++ b/macros/legacy.asm
@@ -113,6 +113,8 @@
 if_greater_than EQUS "ifgreater"
 if_less_than    EQUS "ifless"
 end_all         EQUS "endall"
+return          EQUS "endcallback"
+reloadandreturn EQUS "reloadend"
 
 checkmaptriggers EQUS "checkmapscene"
 domaptrigger     EQUS "setmapscene"
--- a/macros/scripts/events.asm
+++ b/macros/scripts/events.asm
@@ -900,9 +900,9 @@
 	dw \1 ; pointer
 ENDM
 
-	const return_command ; $90
-return: MACRO
-	db return_command
+	const endcallback_command ; $90
+endcallback: MACRO
+	db endcallback_command
 ENDM
 
 	const end_command ; $91
@@ -910,9 +910,9 @@
 	db end_command
 ENDM
 
-	const reloadandreturn_command ; $92
-reloadandreturn: MACRO
-	db reloadandreturn_command
+	const reloadend_command ; $92
+reloadend: MACRO
+	db reloadend_command
 	db \1 ; which_method
 ENDM
 
--- a/maps/AzaleaTown.asm
+++ b/maps/AzaleaTown.asm
@@ -32,7 +32,7 @@
 
 .Flypoint:
 	setflag ENGINE_FLYPOINT_AZALEA
-	return
+	endcallback
 
 AzaleaTownRivalBattleScene1:
 	moveobject AZALEATOWN_SILVER, 11, 11
--- a/maps/BattleTowerOutside.asm
+++ b/maps/BattleTowerOutside.asm
@@ -12,11 +12,11 @@
 	callback MAPCALLBACK_OBJECTS, .Callback2
 
 .Callback1:
-	return
+	endcallback
 
 .Callback2:
 	clearevent EVENT_BATTLE_TOWER_OUTSIDE_SAILOR
-	return
+	endcallback
 
 BattleTowerOutsideYoungsterScript:
 	jumptextfaceplayer BattleTowerOutsideYoungsterText
--- a/maps/BlackthornCity.asm
+++ b/maps/BlackthornCity.asm
@@ -18,17 +18,17 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_BLACKTHORN
-	return
+	endcallback
 
 .Santos:
 	readvar VAR_WEEKDAY
 	ifequal SATURDAY, .SantosAppears
 	disappear BLACKTHORNCITY_SANTOS
-	return
+	endcallback
 
 .SantosAppears:
 	appear BLACKTHORNCITY_SANTOS
-	return
+	endcallback
 
 BlackthornSuperNerdScript:
 	faceplayer
--- a/maps/BlackthornGym1F.asm
+++ b/maps/BlackthornGym1F.asm
@@ -24,7 +24,7 @@
 	iffalse .skip3
 	changeblock 8, 6, $3b ; fallen boulder 2
 .skip3
-	return
+	endcallback
 
 BlackthornGymClairScript:
 	faceplayer
--- a/maps/BlackthornGym2F.asm
+++ b/maps/BlackthornGym2F.asm
@@ -16,7 +16,7 @@
 
 .SetUpStoneTable:
 	writecmdqueue .CommandQueue
-	return
+	endcallback
 
 .CommandQueue:
 	cmdqueue CMDQUEUE_STONETABLE, .StoneTable ; check if any stones are sitting on a warp
--- a/maps/BrunosRoom.asm
+++ b/maps/BrunosRoom.asm
@@ -25,7 +25,7 @@
 	iffalse .KeepExitClosed
 	changeblock 4, 2, $16 ; open door
 .KeepExitClosed:
-	return
+	endcallback
 
 .BrunosDoorLocksBehindYou:
 	applymovement PLAYER, BrunosRoom_EnterMovement
--- a/maps/BurnedTower1F.asm
+++ b/maps/BurnedTower1F.asm
@@ -33,7 +33,7 @@
 	iftrue .HideBasement
 	changeblock 6, 14, $09 ; ladder
 .HideBasement:
-	return
+	endcallback
 
 .MeetEusine:
 	turnobject BURNEDTOWER1F_EUSINE, DOWN
--- a/maps/BurnedTowerB1F.asm
+++ b/maps/BurnedTowerB1F.asm
@@ -28,7 +28,7 @@
 	iftrue .HideLadder
 	changeblock 6, 14, $02 ; floor
 .HideLadder:
-	return
+	endcallback
 
 ReleaseTheBeasts:
 	playmusic MUSIC_NONE
--- a/maps/CeladonCity.asm
+++ b/maps/CeladonCity.asm
@@ -17,7 +17,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_CELADON
-	return
+	endcallback
 
 CeladonCityFisherScript:
 	jumptextfaceplayer CeladonCityFisherText
--- a/maps/CeladonDeptStore6F.asm
+++ b/maps/CeladonDeptStore6F.asm
@@ -14,7 +14,7 @@
 
 .HideRooftopStairs:
 	changeblock 12, 0, $03 ; wall
-	return
+	endcallback
 
 CeladonDeptStore6FSuperNerdScript:
 	jumptextfaceplayer CeladonDeptStore6FSuperNerdText
--- a/maps/CeruleanCity.asm
+++ b/maps/CeruleanCity.asm
@@ -14,7 +14,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_CERULEAN
-	return
+	endcallback
 
 CeruleanCityCooltrainerMScript:
 	faceplayer
--- a/maps/CherrygroveCity.asm
+++ b/maps/CherrygroveCity.asm
@@ -21,7 +21,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_CHERRYGROVE
-	return
+	endcallback
 
 CherrygroveCityGuideGent:
 	faceplayer
--- a/maps/CianwoodCity.asm
+++ b/maps/CianwoodCity.asm
@@ -33,7 +33,7 @@
 	iffalse .Done
 	disappear CIANWOODCITY_EUSINE
 .Done:
-	return
+	endcallback
 
 CianwoodCitySuicuneAndEusine:
 	turnobject PLAYER, UP
--- a/maps/CinnabarIsland.asm
+++ b/maps/CinnabarIsland.asm
@@ -9,7 +9,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_CINNABAR
-	return
+	endcallback
 
 CinnabarIslandBlue:
 	faceplayer
--- a/maps/Colosseum.asm
+++ b/maps/Colosseum.asm
@@ -27,16 +27,16 @@
 	iffalse .Chris2
 	disappear COLOSSEUM_CHRIS2
 	appear COLOSSEUM_CHRIS1
-	return
+	endcallback
 
 .Chris2:
 	disappear COLOSSEUM_CHRIS1
 	appear COLOSSEUM_CHRIS2
-	return
+	endcallback
 
 .PreparePokecenter2F:
 	setmapscene POKECENTER_2F, SCENE_POKECENTER2F_LEAVE_COLOSSEUM
-	return
+	endcallback
 
 .InitializeAndPreparePokecenter2F:
 	setscene SCENE_FINISHED
--- a/maps/CopycatsHouse2F.asm
+++ b/maps/CopycatsHouse2F.asm
@@ -22,7 +22,7 @@
 	disappear COPYCATSHOUSE2F_COPYCAT1
 	appear COPYCATSHOUSE2F_COPYCAT2
 .Done:
-	return
+	endcallback
 
 Copycat:
 	faceplayer
--- a/maps/DayCare.asm
+++ b/maps/DayCare.asm
@@ -13,12 +13,12 @@
 	iftrue .PutDayCareManOutside
 	clearevent EVENT_DAY_CARE_MAN_IN_DAY_CARE
 	setevent EVENT_DAY_CARE_MAN_ON_ROUTE_34
-	return
+	endcallback
 
 .PutDayCareManOutside:
 	setevent EVENT_DAY_CARE_MAN_IN_DAY_CARE
 	clearevent EVENT_DAY_CARE_MAN_ON_ROUTE_34
-	return
+	endcallback
 
 DayCareManScript_Inside:
 	faceplayer
--- a/maps/DragonsDenB1F.asm
+++ b/maps/DragonsDenB1F.asm
@@ -27,7 +27,7 @@
 	checkevent EVENT_BEAT_RIVAL_IN_MT_MOON
 	iftrue .CheckDay
 	disappear DRAGONSDENB1F_SILVER
-	return
+	endcallback
 
 .CheckDay:
 	readvar VAR_WEEKDAY
@@ -34,11 +34,11 @@
 	ifequal TUESDAY, .AppearSilver
 	ifequal THURSDAY, .AppearSilver
 	disappear DRAGONSDENB1F_SILVER
-	return
+	endcallback
 
 .AppearSilver:
 	appear DRAGONSDENB1F_SILVER
-	return
+	endcallback
 
 DragonsDenB1F_ClairScene:
 	appear DRAGONSDENB1F_CLAIR
--- a/maps/EcruteakCity.asm
+++ b/maps/EcruteakCity.asm
@@ -15,7 +15,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_ECRUTEAK
-	return
+	endcallback
 
 EcruteakCityGramps1Script:
 	jumptextfaceplayer EcruteakCityGramps1Text
--- a/maps/EcruteakTinTowerEntrance.asm
+++ b/maps/EcruteakTinTowerEntrance.asm
@@ -25,7 +25,7 @@
 	iftrue .DontBlockTower
 	checkevent EVENT_CLEARED_RADIO_TOWER
 	iftrue .BlockTower
-	return
+	endcallback
 
 .BlockTower:
 	clearevent EVENT_RANG_CLEAR_BELL_1
@@ -35,11 +35,11 @@
 	iftrue .NoClearBell
 	setscene SCENE_DEFAULT
 .NoClearBell:
-	return
+	endcallback
 
 .DontBlockTower:
 	clearevent EVENT_ECRUTEAK_TIN_TOWER_ENTRANCE_WANDERING_SAGE
-	return
+	endcallback
 
 EcruteakTinTowerEntrance_CoordEvent1:
 	checkevent EVENT_RANG_CLEAR_BELL_2
--- a/maps/ElmsLab.asm
+++ b/maps/ElmsLab.asm
@@ -42,7 +42,7 @@
 	iftrue .Skip ; not SCENE_DEFAULT
 	moveobject ELMSLAB_ELM, 3, 4
 .Skip:
-	return
+	endcallback
 
 .WalkUpToElm:
 	applymovement PLAYER, ElmsLab_WalkUpToElmMovement
--- a/maps/FuchsiaCity.asm
+++ b/maps/FuchsiaCity.asm
@@ -12,7 +12,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_FUCHSIA
-	return
+	endcallback
 
 FuchsiaCityYoungster:
 	jumptextfaceplayer FuchsiaCityYoungsterText
--- a/maps/GoldenrodCity.asm
+++ b/maps/GoldenrodCity.asm
@@ -29,7 +29,7 @@
 	iftrue .FloriaDone
 	clearevent EVENT_FLORIA_AT_SUDOWOODO
 .FloriaDone:
-	return
+	endcallback
 
 .MoveTutor:
 	checkevent EVENT_BEAT_ELITE_FOUR
@@ -41,7 +41,7 @@
 	ifequal SATURDAY, .MoveTutorAppear
 .MoveTutorDisappear:
 	disappear GOLDENRODCITY_MOVETUTOR
-	return
+	endcallback
 
 .MoveTutorAppear:
 	checkflag ENGINE_DAILY_MOVE_TUTOR
@@ -48,7 +48,7 @@
 	iftrue .MoveTutorDone
 	appear GOLDENRODCITY_MOVETUTOR
 .MoveTutorDone:
-	return
+	endcallback
 
 MoveTutorScript:
 	faceplayer
--- a/maps/GoldenrodDeptStore5F.asm
+++ b/maps/GoldenrodDeptStore5F.asm
@@ -16,11 +16,11 @@
 	readvar VAR_WEEKDAY
 	ifequal SUNDAY, .yes
 	disappear GOLDENRODDEPTSTORE5F_RECEPTIONIST
-	return
+	endcallback
 
 .yes
 	appear GOLDENRODDEPTSTORE5F_RECEPTIONIST
-	return
+	endcallback
 
 GoldenrodDeptStore5FClerkScript:
 	faceplayer
--- a/maps/GoldenrodDeptStoreB1F.asm
+++ b/maps/GoldenrodDeptStoreB1F.asm
@@ -30,19 +30,19 @@
 	checkevent EVENT_GOLDENROD_DEPT_STORE_B1F_LAYOUT_3
 	iftrue .Layout3
 	changeblock 10, 8, $0d ; floor
-	return
+	endcallback
 
 .Layout2:
 	changeblock 4, 10, $0d ; floor
-	return
+	endcallback
 
 .Layout3:
 	changeblock 10, 12, $0d ; floor
-	return
+	endcallback
 
 .Unblock:
 	clearevent EVENT_GOLDENROD_UNDERGROUND_WAREHOUSE_BLOCKED_OFF
-	return
+	endcallback
 
 GoldenrodDeptStoreB1FBlackBelt1Script:
 	jumptextfaceplayer GoldenrodDeptStoreB1FBlackBelt1Text
--- a/maps/GoldenrodDeptStoreRoof.asm
+++ b/maps/GoldenrodDeptStoreRoof.asm
@@ -18,12 +18,12 @@
 .CheckSaleChangeBlock:
 	checkflag ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
 	iftrue .SaleIsOn
-	return
+	endcallback
 
 .SaleIsOn:
 	changeblock 0, 2, $3f ; cardboard boxes
 	changeblock 0, 4, $0f ; vendor booth
-	return
+	endcallback
 
 .CheckSaleChangeClerk:
 	checkflag ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
@@ -30,12 +30,12 @@
 	iftrue .ChangeClerk
 	setevent EVENT_GOLDENROD_SALE_OFF
 	clearevent EVENT_GOLDENROD_SALE_ON
-	return
+	endcallback
 
 .ChangeClerk:
 	clearevent EVENT_GOLDENROD_SALE_OFF
 	setevent EVENT_GOLDENROD_SALE_ON
-	return
+	endcallback
 
 GoldenrodDeptStoreRoofClerkScript:
 	opentext
--- a/maps/GoldenrodGameCorner.asm
+++ b/maps/GoldenrodGameCorner.asm
@@ -35,7 +35,7 @@
 	ifequal SATURDAY, .move_tutor_outside
 .move_tutor_inside
 	appear GOLDENRODGAMECORNER_MOVETUTOR
-	return
+	endcallback
 
 .move_tutor_outside
 	checkflag ENGINE_DAILY_MOVE_TUTOR
@@ -42,7 +42,7 @@
 	iftrue .finish
 	disappear GOLDENRODGAMECORNER_MOVETUTOR
 .finish
-	return
+	endcallback
 
 MoveTutorInsideScript:
 	faceplayer
--- a/maps/GoldenrodUnderground.asm
+++ b/maps/GoldenrodUnderground.asm
@@ -38,16 +38,16 @@
 	clearevent EVENT_SWITCH_14
 	setval 0
 	writemem wUndergroundSwitchPositions
-	return
+	endcallback
 
 .CheckBasementKey:
 	checkevent EVENT_USED_BASEMENT_KEY
 	iffalse .LockBasementDoor
-	return
+	endcallback
 
 .LockBasementDoor:
 	changeblock 18, 6, $3d ; locked door
-	return
+	endcallback
 
 .CheckDayOfWeek:
 	readvar VAR_WEEKDAY
@@ -63,7 +63,7 @@
 	disappear GOLDENRODUNDERGROUND_OLDER_HAIRCUT_BROTHER
 	appear GOLDENRODUNDERGROUND_YOUNGER_HAIRCUT_BROTHER
 	appear GOLDENRODUNDERGROUND_GRANNY
-	return
+	endcallback
 
 .Monday:
 	disappear GOLDENRODUNDERGROUND_GRAMPS
@@ -74,7 +74,7 @@
 	disappear GOLDENRODUNDERGROUND_OLDER_HAIRCUT_BROTHER
 	disappear GOLDENRODUNDERGROUND_YOUNGER_HAIRCUT_BROTHER
 	disappear GOLDENRODUNDERGROUND_GRANNY
-	return
+	endcallback
 
 .Tuesday:
 	disappear GOLDENRODUNDERGROUND_GRAMPS
@@ -81,7 +81,7 @@
 	appear GOLDENRODUNDERGROUND_OLDER_HAIRCUT_BROTHER
 	disappear GOLDENRODUNDERGROUND_YOUNGER_HAIRCUT_BROTHER
 	disappear GOLDENRODUNDERGROUND_GRANNY
-	return
+	endcallback
 
 .Wednesday:
 	disappear GOLDENRODUNDERGROUND_GRAMPS
@@ -88,7 +88,7 @@
 	disappear GOLDENRODUNDERGROUND_OLDER_HAIRCUT_BROTHER
 	appear GOLDENRODUNDERGROUND_YOUNGER_HAIRCUT_BROTHER
 	disappear GOLDENRODUNDERGROUND_GRANNY
-	return
+	endcallback
 
 .Thursday:
 	disappear GOLDENRODUNDERGROUND_GRAMPS
@@ -95,7 +95,7 @@
 	appear GOLDENRODUNDERGROUND_OLDER_HAIRCUT_BROTHER
 	disappear GOLDENRODUNDERGROUND_YOUNGER_HAIRCUT_BROTHER
 	disappear GOLDENRODUNDERGROUND_GRANNY
-	return
+	endcallback
 
 .Friday:
 	disappear GOLDENRODUNDERGROUND_GRAMPS
@@ -102,7 +102,7 @@
 	disappear GOLDENRODUNDERGROUND_OLDER_HAIRCUT_BROTHER
 	appear GOLDENRODUNDERGROUND_YOUNGER_HAIRCUT_BROTHER
 	disappear GOLDENRODUNDERGROUND_GRANNY
-	return
+	endcallback
 
 .Saturday:
 	disappear GOLDENRODUNDERGROUND_GRAMPS
@@ -109,7 +109,7 @@
 	appear GOLDENRODUNDERGROUND_OLDER_HAIRCUT_BROTHER
 	disappear GOLDENRODUNDERGROUND_YOUNGER_HAIRCUT_BROTHER
 	appear GOLDENRODUNDERGROUND_GRANNY
-	return
+	endcallback
 
 TrainerSupernerdEric:
 	trainer SUPER_NERD, ERIC, EVENT_BEAT_SUPER_NERD_ERIC, SupernerdEricSeenText, SupernerdEricBeatenText, 0, .Script
--- a/maps/GoldenrodUndergroundSwitchRoomEntrances.asm
+++ b/maps/GoldenrodUndergroundSwitchRoomEntrances.asm
@@ -108,7 +108,7 @@
 	doorstate 15, CLOSED1
 	doorstate 16, OPEN1
 .false14
-	return
+	endcallback
 
 GoldenrodUndergroundSwitchRoomEntrancesSuperNerdScript:
 	jumptextfaceplayer GoldenrodUndergroundSwitchRoomEntrances_SuperNerdText
--- a/maps/GoldenrodUndergroundWarehouse.asm
+++ b/maps/GoldenrodUndergroundWarehouse.asm
@@ -31,7 +31,7 @@
 	clearevent EVENT_SWITCH_14
 	setval 0
 	writemem wUndergroundSwitchPositions
-	return
+	endcallback
 
 TrainerGruntM24:
 	trainer GRUNTM, GRUNTM_24, EVENT_BEAT_ROCKET_GRUNTM_24, GruntM24SeenText, GruntM24BeatenText, 0, .Script
--- a/maps/IcePathB1F.asm
+++ b/maps/IcePathB1F.asm
@@ -13,7 +13,7 @@
 
 .SetUpStoneTable:
 	writecmdqueue .CommandQueue
-	return
+	endcallback
 
 .CommandQueue:
 	cmdqueue CMDQUEUE_STONETABLE, .StoneTable ; check if any stones are sitting on a warp
--- a/maps/IlexForest.asm
+++ b/maps/IlexForest.asm
@@ -32,57 +32,57 @@
 	ifequal  9, .PositionNine
 	ifequal 10, .PositionTen
 .Static:
-	return
+	endcallback
 
 .PositionOne:
 	moveobject ILEXFOREST_FARFETCHD, 14, 31
 	appear ILEXFOREST_FARFETCHD
-	return
+	endcallback
 
 .PositionTwo:
 	moveobject ILEXFOREST_FARFETCHD, 15, 25
 	appear ILEXFOREST_FARFETCHD
-	return
+	endcallback
 
 .PositionThree:
 	moveobject ILEXFOREST_FARFETCHD, 20, 24
 	appear ILEXFOREST_FARFETCHD
-	return
+	endcallback
 
 .PositionFour:
 	moveobject ILEXFOREST_FARFETCHD, 29, 22
 	appear ILEXFOREST_FARFETCHD
-	return
+	endcallback
 
 .PositionFive:
 	moveobject ILEXFOREST_FARFETCHD, 28, 31
 	appear ILEXFOREST_FARFETCHD
-	return
+	endcallback
 
 .PositionSix:
 	moveobject ILEXFOREST_FARFETCHD, 24, 35
 	appear ILEXFOREST_FARFETCHD
-	return
+	endcallback
 
 .PositionSeven:
 	moveobject ILEXFOREST_FARFETCHD, 22, 31
 	appear ILEXFOREST_FARFETCHD
-	return
+	endcallback
 
 .PositionEight:
 	moveobject ILEXFOREST_FARFETCHD, 15, 29
 	appear ILEXFOREST_FARFETCHD
-	return
+	endcallback
 
 .PositionNine:
 	moveobject ILEXFOREST_FARFETCHD, 10, 35
 	appear ILEXFOREST_FARFETCHD
-	return
+	endcallback
 
 .PositionTen:
 	moveobject ILEXFOREST_FARFETCHD, 6, 28
 	appear ILEXFOREST_FARFETCHD
-	return
+	endcallback
 
 IlexForestCharcoalApprenticeScript:
 	faceplayer
--- a/maps/IndigoPlateauPokecenter1F.asm
+++ b/maps/IndigoPlateauPokecenter1F.asm
@@ -39,7 +39,7 @@
 	clearevent EVENT_BEAT_ELITE_4_KAREN
 	clearevent EVENT_BEAT_CHAMPION_LANCE
 	setevent EVENT_LANCES_ROOM_OAK_AND_MARY
-	return
+	endcallback
 
 PlateauRivalBattle1:
 	checkevent EVENT_BEAT_RIVAL_IN_MT_MOON
--- a/maps/KarensRoom.asm
+++ b/maps/KarensRoom.asm
@@ -25,7 +25,7 @@
 	iffalse .KeepExitClosed
 	changeblock 4, 2, $16 ; open door
 .KeepExitClosed:
-	return
+	endcallback
 
 .KarensDoorLocksBehindYou:
 	applymovement PLAYER, KarensRoom_EnterMovement
--- a/maps/KogasRoom.asm
+++ b/maps/KogasRoom.asm
@@ -25,7 +25,7 @@
 	iffalse .KeepExitClosed
 	changeblock 4, 2, $16 ; open door
 .KeepExitClosed:
-	return
+	endcallback
 
 .KogasDoorLocksBehindYou:
 	applymovement PLAYER, KogasRoom_EnterMovement
--- a/maps/KurtsHouse.asm
+++ b/maps/KurtsHouse.asm
@@ -22,7 +22,7 @@
 	appear KURTSHOUSE_KURT1
 	disappear KURTSHOUSE_TWIN2
 	appear KURTSHOUSE_TWIN1
-	return
+	endcallback
 
 .MakingBalls:
 	disappear KURTSHOUSE_KURT1
@@ -30,7 +30,7 @@
 	disappear KURTSHOUSE_TWIN1
 	appear KURTSHOUSE_TWIN2
 .Done:
-	return
+	endcallback
 
 Kurt1:
 	faceplayer
--- a/maps/LakeOfRage.asm
+++ b/maps/LakeOfRage.asm
@@ -29,17 +29,17 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_LAKE_OF_RAGE
-	return
+	endcallback
 
 .Wesley:
 	readvar VAR_WEEKDAY
 	ifequal WEDNESDAY, .WesleyAppears
 	disappear LAKEOFRAGE_WESLEY
-	return
+	endcallback
 
 .WesleyAppears:
 	appear LAKEOFRAGE_WESLEY
-	return
+	endcallback
 
 LakeOfRageLanceScript:
 	checkevent EVENT_REFUSED_TO_HELP_LANCE_AT_LAKE_OF_RAGE
--- a/maps/LancesRoom.asm
+++ b/maps/LancesRoom.asm
@@ -27,7 +27,7 @@
 	iffalse .KeepExitClosed
 	changeblock 4, 0, $0b ; open door
 .KeepExitClosed:
-	return
+	endcallback
 
 .LancesDoorLocksBehindYou:
 	applymovement PLAYER, LancesRoom_EnterMovement
--- a/maps/LavenderTown.asm
+++ b/maps/LavenderTown.asm
@@ -12,7 +12,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_LAVENDER
-	return
+	endcallback
 
 LavenderTownPokefanMScript:
 	jumptextfaceplayer LavenderTownPokefanMText
--- a/maps/MahoganyMart1F.asm
+++ b/maps/MahoganyMart1F.asm
@@ -23,11 +23,11 @@
 .MahoganyMart1FStaircase:
 	checkevent EVENT_UNCOVERED_STAIRCASE_IN_MAHOGANY_MART
 	iftrue .ShowStairs
-	return
+	endcallback
 
 .ShowStairs:
 	changeblock 6, 2, $1e ; stairs
-	return
+	endcallback
 
 MahoganyMart1FPharmacistScript:
 	faceplayer
--- a/maps/MahoganyTown.asm
+++ b/maps/MahoganyTown.asm
@@ -22,7 +22,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_MAHOGANY
-	return
+	endcallback
 
 MahoganyTownTryARageCandyBarScript:
 	showemote EMOTE_SHOCK, MAHOGANYTOWN_POKEFAN_M, 15
--- a/maps/MountMoonSquare.asm
+++ b/maps/MountMoonSquare.asm
@@ -16,11 +16,11 @@
 
 .DisappearMoonStone:
 	setevent EVENT_MOUNT_MOON_SQUARE_HIDDEN_MOON_STONE
-	return
+	endcallback
 
 .DisappearRock:
 	disappear MOUNTMOONSQUARE_ROCK
-	return
+	endcallback
 
 ClefairyDance:
 	checkflag ENGINE_MT_MOON_SQUARE_CLEFAIRY
--- a/maps/NewBarkTown.asm
+++ b/maps/NewBarkTown.asm
@@ -20,7 +20,7 @@
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_NEW_BARK
 	clearevent EVENT_FIRST_TIME_BANKING_WITH_MOM
-	return
+	endcallback
 
 NewBarkTown_TeacherStopsYouScene1:
 	playmusic MUSIC_MOM
--- a/maps/OlivineCity.asm
+++ b/maps/OlivineCity.asm
@@ -20,7 +20,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_OLIVINE
-	return
+	endcallback
 
 OlivineCityRivalSceneTop:
 	turnobject PLAYER, LEFT
--- a/maps/PalletTown.asm
+++ b/maps/PalletTown.asm
@@ -10,7 +10,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_PALLET
-	return
+	endcallback
 
 PalletTownTeacherScript:
 	jumptextfaceplayer PalletTownTeacherText
--- a/maps/PewterCity.asm
+++ b/maps/PewterCity.asm
@@ -13,7 +13,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_PEWTER
-	return
+	endcallback
 
 PewterCityCooltrainerFScript:
 	jumptextfaceplayer PewterCityCooltrainerFText
--- a/maps/PlayersHouse2F.asm
+++ b/maps/PlayersHouse2F.asm
@@ -21,14 +21,14 @@
 	checkevent EVENT_INITIALIZED_EVENTS
 	iftrue .SkipInitialization
 	jumpstd InitializeEventsScript
-	return
+	endcallback
 
 .SkipInitialization:
-	return
+	endcallback
 
 .SetUpTileDecorations:
 	special ToggleMaptileDecorations
-	return
+	endcallback
 
 	db 0, 0, 0 ; filler
 
--- a/maps/RadioTower3F.asm
+++ b/maps/RadioTower3F.asm
@@ -16,12 +16,12 @@
 .CardKeyShutterCallback:
 	checkevent EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER
 	iftrue .Change
-	return
+	endcallback
 
 .Change:
 	changeblock 14, 2, $2a ; open shutter
 	changeblock 14, 4, $01 ; floor
-	return
+	endcallback
 
 RadioTower3FSuperNerdScript:
 	jumptextfaceplayer RadioTower3FSuperNerdText
--- a/maps/Route16.asm
+++ b/maps/Route16.asm
@@ -10,11 +10,11 @@
 	readvar VAR_XCOORD
 	ifgreater 13, .CanWalk
 	setflag ENGINE_ALWAYS_ON_BIKE
-	return
+	endcallback
 
 .CanWalk:
 	clearflag ENGINE_ALWAYS_ON_BIKE
-	return
+	endcallback
 
 CyclingRoadSign:
 	jumptext CyclingRoadSignText
--- a/maps/Route17.asm
+++ b/maps/Route17.asm
@@ -13,7 +13,7 @@
 .AlwaysOnBike:
 	setflag ENGINE_ALWAYS_ON_BIKE
 	setflag ENGINE_DOWNHILL
-	return
+	endcallback
 
 TrainerBikerCharles:
 	trainer BIKER, CHARLES, EVENT_BEAT_BIKER_CHARLES, BikerCharlesSeenText, BikerCharlesBeatenText, 0, .Script
--- a/maps/Route19.asm
+++ b/maps/Route19.asm
@@ -22,7 +22,7 @@
 	changeblock  4,  8, $7a ; rock
 	changeblock 10, 10, $7a ; rock
 .Done:
-	return
+	endcallback
 
 TrainerSwimmerfDawn:
 	trainer SWIMMERF, DAWN, EVENT_BEAT_SWIMMERF_DAWN, SwimmerfDawnSeenText, SwimmerfDawnBeatenText, 0, .Script
--- a/maps/Route20.asm
+++ b/maps/Route20.asm
@@ -11,7 +11,7 @@
 
 .ClearRocks:
 	setevent EVENT_CINNABAR_ROCKS_CLEARED
-	return
+	endcallback
 
 TrainerSwimmerfNicole:
 	trainer SWIMMERF, NICOLE, EVENT_BEAT_SWIMMERF_NICOLE, SwimmerfNicoleSeenText, SwimmerfNicoleBeatenText, 0, .Script
--- a/maps/Route23.asm
+++ b/maps/Route23.asm
@@ -6,7 +6,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_INDIGO_PLATEAU
-	return
+	endcallback
 
 IndigoPlateauSign:
 	jumptext IndigoPlateauSignText
--- a/maps/Route29.asm
+++ b/maps/Route29.asm
@@ -28,13 +28,13 @@
 
 .TuscanyDisappears:
 	disappear ROUTE29_TUSCANY
-	return
+	endcallback
 
 .DoesTuscanyAppear:
 	readvar VAR_WEEKDAY
 	ifnotequal TUESDAY, .TuscanyDisappears
 	appear ROUTE29_TUSCANY
-	return
+	endcallback
 
 Route29Tutorial1:
 	turnobject ROUTE29_COOLTRAINER_M1, UP
--- a/maps/Route31.asm
+++ b/maps/Route31.asm
@@ -16,11 +16,11 @@
 .CheckMomCall:
 	checkevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
 	iffalse .DoMomCall
-	return
+	endcallback
 
 .DoMomCall:
 	specialphonecall SPECIALCALL_WORRIED
-	return
+	endcallback
 
 TrainerBugCatcherWade1:
 	trainer BUG_CATCHER, WADE1, EVENT_BEAT_BUG_CATCHER_WADE, BugCatcherWade1SeenText, BugCatcherWade1BeatenText, 0, .Script
--- a/maps/Route32.asm
+++ b/maps/Route32.asm
@@ -36,11 +36,11 @@
 	readvar VAR_WEEKDAY
 	ifequal FRIDAY, .FriedaAppears
 	disappear ROUTE32_FRIEDA
-	return
+	endcallback
 
 .FriedaAppears:
 	appear ROUTE32_FRIEDA
-	return
+	endcallback
 
 Route32CooltrainerMScript:
 	faceplayer
--- a/maps/Route34.asm
+++ b/maps/Route34.asm
@@ -45,11 +45,11 @@
 	checkflag ENGINE_DAY_CARE_LADY_HAS_MON
 	iffalse .HideMon2
 	clearevent EVENT_DAY_CARE_MON_2
-	return
+	endcallback
 
 .HideMon2:
 	setevent EVENT_DAY_CARE_MON_2
-	return
+	endcallback
 
 DayCareManScript_Outside:
 	faceplayer
--- a/maps/Route34IlexForestGate.asm
+++ b/maps/Route34IlexForestGate.asm
@@ -15,12 +15,12 @@
 	iffalse .Normal
 	disappear ROUTE34ILEXFORESTGATE_TEACHER1
 	appear ROUTE34ILEXFORESTGATE_TEACHER2
-	return
+	endcallback
 
 .Normal:
 	disappear ROUTE34ILEXFORESTGATE_TEACHER2
 	appear ROUTE34ILEXFORESTGATE_TEACHER1
-	return
+	endcallback
 
 Route34IlexForestGateCelebiEvent:
 	checkevent EVENT_FOREST_IS_RESTLESS
--- a/maps/Route35NationalParkGate.asm
+++ b/maps/Route35NationalParkGate.asm
@@ -27,11 +27,11 @@
 	checkflag ENGINE_BUG_CONTEST_TIMER
 	iftrue .BugContestIsRunning
 	setscene SCENE_ROUTE35NATIONALPARKGATE_NOTHING
-	return
+	endcallback
 
 .BugContestIsRunning:
 	setscene SCENE_ROUTE35NATIONALPARKGATE_LEAVE_CONTEST_EARLY
-	return
+	endcallback
 
 .CheckIfContestAvailable:
 	readvar VAR_WEEKDAY
@@ -43,13 +43,13 @@
 	disappear ROUTE35NATIONALPARKGATE_OFFICER1
 	appear ROUTE35NATIONALPARKGATE_YOUNGSTER
 	appear ROUTE35NATIONALPARKGATE_OFFICER2
-	return
+	endcallback
 
 .SetContestOfficer:
 	appear ROUTE35NATIONALPARKGATE_OFFICER1
 	disappear ROUTE35NATIONALPARKGATE_YOUNGSTER
 	disappear ROUTE35NATIONALPARKGATE_OFFICER2
-	return
+	endcallback
 
 .LeavingContestEarly:
 	applymovement PLAYER, Route35NationalParkGatePlayerApproachOfficer1Movement
--- a/maps/Route36.asm
+++ b/maps/Route36.asm
@@ -27,11 +27,11 @@
 	readvar VAR_WEEKDAY
 	ifequal THURSDAY, .ArthurAppears
 	disappear ROUTE36_ARTHUR
-	return
+	endcallback
 
 .ArthurAppears:
 	appear ROUTE36_ARTHUR
-	return
+	endcallback
 
 Route36SuicuneScript:
 	showemote EMOTE_SHOCK, PLAYER, 15
--- a/maps/Route36NationalParkGate.asm
+++ b/maps/Route36NationalParkGate.asm
@@ -36,11 +36,11 @@
 	checkflag ENGINE_BUG_CONTEST_TIMER
 	iftrue .BugContestIsRunning
 	setscene SCENE_ROUTE36NATIONALPARKGATE_NOTHING
-	return
+	endcallback
 
 .BugContestIsRunning:
 	setscene SCENE_ROUTE36NATIONALPARKGATE_LEAVE_CONTEST_EARLY
-	return
+	endcallback
 
 .CheckIfContestAvailable:
 	checkevent EVENT_WARPED_FROM_ROUTE_35_NATIONAL_PARK_GATE
@@ -53,13 +53,13 @@
 	iftrue .SetContestOfficer
 	disappear ROUTE36NATIONALPARKGATE_OFFICER1
 	appear ROUTE36NATIONALPARKGATE_OFFICER2
-	return
+	endcallback
 
 .SetContestOfficer:
 	appear ROUTE36NATIONALPARKGATE_OFFICER1
 	disappear ROUTE36NATIONALPARKGATE_OFFICER2
 .Return:
-	return
+	endcallback
 
 .LeavingContestEarly:
 	turnobject PLAYER, UP
--- a/maps/Route37.asm
+++ b/maps/Route37.asm
@@ -17,11 +17,11 @@
 	readvar VAR_WEEKDAY
 	ifequal SUNDAY, .SunnyAppears
 	disappear ROUTE37_SUNNY
-	return
+	endcallback
 
 .SunnyAppears:
 	appear ROUTE37_SUNNY
-	return
+	endcallback
 
 TrainerTwinsAnnandanne1:
 	trainer TWINS, ANNANDANNE1, EVENT_BEAT_TWINS_ANN_AND_ANNE, TwinsAnnandanne1SeenText, TwinsAnnandanne1BeatenText, 0, .Script
--- a/maps/Route40.asm
+++ b/maps/Route40.asm
@@ -23,11 +23,11 @@
 	readvar VAR_WEEKDAY
 	ifequal MONDAY, .MonicaAppears
 	disappear ROUTE40_MONICA
-	return
+	endcallback
 
 .MonicaAppears:
 	appear ROUTE40_MONICA
-	return
+	endcallback
 
 TrainerSwimmerfElaine:
 	trainer SWIMMERF, ELAINE, EVENT_BEAT_SWIMMERF_ELAINE, SwimmerfElaineSeenText, SwimmerfElaineBeatenText, 0, .Script
--- a/maps/Route40BattleTowerGate.asm
+++ b/maps/Route40BattleTowerGate.asm
@@ -10,7 +10,7 @@
 
 .ShowSailor:
 	clearevent EVENT_BATTLE_TOWER_OUTSIDE_SAILOR
-	return
+	endcallback
 
 Route40BattleTowerGateRockerScript:
 	jumptextfaceplayer Route40BattleTowerGateRockerText
--- a/maps/Route43.asm
+++ b/maps/Route43.asm
@@ -18,11 +18,11 @@
 	checkevent EVENT_CLEARED_ROCKET_HIDEOUT
 	iftrue .NoRockets
 	setmapscene ROUTE_43_GATE, SCENE_DEFAULT
-	return
+	endcallback
 
 .NoRockets:
 	setmapscene ROUTE_43_GATE, SCENE_FINISHED
-	return
+	endcallback
 
 TrainerCamperSpencer:
 	trainer CAMPER, SPENCER, EVENT_BEAT_CAMPER_SPENCER, CamperSpencerSeenText, CamperSpencerBeatenText, 0, .Script
--- a/maps/Route43Gate.asm
+++ b/maps/Route43Gate.asm
@@ -24,11 +24,11 @@
 	checkevent EVENT_CLEARED_ROCKET_HIDEOUT
 	iftrue .NoRockets
 	setmapscene ROUTE_43, 0 ; Route 43 does not have a scene variable
-	return
+	endcallback
 
 .NoRockets:
 	setmapscene ROUTE_43, 1 ; Route 43 does not have a scene variable
-	return
+	endcallback
 
 .RocketTakeover:
 	playmusic MUSIC_ROCKET_ENCOUNTER
--- a/maps/RuinsOfAlphAerodactylChamber.asm
+++ b/maps/RuinsOfAlphAerodactylChamber.asm
@@ -25,12 +25,12 @@
 .WallOpen:
 	checkevent EVENT_SOLVED_AERODACTYL_PUZZLE
 	iffalse .FloorClosed
-	return
+	endcallback
 
 .FloorClosed:
 	changeblock 2, 2, $01 ; left floor
 	changeblock 4, 2, $02 ; right floor
-	return
+	endcallback
 
 .WallOpenScript:
 	pause 30
--- a/maps/RuinsOfAlphHoOhChamber.asm
+++ b/maps/RuinsOfAlphHoOhChamber.asm
@@ -26,12 +26,12 @@
 .WallOpen:
 	checkevent EVENT_SOLVED_HO_OH_PUZZLE
 	iffalse .FloorClosed
-	return
+	endcallback
 
 .FloorClosed:
 	changeblock 2, 2, $01 ; left floor
 	changeblock 4, 2, $02 ; right floor
-	return
+	endcallback
 
 .WallOpenScript:
 	pause 30
--- a/maps/RuinsOfAlphKabutoChamber.asm
+++ b/maps/RuinsOfAlphKabutoChamber.asm
@@ -29,12 +29,12 @@
 .WallOpen:
 	checkevent EVENT_SOLVED_KABUTO_PUZZLE
 	iffalse .FloorClosed
-	return
+	endcallback
 
 .FloorClosed:
 	changeblock 2, 2, $01 ; left floor
 	changeblock 4, 2, $02 ; right floor
-	return
+	endcallback
 
 .WallOpenScript:
 	pause 30
--- a/maps/RuinsOfAlphOmanyteChamber.asm
+++ b/maps/RuinsOfAlphOmanyteChamber.asm
@@ -26,12 +26,12 @@
 .WallOpen:
 	checkevent EVENT_SOLVED_OMANYTE_PUZZLE
 	iffalse .FloorClosed
-	return
+	endcallback
 
 .FloorClosed:
 	changeblock 2, 2, $01 ; left floor
 	changeblock 4, 2, $02 ; right floor
-	return
+	endcallback
 
 .WallOpenScript:
 	pause 30
--- a/maps/RuinsOfAlphOutside.asm
+++ b/maps/RuinsOfAlphOutside.asm
@@ -34,12 +34,12 @@
 .YesScientist:
 	appear RUINSOFALPHOUTSIDE_SCIENTIST
 	setscene SCENE_RUINSOFALPHOUTSIDE_GET_UNOWN_DEX
-	return
+	endcallback
 
 .NoScientist:
 	disappear RUINSOFALPHOUTSIDE_SCIENTIST
 	setscene SCENE_RUINSOFALPHOUTSIDE_NOTHING
-	return
+	endcallback
 
 RuinsOfAlphOutsideScientistScene1:
 	turnobject RUINSOFALPHOUTSIDE_SCIENTIST, UP
--- a/maps/RuinsOfAlphResearchCenter.asm
+++ b/maps/RuinsOfAlphResearchCenter.asm
@@ -21,12 +21,12 @@
 .ScientistCallback:
 	checkscene
 	ifequal SCENE_RUINSOFALPHRESEARCHCENTER_GET_UNOWN_DEX, .ShowScientist
-	return
+	endcallback
 
 .ShowScientist:
 	moveobject RUINSOFALPHRESEARCHCENTER_SCIENTIST3, 3, 7
 	appear RUINSOFALPHRESEARCHCENTER_SCIENTIST3
-	return
+	endcallback
 
 .GetUnownDexScript:
 	applymovement RUINSOFALPHRESEARCHCENTER_SCIENTIST3, MovementData_0x5926f
--- a/maps/SaffronCity.asm
+++ b/maps/SaffronCity.asm
@@ -16,7 +16,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_SAFFRON
-	return
+	endcallback
 
 SaffronCityLass1Script:
 	faceplayer
--- a/maps/SilverCaveOutside.asm
+++ b/maps/SilverCaveOutside.asm
@@ -6,7 +6,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_SILVER_CAVE
-	return
+	endcallback
 
 MtSilverPokecenterSign:
 	jumpstd PokecenterSignScript
--- a/maps/TeamRocketBaseB1F.asm
+++ b/maps/TeamRocketBaseB1F.asm
@@ -18,7 +18,7 @@
 
 .HideSecurityGrunt:
 	disappear TEAMROCKETBASEB1F_ROCKET1
-	return
+	endcallback
 
 SecurityCamera1a:
 	checkevent EVENT_SECURITY_CAMERA_1
--- a/maps/TeamRocketBaseB2F.asm
+++ b/maps/TeamRocketBaseB2F.asm
@@ -39,11 +39,11 @@
 .TransmitterDoorCallback:
 	checkevent EVENT_OPENED_DOOR_TO_ROCKET_HIDEOUT_TRANSMITTER
 	iftrue .OpenDoor
-	return
+	endcallback
 
 .OpenDoor:
 	changeblock 14, 12, $07 ; floor
-	return
+	endcallback
 
 RocketBaseBossFLeft:
 	moveobject TEAMROCKETBASEB2F_LANCE, 9, 13
--- a/maps/TeamRocketBaseB3F.asm
+++ b/maps/TeamRocketBaseB3F.asm
@@ -40,11 +40,11 @@
 .CheckGiovanniDoor:
 	checkevent EVENT_OPENED_DOOR_TO_GIOVANNIS_OFFICE
 	iftrue .OpenSesame
-	return
+	endcallback
 
 .OpenSesame:
 	changeblock 10, 8, $07 ; floor
-	return
+	endcallback
 
 LanceGetPasswordScript:
 	turnobject PLAYER, LEFT
--- a/maps/TimeCapsule.asm
+++ b/maps/TimeCapsule.asm
@@ -22,12 +22,12 @@
 	iffalse .Chris2
 	disappear TIMECAPSULE_CHRIS2
 	appear TIMECAPSULE_CHRIS1
-	return
+	endcallback
 
 .Chris2:
 	disappear TIMECAPSULE_CHRIS1
 	appear TIMECAPSULE_CHRIS2
-	return
+	endcallback
 
 .InitializeAndPreparePokecenter2F:
 	setscene SCENE_FINISHED
--- a/maps/TinTower1F.asm
+++ b/maps/TinTower1F.asm
@@ -40,7 +40,7 @@
 	iffalse .Done
 	appear TINTOWER1F_EUSINE
 .Done:
-	return
+	endcallback
 
 .FaceBeasts:
 	checkevent EVENT_FOUGHT_SUICUNE
@@ -64,7 +64,7 @@
 .NoEntei:
 	disappear TINTOWER1F_ENTEI
 .BeastsDone:
-	return
+	endcallback
 
 .FoughtSuicune:
 	disappear TINTOWER1F_SUICUNE
@@ -72,7 +72,7 @@
 	disappear TINTOWER1F_ENTEI
 	clearevent EVENT_TIN_TOWER_1F_WISE_TRIO_1
 	setevent EVENT_TIN_TOWER_1F_WISE_TRIO_2
-	return
+	endcallback
 
 .StairsCallback:
 	checkevent EVENT_GOT_RAINBOW_WING
@@ -79,7 +79,7 @@
 	iftrue .DontHideStairs
 	changeblock 10, 2, $09 ; floor
 .DontHideStairs:
-	return
+	endcallback
 
 .SuicuneBattle:
 	applymovement PLAYER, TinTowerPlayerMovement1
--- a/maps/TinTowerRoof.asm
+++ b/maps/TinTowerRoof.asm
@@ -16,11 +16,11 @@
 
 .Appear:
 	appear TINTOWERROOF_HO_OH
-	return
+	endcallback
 
 .NoAppear:
 	disappear TINTOWERROOF_HO_OH
-	return
+	endcallback
 
 TinTowerHoOh:
 	faceplayer
--- a/maps/TradeCenter.asm
+++ b/maps/TradeCenter.asm
@@ -22,12 +22,12 @@
 	iffalse .Chris2
 	disappear TRADECENTER_CHRIS2
 	appear TRADECENTER_CHRIS1
-	return
+	endcallback
 
 .Chris2:
 	disappear TRADECENTER_CHRIS1
 	appear TRADECENTER_CHRIS2
-	return
+	endcallback
 
 .InitializeAndPreparePokecenter2F:
 	setscene SCENE_FINISHED
--- a/maps/UnionCaveB2F.asm
+++ b/maps/UnionCaveB2F.asm
@@ -19,11 +19,11 @@
 	ifequal FRIDAY, .Appear
 .NoAppear:
 	disappear UNIONCAVEB2F_LAPRAS
-	return
+	endcallback
 
 .Appear:
 	appear UNIONCAVEB2F_LAPRAS
-	return
+	endcallback
 
 UnionCaveLapras:
 	faceplayer
--- a/maps/VermilionCity.asm
+++ b/maps/VermilionCity.asm
@@ -14,7 +14,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_VERMILION
-	return
+	endcallback
 
 VermilionCityTeacherScript:
 	jumptextfaceplayer VermilionCityTeacherText
--- a/maps/VermilionPort.asm
+++ b/maps/VermilionPort.asm
@@ -20,7 +20,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_VERMILION
-	return
+	endcallback
 
 .LeaveFastShipScript:
 	applymovement PLAYER, MovementData_0x74ef3
--- a/maps/VioletCity.asm
+++ b/maps/VioletCity.asm
@@ -16,7 +16,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_VIOLET
-	return
+	endcallback
 
 VioletCityEarlScript:
 	applymovement VIOLETCITY_EARL, VioletCitySpinningEarl_MovementData
--- a/maps/ViridianCity.asm
+++ b/maps/ViridianCity.asm
@@ -12,7 +12,7 @@
 
 .FlyPoint:
 	setflag ENGINE_FLYPOINT_VIRIDIAN
-	return
+	endcallback
 
 ViridianCityCoffeeGramps:
 	faceplayer
--- a/maps/WhirlIslandLugiaChamber.asm
+++ b/maps/WhirlIslandLugiaChamber.asm
@@ -16,11 +16,11 @@
 
 .Appear:
 	appear WHIRLISLANDLUGIACHAMBER_LUGIA
-	return
+	endcallback
 
 .NoAppear:
 	disappear WHIRLISLANDLUGIACHAMBER_LUGIA
-	return
+	endcallback
 
 Lugia:
 	faceplayer
--- a/maps/WillsRoom.asm
+++ b/maps/WillsRoom.asm
@@ -25,7 +25,7 @@
 	iffalse .KeepExitClosed
 	changeblock 4, 2, $16 ; open door
 .KeepExitClosed:
-	return
+	endcallback
 
 .WillsDoorLocksBehindYou:
 	applymovement PLAYER, WillsRoom_EnterMovement
--- a/maps/WiseTriosRoom.asm
+++ b/maps/WiseTriosRoom.asm
@@ -29,17 +29,17 @@
 	iftrue .WiseTrio2
 	clearevent EVENT_WISE_TRIOS_ROOM_WISE_TRIO_1
 	setevent EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2
-	return
+	endcallback
 
 .WiseTrio2:
 	setevent EVENT_WISE_TRIOS_ROOM_WISE_TRIO_1
 	clearevent EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2
-	return
+	endcallback
 
 .NoWiseTrio:
 	setevent EVENT_WISE_TRIOS_ROOM_WISE_TRIO_1
 	setevent EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2
-	return
+	endcallback
 
 WiseTriosRoomSage1Script:
 	jumptextfaceplayer WiseTriosRoomSage1Text