2020-06-21 01:56:57 -04:00
|
|
|
.set LOCALID_DEOXYS, 2
|
|
|
|
|
2021-07-05 13:54:43 -04:00
|
|
|
@ Note: LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK is a local id for this map used elsewhere. It's defined in event_objects.h
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_MapScripts::
|
2019-04-22 16:31:51 -04:00
|
|
|
map_script MAP_SCRIPT_ON_TRANSITION, BirthIsland_Exterior_OnTransition
|
2019-10-31 17:00:37 -04:00
|
|
|
map_script MAP_SCRIPT_ON_RESUME, BirthIsland_Exterior_OnResume
|
|
|
|
map_script MAP_SCRIPT_ON_RETURN_TO_FIELD, BirthIsland_Exterior_OnReturnToField
|
2017-11-09 19:21:31 -06:00
|
|
|
.byte 0
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_OnReturnToField:
|
2019-10-31 17:00:37 -04:00
|
|
|
special SetDeoxysRockPalette
|
2017-11-09 19:21:31 -06:00
|
|
|
end
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_OnTransition:
|
2019-01-02 21:12:43 +00:00
|
|
|
setflag FLAG_MAP_SCRIPT_CHECKED_DEOXYS
|
2019-11-20 23:12:51 -05:00
|
|
|
setvar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_RIVAL_BRENDAN_NORMAL
|
2018-12-28 13:10:02 -06:00
|
|
|
setvar VAR_DEOXYS_ROCK_STEP_COUNT, 0
|
|
|
|
setvar VAR_DEOXYS_ROCK_LEVEL, 0
|
2019-10-31 17:00:37 -04:00
|
|
|
call_if_set FLAG_BATTLED_DEOXYS, BirthIsland_Exterior_EventScript_HideDeoxysAndPuzzle
|
|
|
|
call_if_unset FLAG_BATTLED_DEOXYS, BirthIsland_Exterior_EventScript_TryShowDeoxysPuzzle
|
2017-11-09 19:21:31 -06:00
|
|
|
end
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_EventScript_HideDeoxysAndPuzzle::
|
2018-10-17 22:07:23 -04:00
|
|
|
setflag FLAG_HIDE_DEOXYS
|
|
|
|
setflag FLAG_HIDE_BIRTH_ISLAND_DEOXYS_TRIANGLE
|
2017-11-09 19:21:31 -06:00
|
|
|
return
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_EventScript_TryShowDeoxysPuzzle::
|
2019-02-22 20:21:26 -05:00
|
|
|
goto_if_set FLAG_DEFEATED_DEOXYS, Common_EventScript_NopReturn
|
2018-10-17 22:07:23 -04:00
|
|
|
clearflag FLAG_HIDE_BIRTH_ISLAND_DEOXYS_TRIANGLE
|
2018-12-28 13:10:02 -06:00
|
|
|
clearflag FLAG_DEOXYS_ROCK_COMPLETE
|
2017-11-09 19:21:31 -06:00
|
|
|
return
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_OnResume:
|
2019-10-31 17:00:37 -04:00
|
|
|
call_if_set FLAG_SYS_CTRL_OBJ_DELETE, BirthIsland_Exterior_EventScript_TryRemoveDeoxys
|
2017-11-09 19:21:31 -06:00
|
|
|
end
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_EventScript_TryRemoveDeoxys::
|
2018-08-08 01:37:12 -07:00
|
|
|
specialvar VAR_RESULT, GetBattleOutcome
|
2019-10-06 23:07:59 -04:00
|
|
|
compare VAR_RESULT, B_OUTCOME_CAUGHT
|
2019-02-22 20:21:26 -05:00
|
|
|
goto_if_ne Common_EventScript_NopReturn
|
2020-06-21 01:56:57 -04:00
|
|
|
removeobject LOCALID_DEOXYS
|
2017-11-09 19:21:31 -06:00
|
|
|
return
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_EventScript_Triangle::
|
2017-11-09 19:21:31 -06:00
|
|
|
lock
|
|
|
|
faceplayer
|
2018-12-28 13:10:02 -06:00
|
|
|
special DoDeoxysRockInteraction
|
2017-11-09 19:21:31 -06:00
|
|
|
waitstate
|
|
|
|
switch VAR_RESULT
|
2019-10-31 17:00:37 -04:00
|
|
|
case 0, BirthIsland_Exterior_EventScript_NotSolved1
|
|
|
|
case 1, BirthIsland_Exterior_EventScript_NotSolved2
|
|
|
|
case 2, BirthIsland_Exterior_EventScript_Deoxys
|
|
|
|
case 3, BirthIsland_Exterior_EventScript_NotSolved3
|
2017-11-09 19:21:31 -06:00
|
|
|
end
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_EventScript_NotSolved1::
|
2017-11-09 19:21:31 -06:00
|
|
|
release
|
|
|
|
end
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_EventScript_NotSolved2::
|
2017-11-09 19:21:31 -06:00
|
|
|
release
|
|
|
|
end
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_EventScript_NotSolved3::
|
2017-11-09 19:21:31 -06:00
|
|
|
release
|
|
|
|
end
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_EventScript_Deoxys::
|
2017-11-09 19:21:31 -06:00
|
|
|
waitse
|
2021-07-05 13:54:43 -04:00
|
|
|
setfieldeffectargument 0, LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK
|
|
|
|
setfieldeffectargument 1, MAP_NUM(BIRTH_ISLAND_EXTERIOR)
|
|
|
|
setfieldeffectargument 2, MAP_GROUP(BIRTH_ISLAND_EXTERIOR)
|
2020-06-19 19:58:56 -04:00
|
|
|
dofieldeffect FLDEFF_DESTROY_DEOXYS_ROCK
|
2021-05-21 15:08:00 -05:00
|
|
|
playbgm MUS_RG_ENCOUNTER_DEOXYS, FALSE
|
2020-06-19 19:58:56 -04:00
|
|
|
waitfieldeffect FLDEFF_DESTROY_DEOXYS_ROCK
|
2020-06-21 01:56:57 -04:00
|
|
|
addobject LOCALID_DEOXYS
|
|
|
|
applymovement LOCALID_DEOXYS, BirthIsland_Exterior_Movement_DeoxysApproach
|
2017-11-09 19:21:31 -06:00
|
|
|
waitmovement 0
|
|
|
|
waitse
|
|
|
|
playmoncry SPECIES_DEOXYS, 2
|
|
|
|
delay 40
|
|
|
|
waitmoncry
|
2020-06-21 01:56:57 -04:00
|
|
|
setvar VAR_LAST_TALKED, LOCALID_DEOXYS
|
2019-08-14 23:38:42 -04:00
|
|
|
setvar VAR_0x8004, SPECIES_DEOXYS
|
2019-10-31 17:00:37 -04:00
|
|
|
setvar VAR_0x8005, 30 @ level
|
2019-08-14 23:38:42 -04:00
|
|
|
setvar VAR_0x8006, ITEM_NONE
|
2021-02-15 14:54:35 -05:00
|
|
|
special CreateEventLegalEnemyMon
|
2017-11-09 19:21:31 -06:00
|
|
|
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
2017-11-28 23:02:09 +01:00
|
|
|
special BattleSetup_StartLegendaryBattle
|
2017-11-09 19:21:31 -06:00
|
|
|
waitstate
|
|
|
|
clearflag FLAG_SYS_CTRL_OBJ_DELETE
|
2018-08-08 01:37:12 -07:00
|
|
|
specialvar VAR_RESULT, GetBattleOutcome
|
2019-10-06 23:07:59 -04:00
|
|
|
compare VAR_RESULT, B_OUTCOME_WON
|
2019-10-31 17:00:37 -04:00
|
|
|
goto_if_eq BirthIsland_Exterior_EventScript_DefeatedDeoxys
|
2019-10-06 23:07:59 -04:00
|
|
|
compare VAR_RESULT, B_OUTCOME_RAN
|
2019-10-31 17:00:37 -04:00
|
|
|
goto_if_eq BirthIsland_Exterior_EventScript_RanFromDeoxys
|
2019-10-06 23:07:59 -04:00
|
|
|
compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED
|
2019-10-31 17:00:37 -04:00
|
|
|
goto_if_eq BirthIsland_Exterior_EventScript_RanFromDeoxys
|
2019-01-02 21:12:43 +00:00
|
|
|
setflag FLAG_BATTLED_DEOXYS
|
2017-11-09 19:21:31 -06:00
|
|
|
release
|
|
|
|
end
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_EventScript_DefeatedDeoxys::
|
2019-01-02 21:12:43 +00:00
|
|
|
setflag FLAG_DEFEATED_DEOXYS
|
2019-08-14 23:38:42 -04:00
|
|
|
setvar VAR_0x8004, SPECIES_DEOXYS
|
|
|
|
goto Common_EventScript_LegendaryFlewAway
|
2017-11-09 19:21:31 -06:00
|
|
|
end
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_EventScript_RanFromDeoxys::
|
2019-08-14 23:38:42 -04:00
|
|
|
setvar VAR_0x8004, SPECIES_DEOXYS
|
|
|
|
goto Common_EventScript_LegendaryFlewAway
|
2017-11-09 19:21:31 -06:00
|
|
|
end
|
|
|
|
|
2021-07-20 15:18:31 -04:00
|
|
|
BirthIsland_Exterior_Movement_DeoxysApproach:
|
2018-06-13 18:19:19 -05:00
|
|
|
walk_slow_down
|
|
|
|
walk_slow_down
|
|
|
|
walk_slow_down
|
|
|
|
walk_slow_down
|
|
|
|
walk_slow_down
|
|
|
|
walk_slow_down
|
|
|
|
walk_slow_down
|
2017-11-09 19:21:31 -06:00
|
|
|
step_end
|