pokeemerald/data/maps/PetalburgCity/scripts.inc
2021-05-21 15:08:00 -05:00

784 lines
18 KiB
PHP

.set LOCALID_WALLY, 2
.set LOCALID_BOY, 3
.set LOCALID_WALLYS_DAD, 5
.set LOCALID_GYM_BOY, 8
.set LOCALID_SCOTT, 9
PetalburgCity_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, PetalburgCity_OnTransition
map_script MAP_SCRIPT_ON_FRAME_TABLE, PetalburgCity_OnFrame
.byte 0
PetalburgCity_OnTransition: @ 81DC2D7
setflag FLAG_VISITED_PETALBURG_CITY
compare VAR_PETALBURG_CITY_STATE, 0
call_if_eq PetalburgCity_EventScript_MoveGymBoyToWestEntrance
compare VAR_PETALBURG_CITY_STATE, 2
call_if_eq PetalburgCity_EventScript_DisableMapNameAndMusic
compare VAR_PETALBURG_CITY_STATE, 4
call_if_eq PetalburgCity_EventScript_DisableMapNameAndMusic
compare VAR_PETALBURG_GYM_STATE, 8
call_if_eq PetalburgCity_EventScript_SetGymDoorsUnlocked
end
PetalburgCity_EventScript_MoveGymBoyToWestEntrance:: @ 81DC307
setobjectxyperm LOCALID_GYM_BOY, 5, 11
return
PetalburgCity_EventScript_DisableMapNameAndMusic:: @ 81DC30F
setflag FLAG_HIDE_MAP_NAME_POPUP
savebgm MUS_FOLLOW_ME
return
PetalburgCity_EventScript_SetGymDoorsUnlocked:: @ 81DC316
setvar VAR_PETALBURG_GYM_STATE, 7
return
PetalburgCity_OnFrame: @ 81DC31C
map_script_2 VAR_PETALBURG_CITY_STATE, 2, PetalburgCity_EventScript_WallyTutorial
map_script_2 VAR_PETALBURG_CITY_STATE, 4, PetalburgCity_EventScript_WalkToWallyHouse
.2byte 0
PetalburgCity_EventScript_WallyTutorial:: @ 81DC32E
lockall
special SavePlayerParty
special PutZigzagoonInPlayerParty
applymovement LOCALID_WALLY, PetalburgCity_Movement_WallyTutorialWally
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_WallyTutorialPlayer
waitmovement 0
msgbox Route102_Text_WatchMeCatchPokemon, MSGBOX_DEFAULT
special StartWallyTutorialBattle
waitstate
msgbox Route102_Text_WallyIDidIt, MSGBOX_DEFAULT
applymovement LOCALID_WALLY, Common_Movement_WalkInPlaceFastestLeft, MAP_PETALBURG_CITY
waitmovement LOCALID_WALLY, MAP_PETALBURG_CITY
msgbox Route102_Text_LetsGoBack, MSGBOX_DEFAULT
closemessage
clearflag FLAG_HIDE_MAP_NAME_POPUP
setvar VAR_PETALBURG_CITY_STATE, 3
fadedefaultbgm
clearflag FLAG_DONT_TRANSITION_MUSIC
special LoadPlayerParty
setvar VAR_PETALBURG_GYM_STATE, 1
warp MAP_PETALBURG_CITY_GYM, 255, 4, 108
waitstate
releaseall
end
PetalburgCity_EventScript_WalkToWallyHouse:: @ 81DC390
lockall
setflag FLAG_HIDE_MAP_NAME_POPUP
applymovement LOCALID_WALLYS_DAD, PetalburgCity_Movement_WalkToWallyHouseWallysDad
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_WalkToWallyHousePlayer
waitmovement 0
setvar VAR_0x8004, 7
setvar VAR_0x8005, 5
opendoor VAR_0x8004, VAR_0x8005
waitdooranim
applymovement LOCALID_WALLYS_DAD, PetalburgCity_Movement_WalkInsideHouseWallysDad
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_WalkInsideHousePlayer
waitmovement 0
setflag FLAG_HIDE_PETALBURG_CITY_WALLYS_DAD
hideobjectat OBJ_EVENT_ID_PLAYER, MAP_PETALBURG_CITY
closedoor VAR_0x8004, VAR_0x8005
waitdooranim
clearflag FLAG_HIDE_MAP_NAME_POPUP
fadedefaultbgm
clearflag FLAG_DONT_TRANSITION_MUSIC
warp MAP_PETALBURG_CITY_WALLYS_HOUSE, 255, 2, 4
waitstate
releaseall
end
PetalburgCity_EventScript_Boy:: @ 81DC3E6
lock
faceplayer
msgbox PetalburgCity_Text_WaterReflection, MSGBOX_DEFAULT
closemessage
applymovement LOCALID_BOY, Common_Movement_FaceOriginalDirection
waitmovement 0
release
end
PetalburgCity_EventScript_WallysMom:: @ 81DC3FD
msgbox PetalburgCity_Text_WhereIsWally, MSGBOX_NPC
end
PetalburgCity_Movement_WalkToWallyHousePlayer: @ 81DC406
delay_8
walk_down
walk_down
walk_down
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_up
walk_up
walk_up
walk_up
walk_up
step_end
PetalburgCity_Movement_WalkInsideHousePlayer: @ 81DC418
walk_up
walk_up
step_end
PetalburgCity_Movement_WalkToWallyHouseWallysDad: @ 81DC41B
delay_8
walk_down
walk_down
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_up
walk_up
walk_up
walk_up
walk_up
walk_up
step_end
PetalburgCity_Movement_WalkInsideHouseWallysDad: @ 81DC42D
walk_up
set_invisible
step_end
PetalburgCity_Movement_WallyTutorialPlayer: @ 81DC430
delay_8
walk_down
walk_down
walk_down
walk_down
walk_down
walk_down
walk_down
walk_down
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_up
walk_up
walk_in_place_fastest_right
step_end
PetalburgCity_Movement_WallyTutorialWally: @ 81DC451
delay_8
walk_down
walk_down
walk_down
walk_down
walk_down
walk_down
walk_down
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_up
walk_up
walk_right
delay_16
walk_in_place_fastest_up
delay_16
delay_16
walk_in_place_fastest_right
step_end
PetalburgCity_EventScript_GymSign:: @ 81DC476
msgbox PetalburgCity_Text_GymSign, MSGBOX_SIGN
end
PetalburgCity_EventScript_CitySign:: @ 81DC47F
msgbox PetalburgCity_Text_CitySign, MSGBOX_SIGN
end
PetalburgCity_EventScript_Gentleman:: @ 81DC488
msgbox PetalburgCity_Text_FullPartyExplanation, MSGBOX_NPC
end
PetalburgCity_EventScript_WallyHouseSign:: @ 81DC491
msgbox PetalburgCity_Text_WallyHouseSign, MSGBOX_SIGN
end
PetalburgCity_EventScript_ShowGymToPlayer0:: @ 81DC49A
lockall
setvar VAR_0x8008, 0
goto PetalburgCity_EventScript_ShowGymToPlayer
end
PetalburgCity_EventScript_ShowGymToPlayer1:: @ 81DC4A6
lockall
setvar VAR_0x8008, 1
goto PetalburgCity_EventScript_ShowGymToPlayer
end
PetalburgCity_EventScript_ShowGymToPlayer2:: @ 81DC4B2
lockall
setvar VAR_0x8008, 2
goto PetalburgCity_EventScript_ShowGymToPlayer
end
PetalburgCity_EventScript_ShowGymToPlayer3:: @ 81DC4BE
lockall
setvar VAR_0x8008, 3
goto PetalburgCity_EventScript_ShowGymToPlayer
end
PetalburgCity_EventScript_ShowGymToPlayer:: @ 81DC4CA
applymovement LOCALID_GYM_BOY, Common_Movement_FacePlayer
waitmovement 0
playbgm MUS_FOLLOW_ME, FALSE
playse SE_PIN
applymovement LOCALID_GYM_BOY, Common_Movement_ExclamationMark
waitmovement 0
applymovement LOCALID_GYM_BOY, Common_Movement_Delay48
waitmovement 0
compare VAR_0x8008, 0
call_if_eq PetalburgCity_EventScript_BoyApproachPlayer0
compare VAR_0x8008, 1
call_if_eq PetalburgCity_EventScript_BoyApproachPlayer1
compare VAR_0x8008, 2
call_if_eq PetalburgCity_EventScript_BoyApproachPlayer2
compare VAR_0x8008, 3
call_if_eq PetalburgCity_EventScript_BoyApproachPlayer3
msgbox PetalburgCity_Text_AreYouRookieTrainer, MSGBOX_DEFAULT
closemessage
compare VAR_0x8008, 0
call_if_eq PetalburgCity_EventScript_LeadPlayerToGym0
compare VAR_0x8008, 1
call_if_eq PetalburgCity_EventScript_LeadPlayerToGym1
compare VAR_0x8008, 2
call_if_eq PetalburgCity_EventScript_LeadPlayerToGym2
compare VAR_0x8008, 3
call_if_eq PetalburgCity_EventScript_LeadPlayerToGym3
msgbox PetalburgCity_Text_ThisIsPetalburgGym, MSGBOX_DEFAULT
applymovement LOCALID_GYM_BOY, Common_Movement_WalkInPlaceFastestRight
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight
waitmovement 0
msgbox PetalburgCity_Text_ThisIsGymSign, MSGBOX_DEFAULT
closemessage
applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyWalkAway
waitmovement 0
fadedefaultbgm
releaseall
end
PetalburgCity_EventScript_BoyApproachPlayer0:: @ 81DC57F
applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyApproachPlayer0
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestDown
waitmovement 0
return
PetalburgCity_EventScript_BoyApproachPlayer1:: @ 81DC594
applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyApproachPlayer1
waitmovement 0
return
PetalburgCity_EventScript_BoyApproachPlayer2:: @ 81DC59F
applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyApproachPlayer2
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp
waitmovement 0
return
PetalburgCity_EventScript_BoyApproachPlayer3:: @ 81DC5B4
applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyApproachPlayer3
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestUp
waitmovement 0
return
PetalburgCity_EventScript_LeadPlayerToGym0:: @ 81DC5C9
applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyWalkToGym0
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWalkToGym0
waitmovement 0
return
PetalburgCity_EventScript_LeadPlayerToGym1:: @ 81DC5DB
applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyWalkToGym1
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWalkToGym1
waitmovement 0
return
PetalburgCity_EventScript_LeadPlayerToGym2:: @ 81DC5ED
applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyWalkToGym2
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWalkToGym2
waitmovement 0
return
PetalburgCity_EventScript_LeadPlayerToGym3:: @ 81DC5FF
applymovement LOCALID_GYM_BOY, PetalburgCity_Movement_BoyWalkToGym3
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWalkToGym3
waitmovement 0
return
@ Unused
PetalburgCity_Movement_Delay48:: @ 81DC611
delay_16
delay_16
delay_16
step_end
PetalburgCity_Movement_BoyApproachPlayer0: @ 81DC615
walk_right
walk_right
walk_right
walk_in_place_fastest_up
step_end
PetalburgCity_Movement_BoyApproachPlayer1: @ 81DC61A
walk_right
walk_right
step_end
PetalburgCity_Movement_BoyApproachPlayer2: @ 81DC61D
walk_right
walk_right
walk_right
walk_in_place_fastest_down
step_end
PetalburgCity_Movement_BoyApproachPlayer3: @ 81DC622
walk_down
walk_right
walk_right
walk_right
walk_in_place_fastest_down
step_end
PetalburgCity_Movement_BoyWalkToGym0: @ 81DC628
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_up
walk_right
walk_in_place_fastest_up
step_end
PetalburgCity_Movement_BoyWalkToGym1: @ 81DC633
walk_down
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_up
walk_up
walk_right
walk_in_place_fastest_up
step_end
PetalburgCity_Movement_BoyWalkToGym2: @ 81DC641
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_up
walk_right
walk_in_place_fastest_up
step_end
PetalburgCity_Movement_BoyWalkToGym3: @ 81DC64C
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_up
walk_up
walk_right
walk_in_place_fastest_up
step_end
PetalburgCity_Movement_BoyWalkAway: @ 81DC658
walk_down
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
step_end
PetalburgCity_Movement_PlayerWalkToGym0: @ 81DC665
walk_down
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_up
step_end
PetalburgCity_Movement_PlayerWalkToGym1: @ 81DC66F
delay_16
delay_16
walk_down
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_up
walk_up
step_end
PetalburgCity_Movement_PlayerWalkToGym2: @ 81DC67C
walk_up
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_up
step_end
PetalburgCity_Movement_PlayerWalkToGym3: @ 81DC686
walk_up
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_right
walk_up
walk_up
step_end
PetalburgCity_EventScript_Scott0:: @ 81DC691
lockall
addobject LOCALID_SCOTT
setvar VAR_0x8008, 0
setobjectxy LOCALID_SCOTT, 13, 10
goto PetalburgCity_EventScript_Scott
end
PetalburgCity_EventScript_Scott1:: @ 81DC6A7
lockall
addobject LOCALID_SCOTT
setvar VAR_0x8008, 1
setobjectxy LOCALID_SCOTT, 13, 11
goto PetalburgCity_EventScript_Scott
end
PetalburgCity_EventScript_Scott2:: @ 81DC6BD
lockall
addobject LOCALID_SCOTT
setvar VAR_0x8008, 2
setobjectxy LOCALID_SCOTT, 13, 12
goto PetalburgCity_EventScript_Scott
end
PetalburgCity_EventScript_Scott3:: @ 81DC6D3
lockall
addobject LOCALID_SCOTT
setvar VAR_0x8008, 3
setobjectxy LOCALID_SCOTT, 13, 13
goto PetalburgCity_EventScript_Scott
end
PetalburgCity_EventScript_Scott:: @ 81DC6E9
applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottStartWalkLeft
waitmovement 0
playse SE_PIN
applymovement LOCALID_SCOTT, Common_Movement_ExclamationMark
waitmovement 0
applymovement LOCALID_SCOTT, Common_Movement_Delay48
waitmovement 0
applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottApproachPlayer
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFastestRight
waitmovement 0
setvar VAR_SCOTT_STATE, 1
msgbox PetalburgCity_Text_AreYouATrainer, MSGBOX_DEFAULT
closemessage
applymovement LOCALID_SCOTT, Common_Movement_WalkInPlaceFastestRight
waitmovement 0
delay 30
msgbox PetalburgCity_Text_WellMaybeNot, MSGBOX_DEFAULT
closemessage
applymovement LOCALID_SCOTT, Common_Movement_WalkInPlaceFastestLeft
waitmovement 0
delay 30
msgbox PetalburgCity_Text_ImLookingForTalentedTrainers, MSGBOX_DEFAULT
closemessage
compare VAR_0x8008, 0
call_if_eq PetalburgCity_EventScript_ScottExit0
compare VAR_0x8008, 1
call_if_eq PetalburgCity_EventScript_ScottExit1
compare VAR_0x8008, 2
call_if_eq PetalburgCity_EventScript_ScottExit2
compare VAR_0x8008, 3
call_if_eq PetalburgCity_EventScript_ScottExit3
setvar VAR_SCOTT_PETALBURG_ENCOUNTER, 1
removeobject LOCALID_SCOTT
releaseall
end
PetalburgCity_EventScript_ScottExit0:: @ 81DC78E
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWatchScottExit0
applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottExit0
waitmovement 0
return
PetalburgCity_EventScript_ScottExit1:: @ 81DC7A0
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWatchScottExit1
applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottExit1
waitmovement 0
return
PetalburgCity_EventScript_ScottExit2:: @ 81DC7B2
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWatchScottExit2
applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottExit2
waitmovement 0
return
PetalburgCity_EventScript_ScottExit3:: @ 81DC7C4
applymovement OBJ_EVENT_ID_PLAYER, PetalburgCity_Movement_PlayerWatchScottExit3
applymovement LOCALID_SCOTT, PetalburgCity_Movement_ScottExit3
waitmovement 0
return
PetalburgCity_Movement_ScottStartWalkLeft: @ 81DC7D6
walk_left
walk_left
walk_left
walk_left
step_end
PetalburgCity_Movement_ScottApproachPlayer: @ 81DC7DB
walk_left
walk_left
walk_left
walk_left
step_end
PetalburgCity_Movement_ScottExit0: @ 81DC7E0
walk_down
walk_down
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
step_end
PetalburgCity_Movement_PlayerWatchScottExit0: @ 81DC7EE
delay_16
walk_in_place_fastest_down
delay_16
delay_16
delay_8
walk_in_place_fastest_left
step_end
PetalburgCity_Movement_ScottExit1: @ 81DC7F5
walk_down
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
step_end
PetalburgCity_Movement_PlayerWatchScottExit1: @ 81DC802
delay_16
walk_in_place_fastest_down
delay_16
delay_8
walk_in_place_fastest_left
step_end
PetalburgCity_Movement_ScottExit2: @ 81DC808
walk_down
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
step_end
PetalburgCity_Movement_PlayerWatchScottExit2: @ 81DC815
delay_16
walk_in_place_fastest_down
delay_16
delay_8
walk_in_place_fastest_left
step_end
PetalburgCity_Movement_ScottExit3: @ 81DC81B
walk_up
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
walk_left
step_end
PetalburgCity_Movement_PlayerWatchScottExit3: @ 81DC828
delay_16
walk_in_place_fastest_up
delay_16
delay_8
walk_in_place_fastest_left
step_end
PetalburgCity_EventScript_GymBoy:: @ 81DC82E
msgbox PetalburgCity_Text_AreYouRookieTrainer, MSGBOX_NPC
end
PetalburgCity_Text_WhereIsWally: @ 81DC837
.string "Where has our WALLY gone?\p"
.string "We have to leave for VERDANTURF TOWN\n"
.string "very soon…$"
PetalburgCity_Text_AreYouRookieTrainer: @ 81DC881
.string "Hiya! Are you maybe…\n"
.string "A rookie TRAINER?\p"
.string "Do you know what POKéMON TRAINERS\n"
.string "do when they reach a new town?\p"
.string "They first check what kind of GYM\n"
.string "is in the town.$"
PetalburgCity_Text_ThisIsPetalburgGym: @ 81DC91B
.string "See? This is PETALBURG CITY's GYM.$"
PetalburgCity_Text_ThisIsGymSign: @ 81DC93E
.string "This is the GYM's sign. Look for it\n"
.string "whenever you're looking for a GYM.$"
PetalburgCity_Text_WaterReflection: @ 81DC985
.string "My face is reflected in the water.\p"
.string "It's a shining grin full of hope…\p"
.string "Or it could be a look of somber silence\n"
.string "struggling with fear…\p"
.string "What do you see reflected in your face?$"
PetalburgCity_Text_FullPartyExplanation: @ 81DCA30
.string "Let's say you have six POKéMON.\n"
.string "If you catch another one…\p"
.string "It is automatically sent to a STORAGE\n"
.string "BOX over a PC connection.$"
PetalburgCity_Text_GymSign: @ 81DCAAA
.string "PETALBURG CITY POKéMON GYM\n"
.string "LEADER: NORMAN\l"
.string "“A man in pursuit of power!”$"
PetalburgCity_Text_CitySign: @ 81DCAF1
.string "PETALBURG CITY\n"
.string "“Where people mingle with nature.”$"
PetalburgCity_Text_WallyHouseSign: @ 81DCB23
.string "WALLY'S HOUSE$"
PetalburgCity_Text_AreYouATrainer: @ 81DCB31
.string "Excuse me!\p"
.string "Let me guess, from the way you're\n"
.string "dressed, are you a POKéMON TRAINER?$"
PetalburgCity_Text_WellMaybeNot: @ 81DCB82
.string "… … … … … …\p"
.string "Well, maybe not.\n"
.string "Your clothes aren't all that dirty.\p"
.string "You're either a rookie TRAINER,\n"
.string "or maybe you're just an ordinary kid.$"
PetalburgCity_Text_ImLookingForTalentedTrainers: @ 81DCC09
.string "I'm roaming the land in search of\n"
.string "talented TRAINERS.\p"
.string "I'm sorry to have taken your time.$"