pokeemerald/data/maps/Route121_SafariZoneEntrance/scripts.inc
2021-07-20 15:18:31 -04:00

138 lines
4.3 KiB
C++

Route121_SafariZoneEntrance_MapScripts::
map_script MAP_SCRIPT_ON_FRAME_TABLE, Route121_SafariZoneEntrance_OnFrame
.byte 0
Route121_SafariZoneEntrance_OnFrame:
map_script_2 VAR_SAFARI_ZONE_STATE, 1, Route121_SafariZoneEntrance_EventScript_ExitSafariZone
.2byte 0
Route121_SafariZoneEntrance_EventScript_ExitSafariZone::
lockall
applymovement OBJ_EVENT_ID_PLAYER, Route121_SafariZoneEntrance_Movement_ExitSafariZone
waitmovement 0
setvar VAR_SAFARI_ZONE_STATE, 0
releaseall
end
Route121_SafariZoneEntrance_Movement_ExitSafariZone:
walk_up
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
step_end
Route121_SafariZoneEntrance_EventScript_WelcomeAttendant::
msgbox Route121_SafariZoneEntrance_Text_WelcomeToSafariZone, MSGBOX_NPC
end
Route121_SafariZoneEntrance_EventScript_InfoAttendant::
lock
faceplayer
msgbox Route121_SafariZoneEntrance_Text_WelcomeFirstTime, MSGBOX_YESNO
compare VAR_RESULT, YES
goto_if_eq Route121_SafariZoneEntrance_EventScript_FirstTimeInfo
msgbox Route121_SafariZoneEntrance_Text_ComeInAndEnjoy, MSGBOX_DEFAULT
release
end
Route121_SafariZoneEntrance_EventScript_FirstTimeInfo::
msgbox Route121_SafariZoneEntrance_Text_FirstTimeInfo, MSGBOX_DEFAULT
release
end
Route121_SafariZoneEntrance_EventScript_EntranceCounterTrigger::
lockall
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp
waitmovement 0
showmoneybox 0, 0, 0
msgbox Route121_SafariZoneEntrance_Text_WouldYouLikeToPlay, MSGBOX_YESNO
compare VAR_RESULT, YES
goto_if_eq Route121_SafariZoneEntrance_EventScript_TryEnterSafariZone
msgbox Route121_SafariZoneEntrance_Text_PlayAnotherTime, MSGBOX_DEFAULT
goto Route121_SafariZoneEntrance_EventScript_MovePlayerBackFromCounter
end
Route121_SafariZoneEntrance_EventScript_TryEnterSafariZone::
checkitem ITEM_POKEBLOCK_CASE, 1
compare VAR_RESULT, 0
goto_if_eq Route121_SafariZoneEntrance_EventScript_NoPokeblockCase
call Route121_SafariZoneEntrance_EventScript_CheckHasRoomForPokemon
checkmoney 500, 0
compare VAR_RESULT, 0
goto_if_eq Route121_SafariZoneEntrance_EventScript_NotEnoughMoney
playse SE_SHOP
msgbox Route121_SafariZoneEntrance_Text_ThatWillBe500Please, MSGBOX_DEFAULT
removemoney 500, 0
updatemoneybox 0, 0
msgbox Route121_SafariZoneEntrance_Text_HereAreYourSafariBalls, MSGBOX_DEFAULT
playfanfare MUS_OBTAIN_ITEM
message Route121_SafariZoneEntrance_Text_Received30SafariBalls
waitfanfare
msgbox Route121_SafariZoneEntrance_Text_PleaseEnjoyYourself, MSGBOX_DEFAULT
closemessage
hidemoneybox
applymovement OBJ_EVENT_ID_PLAYER, Route121_SafariZoneEntrance_Movement_EnterSafariZone
waitmovement 0
special EnterSafariMode
setvar VAR_SAFARI_ZONE_STATE, 2
clearflag FLAG_GOOD_LUCK_SAFARI_ZONE
warp MAP_SAFARI_ZONE_SOUTH, 255, 32, 33
waitstate
end
Route121_SafariZoneEntrance_EventScript_CheckHasRoomForPokemon::
getpartysize
compare VAR_RESULT, PARTY_SIZE
goto_if_ne Route121_SafariZoneEntrance_EventScript_HasRoomForPokemon
specialvar VAR_RESULT, ScriptCheckFreePokemonStorageSpace
compare VAR_RESULT, 1
goto_if_eq Route121_SafariZoneEntrance_EventScript_HasRoomForPokemon
msgbox Route121_SafariZoneEntrance_Text_PCIsFull, MSGBOX_DEFAULT
goto Route121_SafariZoneEntrance_EventScript_MovePlayerBackFromCounter
end
Route121_SafariZoneEntrance_EventScript_HasRoomForPokemon::
return
Route121_SafariZoneEntrance_EventScript_NoPokeblockCase::
msgbox Route121_SafariZoneEntrance_Text_YouNeedPokeblockCase, MSGBOX_DEFAULT
goto Route121_SafariZoneEntrance_EventScript_MovePlayerBackFromCounter
end
Route121_SafariZoneEntrance_EventScript_NotEnoughMoney::
msgbox Route121_SafariZoneEntrance_Text_NotEnoughMoney, MSGBOX_DEFAULT
goto Route121_SafariZoneEntrance_EventScript_MovePlayerBackFromCounter
end
Route121_SafariZoneEntrance_EventScript_MovePlayerBackFromCounter::
closemessage
hidemoneybox
applymovement OBJ_EVENT_ID_PLAYER, Route121_SafariZoneEntrance_Movement_BackAwayFromCounter
waitmovement 0
releaseall
end
Route121_SafariZoneEntrance_Movement_BackAwayFromCounter:
walk_right
step_end
Route121_SafariZoneEntrance_Movement_EnterSafariZone:
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_down
delay_16
step_end
Route121_SafariZoneEntrance_EventScript_TrainerTipSign::
msgbox Route121_SafariZoneEntrance_Text_TrainerTip, MSGBOX_SIGN
end