summaryrefslogtreecommitdiff
path: root/data/maps/SouthernIsland_Interior/scripts.inc
blob: 958c5f5463170414bc288ff99e7df7795ba266b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
SouthernIsland_Interior_MapScripts:: @ 8242A45
	map_script MAP_SCRIPT_ON_RESUME, SouthernIsland_Interior_MapScript1_242A50
	map_script MAP_SCRIPT_ON_TRANSITION, SouthernIsland_Interior_MapScript1_242A6E
	.byte 0

SouthernIsland_Interior_MapScript1_242A50: @ 8242A50
	call_if_set FLAG_SYS_CTRL_OBJ_DELETE, SouthernIsland_Interior_EventScript_242A5A
	end

SouthernIsland_Interior_EventScript_242A5A:: @ 8242A5A
	specialvar VAR_RESULT, GetBattleOutcome
	compare VAR_RESULT, 7
	goto_if_ne Common_EventScript_NopReturn
	removeobject 2
	return

SouthernIsland_Interior_MapScript1_242A6E: @ 8242A6E
	compare VAR_ROAMER_POKEMON, 0
	call_if_eq SouthernIsland_Interior_EventScript_242A8A
	compare VAR_ROAMER_POKEMON, 0
	call_if_ne SouthernIsland_Interior_EventScript_242A95
	call SouthernIsland_Interior_EventScript_242AA0
	end

SouthernIsland_Interior_EventScript_242A8A:: @ 8242A8A
	setvar VAR_OBJ_GFX_ID_1, EVENT_OBJ_GFX_LATIOS
	setvar VAR_TEMP_4, 408
	return

SouthernIsland_Interior_EventScript_242A95:: @ 8242A95
	setvar VAR_OBJ_GFX_ID_1, EVENT_OBJ_GFX_LATIAS
	setvar VAR_TEMP_4, 407
	return

SouthernIsland_Interior_EventScript_242AA0:: @ 8242AA0
	checkplayergender
	compare VAR_RESULT, MALE
	goto_if_eq SouthernIsland_Interior_EventScript_242AB8
	compare VAR_RESULT, FEMALE
	goto_if_eq SouthernIsland_Interior_EventScript_242ABE
	end

SouthernIsland_Interior_EventScript_242AB8:: @ 8242AB8
	setvar VAR_OBJ_GFX_ID_0, EVENT_OBJ_GFX_RIVAL_BRENDAN_NORMAL
	return

SouthernIsland_Interior_EventScript_242ABE:: @ 8242ABE
	setvar VAR_OBJ_GFX_ID_0, EVENT_OBJ_GFX_RIVAL_MAY_NORMAL
	return

SouthernIsland_Interior_EventScript_242AC4:: @ 8242AC4
	lockall
	setvar VAR_0x8008, 12
	goto SouthernIsland_Interior_EventScript_242AD0
	end

SouthernIsland_Interior_EventScript_242AD0:: @ 8242AD0
	goto_if_set FLAG_TEMP_2, SouthernIsland_Interior_EventScript_242B9A
	goto_if_set FLAG_DEFEATED_LATIAS_OR_LATIOS, SouthernIsland_Interior_EventScript_242B9A
	goto_if_set FLAG_CAUGHT_LATIAS_OR_LATIOS, SouthernIsland_Interior_EventScript_242B9A
	goto_if_unset FLAG_SYS_HAS_EON_TICKET, SouthernIsland_Interior_EventScript_242B9A
	setflag FLAG_ENCOUNTERED_LATIAS_OR_LATIOS
	setflag FLAG_TEMP_2
	special SpawnCameraObject
	applymovement EVENT_OBJ_ID_CAMERA, SouthernIsland_Interior_Movement_242BCA
	waitmovement 0
	delay 50
	waitse
	playmoncry VAR_TEMP_4, 0
	delay 30
	waitmoncry
	addobject 2
	delay 30
	applymovement EVENT_OBJ_ID_CAMERA, SouthernIsland_Interior_Movement_242BCE
	applymovement 2, SouthernIsland_Interior_Movement_242BDA
	waitmovement 0
	delay 50
	special RemoveCameraObject
	setvar VAR_LAST_TALKED, 2
	compare VAR_ROAMER_POKEMON, 0
	call_if_eq SouthernIsland_Interior_EventScript_242BA4
	compare VAR_ROAMER_POKEMON, 0
	call_if_ne SouthernIsland_Interior_EventScript_242BB7
	setflag FLAG_SYS_CTRL_OBJ_DELETE
	special BattleSetup_StartLatiBattle
	waitstate
	clearflag FLAG_SYS_CTRL_OBJ_DELETE
	specialvar VAR_RESULT, GetBattleOutcome
	compare VAR_RESULT, 1
	goto_if_eq SouthernIsland_Interior_EventScript_242B81
	compare VAR_RESULT, 4
	goto_if_eq SouthernIsland_Interior_EventScript_242B8F
	compare VAR_RESULT, 5
	goto_if_eq SouthernIsland_Interior_EventScript_242B8F
	setflag FLAG_CAUGHT_LATIAS_OR_LATIOS
	releaseall
	end

SouthernIsland_Interior_EventScript_242B81:: @ 8242B81
	setflag FLAG_DEFEATED_LATIAS_OR_LATIOS
	copyvar VAR_0x8004, VAR_TEMP_4
	goto SouthernIsland_Interior_EventScript_273776
	end

SouthernIsland_Interior_EventScript_242B8F:: @ 8242B8F
	copyvar VAR_0x8004, VAR_TEMP_4
	goto SouthernIsland_Interior_EventScript_273776
	end

SouthernIsland_Interior_EventScript_242B9A:: @ 8242B9A
	msgbox SouthernIsland_Interior_Text_2A6AA1, MSGBOX_DEFAULT
	releaseall
	end

SouthernIsland_Interior_EventScript_242BA4:: @ 8242BA4
	setvar VAR_0x8004, 408
	setvar VAR_0x8005, 50
	setvar VAR_0x8006, 191
	special CreateObedientEnemyMon
	return

SouthernIsland_Interior_EventScript_242BB7:: @ 8242BB7
	setvar VAR_0x8004, 407
	setvar VAR_0x8005, 50
	setvar VAR_0x8006, 191
	special CreateObedientEnemyMon
	return

SouthernIsland_Interior_Movement_242BCA: @ 8242BCA
	walk_up
	walk_up
	walk_up
	step_end

SouthernIsland_Interior_Movement_242BCE: @ 8242BCE
	delay_16
	delay_16
	delay_16
	delay_16
	delay_16
	delay_16
	delay_16
	walk_down
	walk_down
	walk_down
	walk_in_place_fastest_up
	step_end

SouthernIsland_Interior_Movement_242BDA: @ 8242BDA
	walk_down
	walk_down
	walk_down
	walk_down
	walk_down
	delay_16
	delay_16
	walk_down
	walk_down
	walk_down
	walk_down
	step_end