pokeemerald/data/maps/OldaleTown/scripts.inc

402 lines
9.5 KiB
PHP
Raw Normal View History

.set LOCALID_MART_EMPLOYEE, 2
.set LOCALID_FOOTPRINTS_MAN, 3
.set LOCALID_RIVAL, 4
2021-07-20 21:18:31 +02:00
OldaleTown_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, OldaleTown_OnTransition
2017-11-10 02:21:31 +01:00
.byte 0
2021-07-20 21:18:31 +02:00
OldaleTown_OnTransition:
call Common_EventScript_SetupRivalGfxId
2017-11-10 02:21:31 +01:00
setflag FLAG_VISITED_OLDALE_TOWN
2019-10-21 01:30:25 +02:00
call_if_unset FLAG_ADVENTURE_STARTED, OldaleTown_EventScript_BlockWestEntrance
call_if_unset FLAG_RECEIVED_POTION_OLDALE, OldaleTown_EventScript_MoveMartEmployee
call_if_set FLAG_ADVENTURE_STARTED, OldaleTown_EventScript_SetOldaleState
2017-11-10 02:21:31 +01:00
end
2019-10-21 01:30:25 +02:00
@ This script seems pointless because nothing uses VAR_OLDALE_TOWN_STATE
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_SetOldaleState::
2019-08-05 17:23:45 +02:00
setvar VAR_OLDALE_TOWN_STATE, 1
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_BlockWestEntrance::
setobjectxyperm LOCALID_FOOTPRINTS_MAN, 1, 11
setobjectmovementtype LOCALID_FOOTPRINTS_MAN, MOVEMENT_TYPE_FACE_LEFT
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_MoveMartEmployee::
setobjectxyperm LOCALID_MART_EMPLOYEE, 13, 14
setobjectmovementtype LOCALID_MART_EMPLOYEE, MOVEMENT_TYPE_FACE_DOWN
2017-11-10 02:21:31 +01:00
return
2022-08-26 04:00:24 +02:00
OldaleTown_EventScript_TownSign::
msgbox OldaleTown_Text_TownSign, MSGBOX_SIGN
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_Girl::
2019-10-21 01:30:25 +02:00
msgbox OldaleTown_Text_SavingMyProgress, MSGBOX_NPC
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_MartEmployee::
2017-11-10 02:21:31 +01:00
lock
faceplayer
2019-10-21 01:30:25 +02:00
goto_if_set FLAG_RECEIVED_POTION_OLDALE, OldaleTown_EventScript_ExplainPotion
goto_if_set FLAG_TEMP_1, OldaleTown_EventScript_ExplainPotion
2018-10-17 18:25:12 +02:00
setflag FLAG_TEMP_1
2021-05-21 22:08:00 +02:00
playbgm MUS_FOLLOW_ME, FALSE
2019-10-21 01:30:25 +02:00
msgbox OldaleTown_Text_IWorkAtPokemonMart, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
closemessage
switch VAR_FACING
2019-10-21 01:30:25 +02:00
case DIR_SOUTH, OldaleTown_EventScript_GoToMartSouth
case DIR_NORTH, OldaleTown_EventScript_GoToMartNorth
case DIR_EAST, OldaleTown_EventScript_GoToMartEast
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_GoToMartSouth::
applymovement LOCALID_MART_EMPLOYEE, OldaleTown_Movement_EmployeeSouth
applymovement OBJ_EVENT_ID_PLAYER, OldaleTown_Movement_PlayerSouth
2017-11-10 02:21:31 +01:00
waitmovement 0
2019-10-21 01:30:25 +02:00
goto OldaleTown_EventScript_ExplainPokemonMart
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_GoToMartNorth::
applymovement LOCALID_MART_EMPLOYEE, OldaleTown_Movement_EmployeeNorth
applymovement OBJ_EVENT_ID_PLAYER, OldaleTown_Movement_PlayerNorth
2017-11-10 02:21:31 +01:00
waitmovement 0
2019-10-21 01:30:25 +02:00
goto OldaleTown_EventScript_ExplainPokemonMart
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_GoToMartEast::
applymovement OBJ_EVENT_ID_PLAYER, OldaleTown_Movement_PlayerEast
applymovement LOCALID_MART_EMPLOYEE, OldaleTown_Movement_EmployeeEast
2017-11-10 02:21:31 +01:00
waitmovement 0
2019-10-21 01:30:25 +02:00
goto OldaleTown_EventScript_ExplainPokemonMart
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_ExplainPokemonMart::
2019-10-21 01:30:25 +02:00
msgbox OldaleTown_Text_ThisIsAPokemonMart, MSGBOX_DEFAULT
giveitem ITEM_POTION
goto_if_eq VAR_RESULT, FALSE, OldaleTown_EventScript_BagIsFull
2019-10-21 01:30:25 +02:00
msgbox OldaleTown_Text_PotionExplanation, MSGBOX_DEFAULT
2019-01-02 22:12:43 +01:00
setflag FLAG_RECEIVED_POTION_OLDALE
2017-11-10 02:21:31 +01:00
fadedefaultbgm
release
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_ExplainPotion::
2019-10-21 01:30:25 +02:00
msgbox OldaleTown_Text_PotionExplanation, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_BagIsFull::
msgbox gText_TooBadBagIsFull, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
fadedefaultbgm
release
end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_EmployeeEast:
walk_up
walk_up
walk_up
walk_up
walk_up
walk_up
walk_up
walk_in_place_faster_down
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_EmployeeSouth:
walk_left
walk_up
walk_up
walk_right
walk_up
walk_up
walk_up
walk_up
walk_up
walk_in_place_faster_down
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_EmployeeNorth:
walk_up
walk_up
walk_up
walk_up
walk_up
walk_up
walk_up
walk_in_place_faster_down
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_Unknown1:
walk_up
walk_up
walk_right
walk_right
walk_right
walk_right
walk_up
walk_up
walk_up
walk_up
walk_up
delay_8
walk_in_place_faster_down
step_end
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_PlayerEast:
walk_right
walk_up
walk_up
walk_up
walk_up
walk_up
walk_up
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_PlayerSouth:
delay_16
delay_16
delay_16
delay_16
walk_up
walk_up
walk_up
walk_up
walk_up
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_PlayerNorth:
walk_up
walk_up
walk_up
walk_up
walk_up
walk_up
walk_up
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_Unknown2:
walk_left
walk_up
walk_up
walk_right
walk_right
walk_right
walk_right
walk_up
walk_up
walk_up
walk_up
step_end
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_FootprintsMan::
2017-11-10 02:21:31 +01:00
lock
faceplayer
2019-10-21 01:30:25 +02:00
goto_if_set FLAG_ADVENTURE_STARTED, OldaleTown_EventScript_NotBlockingPath
msgbox OldaleTown_Text_DiscoveredFootprints, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
closemessage
applymovement LOCALID_FOOTPRINTS_MAN, Common_Movement_FaceOriginalDirection
2017-11-10 02:21:31 +01:00
waitmovement 0
release
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_BlockedPath::
2017-11-10 02:21:31 +01:00
lockall
applymovement OBJ_EVENT_ID_PLAYER, OldaleTown_Movement_PlayerStepBack
applymovement LOCALID_FOOTPRINTS_MAN, OldaleTown_Movement_BackUp
2017-11-10 02:21:31 +01:00
waitmovement 0
2019-10-21 01:30:25 +02:00
msgbox OldaleTown_Text_WaitDontComeInHere, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
closemessage
applymovement LOCALID_FOOTPRINTS_MAN, OldaleTown_Movement_ReturnToOriginalPosition
2017-11-10 02:21:31 +01:00
waitmovement 0
releaseall
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_NotBlockingPath::
2019-10-21 01:30:25 +02:00
msgbox OldaleTown_Text_FinishedSketchingFootprints, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_Rival::
2017-11-10 02:21:31 +01:00
lockall
applymovement LOCALID_RIVAL, Common_Movement_FacePlayer
2017-11-10 02:21:31 +01:00
waitmovement 0
setvar VAR_0x8009, 0
2019-10-21 01:30:25 +02:00
goto OldaleTown_EventScript_ShowRivalMessage
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_RivalTrigger1::
2017-11-10 02:21:31 +01:00
lockall
applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalApproachPlayer1
2017-11-10 02:21:31 +01:00
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterRight
2017-11-10 02:21:31 +01:00
waitmovement 0
setvar VAR_0x8009, 1
2019-10-21 01:30:25 +02:00
goto OldaleTown_EventScript_ShowRivalMessage
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_RivalTrigger2::
2017-11-10 02:21:31 +01:00
lockall
applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalApproachPlayer2
2017-11-10 02:21:31 +01:00
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterRight
2017-11-10 02:21:31 +01:00
waitmovement 0
setvar VAR_0x8009, 1
2019-10-21 01:30:25 +02:00
goto OldaleTown_EventScript_ShowRivalMessage
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_RivalTrigger3::
2017-11-10 02:21:31 +01:00
lockall
applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalApproachPlayer3
2017-11-10 02:21:31 +01:00
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterRight
2017-11-10 02:21:31 +01:00
waitmovement 0
setvar VAR_0x8009, 1
2019-10-21 01:30:25 +02:00
goto OldaleTown_EventScript_ShowRivalMessage
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_ShowRivalMessage::
2017-11-10 02:21:31 +01:00
checkplayergender
goto_if_eq VAR_RESULT, MALE, OldaleTown_EventScript_ShowMayMessage
goto_if_eq VAR_RESULT, FEMALE, OldaleTown_EventScript_ShowBrendanMessage
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_ShowMayMessage::
2019-10-21 01:30:25 +02:00
msgbox OldaleTown_Text_MayLetsGoBack, MSGBOX_DEFAULT
goto OldaleTown_EventScript_RivalFinish
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_ShowBrendanMessage::
2019-10-21 01:30:25 +02:00
msgbox OldaleTown_Text_BrendanLetsGoBack, MSGBOX_DEFAULT
goto OldaleTown_EventScript_RivalFinish
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_RivalFinish::
2017-11-10 02:21:31 +01:00
closemessage
call_if_eq VAR_0x8009, 0, OldaleTown_EventScript_DoExitMovement1
call_if_eq VAR_0x8009, 1, OldaleTown_EventScript_DoExitMovement2
applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalExit
2017-11-10 02:21:31 +01:00
waitmovement 0
removeobject LOCALID_RIVAL
2019-08-05 17:23:45 +02:00
setvar VAR_OLDALE_RIVAL_STATE, 2
2018-10-18 21:28:59 +02:00
setflag FLAG_HIDE_OLDALE_TOWN_RIVAL
2017-11-10 02:21:31 +01:00
releaseall
end
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_DoExitMovement1::
goto_if_ne VAR_FACING, DIR_SOUTH, OldaleTown_EventScript_DoExitMovement2
applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalExit
2017-11-10 02:21:31 +01:00
waitmovement 0
return
2021-07-20 21:18:31 +02:00
OldaleTown_EventScript_DoExitMovement2::
applymovement OBJ_EVENT_ID_PLAYER, OldaleTown_Movement_WatchRivalExit
applymovement LOCALID_RIVAL, OldaleTown_Movement_RivalExit
2017-11-10 02:21:31 +01:00
waitmovement 0
return
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_RivalApproachPlayer1:
walk_left
walk_left
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_RivalApproachPlayer2:
walk_left
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_RivalApproachPlayer3:
face_left
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_RivalExit:
walk_down
walk_down
walk_down
walk_down
walk_down
walk_down
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_WatchRivalExit:
delay_8
delay_4
walk_in_place_faster_down
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_PlayerStepBack:
delay_8
walk_right
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_BackUp:
walk_fast_up
walk_in_place_faster_left
lock_facing_direction
walk_right
unlock_facing_direction
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Movement_ReturnToOriginalPosition:
walk_down
walk_left
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
OldaleTown_Text_SavingMyProgress:
2018-12-07 16:41:08 +01:00
.string "I want to take a rest, so I'm saving my\n"
2017-11-10 02:21:31 +01:00
.string "progress.$"
2021-07-20 21:18:31 +02:00
OldaleTown_Text_IWorkAtPokemonMart:
2017-11-10 02:21:31 +01:00
.string "Hi!\n"
.string "I work at a POKéMON MART.\p"
.string "Can I get you to come with me?$"
2021-07-20 21:18:31 +02:00
OldaleTown_Text_ThisIsAPokemonMart:
2017-11-10 02:21:31 +01:00
.string "This is a POKéMON MART.\n"
.string "Just look for our blue roof.\p"
.string "We sell a variety of goods including\n"
.string "POKé BALLS for catching POKéMON.\p"
2018-12-07 16:41:08 +01:00
.string "Here, I'd like you to have this as\n"
2017-11-10 02:21:31 +01:00
.string "a promotional item.$"
2021-07-20 21:18:31 +02:00
OldaleTown_Text_PotionExplanation:
2018-12-07 16:41:08 +01:00
.string "A POTION can be used anytime, so it's\n"
2017-11-10 02:21:31 +01:00
.string "even more useful than a POKéMON CENTER\l"
.string "in certain situations.$"
2021-07-20 21:18:31 +02:00
OldaleTown_Text_WaitDontComeInHere:
2017-11-10 02:21:31 +01:00
.string "Aaaaah! Wait!\n"
2018-12-07 16:41:08 +01:00
.string "Please don't come in here.\p"
2017-11-10 02:21:31 +01:00
.string "I just discovered the footprints of\n"
.string "a rare POKéMON!\p"
.string "Wait until I finish sketching\n"
.string "them, okay?$"
2021-07-20 21:18:31 +02:00
OldaleTown_Text_DiscoveredFootprints:
2017-11-10 02:21:31 +01:00
.string "I just discovered the footprints of\n"
.string "a rare POKéMON!\p"
.string "Wait until I finish sketching\n"
.string "them, okay?$"
2021-07-20 21:18:31 +02:00
OldaleTown_Text_FinishedSketchingFootprints:
2017-11-10 02:21:31 +01:00
.string "I finished sketching the footprints of\n"
.string "a rare POKéMON.\p"
.string "But it turns out they were only my\n"
.string "own footprints…$"
2021-07-20 21:18:31 +02:00
OldaleTown_Text_MayLetsGoBack:
2017-11-10 02:21:31 +01:00
.string "MAY: {PLAYER}{KUN}!\n"
.string "Over here!\l"
2018-12-07 16:41:08 +01:00
.string "Let's hurry home!$"
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
OldaleTown_Text_BrendanLetsGoBack:
2018-12-07 16:41:08 +01:00
.string "BRENDAN: I'm heading back to my dad's\n"
2017-11-10 02:21:31 +01:00
.string "LAB now.\l"
.string "{PLAYER}, you should hustle back, too.$"
2022-08-26 04:00:24 +02:00
OldaleTown_Text_TownSign:
2017-11-10 02:21:31 +01:00
.string "OLDALE TOWN\n"
.string "“Where things start off scarce.”$"