Route77_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

Route77_Item_1:
	db TWISTEDSPOON, 1

Route77_Item_2:
	db HYPER_POTION, 1

Route77HiddenItem:
	dw EVENT_ROUTE_77_HIDDENITEM_GOLD_TOKEN
	db GOLD_TOKEN

Route77PokecenterSign:
	jumpstd pokecentersign

Route77QRCode:
	opentext
	qrcode 4
	waitbutton
	checkitem QR_READER
	sif false, then
		closetext
		end
	sendif
	farwritetext UsingQRScannerText
	playwaitsfx SFX_CALL
	jumptext .text

.text
	db TX_COMPRESSED, $61, $07, $b9, $82, $ee, $79, $80, $63, $10, $b4, $83
	db $7a, $a3, $45, $c0, $e1, $18, $e8, $2a, $b5, $79
	db $54, $2b, $ab
	db $ba, $68

Route77Boulder:
	jumpstd strengthboulder

Route77FruitTree:
	fruittree 17

Route77Guard_AfterIlk:
	faceplayer
	checkevent EVENT_GOT_HM02
	sif false, then
		opentext
		writetext .give_HM_text
		givetm 98 + RECEIVED_TM
		setevent EVENT_GOT_HM02
	sendif
	jumptext .regular_text

.regular_text
	db TX_COMPRESSED, $76, $9f, $c4, $9f, $7a, $19, $bc, $e8, $c9

	db $c4, $03, $a8, $93, $d5, $e6, $18, $31, $ac, $15, $a4, $64
	db $e5, $ec, $16, $17, $e7, $0a, $c3, $87, $a3, $ae, $a9

	db $78, $03, $08, $21, $cc, $eb, $4c, $a9, $4b, $0c, $04, $16, $b8
	db $d3, $40

.give_HM_text
	db TX_COMPRESSED, $c7, $08, $54, $91, $3a, $35, $23, $80, $82, $d3, $01
	db $bd, $c8, $6e, $33, $d3, $d5, $e9, $19, $39, $61
	db $54, $23, $50, $8f

	db $00, $07, $9d, $3b, $72, $c6, $f9, $fe, $34, $83
	db $7a, $d2, $34, $46, $22, $b2, $c3, $39, $3b
	db $01, $61, $8d, $ba, $20, $d7, $1b, $47, $60
	db $9e, $c3, $51, $66, $be
	db $34, $f1, $00

Route77Guard_BeforeIlk:
	faceplayer
	checkflag ENGINE_ELECTRONBADGE
	sif false
		jumptext .no_badge_text
	checkevent EVENT_GOT_HM02
	sif false, then
		opentext
		writetext .no_clearance_text
		givetm 98 + RECEIVED_TM
		setevent EVENT_GOT_HM02
	sendif
	jumptext .after_HM_text

.no_clearance_text
	db TX_COMPRESSED, $75, $19, $d2, $53, $27, $4e, $e0, $20
	db $b4, $f0, $8d, $45, $ca, $87, $69, $0b, $57
	db $35, $50, $36, $f4, $79, $8c, $f4, $f5, $7a, $46, $4f

	db $c0, $1b, $9c, $43, $58, $60, $6b, $3c, $cd, $8a, $f7
	db $2f, $1e, $ae, $d2, $2c, $da, $d5, $23, $89, $35, $9f

	db $80, $3a, $c2, $04, $9d, $05, $2a, $38, $c8, $5a, $ee
	db $5e, $e4, $ee, $20, $2f, $9c, $3a, $74, $41, $ae
	db $d5, $58, $66, $a1, $03, $45, $c6, $91, $4f

	db $00, $0c, $71, $a9, $1c, $b4, $ed, $ce, $5a, $05, $4f
	db $03, $cd, $d3, $b7, $8a, $24, $e3, $3b, $de, $9e
	db $7e, $a8, $4d, $67, $bc, $2b, $0e, $1e, $8a, $07, $d5, $21, $35, $9e, $d2

	db $80, $a7

	db $80, $03, $74, $ed, $d2, $c7, $69, $fc, $49, $e2
	db $79, $9d, $ef, $4f, $33, $85, $61, $c3, $d1, $d7, $54, $a9

	db $40, $39, $42, $d4, $52, $20, $6a, $96, $9d
	db $b7, $99, $5e, $89, $b0, $50, $42, $c3, $81, $a1, $01, $5d

	db $28, $01, $5d, $04, $ac, $e2, $4e, $33, $a4, $89, $3e, $88
	db $78, $64, $96, $91, $a2, $20, $76, $d6, $d8, $c2, $4f

	db $00, $62, $71, $48, $81, $a9, $11, $f0, $ac
	db $de, $d5, $61, $6a, $e5, $a4, $68, $88, $b5, $e9, $39
	db $35, $4b, $3e, $46, $12, $4b, $4e, $92, $3a, $99, $0f

	db $80, $53

	db $c0, $00, $1c, $1a, $c1, $4a, $8f, $bd, $fc, $04, $16
	db $9e, $e4, $37, $01, $05, $a5, $a0, $fb, $84
	db $d5, $59, $3d, $ec, $49, $ac

	db $fc, $00, $a4, $8d, $11, $88, $ac, $a8, $7d, $ec, $49, $f4
	db $43, $c0, $82, $d4, $e4, $ee, $2b, $d6, $54, $a5
	db $85, $53, $6e, $88, $35, $c6, $d1, $d8, $29, $86, $a2, $cd, $7e
	db $a7, $88

.after_HM_text
	db TX_COMPRESSED, $62, $2a, $2c, $39, $b0, $68, $8a, $7d, $05

	db $e0, $0e, $50, $b4, $b8, $0e, $57, $c2, $49, $50, $fb
	db $d7, $95, $9c, $d5, $7d, $39, $61, $98, $74
	db $10, $00, $41, $6a, $58, $60, $df, $10, $15, $de, $92
	db $de, $11, $dd, $64, $d1, $01, $05, $a6, $03
	db $55, $bd, $59, $ee, $41, $40, $61, $a0, $76, $79

	db $e2, $00, $57, $54, $8e, $21, $a5, $9c, $b0, $cb, $de, $a9
	db $3d, $61, $9c, $2b, $0e, $1e, $8e, $ba, $a5, $34, $99
	db $00, $e9, $c3, $d9, $c9, $dc, $04, $16, $a6
	db $bc, $cf, $4f, $57, $a4, $64, $e5, $86, $08, $d4, $23
	db $d4, $d0

.no_badge_text
	db TX_COMPRESSED, $75, $2a, $d4, $41, $91, $16, $b6, $99, $b3
	db $cb, $d6, $19, $4e, $34, $8b, $9c, $b5, $ab, $cc, $b4, $8d
	db $0a, $95, $ac, $79, $e4, $e6, $01, $5c, $20, $6a

	db $f0, $01, $5d, $04, $ac, $ff, $07, $84, $04, $16, $a2, $77
	db $2f, $3e, $15, $9c, $57, $b9, $e4, $d1, $f8
	db $e8, $05, $41, $6b, $b9, $98, $19, $f6, $3e, $15
	db $9b, $cc, $85, $fc, $02, $bb, $d5, $7d, $39, $61
	db $55, $d3, $b8, $08, $2d, $4b, $4a, $c2, $d7, $29
	db $f5, $34

Route77_Trainer_1:
	trainer EVENT_ROUTE_77_TRAINER_1, FISHER, 2, .before_battle_text, .battle_won_text, $0000, .Script

.Script
	end_if_just_battled
	jumptext .after_battle_text

.before_battle_text
	db TX_COMPRESSED, $74, $c0, $71, $59, $99, $22, $cc, $fa, $32, $09, $ac
	db $f5, $eb, $49, $bf, $06, $49, $61, $ce, $82
	db $e3, $4d

.battle_won_text
	db TX_COMPRESSED, $50, $23, $a1, $0a, $13
	db $c6, $9a

.after_battle_text
	db TX_COMPRESSED, $28, $6f, $9c, $b0, $cd, $ce, $65
	db $85, $e7, $c1, $46, $43, $de, $9b, $36, $30, $93
	db $d4, $d0

Route77_Trainer_2:
	trainer EVENT_ROUTE_77_TRAINER_2, FISHER, 3, .before_battle_text, .battle_won_text, $0000, .Script

.Script
	end_if_just_battled
	jumptext .after_battle_text

.before_battle_text
	db TX_COMPRESSED, $15, $05, $19, $db, $65, $30, $68, $8c, $5c, $ec, $21, $77

	db $10, $02, $65, $a4, $5c, $c7, $76, $ec, $4c, $4d, $b8, $3b
	db $e3, $4d

.battle_won_text
	db TX_COMPRESSED, $73, $a6, $9e, $08, $dd, $3b, $74
	db $b4, $d0

.after_battle_text
	db TX_COMPRESSED, $07, $86, $e2, $b1, $f3, $0c, $81, $6b, $94, $d2
	db $d3, $40

Route77_Trainer_3:
	trainer EVENT_ROUTE_77_TRAINER_3, FISHER, 4, .before_battle_text, .battle_won_text, $0000, .Script

.Script
	end_if_just_battled
	jumptext .after_battle_text

.before_battle_text
	db TX_COMPRESSED, $6d, $d6, $b9, $4d, $cb, $a8
	db $2f, $2b, $1f, $30, $1c, $af, $84, $9c
	db $69, $a0

.battle_won_text
	text "OW!"
	done

.after_battle_text
	db TX_COMPRESSED, $53, $0a, $f9, $3b, $96, $bd, $19, $06, $4e
	db $7e, $f3, $a7, $0f, $65, $38, $d2, $2e, $33, $b6, $ca
	db $55, $22, $d6, $12, $73, $02, $43, $47
	db $1a, $68

Route77_Trainer_4:
	trainer EVENT_ROUTE_77_TRAINER_4, YOUNGSTER, 4, .before_battle_text, .battle_won_text, $0000, .Script

.Script
	end_if_just_battled
	jumptext .after_battle_text

.before_battle_text
	db TX_COMPRESSED, $75, $29, $c6, $91, $71, $3b, $99, $61
	db $79, $9d, $b6, $53, $2d, $26, $83, $a7
	db $82, $9a

.battle_won_text
	db TX_COMPRESSED, $73, $f2, $9f, $c2, $06, $61, $a3, $5f
	db $a9, $a0

.after_battle_text
	db TX_COMPRESSED, $75, $16, $7d, $3d, $41, $e6, $5a, $4d
	db $f7, $95, $eb, $2a, $50, $64, $96, $93, $95, $0f, $b9
	db $f5, $34

Route77_Trainer_5:
	trainer EVENT_ROUTE_77_TRAINER_5, CAMPER, 4, .before_battle_text, .battle_won_text, $0000, .Script

.Script
	end_if_just_battled
	jumptext .after_battle_text

.before_battle_text
	db TX_COMPRESSED, $6d, $d7, $c4, $0c, $9c, $c0, $b5, $68, $1e, $4f
	db $ef, $72, $1b, $bd, $9d, $08, $31, $c1, $df
	db $a9, $a0

.battle_won_text
	db TX_COMPRESSED, $6e, $7d, $ef, $e5, $49, $0c, $a8, $7d
	db $eb, $d5, $6a, $df, $8f, $9c, $68, $44, $20, $6a, $a5
	db $a6, $80

.after_battle_text
	db TX_COMPRESSED, $62, $fb, $f4, $f0, $47, $4e, $1e, $ce, $4e
	db $de, $64, $3d, $cc, $a8, $76, $98, $f8, $29, $56, $ad
	db $f5, $40, $e5, $7c, $24, $98, $68, $c9, $67, $9f

	db $00, $a7

	db $80, $03, $94, $2d, $17, $1c, $46, $82, $19, $39, $8e
	db $9e, $42, $42, $d7, $73, $12, $7b, $99, $80
	db $56, $ab, $60, $39, $5f, $09, $23, $69, $92, $cd, $74

	db $a0, $01, $e1, $84, $33, $cf, $e3, $a7, $0f, $62, $4f
	db $7a, $f5, $a4, $df, $84, $db, $69, $7b, $de, $82
	db $f5, $34

Route77_Trainer_6:
	trainer EVENT_ROUTE_77_TRAINER_6, PICNICKER, 4, .before_battle_text, .battle_won_text, $0000, .Script

.Script
	end_if_just_battled
	jumptext .after_battle_text

.before_battle_text
	db TX_COMPRESSED, $75, $29, $c6, $91, $71, $9d, $6b, $94
	db $db, $d6, $95, $99, $c0, $72, $be, $12, $71

	db $00, $0f, $0d, $5f, $96, $37, $ce, $58
	db $5e, $7f, $54, $8e, $5a, $4d, $f9, $80, $f9, $4d, $f1
	db $a6, $80

.battle_won_text
	db TX_COMPRESSED, $6e, $7d, $ef, $e5, $a7, $6e, $55, $a8
	db $9a, $f2, $b1, $dc, $c1, $a2, $7e, $6d, $ce, $9e, $a2
	db $fd, $4d

.after_battle_text
	db TX_COMPRESSED, $61, $34, $68, $44, $75, $10, $90, $b5, $dc
	db $bc, $9d, $06, $39, $6b, $d1, $90, $f3, $2d, $26
	db $fa, $ad, $8a, $c7, $71, $f0, $ac, $e6, $03, $5a, $2e, $9e
	db $0a, $68

Route77_MapEventHeader:: db 0, 0

.Warps: db 6
	warp_def 73, 10, 1, MILOS_F1
	warp_def 21, 13, 1, ROUTE_77_JEWELERS
	warp_def 51, 7, 3, ROUTE_77_DAYCARE_HOUSE
	warp_def 69, 5, 1, ROUTE_77_POKECENTER
	warp_def 73, 9, 1, MILOS_F1
	warp_def 5, 11, 3, TORENIA_GATE

.CoordEvents: db 0

.BGEvents: db 3
	signpost 9, 13, SIGNPOST_READ, Route77QRCode
	signpost 25, 4, SIGNPOST_ITEM, Route77HiddenItem
	signpost 69, 6, SIGNPOST_READ, Route77PokecenterSign

.ObjectEvents: db 13
	person_event SPRITE_FISHER, 30, 10, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_TRAINER, 1, Route77_Trainer_1, -1
	person_event SPRITE_FISHER, 37, 8, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_TRAINER, 3, Route77_Trainer_2, -1
	person_event SPRITE_FISHER, 44, 13, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_TRAINER, 3, Route77_Trainer_3, -1
	person_event SPRITE_YOUNGSTER, 63, 1, SPRITEMOVEDATA_SPINCLOCKWISE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_TRAINER, 3, Route77_Trainer_4, -1
	person_event SPRITE_YOUNGSTER, 23, 11, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_TRAINER, 4, Route77_Trainer_5, -1
	person_event SPRITE_PICNICKER, 57, 13, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_GREEN, PERSONTYPE_TRAINER, 5, Route77_Trainer_6, -1
	person_event SPRITE_BOULDER, 69, 9, SPRITEMOVEDATA_STRENGTH_BOULDER, 0, 0, -1, -1, PAL_OW_BROWN, PERSONTYPE_SCRIPT, 0, Route77Boulder, -1
	person_event SPRITE_OFFICER, 50, 17, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_GREEN, PERSONTYPE_SCRIPT, 3, Route77Guard_AfterIlk, -1
	person_event SPRITE_OFFICER, 40, 11, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_OW_GREEN, PERSONTYPE_SCRIPT, 0, Route77Guard_BeforeIlk, EVENT_ILK_EARTHQUAKE
	person_event SPRITE_POKE_BALL, 73, 1, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_YELLOW, PERSONTYPE_TMHMBALL, TM_CURSE, 0, EVENT_ROUTE_77_TM03
	person_event SPRITE_FRUIT_TREE, 15, 12, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, Route77FruitTree, -1
	person_event SPRITE_POKE_BALL, 13, 1, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 0, Route77_Item_1, EVENT_ROUTE_77_ITEM_1
	person_event SPRITE_POKE_BALL, 7, 5, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 0, Route77_Item_2, EVENT_ROUTE_77_ITEM_2

