summaryrefslogtreecommitdiff
path: root/data/maps/SevenIsland_TrainerTower_Lobby/scripts.inc
blob: 0558b5a8b1918f5d90583774ac3b5e0dc778104b (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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
SevenIsland_TrainerTower_Lobby_MapScripts:: @ 8164839
	map_script MAP_SCRIPT_ON_RESUME, SevenIsland_TrainerTower_Lobby_OnResume
	map_script MAP_SCRIPT_ON_RETURN_TO_FIELD, SevenIsland_TrainerTower_Lobby_OnReturnToField
	map_script MAP_SCRIPT_ON_TRANSITION, SevenIsland_TrainerTower_Lobby_OnTransition
	map_script MAP_SCRIPT_ON_LOAD, SevenIsland_TrainerTower_Lobby_OnLoad
	map_script MAP_SCRIPT_ON_FRAME_TABLE, SevenIsland_TrainerTower_Lobby_OnFrame
	.byte 0

SevenIsland_TrainerTower_Lobby_OnResume:: @ 8164853
	setvar VAR_TEMP_2, 0
	setvar VAR_0x8004, 10
	special sub_815D9E8
	setvar VAR_0x8004, 18
	special sub_815D9E8
	compare VAR_RESULT, 0
	goto_if_eq EventScript_164886
	setvar VAR_TEMP_0, 0
	setobjectxy OBJ_EVENT_ID_PLAYER, 9, 7
	applymovement OBJ_EVENT_ID_PLAYER, Movement_164AD4

EventScript_164886:: @ 8164886
	end

SevenIsland_TrainerTower_Lobby_OnReturnToField:: @ 8164887
	addobject 1
	addobject 2
	addobject 3
	addobject 4
	addobject 5
	end

SevenIsland_TrainerTower_Lobby_OnLoad:: @ 8164897
	compare VAR_TEMP_D, 17
	call_if_eq EventScript_1648A3
	end

EventScript_1648A3:: @ 81648A3
	setmetatile 17, 10, 647, 0
	return

SevenIsland_TrainerTower_Lobby_OnTransition:: @ 81648AD
	setworldmapflag FLAG_WORLD_MAP_SEVEN_ISLAND_TRAINER_TOWER_LOBBY
	getplayerxy VAR_TEMP_D, VAR_RESULT
	end

SevenIsland_TrainerTower_Lobby_OnFrame:: @ 81648B6
	map_script_2 VAR_TEMP_0, 0, EventScript_1648ED
	map_script_2 VAR_TEMP_D, 0x11, EventScript_1648C8
	.2byte 0

EventScript_1648C8:: @ 81648C8
	lockall
	applymovement OBJ_EVENT_ID_PLAYER, Movement_1648EA
	waitmovement 0
	setmetatile 17, 10, 692, 1
	special DrawWholeMapView
	playse SE_TK_KASYA
	waitse
	setvar VAR_TEMP_D, 0
	releaseall
	end

Movement_1648EA:: @ 81648EA
	walk_down
	walk_down
	step_end

EventScript_1648ED:: @ 81648ED
	setvar VAR_TEMP_0, 1
	setvar VAR_0x8004, 12
	special sub_815D9E8
	switch VAR_RESULT
	case 0, EventScript_164920
	case 1, EventScript_164938
	case 2, EventScript_16495C

EventScript_164920:: @ 8164920
	lock
	faceplayer
	applymovement OBJ_EVENT_ID_PLAYER, Movement_164AD4
	textcolor 1
	msgbox gUnknown_817C937
	goto EventScript_16494B

EventScript_164938:: @ 8164938
	lock
	faceplayer
	applymovement OBJ_EVENT_ID_PLAYER, Movement_164AD4
	textcolor 1
	msgbox gUnknown_817C9C0

EventScript_16494B:: @ 816494B
	closemessage
	applymovement OBJ_EVENT_ID_PLAYER, Movement_164AD6
	waitmovement 0
	setvar VAR_MAP_SCENE_TRAINER_TOWER, 0
	release

EventScript_16495C:: @ 816495C
	end

SevenIsland_TrainerTower_Lobby_EventScript_16495D:: @ 816495D
	lock
	faceplayer
	call EventScript_PkmnCenterNurse
	release
	end

SevenIsland_TrainerTower_Lobby_EventScript_164966:: @ 8164966
	lock
	faceplayer
	setvar VAR_0x8004, 20
	special sub_815D9E8
	compare VAR_RESULT, 1
	goto_if_eq EventScript_164988
	msgbox gUnknown_817C9A2
	goto EventScript_164990

EventScript_164988:: @ 8164988
	msgbox gUnknown_817CE1F

EventScript_164990:: @ 8164990
	release
	end

SevenIsland_TrainerTower_Lobby_EventScript_164992:: @ 8164992
	goto_if_questlog EventScript_ReleaseEnd
	lock
	faceplayer
	message Text_MayIHelpYou
	waitmessage
	pokemart Items_1649B8
	msgbox Text_PleaseComeAgain
	release
	end

	.align 2
Items_1649B8:: @ 81649B8
	.2byte ITEM_ULTRA_BALL
	.2byte ITEM_GREAT_BALL
	.2byte ITEM_FULL_RESTORE
	.2byte ITEM_MAX_POTION
	.2byte ITEM_HYPER_POTION
	.2byte ITEM_REVIVE
	.2byte ITEM_FULL_HEAL
	.2byte ITEM_ESCAPE_ROPE
	.2byte ITEM_MAX_REPEL
	.2byte ITEM_NONE
	release
	end

SevenIsland_TrainerTower_Lobby_EventScript_1649CE:: @ 81649CE
	lockall
	applymovement OBJ_EVENT_ID_PLAYER, Movement_164AD4
	textcolor 1
	msgbox gUnknown_817C794
	setvar VAR_0x8004, 17
	special sub_815D9E8
	compare VAR_RESULT, 0
	goto_if_eq EventScript_164A00
	msgbox gUnknown_817C7D9
	goto EventScript_164A08

EventScript_164A00:: @ 8164A00
	msgbox gUnknown_817C850

EventScript_164A08:: @ 8164A08
	message Text_17C88D
	waitmessage
	multichoice 18, 6, MULTICHOICE_YES_NO_INFO, FALSE
	switch VAR_RESULT
	case 0, EventScript_164A53
	case 1, EventScript_164ABF
	case 2, EventScript_164A45
	case 127, EventScript_164ABF
	end

EventScript_164A45:: @ 8164A45
	msgbox gUnknown_817CCC9
	goto EventScript_164A08
	end

EventScript_164A53:: @ 8164A53
	multichoice 13, 3, MULTICHOICE_TRAINER_TOWER_MODE, FALSE
	switch VAR_RESULT
	case 0, EventScript_164AA0
	case 1, EventScript_164AA0
	case 2, EventScript_164AA0
	case 3, EventScript_164AA0
	case 4, EventScript_164ABF
	case 127, EventScript_164ABF
	end

EventScript_164AA0:: @ 8164AA0
	copyvar VAR_0x8005, VAR_RESULT
	setvar VAR_MAP_SCENE_TRAINER_TOWER, 1
	special HealPlayerParty
	msgbox gUnknown_817C8BF
	setvar VAR_0x8004, 6
	special sub_815D9E8
	releaseall
	end

EventScript_164ABF:: @ 8164ABF
	msgbox gUnknown_817C91D
	closemessage
	applymovement OBJ_EVENT_ID_PLAYER, Movement_164AD6
	waitmovement 0
	releaseall
	end

Movement_164AD4:: @ 8164AD4
	face_right
	step_end

Movement_164AD6:: @ 8164AD6
	walk_down
	step_end

SevenIsland_TrainerTower_Lobby_EventScript_164AD8:: @ 8164AD8
	lockall
	fadescreen FADE_TO_BLACK
	setvar VAR_0x8004, 1
	special Special_BattleRecords
	waitstate
	releaseall
	end

SevenIsland_TrainerTower_Lobby_EventScript_164AE6:: @ 8164AE6
	msgbox gUnknown_817CE38, MSGBOX_NPC
	end

SevenIsland_TrainerTower_Lobby_EventScript_164AEF:: @ 8164AEF
	msgbox gUnknown_817CE9F, MSGBOX_NPC
	end