2020-06-21 07:56:57 +02:00
|
|
|
.set LOCALID_GROUDON, 1
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
TerraCave_End_MapScripts::
|
2019-10-31 22:00:37 +01:00
|
|
|
map_script MAP_SCRIPT_ON_RESUME, TerraCave_End_OnResume
|
2019-04-22 22:31:51 +02:00
|
|
|
map_script MAP_SCRIPT_ON_TRANSITION, TerraCave_End_OnTransition
|
2017-11-10 02:21:31 +01:00
|
|
|
.byte 0
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
TerraCave_End_OnResume:
|
2019-10-31 22:00:37 +01:00
|
|
|
call_if_set FLAG_SYS_CTRL_OBJ_DELETE, TerraCave_End_EventScript_TryRemoveGroudon
|
2017-11-10 02:21:31 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
TerraCave_End_EventScript_TryRemoveGroudon::
|
2018-08-08 10:37:12 +02:00
|
|
|
specialvar VAR_RESULT, GetBattleOutcome
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn
|
2020-06-21 07:56:57 +02:00
|
|
|
removeobject LOCALID_GROUDON
|
2017-11-10 02:21:31 +01:00
|
|
|
return
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
TerraCave_End_OnTransition:
|
2019-10-31 22:00:37 +01:00
|
|
|
call_if_unset FLAG_DEFEATED_GROUDON, TerraCave_End_EventScript_ShowGroudon
|
2017-11-10 02:21:31 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
TerraCave_End_EventScript_ShowGroudon::
|
2018-10-19 03:32:21 +02:00
|
|
|
clearflag FLAG_HIDE_TERRA_CAVE_GROUDON
|
2018-05-19 18:02:43 +02:00
|
|
|
setvar VAR_TEMP_1, 1
|
2017-11-10 02:21:31 +01:00
|
|
|
return
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
TerraCave_End_EventScript_Groudon::
|
2017-11-10 02:21:31 +01:00
|
|
|
lockall
|
2019-11-21 05:12:51 +01:00
|
|
|
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceUp
|
2017-11-10 02:21:31 +01:00
|
|
|
waitmovement 0
|
2020-06-21 07:56:57 +02:00
|
|
|
applymovement LOCALID_GROUDON, TerraCave_End_Movement_GroudonApproach
|
2017-11-10 02:21:31 +01:00
|
|
|
waitmovement 0
|
|
|
|
waitse
|
2021-11-07 18:58:11 +01:00
|
|
|
playmoncry SPECIES_GROUDON, CRY_MODE_ENCOUNTER
|
2017-11-10 02:21:31 +01:00
|
|
|
delay 40
|
|
|
|
waitmoncry
|
2020-06-21 07:56:57 +02:00
|
|
|
setvar VAR_LAST_TALKED, LOCALID_GROUDON
|
2022-04-02 23:09:51 +02:00
|
|
|
setwildbattle SPECIES_GROUDON, 70
|
2017-11-10 02:21:31 +01:00
|
|
|
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
2017-11-28 23:02:09 +01:00
|
|
|
special BattleSetup_StartLegendaryBattle
|
2017-11-10 02:21:31 +01:00
|
|
|
waitstate
|
|
|
|
clearflag FLAG_SYS_CTRL_OBJ_DELETE
|
2018-05-19 18:02:43 +02:00
|
|
|
setvar VAR_TEMP_1, 0
|
2018-08-08 10:37:12 +02:00
|
|
|
specialvar VAR_RESULT, GetBattleOutcome
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_eq VAR_RESULT, B_OUTCOME_WON, TerraCave_End_EventScript_DefeatedGroudon
|
|
|
|
goto_if_eq VAR_RESULT, B_OUTCOME_RAN, TerraCave_End_EventScript_RanFromGroudon
|
|
|
|
goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, TerraCave_End_EventScript_RanFromGroudon
|
2019-12-02 01:19:47 +01:00
|
|
|
setvar VAR_SHOULD_END_ABNORMAL_WEATHER, 1
|
2019-01-02 22:12:43 +01:00
|
|
|
setflag FLAG_DEFEATED_GROUDON
|
2017-11-10 02:21:31 +01:00
|
|
|
releaseall
|
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
TerraCave_End_EventScript_DefeatedGroudon::
|
2019-12-02 01:19:47 +01:00
|
|
|
setvar VAR_SHOULD_END_ABNORMAL_WEATHER, 1
|
2019-01-02 22:12:43 +01:00
|
|
|
setflag FLAG_DEFEATED_GROUDON
|
2019-08-15 05:38:42 +02:00
|
|
|
goto Common_EventScript_RemoveStaticPokemon
|
2017-11-10 02:21:31 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
TerraCave_End_EventScript_RanFromGroudon::
|
2019-08-15 05:38:42 +02:00
|
|
|
setvar VAR_0x8004, SPECIES_GROUDON
|
|
|
|
goto Common_EventScript_LegendaryFlewAway
|
2017-11-10 02:21:31 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
TerraCave_End_Movement_GroudonApproach:
|
2018-06-14 01:19:19 +02:00
|
|
|
init_affine_anim
|
|
|
|
walk_down_start_affine
|
|
|
|
delay_16
|
|
|
|
delay_16
|
|
|
|
walk_down_affine
|
|
|
|
delay_16
|
|
|
|
delay_16
|
|
|
|
walk_down_affine
|
2017-11-10 02:21:31 +01:00
|
|
|
step_end
|
|
|
|
|