Route69IlkBrotherHouse_MapScriptHeader;trigger count
	db 2

	maptrigger .Trigger0
	maptrigger .Trigger1
 ;callback count
	db 0

.Trigger0
	priorityjump IlkBrothersInTrouble
.Trigger1
	end

Route69IlkBrotherHouseStove:
	jumptext .text

.text
	db TX_COMPRESSED, $62, $fb, $ff, $96, $91, $a2, $22, $c2, $0c
	db $6f, $10, $cf, $28, $8c, $f4, $f4, $83, $27, $3e
	db $a6, $80

Route69IlkBrotherHouseSink:
	jumptext .text

.text
	db TX_COMPRESSED, $12, $ee, $a7

	db $88, $06, $e9, $db, $9b, $32, $35, $d8, $28, $81, $91, $4b
	db $8d, $34

Route69IlkBrotherHouseN64:
	jumptext .text

.text
	db TX_COMPRESSED, $75, $78, $a6, $92, $03, $c4, $d2, $9f, $f1
	db $a6, $80

IlkBrothersInTrouble:
	musicfadeout MUSIC_RIVAL_ENCOUNTER, 8
	applymovement PLAYER, .walk_to_ilk_bro
	showemote EMOTE_SHOCK, 2, 15
	opentext
	writetext .text
	closetext
	dotrigger 1
	setevent EVENT_ROUTE_69_ILK_BRO_TRAPPED
	end

.walk_to_ilk_bro
	step_up
	step_up
	step_up
	turn_head_left
	step_end

.text
	db TX_COMPRESSED, $53, $19, $37, $bd, $05

	db $c4, $01, $49, $38, $c8, $44, $22, $6a, $ce, $24, $d6, $7c

	db $40, $37, $d1, $dd, $3c

	db $00, $1c, $a1, $68, $b8, $e5, $38, $d2, $2e, $6c, $52, $1e

	db $7c, $02, $9e

	db $00, $05, $24, $e3, $21, $10, $88, $83, $25, $c0, $41
	db $69, $e4, $9a, $ce, $96, $37, $4e, $dc, $a8, $d6
	db $6a, $ad, $26, $0a, $5a, $46, $45, $21, $93, $9a

	db $50, $14, $f0

	db $00, $76, $9a, $59, $c2, $b0, $e1, $e8, $eb, $aa
	db $4f, $20, $c9, $70, $10, $5a, $96, $18, $93, $e8, $8a

	db $50, $0d, $cf, $bd, $96, $93, $25, $3c

	db $00, $14, $19, $cb, $4e, $dc, $e5, $a0, $50, $64
	db $7a, $d2, $71, $5e, $b2, $a5, $f9, $69, $35, $9d

	db $28, $06, $27, $15, $ac, $2a, $47, $06, $49, $a4
	db $cb, $c3, $44, $b5, $82, $19, $39, $96, $19, $7a, $a4
	db $6a, $9f, $05, $04, $04, $2b, $82, $5b, $c8, $49

	db $e0, $1c, $3d, $3d, $41, $fe, $24, $fa, $23
	db $8d, $3c, $40

IlkBrothersTalkToRival:
	opentext
	writetext .talk_to_bagon_text
	closetext
	showemote 0, 3, 15
	faceplayer
	opentext
	writetext .before_battle_text
	winlosstext .battle_won_text, .battle_lost_text
	setlasttalked 255
	loadtrainer RIVAL1, RIVAL1_1
	writecode VAR_BATTLETYPE, BATTLETYPE_CANLOSE
	setlasttalked $3
	dontrestartmapmusic
	startbattle
	disappear 4
	setevent EVENT_RIVAL_ROUTE_69
	reloadmap
	special HealParty
	playmusic MUSIC_RIVAL_AFTER
	opentext
	writetext .after_battle_text
	closetext
	playmusic MUSIC_NONE
	playsound SFX_WARP_FROM
	applymovement 3, .rival_teleports
	disappear 3
	waitsfx
	playmapmusic
	spriteface 2, UP
	checkcode VAR_FACING
	sif =, RIGHT, then
		applymovement 0, .walk_to_ilk_bro_facing_right
	selse
		applymovement 0, .walk_to_ilk_bro
	sendif
	spriteface 2, RIGHT
	opentext
	writetext .ilk_bro_after_battle_text
	special SpecialNameRival
	clearevent EVENT_ROUTE_69_ILK_BRO_TRAPPED
	jumptext .after_naming_rival_text

.rival_teleports
	teleport_from
	remove_person
	step_end

.walk_to_ilk_bro
	step_left
	step_left
	step_left
	step_down
	step_down
	step_down
	step_left
	step_end

.walk_to_ilk_bro_facing_right
	step_left
	step_left
	step_left
	step_down
	step_down
	step_down
	step_down
	turn_head_left
	step_end

.talk_to_bagon_text
	db TX_COMPRESSED, $63, $a9, $de

	db $20, $1c, $a1, $68, $b8, $e3, $e3, $21, $c2, $06, $aa, $78

	db $00, $53, $c0, $d1, $3a, $68, $44, $04, $16, $a5, $5a, $4b
	db $7a, $c3, $39, $3b, $89, $69, $77, $4f
	db $05, $3c, $40

.before_battle_text
	db TX_COMPRESSED, $6e, $9d, $b9, $90, $c0, $41, $6a, $55, $a4, $bf
	db $bc, $08, $2d, $4e, $8e, $ef, $a7, $15, $af, $6e

	db $94, $03, $94, $2d, $17, $1c, $20, $6e, $72, $11, $93
	db $97, $ac, $33, $93, $b8, $32, $47, $c1, $4a, $b4, $17
	db $1a, $78, $80

.battle_won_text
	db TX_COMPRESSED, $75, $71, $06, $6f, $a2, $74, $6a
	db $46, $f5, $a4, $68, $80, $e5, $7c, $24, $8c, $85, $ae
	db $e5, $53, $48, $38, $80, $be, $72, $d7, $a3, $20, $c9, $cd, $3c

	db $00, $1d, $4a, $87, $de, $c7, $f5, $48, $e0
	db $ed, $e4, $5a, $c2, $4e, $4d, $7f, $8a, $c1, $4d, $20
	db $25, $4f, $9e, $91, $10, $86, $c9, $a1, $1a, $b0, $5e
	db $a6, $80

.battle_lost_text
	db TX_COMPRESSED, $63, $a9

	db $e2, $00, $a4, $ed, $ca, $b5, $10, $e9, $db, $59, $be, $7d
	db $04, $f0, $8d, $b4, $9d, $8d, $9e
	db $34, $d0

.after_battle_text
	db TX_COMPRESSED, $72, $85, $a2, $e3, $88, $0c, $26, $e1, $87

	db $80, $14, $37, $ce, $58, $61, $d3, $a3, $bf

	db $00, $75, $39, $0d, $ca, $71, $a4, $5c, $a9, $3b, $71
	db $d3, $c4, $33, $c9, $e6, $60, $b0, $bf, $2d, $23
	db $42, $a0, $f7, $33, $0d, $5d

	db $f8, $03, $68, $f4, $3c

	db $40, $09, $af, $8d, $20, $f3, $34
	db $8f, $0b, $90, $ce, $88, $38, $e4, $08, $83
	db $f5, $3c, $40

.ilk_bro_after_battle_text
	db TX_COMPRESSED, $75, $11, $b5, $4b, $49, $ca, $92, $1e
	db $9b, $d6, $91, $93, $9e, $31, $b8, $6a

	db $e2, $01, $ca, $16, $a2, $1a, $59, $c1, $0d, $5c, $68, $44
	db $d7, $b9, $08, $73, $30, $1f, $29, $be

	db $20, $38, $07, $98, $93, $96, $7d, $ec, $04, $16
	db $9e, $48, $d1, $09, $af, $9d
	db $2d, $3c, $40

.after_naming_rival_text
	db TX_COMPRESSED, $13, $5f, $f8, $96, $93

	db $4a, $00, $a4, $ed, $cc, $7d, $58, $30, $ef, $57, $01, $05
	db $a7, $95, $ed, $df, $4f, $32, $a1, $da, $69, $e0

	db $00, $ea, $5a, $46, $45, $28, $3b, $8a, $cf, $a1, $27, $28
	db $7a, $c3, $1f, $05, $15, $ac, $36, $93, $5f
	
	db $80, $3b, $4f, $e0, $20, $b5, $1f, $3b, $89, $1b
	db $ef, $6f, $56, $7b, $90, $54

	db $a0, $18, $9c, $d4, $29, $1e, $60, $20, $b5, $2c
	db $2f, $32, $93, $65, $4a, $34, $22, $04, $91, $f3, $a5

	db $00, $52, $76, $e5, $5a, $88, $41, $b2, $70, $38
	db $3c, $91, $bf
	
	db $e0, $1c, $01, $25, $32, $60, $15, $f2, $77, $2c
	db $2f, $2c, $ed, $a5, $92, $24, $68
	db $55, $8f, $ab, $06, $1d, $ea
	
	db $fc, $01, $89, $c5, $9e, $f7, $a0, $a7, $42, $0c, $68
	db $7a, $d3, $b7, $01, $ca, $f8, $49
	db $ea, $68

Route69IlkBrotherHouseIlkBrother:
	checkevent EVENT_RIVAL_ROUTE_69
	sif true
		jumptextfaceplayer .after_battling_rival
	jumptextfaceplayer .before_battling_rival

.before_battling_rival
	db TX_COMPRESSED, $e1, $e9, $ea, $0f, $f1, $2d, $2d, $60, $b8
	db $d3, $40

.after_battling_rival
	db TX_COMPRESSED, $29, $3a, $45, $24, $4d, $e7, $46, $49, $80
	db $56, $f5, $ac, $10, $c9, $cc, $b0, $c4, $58, $44
	db $2a, $b4, $ed, $c6, $57, $a2, $6c, $14, $52, $1e

	db $7c, $01, $d4, $48, $44, $1c, $7c, $14, $12, $de, $42, $48, $34
	db $3c, $8d, $c0, $e6, $93, $31, $01, $68, $99, $a7
	db $82, $9a

Route69IlkBrotherHouse_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def $9, $4, 3, ROUTE_69
	warp_def $9, $5, 3, ROUTE_69

	;xy triggers
	db 0

	;signposts
	db 5
	signpost 1, 0, SIGNPOST_READ, Route69IlkBrotherHouseStove
	signpost 0, 0, SIGNPOST_READ, Route69IlkBrotherHouseStove
	signpost 0, 1, SIGNPOST_READ, Route69IlkBrotherHouseSink
	signpost 1, 1, SIGNPOST_READ, Route69IlkBrotherHouseSink
	signpost 2, 9, SIGNPOST_READ, Route69IlkBrotherHouseN64

	;people-events
	db 3
	person_event SPRITE_SCIENTIST, 6, 3, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, Route69IlkBrotherHouseIlkBrother, -1
	person_event SPRITE_SILVER, 2, 8, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, IlkBrothersTalkToRival, EVENT_RIVAL_ROUTE_69
	person_event SPRITE_BAGON, 1, 8, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, ObjectEvent, EVENT_RIVAL_ROUTE_69

