Route69IlkBrotherHouse_MapScriptHeader;trigger count
	db 2

	maptrigger .Trigger0
	maptrigger .Trigger1
 ;callback count
	db 0

.Trigger0
	priorityjump IlkBrothersInTrouble
	end

.Trigger1
	end

IlkBrothersInTrouble:
	playmusic MUSIC_RIVAL_ENCOUNTER
	applymovement 0, WalkToIlkBro
	showemote 0, 2, 15
	opentext
	writetext IlkBroNoticesYouText
	waitbutton
	closetext
	dotrigger 1
	setevent EVENT_ROUTE_69_ILK_BRO_TRAPPED
	end

IlkBrothersTalkToRival:
	opentext
	writetext IlkBroRivalTalkToPoke
	waitbutton
	closetext
	showemote 0, 3, 15
	faceplayer
	opentext
	writetext TextIlkBroRivalStartBattle
	waitbutton
	winlosstext IlkBroRivalWin, IlkBroRivalLose
	setlasttalked 255
	loadtrainer RIVAL1, RIVAL1_1
	writecode VAR_BATTLETYPE, BATTLETYPE_CANLOSE
	setlasttalked $3
	dontrestartmapmusic
	startbattle
	reloadmapafterbattle
	playmusic MUSIC_RIVAL_AFTER
	setevent EVENT_RIVAL_ROUTE_69
	disappear 4
	opentext
	writetext TextIlkBroRivalAfterBattle
	waitbutton
	closetext
	playmusic MUSIC_NONE
	playsound SFX_WARP_FROM
	applymovement 3, IlkBroRivalTeleport
	disappear 3
	waitsfx
	playmusic MUSIC_ROUTE_D

	spriteface 2, UP

	checkcode VAR_FACING
	sif =, RIGHT, then
		applymovement 0, WalkToIlkBroBackFacedRight
	selse
		applymovement 0, WalkToIlkBroBack
	sendif

	spriteface 2, RIGHT
	opentext
	writetext IlkBroTextAfter
	waitbutton
	special SpecialNameRival
	clearevent EVENT_ROUTE_69_ILK_BRO_TRAPPED
	jumptext IlkBroTextAfterNameRival

IlkBroRivalTeleport:
	teleport_from
	remove_person
	step_end

WalkToIlkBroBack:
	step_left
	step_left
	step_left
	step_down
	step_down
	step_down
	step_left
	step_end

WalkToIlkBroBackFacedRight:
	step_left
	step_left
	step_left
	step_down
	step_down
	step_down
	step_down
	turn_head_left
	step_end

WalkToIlkBro:
	step_up
	step_up
	step_up
	turn_head_left
	step_end

IlkBroWalkToRival:
	step_up
	step_up
	step_right
	step_right
	step_right
	step_right
	step_up
	step_end

Route69IlkBrotherHouseSignpost1:
	jumptext Route69IlkBrotherHouseSignpost1_Text_188d32

Route69IlkBrotherHouseSignpost2:
	jumptext Route69IlkBrotherHouseSignpost1_Text_188d32

Route69IlkBrotherHouseSignpost3:
	jumptext Route69IlkBrotherHouseSignpost3_Text_188d73

Route69IlkBrotherHouseSignpost4:
	jumptext Route69IlkBrotherHouseSignpost3_Text_188d73

Route69IlkBrotherHouseSignpost5:
	jumptext Route69IlkBrotherHouseSignpost5_Text_188d9b

Route69IlkBrotherHouseNPC1:
	checkevent EVENT_RIVAL_ROUTE_69
	sif true
		jumptextfaceplayer Route69IlkBrotherHouseNPC1_Text_After
	jumptextfaceplayer Route69IlkBrotherHouseNPC1_Text_Before

IlkBroTextAfter:
	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, $34

IlkBroTextAfterNameRival:
	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, $4c, $04, $16, $a3, $e7, $71, $23
	db $7d, $ed, $ea, $cf, $72, $0a

	db $94, $03, $13, $9a, $85, $23, $cc, $04, $16, $a5
	db $85, $e6, $52, $6c, $a9, $46, $84, $40, $92, $3e, $74

	db $a0, $0a, $4e, $dc, $ab, $51, $08, $36, $4e, $07
	db $07, $92, $37
	
	db $fc, $03, $80, $24, $a6, $4c, $02, $be, $4e, $e5
	db $85, $e5, $9d, $b4, $b2, $44, $8d
	db $0a, $b1, $f5, $60, $c3, $bd, $5f
	
	db $80, $31, $38, $b3, $de, $f4, $14, $e8, $41, $8d
	db $0f, $5a, $76, $e0, $39, $5f, $09
	db $3d, $4d


IlkBroRivalWin:
	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

IlkBroRivalLose:
	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

TextIlkBroRivalAfterBattle:
	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, $34

TextIlkBroRivalStartBattle:
	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, $68

IlkBroRivalTalkToPoke:
	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, $34

IlkBroNoticesYouText:
	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, $34

Route69IlkBrotherHouseSignpost1_Text_188d32:
	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

Route69IlkBrotherHouseSignpost3_Text_188d73:
	db TX_COMPRESSED, $12, $ee, $a7

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

Route69IlkBrotherHouseSignpost5_Text_188d9b:
	db TX_COMPRESSED, $75, $78, $a6, $92, $03, $c4, $d2, $9f, $f1
	db $a6, $80

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

Route69IlkBrotherHouseNPC1_Text_After:
	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, Route69IlkBrotherHouseSignpost1
	signpost 0, 0, SIGNPOST_READ, Route69IlkBrotherHouseSignpost2
	signpost 0, 1, SIGNPOST_READ, Route69IlkBrotherHouseSignpost3
	signpost 1, 1, SIGNPOST_READ, Route69IlkBrotherHouseSignpost4
	signpost 2, 9, SIGNPOST_READ, Route69IlkBrotherHouseSignpost5

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

