pokeemerald/data/maps/SouthernIsland_Interior/scripts.inc

148 lines
4.3 KiB
PHP
Raw Normal View History

.set LOCALID_LATI, 2
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_MapScripts::
2019-10-31 22:00:37 +01:00
map_script MAP_SCRIPT_ON_RESUME, SouthernIsland_Interior_OnResume
map_script MAP_SCRIPT_ON_TRANSITION, SouthernIsland_Interior_OnTransition
2017-11-10 02:21:31 +01:00
.byte 0
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_OnResume:
2019-10-31 22:00:37 +01:00
call_if_set FLAG_SYS_CTRL_OBJ_DELETE, SouthernIsland_Interior_EventScript_TryRemoveLati
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_TryRemoveLati::
specialvar VAR_RESULT, GetBattleOutcome
goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn
removeobject LOCALID_LATI
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_OnTransition:
call_if_eq VAR_ROAMER_POKEMON, 0, SouthernIsland_Interior_EventScript_SetUpLatios
call_if_ne VAR_ROAMER_POKEMON, 0, SouthernIsland_Interior_EventScript_SetUpLatias
2019-10-31 22:00:37 +01:00
call SouthernIsland_Interior_EventScript_SetUpPlayerGfx
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_SetUpLatios::
setvar VAR_OBJ_GFX_ID_1, OBJ_EVENT_GFX_LATIOS
2019-08-15 05:38:42 +02:00
setvar VAR_TEMP_4, SPECIES_LATIOS
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_SetUpLatias::
setvar VAR_OBJ_GFX_ID_1, OBJ_EVENT_GFX_LATIAS
2019-08-15 05:38:42 +02:00
setvar VAR_TEMP_4, SPECIES_LATIAS
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_SetUpPlayerGfx::
2017-11-10 02:21:31 +01:00
checkplayergender
goto_if_eq VAR_RESULT, MALE, SouthernIsland_Interior_EventScript_SetBrendanGfx
goto_if_eq VAR_RESULT, FEMALE, SouthernIsland_Interior_EventScript_SetMayGfx
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_SetBrendanGfx::
setvar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_RIVAL_BRENDAN_NORMAL
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_SetMayGfx::
setvar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_RIVAL_MAY_NORMAL
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_TryLatiEncounter::
2017-11-10 02:21:31 +01:00
lockall
2022-01-11 08:19:20 +01:00
setvar VAR_0x8008, 12 @ Player's Y coordinate. Not read
2019-10-31 22:00:37 +01:00
goto SouthernIsland_Interior_EventScript_Lati
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_Lati::
2019-10-31 22:00:37 +01:00
goto_if_set FLAG_TEMP_2, SouthernIsland_Interior_EventScript_Sign
goto_if_set FLAG_DEFEATED_LATIAS_OR_LATIOS, SouthernIsland_Interior_EventScript_Sign
goto_if_set FLAG_CAUGHT_LATIAS_OR_LATIOS, SouthernIsland_Interior_EventScript_Sign
2020-03-03 07:36:20 +01:00
goto_if_unset FLAG_ENABLE_SHIP_SOUTHERN_ISLAND, SouthernIsland_Interior_EventScript_Sign
2019-01-02 22:12:43 +01:00
setflag FLAG_ENCOUNTERED_LATIAS_OR_LATIOS
2018-10-17 18:25:12 +02:00
setflag FLAG_TEMP_2
special SpawnCameraObject
applymovement OBJ_EVENT_ID_CAMERA, SouthernIsland_Interior_Movement_CameraPanUp
2017-11-10 02:21:31 +01:00
waitmovement 0
delay 50
waitse
2021-11-07 18:58:11 +01:00
playmoncry VAR_TEMP_4, CRY_MODE_NORMAL
2017-11-10 02:21:31 +01:00
delay 30
waitmoncry
addobject LOCALID_LATI
2017-11-10 02:21:31 +01:00
delay 30
applymovement OBJ_EVENT_ID_CAMERA, SouthernIsland_Interior_Movement_CameraPanDown
applymovement LOCALID_LATI, SouthernIsland_Interior_Movement_LatiApproach
2017-11-10 02:21:31 +01:00
waitmovement 0
delay 50
special RemoveCameraObject
setvar VAR_LAST_TALKED, LOCALID_LATI
call_if_eq VAR_ROAMER_POKEMON, 0, SouthernIsland_Interior_EventScript_SetLatiosBattleVars
call_if_ne VAR_ROAMER_POKEMON, 0, SouthernIsland_Interior_EventScript_SetLatiasBattleVars
2017-11-10 02:21:31 +01:00
setflag FLAG_SYS_CTRL_OBJ_DELETE
2017-11-28 23:02:09 +01:00
special BattleSetup_StartLatiBattle
2017-11-10 02:21:31 +01:00
waitstate
clearflag FLAG_SYS_CTRL_OBJ_DELETE
specialvar VAR_RESULT, GetBattleOutcome
goto_if_eq VAR_RESULT, B_OUTCOME_WON, SouthernIsland_Interior_EventScript_LatiDefeated
goto_if_eq VAR_RESULT, B_OUTCOME_RAN, SouthernIsland_Interior_EventScript_RanFromLati
goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, SouthernIsland_Interior_EventScript_RanFromLati
2019-01-02 22:12:43 +01:00
setflag FLAG_CAUGHT_LATIAS_OR_LATIOS
2017-11-10 02:21:31 +01:00
releaseall
end
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_LatiDefeated::
2019-01-02 22:12:43 +01:00
setflag FLAG_DEFEATED_LATIAS_OR_LATIOS
2018-05-19 18:02:43 +02:00
copyvar VAR_0x8004, VAR_TEMP_4
2019-08-15 05:38:42 +02:00
goto Common_EventScript_LegendaryFlewAway
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_RanFromLati::
2018-05-19 18:02:43 +02:00
copyvar VAR_0x8004, VAR_TEMP_4
2019-08-15 05:38:42 +02:00
goto Common_EventScript_LegendaryFlewAway
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_Sign::
msgbox SouthernIsland_Interior_Text_Sign, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
releaseall
end
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_SetLatiosBattleVars::
2022-01-11 08:16:25 +01:00
seteventmon SPECIES_LATIOS, 50, ITEM_SOUL_DEW
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_EventScript_SetLatiasBattleVars::
2022-01-11 08:16:25 +01:00
seteventmon SPECIES_LATIAS, 50, ITEM_SOUL_DEW
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_Movement_CameraPanUp:
walk_up
walk_up
walk_up
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_Movement_CameraPanDown:
delay_16
delay_16
delay_16
delay_16
delay_16
delay_16
delay_16
walk_down
walk_down
walk_down
walk_in_place_faster_up
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
SouthernIsland_Interior_Movement_LatiApproach:
walk_down
walk_down
walk_down
walk_down
walk_down
delay_16
delay_16
walk_down
walk_down
walk_down
walk_down
2017-11-10 02:21:31 +01:00
step_end