95 lines
2.6 KiB
PHP
Raw Normal View History

2021-07-20 15:18:31 -04:00
AncientTomb_MapScripts::
2019-10-31 17:00:37 -04:00
map_script MAP_SCRIPT_ON_RESUME, AncientTomb_OnResume
map_script MAP_SCRIPT_ON_LOAD, AncientTomb_OnLoad
2019-04-04 19:28:37 -04:00
map_script MAP_SCRIPT_ON_TRANSITION, AncientTomb_OnTransition
2017-11-09 19:21:31 -06:00
.byte 0
2021-07-20 15:18:31 -04:00
AncientTomb_OnResume:
2019-10-31 17:00:37 -04:00
call_if_set FLAG_SYS_CTRL_OBJ_DELETE, AncientTomb_EventScript_TryRemoveRegisteel
2017-11-09 19:21:31 -06:00
end
2021-07-20 15:18:31 -04:00
AncientTomb_EventScript_TryRemoveRegisteel::
specialvar VAR_RESULT, GetBattleOutcome
compare VAR_RESULT, B_OUTCOME_CAUGHT
2019-02-22 20:21:26 -05:00
goto_if_ne Common_EventScript_NopReturn
2017-11-09 19:21:31 -06:00
removeobject VAR_LAST_TALKED
return
2021-07-20 15:18:31 -04:00
AncientTomb_OnTransition:
2017-12-26 21:20:29 -06:00
setflag FLAG_LANDMARK_ANCIENT_TOMB
2019-10-31 17:00:37 -04:00
call_if_unset FLAG_DEFEATED_REGISTEEL, AncientTomb_EventScript_ShowRegisteel
2017-11-09 19:21:31 -06:00
end
2021-07-20 15:18:31 -04:00
AncientTomb_EventScript_ShowRegisteel::
clearflag FLAG_HIDE_REGISTEEL
2017-11-09 19:21:31 -06:00
return
2021-07-20 15:18:31 -04:00
AncientTomb_OnLoad:
2019-10-31 17:00:37 -04:00
call_if_unset FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED, AncientTomb_EventScript_HideRegiEntrance
2017-11-09 19:21:31 -06:00
end
2021-07-20 15:18:31 -04:00
AncientTomb_EventScript_HideRegiEntrance::
setmetatile 7, 19, METATILE_Cave_EntranceCover, 1
setmetatile 8, 19, METATILE_Cave_EntranceCover, 1
setmetatile 9, 19, METATILE_Cave_EntranceCover, 1
setmetatile 7, 20, METATILE_Cave_SealedChamberBraille_Mid, 1
setmetatile 8, 20, METATILE_Cave_SealedChamberBraille_Mid, 1
setmetatile 9, 20, METATILE_Cave_SealedChamberBraille_Mid, 1
2017-11-09 19:21:31 -06:00
return
2021-07-20 15:18:31 -04:00
AncientTomb_EventScript_CaveEntranceMiddle::
2017-11-09 19:21:31 -06:00
lockall
2019-10-31 17:00:37 -04:00
goto_if_set FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED, AncientTomb_EventScript_BigHoleInWall
braillemessage AncientTomb_Braille_ShineInTheMiddle
2017-11-09 19:21:31 -06:00
waitbuttonpress
2019-10-31 17:00:37 -04:00
closebraillemessage
2017-11-09 19:21:31 -06:00
releaseall
end
2021-07-20 15:18:31 -04:00
AncientTomb_EventScript_BigHoleInWall::
2019-08-14 23:38:42 -04:00
msgbox gText_BigHoleInTheWall, MSGBOX_DEFAULT
2017-11-09 19:21:31 -06:00
releaseall
end
2021-07-20 15:18:31 -04:00
AncientTomb_EventScript_CaveEntranceSide::
2017-11-09 19:21:31 -06:00
lockall
2019-10-31 17:00:37 -04:00
braillemessage AncientTomb_Braille_ShineInTheMiddle
2017-11-09 19:21:31 -06:00
waitbuttonpress
2019-10-31 17:00:37 -04:00
closebraillemessage
2017-11-09 19:21:31 -06:00
releaseall
end
2021-07-20 15:18:31 -04:00
AncientTomb_EventScript_Registeel::
2017-11-09 19:21:31 -06:00
lock
faceplayer
waitse
playmoncry SPECIES_REGISTEEL, 2
delay 40
waitmoncry
setwildbattle SPECIES_REGISTEEL, 40, ITEM_NONE
setflag FLAG_SYS_CTRL_OBJ_DELETE
2017-11-28 23:02:09 +01:00
special StartRegiBattle
2017-11-09 19:21:31 -06:00
waitstate
clearflag FLAG_SYS_CTRL_OBJ_DELETE
specialvar VAR_RESULT, GetBattleOutcome
compare VAR_RESULT, B_OUTCOME_WON
2019-10-31 17:00:37 -04:00
goto_if_eq AncientTomb_EventScript_DefeatedRegisteel
compare VAR_RESULT, B_OUTCOME_RAN
2019-10-31 17:00:37 -04:00
goto_if_eq AncientTomb_EventScript_RanFromRegisteel
compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED
2019-10-31 17:00:37 -04:00
goto_if_eq AncientTomb_EventScript_RanFromRegisteel
2019-01-02 21:12:43 +00:00
setflag FLAG_DEFEATED_REGISTEEL
2017-11-09 19:21:31 -06:00
release
end
2021-07-20 15:18:31 -04:00
AncientTomb_EventScript_DefeatedRegisteel::
2019-01-02 21:12:43 +00:00
setflag FLAG_DEFEATED_REGISTEEL
2019-08-14 23:38:42 -04:00
goto Common_EventScript_RemoveStaticPokemon
2017-11-09 19:21:31 -06:00
end
2021-07-20 15:18:31 -04:00
AncientTomb_EventScript_RanFromRegisteel::
2019-08-14 23:38:42 -04:00
setvar VAR_0x8004, SPECIES_REGISTEEL
goto Common_EventScript_LegendaryFlewAway
2017-11-09 19:21:31 -06:00
end