MoragaGym_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

MoragaGymSignpost1:
	jumptext MoragaGymSignpost1_Text_17b130

MoragaGymNPC1:
	faceplayer
	opentext
	checkflag ENGINE_SPROUTBADGE
	iffalse MoragaGym_17ad3d
	jumptext MoragaGymNPC1_Text_17ad6c

MoragaGym_Trainer_1:
	trainer EVENT_MORAGA_GYM_TRAINER_1, TEACHER, 1, MoragaGym_Trainer_1_Text_17b081, MoragaGym_Trainer_1_Text_17b09f, $0000, .Script

.Script:
	end_if_just_battled
	jumptext MoragaGym_Trainer_1_Script_Text_17b0b9

MoragaGym_Trainer_2:
	trainer EVENT_MORAGA_GYM_TRAINER_2, LASS, 8, MoragaGym_Trainer_2_Text_17af76, MoragaGym_Trainer_2_Text_17af91, $0000, .Script

.Script:
	end_if_just_battled
	jumptext MoragaGym_Trainer_2_Script_Text_17afa3

MoragaGym_Trainer_3:
	trainer EVENT_MORAGA_GYM_TRAINER_3, COOLTRAINERM, 7, MoragaGym_Trainer_3_Text_17afd7, MoragaGym_Trainer_3_Text_17b00a, $0000, .Script

.Script:
	end_if_just_battled
	jumptext MoragaGym_Trainer_3_Script_Text_17b01f

MoragaGym_Trainer_4:
	trainer EVENT_MORAGA_GYM_TRAINER_4, LASS, 7, MoragaGym_Trainer_4_Text_17af10, MoragaGym_Trainer_4_Text_17af27, $0000, .Script

.Script:
	end_if_just_battled
	jumptext MoragaGym_Trainer_4_Script_Text_17af30

MoragaGym_17ad3d:
	writetext MoragaGym_17ad3d_Text_17ad97
	winlosstext MoragaGym_17ad3dText_17ae3d, 0
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_NORMAL
	loadtrainer LOIS, 1
	startbattle
	reloadmapafterbattle
	playmapmusic
	opentext
	writetext MoragaGym_17ad3d_Text_17ae7c
	playwaitsfx SFX_TCG2_DIDDLY_5
	playmusic MUSIC_GYM
	writetext MoragaGym_17ad3d_Text_17ae96
	waitbutton
	givetm 19 + RECEIVED_TM
	opentext
	writetext MoragaGym_17ad3d_Text_17aeb1
	setflag ENGINE_SPROUTBADGE
	endtext

MoragaGymSignpost1_Text_17b130:
	db TX_COMPRESSED, $15, $0a, $f7, $9d, $85, $06, $a2
	db $3c, $0e, $57, $c2, $48, $c2, $04

	db $f8, $0c, $73, $dc, $9a, $dc, $66, $38, $46
	db $8a, $68

MoragaGymNPC1_Text_17ad6c:
	db TX_COMPRESSED, $12, $34, $5c, $0e, $13, $ad, $32, $a5, $02
	db $47, $b9, $3b, $b1, $93, $99, $69, $38, $e4, $1d, $38, $12
	db $2a, $57, $b9, $e4, $d1
	db $ea, $68

MoragaGym_Trainer_1_Text_17b081:
	db TX_COMPRESSED, $e0, $1e, $60, $26, $88, $40, $cc, $70, $8d, $11, $3a
	db $87, $b6, $5d, $43, $25
	db $2d, $34

MoragaGym_Trainer_1_Text_17b09f:
	db TX_COMPRESSED, $75, $02, $4e, $82, $9a, $85, $23, $cc
	db $d7, $85, $9b, $46, $8b, $18, $49
	db $c6, $9a

MoragaGym_Trainer_1_Script_Text_17b0b9:
	db TX_COMPRESSED, $c7, $08, $d1, $13, $a8, $9b, $2e, $a1
	db $91, $e4, $0d, $16, $6b, $95, $24, $38, $a6, $f5, $01

	db $01, $b1, $84, $09, $f9, $8e, $7b, $93, $5f, $e2, $b6
	db $ad, $e4, $24, $e7, $46, $0c, $68, $83, $24, $13, $1a, $4b, $0f

	db $80, $3a, $8c, $e9, $29, $91, $66, $f9, $be, $ac
	db $d6, $f2, $4d, $70, $9a, $f9, $d3, $c1, $06, $88, $3b
	db $54, $2e, $58, $c9
	db $4b, $4d

MoragaGym_Trainer_2_Text_17af76:
	db TX_COMPRESSED, $72, $85, $a2, $e3, $84, $0d, $c5, $9e, $e4
	db $13, $d8, $05, $73, $1c, $23, $47
	db $a9, $a0

MoragaGym_Trainer_2_Text_17af91:
	db TX_COMPRESSED, $e1, $35, $a7, $44, $22, $02, $0b, $53, $56, $7e
	db $a6, $80

MoragaGym_Trainer_2_Script_Text_17afa3:
	db TX_COMPRESSED, $74, $59, $16, $7b, $de, $82, $88, $48
	db $27, $b5, $58, $5a, $b8, $43, $a9, $90, $be, $6b, $47
	db $a9, $a0

MoragaGym_Trainer_3_Text_17afd7:
	db TX_COMPRESSED, $74, $59, $36, $32, $10, $f6, $65, $ac
	db $9b, $d6, $9d, $b9, $d0, $83, $1a, $22, $74, $9c, $8c, $9c
	db $aa, $a8, $76, $99, $69, $39, $c8, $d7, $d4, $71
	db $a6, $80

MoragaGym_Trainer_3_Text_17b00a:
	db TX_COMPRESSED, $13, $21, $40, $f5, $3f, $98, $05, $7c, $8c, $18
	db $de, $7c, $f8
	db $d3, $40

MoragaGym_Trainer_3_Script_Text_17b01f:
	db TX_COMPRESSED, $29, $26, $0a, $64, $24, $a6, $4e, $9d
	db $bd, $4e, $34, $8b, $9a, $40, $53, $96, $81, $44, $e9, $39
	db $54, $16, $ae, $24, $d6, $7e

	db $00, $ec, $9d, $05, $2d, $27, $15, $9a, $2e, $0d
	db $0f, $6f, $7a, $1a, $8f, $32, $c3, $19, $48, $fb, $df
	db $53, $40

MoragaGym_Trainer_4_Text_17af10:
	db TX_COMPRESSED, $c7, $08, $d1, $06, $88, $80
	db $bc, $32, $20, $40, $d6, $32, $73
	db $c6, $9a

MoragaGym_Trainer_4_Text_17af27:
	db TX_COMPRESSED, $6e, $90, $84, $42, $38
	db $d3, $40

MoragaGym_Trainer_4_Script_Text_17af30:
	db TX_COMPRESSED, $75, $2a, $d2, $5c, $b0, $c5, $67, $36, $30, $81
	db $3e, $f6, $39, $ee, $4d, $72, $9c, $69, $17, $3a, $35, $23
	db $54, $93, $5c, $09, $0e, $67, $41, $71
	db $a6, $80

MoragaGym_17ad3d_Text_17ad97:
	db TX_COMPRESSED, $ad, $29, $4d, $3c, $11, $27, $de, $87

	db $c0, $1d, $16, $4a, $71, $a4, $5c, $40
	db $5e, $4e, $88, $10, $0a, $9e

	db $00, $02, $a0, $a7, $3a, $bc, $99, $22, $1f, $3e, $f5
	db $0f, $54, $12, $64, $d7, $83, $5d

	db $f0, $07, $69, $80, $8d, $1f, $88, $0a, $d6, $0b, $f1, $d1
	db $63, $d8, $e1, $1a, $3f, $2d, $27, $18, $40, $9f

	db $01, $d3, $dc, $9a, $e0, $70, $96, $91
	db $a1, $e6, $47, $60, $a0, $57, $2c, $35, $13

	db $c0, $1d, $44, $34, $20, $40, $50, $70, $10, $5a
	db $7a, $ad, $25, $cb, $0c, $57, $b7, $7d, $3a

	db $50, $0d, $c2, $4c, $9a, $f0, $6b, $bc
	db $69, $a0

MoragaGym_17ad3dText_17ae3d:
	db TX_COMPRESSED, $50, $18, $fb, $4c, $a6, $2b, $e8, $d0, $88, $16
	db $ad, $e0, $e1, $2d, $3b, $71, $5e, $dd, $f4, $f8

	db $80, $72, $85, $a8, $9d, $06, $38, $7a, $b2, $1e
	db $5e, $b4, $8d, $11, $5e, $e7, $93
	db $e3, $4d

MoragaGym_17ad3d_Text_17ae7c:
	db TX_COMPRESSED, $a7, $8e, $2c, $d9, $31, $83, $1e
	db $5e, $50, $21, $61, $6a, $e0, $96, $e7, $93
	db $f5, $34

MoragaGym_17ad3d_Text_17ae96:
	db TX_COMPRESSED, $72, $85, $a6, $03, $87, $ab, $21
	db $e5, $eb, $48, $d1, $0a, $15, $96, $10
	db $fa, $9a

MoragaGym_17ad3d_Text_17aeb1:
	db TX_COMPRESSED, $28, $54, $5a, $73, $30, $68, $8c, $21, $f3
	db $af, $70, $2f, $46, $4e

	db $20, $1c, $a1, $69, $70, $1c, $af, $84, $92, $a1, $f7
	db $af, $2c, $d9, $08, $31, $ae, $27, $7b, $84, $0e
	db $0a, $ad, $27, $33, $af, $ef, $27, $07
	db $6a, $b2, $7b, $d4, $4b, $0c, $1d, $a2, $60, $13
	db $f5, $34

MoragaGym_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def $11, $4, 4, MORAGA_TOWN
	warp_def $11, $5, 4, MORAGA_TOWN

	;xy triggers
	db 0

	;signposts
	db 2
	signpost 15, 3, SIGNPOST_READ, MoragaGymSignpost1
	signpost 15, 6, SIGNPOST_READ, MoragaGymSignpost1

	;people-events
	db 5
	person_event SPRITE_LOIS, 3, 4, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, MoragaGymNPC1, -1
	person_event SPRITE_TEACHER, 6, 6, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, MoragaGym_Trainer_1, -1
	person_event SPRITE_LASS, 10, 6, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, MoragaGym_Trainer_2, -1
	person_event SPRITE_COOLTRAINER_M, 7, 3, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 2, MoragaGym_Trainer_3, -1
	person_event SPRITE_LASS, 11, 3, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 2, 2, MoragaGym_Trainer_4, -1

