AzaleaGym_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

AzaleaGymSignpost1:
	jumptext AzaleaGymSignpost1_Text_324316

AzaleaGymSignpost2:
	jumptext AzaleaGymSignpost1_Text_324316

AzaleaGym_Item_1:
	db IRON, 1

AzaleaGym_Trainer_1:
	trainer EVENT_AZALEA_GYM_TRAINER_1, LASS, 4, AzaleaGym_Trainer_1_Text_32434e, AzaleaGym_Trainer_1_Text_324384, $0000, .Script

.Script:
	end_if_just_battled
	jumptext AzaleaGym_Trainer_1_Script_Text_324397

AzaleaGym_Trainer_2:
	trainer EVENT_AZALEA_GYM_TRAINER_2, BUG_CATCHER, 8, AzaleaGym_Trainer_2_Text_324566, AzaleaGym_Trainer_2_Text_32459b, $0000, .Script

.Script:
	end_if_just_battled
	jumptext AzaleaGym_Trainer_2_Script_Text_3245c0

AzaleaGym_Trainer_3:
	trainer EVENT_AZALEA_GYM_TRAINER_3, BUG_CATCHER, 7, AzaleaGym_Trainer_3_Text_324446, AzaleaGym_Trainer_3_Text_324477, $0000, .Script

.Script:
	end_if_just_battled
	jumptext AzaleaGym_Trainer_3_Script_Text_324499

AzaleaGym_Trainer_4:
	trainer EVENT_AZALEA_GYM_TRAINER_4, LASS, 5, AzaleaGym_Trainer_4_Text_3243db, AzaleaGym_Trainer_4_Text_324407, $0000, .Script

.Script:
	end_if_just_battled
	jumptext AzaleaGym_Trainer_4_Script_Text_32441a

AzaleaGymNPC1:
	faceplayer
	opentext
	checkflag ENGINE_HIVEBADGE
	iffalse AzaleaGym_324600
	jumptext AzaleaGymNPC1_Text_324632

AzaleaGym_Trainer_5:
	trainer EVENT_AZALEA_GYM_TRAINER_5, BUG_CATCHER, 9, AzaleaGym_Trainer_5_Text_3244d9, AzaleaGym_Trainer_5_Text_324516, $0000, .Script

.Script:
	end_if_just_battled
	jumptext AzaleaGym_Trainer_5_Script_Text_324520

AzaleaGymNPC2:
	jumptextfaceplayer AzaleaGymNPC2_Text_32429b

AzaleaGym_324600:
	writetext AzaleaGym_324600_Text_32467c
	winlosstext AzaleaGym_324600Text_324711, 0
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_NORMAL
	loadtrainer BUGSY, 1
	startbattle
	reloadmapafterbattle
	playmapmusic
	opentext
	writetext AzaleaGym_324600_Text_32477b
	playwaitsfx SFX_TCG2_DIDDLY_5
	setflag ENGINE_HIVEBADGE
	playmusic MUSIC_GYM
	writetext AzaleaGym_324600_Text_324793
	waitbutton
	givetm 87 + RECEIVED_TM
	opentext
	writetext AzaleaGym_324600_Text_3247c3
	setflag ENGINE_HIVEBADGE
	endtext

AzaleaGymSignpost1_Text_324316:
	db TX_COMPRESSED, $ac, $4d, $ef, $4f, $61, $41, $a8
	db $8f, $03, $95, $f0, $92, $30, $81

	db $3e, $03, $1c, $f7, $26, $b7, $18, $24, $d7, $28
	db $05, $4d

AzaleaGym_Trainer_1_Text_32434e:
	db TX_COMPRESSED, $29, $26, $b3, $c5, $08, $19, $56, $82, $95, $19, $71
	db $bd, $d3, $bb, $19, $39, $80, $82, $d4, $57, $b7, $7d
	db $35, $56, $93, $9d, $3d, $c9, $af
	db $8d, $34

AzaleaGym_Trainer_1_Text_324384:
	db TX_COMPRESSED, $76, $98, $f8, $29, $c8, $43, $92, $1a, $11, $4f
	db $05, $34

AzaleaGym_Trainer_1_Script_Text_324397:
	db TX_COMPRESSED, $72, $85, $a8, $b3, $de, $f4, $14, $56, $d0, $fb, $73
	db $5e, $45, $ac, $24, $e6, $59, $eb, $fe

	db $00, $ea, $6e, $5f, $1a, $ce, $5a, $76
	db $fd, $4d

AzaleaGym_Trainer_2_Text_324566:
	db TX_COMPRESSED, $12, $6b, $98, $0e, $57, $c2, $48, $60, $c1, $e8, $31
	db $bc, $08, $2d, $13, $9f

	db $00, $50, $19, $69, $30, $53, $93
	db $b7, $91, $6b, $09, $39, $35, $cc, $35, $16, $6b
	db $f5, $34

AzaleaGym_Trainer_2_Text_32459b:
	db TX_COMPRESSED, $62, $1a, $8c, $18, $d7, $f9, $4e, $34, $8b
	db $78, $c1, $83, $d0, $61, $93, $98, $34, $12
	db $98, $a8, $c8, $16, $b9, $4f
	db $1a, $68

AzaleaGym_Trainer_2_Script_Text_3245c0:
	db TX_COMPRESSED, $75, $39, $68, $d0, $88, $eb, $1a, $2b, $3b, $b3
	db $5b, $d6, $bd, $19, $26, $c5, $63, $b8, $f8, $56, $7c
	db $69, $a0

AzaleaGym_Trainer_3_Text_324446:
	db TX_COMPRESSED, $12, $6b, $98, $0e, $57, $c2, $49, $ab
	db $37, $97, $b9

	db $e2, $01, $89, $ac, $f1, $4b, $49, $c1, $0b, $08, $70
	db $79, $90, $be, $32, $73, $36, $e0, $2d
	db $e3, $4d

AzaleaGym_Trainer_3_Text_324477:
	db TX_COMPRESSED, $6e, $7d, $ec, $04, $16, $8b, $8e, $58, $5a, $e5
	db $2f, $5a, $76, $f1, $4c, $02, $b8, $86, $96, $7e
	db $a6, $80

AzaleaGym_Trainer_3_Script_Text_324499:
	db TX_COMPRESSED, $75, $1f, $3b, $9b, $19, $08, $7b, $39, $1a
	db $fa, $f5, $49, $0c, $e8, $41, $8d, $11, $5b, $5c
	db $aa, $07, $2b, $e1, $27
	db $a9, $a0

AzaleaGym_Trainer_4_Text_3243db:
	db TX_COMPRESSED, $6f, $a3, $be

	db $20, $38, $02, $4a, $64, $5b, $48, $4c, $b0
	db $bc, $24, $d7, $28, $05, $f8, $af, $6e, $fa, $71, $a4
	db $2a, $c0, $6b, $45, $f1
	db $a6, $80

AzaleaGym_Trainer_4_Text_324407:
	db TX_COMPRESSED, $76, $98, $f8, $29, $c8, $43, $92, $1a, $11, $4f
	db $05, $34

AzaleaGym_Trainer_4_Script_Text_32441a:
	db TX_COMPRESSED, $74, $59, $35, $09, $d7, $cf, $30, $38, $47, $c1
	db $3d, $d0, $a1, $1e
	db $a6, $80

AzaleaGymNPC1_Text_324632:
	db TX_COMPRESSED, $12, $6b, $98, $0e, $57, $c2, $49, $ab
	db $37, $b2, $66, $23

	db $c0, $0a, $49, $ac, $f1, $4d
	db $23, $c6, $4c, $f4, $d0, $89, $af, $85, $a2

	db $58, $00, $e1, $1f, $04, $8b, $35, $8c, $d1, $2c
	db $2f, $2b, $38, $74, $e8, $8e, $85, $67, $9f
	db $53, $40

AzaleaGym_Trainer_5_Text_3244d9:
	db TX_COMPRESSED, $75, $39, $59, $d5, $1a, $11, $2a, $1d, $a6, $3e
	db $09, $e0, $72, $be, $12

	db $78, $03, $a8, $c8, $5a, $ee, $49, $4c, $83, $7f, $79, $19
	db $0d, $e1, $dc, $d2, $02, $81, $b4, $9a, $e5, $5a, $0b
	db $d4, $d0

AzaleaGym_Trainer_5_Text_324516:
	db TX_COMPRESSED, $73, $ad, $7c, $f3, $ca, $78
	db $d3, $40

AzaleaGym_Trainer_5_Script_Text_324520:
	db TX_COMPRESSED, $af, $bd, $95, $1c, $67, $49, $32, $18, $34
	db $3d, $ca, $c3, $54, $d2, $66, $72

	db $76, $01, $59, $dd, $9a, $ff, $35, $13
	db $5e, $b3, $d7
	db $fd, $4d

AzaleaGymNPC2_Text_32429b:
	db TX_COMPRESSED, $72, $86, $32, $9d, $ef, $4c, $9c, $9a, $f8

	db $80, $12, $6b, $94, $02, $c5, $14, $88, $1a, $ba, $79, $e4
	db $de, $0e, $10, $64, $41, $b3, $70, $1c, $af, $84
	db $8a, $86, $88, $64, $0a, $df, $0b, $48

	db $e2, $00, $a5, $82, $97, $aa, $43, $27, $32, $d2, $6f
	db $bd, $90, $d4, $49, $50, $ed, $33, $01, $ac, $e6, $93
	db $2a, $b0, $e8, $21, $93, $98, $0e, $57, $c2, $4e
	db $34, $d0

AzaleaGym_324600_Text_32467c:
	db TX_COMPRESSED, $74, $59, $04, $9a, $e5, $00

	db $bc, $01, $d4, $21, $83, $1a, $e7, $42, $83, $95, $24
	db $c8, $f0, $ee, $32, $17, $cd, $12, $c3, $15, $b5
	db $ca, $a0, $72, $be, $12, $71

	db $00, $e5, $0b, $51, $9d, $24, $64, $24, $40, $f2, $6b
	db $79, $f3, $96, $93, $9a, $d5, $a4, $2b, $1d, $82
	db $54, $12, $45, $6d, $73, $01, $ca, $f8, $49

	db $c4, $03, $a6, $03, $9d, $3d, $59, $0f, $33
	db $5e, $e8, $6e, $04, $18, $d7, $2d

	db $26, $00, $11, $ea, $d1, $f9, $d3, $b8, $f9
	db $bc, $84, $86, $a8, $08, $2d
	db $7a, $9a

AzaleaGym_324600Text_324711:
	db TX_COMPRESSED, $72, $85, $a9, $ab, $39, $af, $e8, $9b, $19, $39

	db $e2, $00, $a4, $9a, $ce, $54, $3e, $f6, $6f, $6a, $d0, $48
	db $79, $59, $c4, $05, $f3, $b4, $8c, $9c, $c2, $1d

	db $40, $2c, $33, $a7, $ab, $24, $d5, $61, $6a
	db $de, $56, $d7, $30, $1c, $af, $84, $9c

	db $40, $70, $f4, $f5, $07, $2f, $54, $8e, $5a
	db $4d, $e6, $23, $06, $38, $25, $b9, $e4, $f8
	db $d3, $40

AzaleaGym_324600_Text_32477b:
	db TX_COMPRESSED, $a7, $8e, $2c, $d9, $31, $83, $1e
	db $5e, $62, $30, $63, $82, $5b, $9e, $4f
	db $d4, $d0

AzaleaGym_324600_Text_324793:
	db TX_COMPRESSED, $e1, $e9, $ea, $0e, $5e, $a9, $1c, $b4, $8d
	db $0f, $72, $3c, $2e, $6a, $25, $47, $de
	db $fd, $50, $20, $b5, $32, $68, $35, $83, $1c, $1d
	db $fa, $9a

AzaleaGym_324600_Text_3247c3:
	db TX_COMPRESSED, $29, $23, $44, $56, $d7, $30, $a1, $59, $50, $56, $a4
	db $87, $b0, $0a, $e6, $f7, $b0, $1c, $af, $84
	db $8a, $aa, $1d, $a6, $24, $2b, $22

	db $3c, $00, $a4, $ed, $ca, $b4, $17, $e1, $83, $19
	db $1e, $7c, $2b, $38, $0e, $57, $c2, $48, $ce

	db $90, $02, $75, $64, $34, $22, $5a
	db $4d, $e1, $01, $a8, $d7, $03, $84, $56, $d7, $28
	db $e3, $4d

AzaleaGym_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def $f, $4, 4, AZALEA_TOWN
	warp_def $f, $5, 4, AZALEA_TOWN

	;xy triggers
	db 0

	;signposts
	db 2
	signpost 13, 3, SIGNPOST_READ, AzaleaGymSignpost1
	signpost 13, 6, SIGNPOST_READ, AzaleaGymSignpost2

	;people-events
	db 8
	person_event SPRITE_P0, -3, -3, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 1, AzaleaGym_Item_1, EVENT_AZALEA_GYM_ITEM_1
	person_event SPRITE_LASS, 10, 4, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TRAINER, 1, AzaleaGym_Trainer_1, -1
	person_event SPRITE_BUG_CATCHER, 3, 5, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_TRAINER, 1, AzaleaGym_Trainer_2, -1
	person_event SPRITE_BUG_CATCHER, 2, 8, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_TRAINER, 1, AzaleaGym_Trainer_3, -1
	person_event SPRITE_LASS, 10, 5, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TRAINER, 1, AzaleaGym_Trainer_4, -1
	person_event SPRITE_BUGSY, 7, 5, SPRITEMOVEDATA_WANDER, 0, 0, -1, -1, PAL_OW_GREEN, PERSONTYPE_SCRIPT, 0, AzaleaGymNPC1, -1
	person_event SPRITE_BUG_CATCHER, 8, 1, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_TRAINER, 3, AzaleaGym_Trainer_5, -1
	person_event SPRITE_GYM_GUY, 13, 7, SPRITEMOVEDATA_00, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, AzaleaGymNPC2, -1

