summaryrefslogtreecommitdiff
path: root/data/maps/BattleTower_Lobby/scripts.inc
blob: a3c2e7974ca3b2672b73a695af77f09b9d16d786 (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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
BattleTower_Lobby_MapScripts:: @ 816027E
	map_script MAP_SCRIPT_ON_RESUME, BattleTower_Lobby_MapScript1_160293
	map_script MAP_SCRIPT_ON_TRANSITION, BattleTower_Lobby_MapScript1_1602E8
	map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleTower_Lobby_MapScript2_160302
	map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, BattleTower_Lobby_MapScript2_1602EE
	.byte 0

BattleTower_Lobby_MapScript1_160293:: @ 8160293
	special TryEnableBravoTrainerBattleTower
	call BattleTower_Lobby_EventScript_16029C
	end

BattleTower_Lobby_EventScript_16029C:: @ 816029C
	setvar VAR_0x8004, 10
	special SetBattleTowerProperty
	goto_if_set FLAG_RECEIVED_GOLD_SHIELD, BattleTower_Lobby_EventScript_1602E4
	goto_if_set FLAG_RECEIVED_SILVER_SHIELD, BattleTower_Lobby_EventScript_1602CD
	specialvar VAR_0x8007, GetBestBattleTowerStreak
	compare VAR_0x8007, 50
	goto_if_lt BattleTower_Lobby_EventScript_1602E4
	clearflag FLAG_HIDE_AWARD_MAN_BATTLE_TOWER
	special TryInitBattleTowerAwardManObjectEvent
	return

BattleTower_Lobby_EventScript_1602CD:: @ 81602CD
	specialvar VAR_0x8007, GetBestBattleTowerStreak
	compare VAR_0x8007, 100
	goto_if_lt BattleTower_Lobby_EventScript_1602E4
	clearflag FLAG_HIDE_AWARD_MAN_BATTLE_TOWER
	special TryInitBattleTowerAwardManObjectEvent
	return

BattleTower_Lobby_EventScript_1602E4:: @ 81602E4
	setflag FLAG_HIDE_AWARD_MAN_BATTLE_TOWER
	return

BattleTower_Lobby_MapScript1_1602E8:: @ 81602E8
	call BattleTower_Lobby_EventScript_1AE2ED
	end

BattleTower_Lobby_MapScript2_1602EE:: @ 81602EE
	map_script_2 VAR_TEMP_1, 0, BattleTower_Lobby_EventScript_1602F8
	.2byte 0

BattleTower_Lobby_EventScript_1602F8:: @ 81602F8
	setvar VAR_TEMP_1, 1
	turnobject OBJ_EVENT_ID_PLAYER, 2
	end

BattleTower_Lobby_MapScript2_160302:: @ 8160302
	map_script_2 VAR_TEMP_0, 0, BattleTower_Lobby_EventScript_16032C
	map_script_2 VAR_TEMP_0, 1, BattleTower_Lobby_EventScript_160330
	map_script_2 VAR_TEMP_0, 2, BattleTower_Lobby_EventScript_160342
	map_script_2 VAR_TEMP_0, 3, BattleTower_Lobby_EventScript_160419
	map_script_2 VAR_TEMP_0, 4, BattleTower_Lobby_EventScript_16044B
	.2byte 0

BattleTower_Lobby_EventScript_16032C:: @ 816032C
	special sub_8134548
	end

BattleTower_Lobby_EventScript_160330:: @ 8160330
	lock
	faceplayer
	msgbox BattleTower_Lobby_Text_19A3FD, MSGBOX_DEFAULT
	closemessage
	setvar VAR_TEMP_0, 5
	release
	end

BattleTower_Lobby_EventScript_160342:: @ 8160342
	lock
	faceplayer
	message BattleTower_Lobby_Text_19A487
	waitmessage
	setvar VAR_0x8004, 0
	special BattleTowerUtil
	compare VAR_RESULT, 6
	goto_if_eq BattleTower_Lobby_EventScript_16037D
	special AwardBattleTowerRibbons
	compare VAR_RESULT, 0
	goto_if_eq BattleTower_Lobby_EventScript_16037D
	message BattleTower_Lobby_Text_19A6BE
	waitmessage
	playfanfare MUS_OBTAIN_ITEM
	waitfanfare
	msgbox BattleTower_Lobby_Text_19A719, MSGBOX_DEFAULT

BattleTower_Lobby_EventScript_16037D:: @ 816037D
	setvar VAR_0x8004, 8
	special BattleTowerUtil
	compare VAR_RESULT, 1
	goto_if_eq BattleTower_Lobby_EventScript_1603AD
	message BattleTower_Lobby_Text_19A589
	waitmessage
	setvar VAR_0x8004, 13
	special SetBattleTowerProperty
	special DetermineBattleTowerPrize
	setvar VAR_0x8004, 3
	special SaveBattleTowerProgress
	playse SE_SAVE
	waitse

BattleTower_Lobby_EventScript_1603AD:: @ 81603AD
	setvar VAR_0x8004, 0
	setvar VAR_0x8005, 3
	special SetBattleTowerProperty
	message BattleTower_Lobby_Text_19A4BB
	waitmessage
	special GiveBattleTowerPrize
	switch VAR_RESULT
	case 0, BattleTower_Lobby_EventScript_160408
	message BattleTower_Lobby_Text_19A506
	waitmessage
	playfanfare MUS_OBTAIN_ITEM
	waitfanfare
	setvar VAR_0x8004, 9
	special BattleTowerUtil
	compare VAR_RESULT, 49
	goto_if_ne BattleTower_Lobby_EventScript_1603F8
	msgbox BattleTower_Lobby_Text_19A617, MSGBOX_DEFAULT

BattleTower_Lobby_EventScript_1603F8:: @ 81603F8
	msgbox BattleTower_Lobby_Text_199FA9, MSGBOX_DEFAULT
	closemessage
	setvar VAR_TEMP_0, 5
	release
	end

BattleTower_Lobby_EventScript_160408:: @ 8160408
	msgbox BattleTower_Lobby_Text_19A520, MSGBOX_DEFAULT
	waitmessage
	closemessage
	setvar VAR_TEMP_0, 5
	release
	end

BattleTower_Lobby_EventScript_160419:: @ 8160419
	lock
	faceplayer
	message BattleTower_Lobby_Text_19A571
	waitmessage
	message BattleTower_Lobby_Text_19A589
	waitmessage
	setvar VAR_0x8004, 13
	special SetBattleTowerProperty
	setvar VAR_0x8004, 0
	special SaveBattleTowerProgress
	playse SE_SAVE
	waitse
	msgbox BattleTower_Lobby_Text_199FA9, MSGBOX_DEFAULT
	closemessage
	setvar VAR_TEMP_0, 5
	release
	end

BattleTower_Lobby_EventScript_16044B:: @ 816044B
	lock
	faceplayer
	setvar VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, 1
	message BattleTower_Lobby_Text_19A5B1
	waitmessage
	message BattleTower_Lobby_Text_19A5CE
	waitmessage
	setvar VAR_0x8004, 1
	special SaveBattleTowerProgress
	playse SE_SAVE
	waitse
	setvar VAR_0x8004, 8
	setvar VAR_0x8005, 0
	special SetBattleTowerProperty
	setvar VAR_TEMP_0, 5
	special SavePlayerParty
	special SetBattleTowerParty
	msgbox BattleTower_Lobby_Text_19A0A8, MSGBOX_DEFAULT
	closemessage
	call BattleTower_Lobby_EventScript_160664
	warp MAP_BATTLE_TOWER_ELEVATOR, 255, 1, 6
	setvar VAR_TEMP_0, 0
	waitstate

BattleTower_Lobby_EventScript_16049E:: @ 816049E
	lock
	faceplayer
	setvar VAR_0x8004, 0
	special BattleTowerUtil
	compare VAR_RESULT, 6
	goto_if_eq BattleTower_Lobby_EventScript_160342
	special SavePlayerParty
	msgbox BattleTower_Lobby_Text_199F2C, MSGBOX_DEFAULT

BattleTower_Lobby_EventScript_1604BE:: @ 81604BE
	message BattleTower_Lobby_Text_199F79
	waitmessage
	multichoice 15, 6, 23, 0
	switch VAR_RESULT
	case 0, BattleTower_Lobby_EventScript_1604FA
	case 1, BattleTower_Lobby_EventScript_160600
	case 2, BattleTower_Lobby_EventScript_160652
	case 127, BattleTower_Lobby_EventScript_160652

BattleTower_Lobby_EventScript_1604FA:: @ 81604FA
	message BattleTower_Lobby_Text_19A024
	waitmessage
	multichoice 18, 6, 24, 0
	switch VAR_RESULT
	case 2, BattleTower_Lobby_EventScript_160652
	case 127, BattleTower_Lobby_EventScript_160652
	special CheckPartyBattleTowerBanlist
	compare VAR_0x8004, 1
	goto_if_eq BattleTower_Lobby_EventScript_16060D
	setvar VAR_0x8004, 1
	copyvar VAR_0x8005, VAR_RESULT
	copyvar VAR_0x8006, VAR_RESULT
	special SetBattleTowerProperty
	msgbox BattleTower_Lobby_Text_19A07B, MSGBOX_DEFAULT
	fadescreen FADE_TO_BLACK
	special ChooseBattleTowerPlayerParty
	waitstate
	compare VAR_RESULT, 0
	goto_if_eq BattleTower_Lobby_EventScript_16064F
	msgbox BattleTower_Lobby_Text_199FDA, MSGBOX_YESNO
	switch VAR_RESULT
	case NO, BattleTower_Lobby_EventScript_16064F
	case YES, BattleTower_Lobby_EventScript_160587
	case 127, BattleTower_Lobby_EventScript_16064F

BattleTower_Lobby_EventScript_160587:: @ 8160587
	setvar VAR_0x8004, 5
	special SetBattleTowerProperty
	setvar VAR_TEMP_0, 0
	setvar VAR_0x8004, 11
	special SetBattleTowerProperty
	setvar VAR_0x8004, 0
	setvar VAR_0x8005, 1
	special SetBattleTowerProperty
	setvar VAR_0x8004, 8
	setvar VAR_0x8005, 0
	special SetBattleTowerProperty
	special LoadPlayerParty
	closemessage
	delay 2
	call Common_EventScript_SaveGame
	setvar VAR_TEMP_0, 5
	erasebox 0, 0, 15, 10
	compare VAR_RESULT, 0
	goto_if_eq BattleTower_Lobby_EventScript_160642
	incrementgamestat GAME_STAT_ENTERED_BATTLE_TOWER
	special SavePlayerParty
	special SetBattleTowerParty
	setvar VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, 1
	msgbox BattleTower_Lobby_Text_19A0A8, MSGBOX_DEFAULT
	closemessage
	call BattleTower_Lobby_EventScript_160664
	warp MAP_BATTLE_TOWER_ELEVATOR, 255, 1, 6
	setvar VAR_TEMP_0, 0
	waitstate

BattleTower_Lobby_EventScript_160600:: @ 8160600
	msgbox BattleTower_Lobby_Text_19A0D1, MSGBOX_DEFAULT
	goto BattleTower_Lobby_EventScript_1604BE

BattleTower_Lobby_EventScript_16060D:: @ 816060D
	switch VAR_RESULT
	case 0, BattleTower_Lobby_EventScript_160628
	case 1, BattleTower_Lobby_EventScript_160635

BattleTower_Lobby_EventScript_160628:: @ 8160628
	msgbox BattleTower_Lobby_Text_19A249, MSGBOX_DEFAULT
	goto BattleTower_Lobby_EventScript_160662

BattleTower_Lobby_EventScript_160635:: @ 8160635
	msgbox BattleTower_Lobby_Text_19A32D, MSGBOX_DEFAULT
	goto BattleTower_Lobby_EventScript_160662

BattleTower_Lobby_EventScript_160642:: @ 8160642
	setvar VAR_0x8004, 12
	special SetBattleTowerProperty
	goto BattleTower_Lobby_EventScript_160652

BattleTower_Lobby_EventScript_16064F:: @ 816064F
	special LoadPlayerParty

BattleTower_Lobby_EventScript_160652:: @ 8160652
	msgbox BattleTower_Lobby_Text_199FA9, MSGBOX_DEFAULT
	setvar VAR_0x8004, 11
	special SetBattleTowerProperty

BattleTower_Lobby_EventScript_160662:: @ 8160662
	release
	end

BattleTower_Lobby_EventScript_160664:: @ 8160664
	applymovement 1, BattleTower_Lobby_Movement_160693
	applymovement OBJ_EVENT_ID_PLAYER, BattleTower_Lobby_Movement_160693
	waitmovement 0
	opendoor 6, 1
	waitdooranim
	applymovement 1, BattleTower_Lobby_Movement_160697
	applymovement OBJ_EVENT_ID_PLAYER, BattleTower_Lobby_Movement_16069A
	waitmovement 0
	closedoor 6, 1
	waitdooranim
	return

BattleTower_Lobby_Movement_160693:: @ 8160693
	walk_up
	walk_up
	walk_up
	step_end

BattleTower_Lobby_Movement_160697:: @ 8160697
	walk_up
	set_invisible
	step_end

BattleTower_Lobby_Movement_16069A:: @ 816069A
	walk_up
	walk_up
	set_invisible
	step_end

@ 816069E
	walk_fast_up
	walk_fast_up
	walk_fast_up
	walk_fast_up
	walk_fast_up
	set_invisible
	step_end

BattleTower_Lobby_EventScript_1606A5:: @ 81606A5
	lock
	faceplayer
	msgbox BattleTower_Lobby_Text_19A747, MSGBOX_YESNO
	switch VAR_RESULT
	case YES, BattleTower_Lobby_EventScript_1606CC
	case NO, BattleTower_Lobby_EventScript_1606F7
	release
	end

BattleTower_Lobby_EventScript_1606CC:: @ 81606CC
	msgbox BattleTower_Lobby_Text_19A7C3, MSGBOX_DEFAULT
	setvar VAR_0x8004, 1
	call Common_EventScript_ShowEasyChatScreen
	lock
	faceplayer
	compare VAR_RESULT, 0
	goto_if_eq BattleTower_Lobby_EventScript_160701
	compare VAR_RESULT, 1
	goto_if_eq BattleTower_Lobby_EventScript_16070B
	end

BattleTower_Lobby_EventScript_1606F7:: @ 81606F7
	msgbox BattleTower_Lobby_Text_19A7FD, MSGBOX_DEFAULT
	release
	end

BattleTower_Lobby_EventScript_160701:: @ 8160701
	msgbox BattleTower_Lobby_Text_19A83D, MSGBOX_DEFAULT
	release
	end

BattleTower_Lobby_EventScript_16070B:: @ 816070B
	msgbox BattleTower_Lobby_Text_19A871, MSGBOX_DEFAULT
	release
	end

BattleTower_Lobby_EventScript_160715:: @ 8160715
	msgbox BattleTower_Lobby_Text_19A8AE, MSGBOX_NPC
	end

BattleTower_Lobby_EventScript_16071E:: @ 816071E
	msgbox BattleTower_Lobby_Text_19A946, MSGBOX_NPC
	end

BattleTower_Lobby_EventScript_160727:: @ 8160727
	lockall
	special ShowBattleTowerRecords
	waitbuttonpress
	erasebox 0, 0, 29, 19
	releaseall
	end

BattleTower_Lobby_EventScript_160733:: @ 8160733
	lock
	faceplayer
	goto_if_set FLAG_RECEIVED_GOLD_SHIELD, BattleTower_Lobby_EventScript_1607C5
	goto_if_set FLAG_RECEIVED_SILVER_SHIELD, BattleTower_Lobby_EventScript_160773
	msgbox BattleTower_Lobby_Text_19A9EE, MSGBOX_DEFAULT
	setvar VAR_0x8008, DECOR_SILVER_SHIELD
	givedecoration DECOR_SILVER_SHIELD
	compare VAR_RESULT, 0
	goto_if_eq BattleTower_Lobby_EventScript_1607AF
	setflag FLAG_RECEIVED_SILVER_SHIELD
	msgbox BattleTower_Lobby_Text_19ABAA, MSGBOX_DEFAULT
	release
	end

BattleTower_Lobby_EventScript_160773:: @ 8160773
	specialvar VAR_RESULT, GetBestBattleTowerStreak
	compare VAR_RESULT, 100
	goto_if_lt BattleTower_Lobby_EventScript_1607C5
	msgbox BattleTower_Lobby_Text_19AAC4, MSGBOX_DEFAULT
	setvar VAR_0x8008, DECOR_GOLD_SHIELD
	givedecoration DECOR_GOLD_SHIELD
	compare VAR_RESULT, 0
	goto_if_eq BattleTower_Lobby_EventScript_1607AF
	setflag FLAG_RECEIVED_GOLD_SHIELD
	msgbox BattleTower_Lobby_Text_19ABAA, MSGBOX_DEFAULT
	release
	end

BattleTower_Lobby_EventScript_1607AF:: @ 81607AF
	bufferdecorationname 1, VAR_0x8008
	msgbox Text_NoRoomLeftForAnother, MSGBOX_DEFAULT
	msgbox BattleTower_Lobby_Text_19ABED, MSGBOX_DEFAULT
	release
	end

BattleTower_Lobby_EventScript_1607C5:: @ 81607C5
	msgbox BattleTower_Lobby_Text_19AC55, MSGBOX_DEFAULT
	release
	end