RuinsF5_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

RuinsF5GrappleHookSpot:
	opentext
	checkitem GRAPPLE_HOOK
	sif false
		jumptext RuinsF5_GrappleHookSpot_Text_NoGrappleHook
	writetext RuinsF5GrappleHookSpot_Text_WantToUseIt
	yesorno
	sif true, then
		playwaitsfx SFX_VICEGRIP
		warp RUINS_ROOF, 6, 7
	sendif
	closetext
	end

RuinsF5Chest:
	opentext
	checkevent EVENT_RUINS_OPENED_CHEST
	sif true
		jumptext RuinsF5_Chest_Text_Empty
	checkitem RED_JEWEL
	sif false
		jumptext RuinsF5_Chest_Text_Locked
	checkitem BLUE_JEWEL
	sif false
		jumptext RuinsF5_Chest_Text_Locked
	checkitem BROWN_JEWEL
	sif false
		jumptext RuinsF5_Chest_Text_Locked
	checkitem WHITE_JEWEL
	sif false
		jumptext RuinsF5_Chest_Text_Locked
	writetext RuinsF5Chest_Text_24efa2
	playwaitsfx SFX_WALL_OPEN
	writetext RuinsF5Chest_Text_Inside
	waitbutton
	takeitem RED_JEWEL, 1
	takeitem BLUE_JEWEL, 1
	takeitem BROWN_JEWEL, 1
	takeitem WHITE_JEWEL, 1
	setevent EVENT_RUINS_OPENED_CHEST
	verbosegiveitem PRISM_JEWEL
	waitbutton
	closetext
	end

RuinsF5_Item_1:
	db WHITE_JEWEL, 1

RuinsF5_PatrollerGreen:
	trainer EVENT_RUINS_F5_TRAINER_1, PATROLLER, 14, RuinsF5_PatrollerGreen_Text_BeforeBattle, RuinsF5_PatrollerGreen_Text_BattleWon, $0000, .Script
.Script
	jumptext RuinsF5_PatrollerGreen_Text_AfterBattle

RuinsF5GrappleHookSpot_Text_WantToUseIt:
	db TX_COMPRESSED, $72, $85, $a8, $9d, $06, $39
	db $af, $30, $97, $a2, $04, $74, $e3, $10, $85, $4b

	db $c0, $1b, $e9, $2e, $58, $63, $48, $38, $3b, $96
	db $17, $b9, $3b, $96, $19, $69, $39, $61, $11
	db $4b, $4d

RuinsF5Chest_Text_24efa2:
	db TX_COMPRESSED, $e1, $ee, $b2, $79, $9b, $de, $cc, $02, $d2
	db $de, $a7, $0e, $a3, $ea, $20, $c8, $81, $e4, $e0, $70
	db $55, $69, $39, $82, $c2, $4b, $89, $0f, $4d, $1e

	db $00, $52, $4c, $14, $de, $f6, $60, $3b
	db $78, $41, $af, $03, $66, $fa, $0b

	db $88, $02, $92, $71, $94, $9a, $2e, $55, $a8
	db $79, $a2, $74, $2c, $a9, $1e, $78
	db $d3, $40

RuinsF5Chest_Text_Inside:
	db TX_COMPRESSED, $74, $44, $0f, $27, $06, $8a, $78

	db $00, $14, $93, $9c, $2b, $1a, $1f, $82, $64, $ea, $3e, $f1
	db $a6, $80

RuinsF5_PatrollerGreen_Text_BeforeBattle:
	db TX_COMPRESSED, $6d, $0b, $5d, $cc, $04, $16, $a5, $38, $d2
	db $2d, $e4, $58, $44, $4d, $ea, $cf, $72, $0a

	db $94, $03, $73, $2e, $39, $d0, $85, $48, $64, $e6, $60, $15
	db $bd, $69, $38, $84, $ea, $f2, $88, $1c, $25, $a4
	db $d5, $14, $d2, $ef, $a7, $18, $4d, $6a, $f2, $3d, $27

	db $80, $37, $37, $0f, $62, $b3, $95, $1e, $f6, $d2
	db $09, $e1, $e1, $2a, $39, $80, $c9, $99, $a4
	db $ca, $ac, $9f, $46, $0c, $6b, $96, $93, $7e, $58
	db $55, $5a, $42, $83, $88, $64, $66, $4b, $1a, $2d, $1c

	db $40, $37, $36, $03, $81, $27, $41, $4c, $02, $d1
	db $32, $f2, $02, $f9, $ca, $82, $bb, $4f, $4d, $08
	db $55, $4e, $1d, $47, $d4, $44, $06, $61, $ab

	db $f0, $01, $26, $ae, $02, $0b, $45, $c7, $08, $1b
	db $7b, $93, $bb, $19, $39, $96, $91, $a2, $04, $87
	db $ea, $68

RuinsF5_PatrollerGreen_Text_BattleWon:
	db TX_COMPRESSED, $6e, $7d, $ef, $e0, $48, $71, $fd, $26
	db $27, $ad, $7a, $84, $c1, $a2, $69, $03, $69, $35
	db $aa, $7f, $49, $8a, $64, $fa, $d2, $06, $12
	db $7a, $9a

RuinsF5_PatrollerGreen_Text_AfterBattle:
	db TX_COMPRESSED, $c7, $08, $54, $bf, $1d, $42, $19, $e6, $58
	db $5e, $e4, $ee, $08, $d1, $e7, $f0, $10, $9a, $cf, $54, $88, $1a

	db $bc, $00, $5c, $0c, $6b, $04, $12, $1c, $21, $9e, $51, $2c
	db $2f, $3f, $aa, $47, $36, $74, $60, $c3, $27, $34, $f0
	db $2a, $40, $5f, $34, $86, $af
	db $53, $40

RuinsF5_GrappleHookSpot_Text_NoGrappleHook:
	db TX_COMPRESSED, $29, $26, $b3, $c5, $36, $24, $3d, $38, $32
	db $3d, $69, $38, $c9, $8f, $a3, $27, $3e

	db $00, $ea, $e5, $41, $6b, $b9, $8a, $ce, $0b, $36, $87
	db $66, $f5, $a4, $e0, $30, $ce, $a8, $3c, $20, $20
	db $b4, $a9, $90, $b5, $dc, $c4, $05, $f3, $48, $6a
	db $55, $c9, $dc, $68, $44, $b4, $9a, $cf
	db $8d, $34

RuinsF5_Chest_Text_Empty:
	db TX_COMPRESSED, $75, $78, $a1, $be, $22, $c1

	db $78, $00, $3c, $31, $48, $79, $c8, $c9, $cf
	db $de, $58, $f9, $4d, $d2
	db $d3, $40

RuinsF5_Chest_Text_Locked:
	db TX_COMPRESSED, $29, $27, $19, $49, $a2, $e0
	db $d0, $f7, $42, $ca, $91, $e7

	db $c0, $1d, $5c, $e8, $42, $a4, $89, $d1, $a9
	db $1b, $d8, $05, $a5, $c1, $d9, $be, $88, $ce
	db $91, $56, $03, $b8, $32, $4c, $16, $12, $5f

	db $80, $36, $85, $ae, $e6, $5a, $46, $88, $ac, $e5, $a4
	db $de, $ab, $41, $4b, $0c, $68, $9d, $0b, $2a
	db $4a, $ad, $23, $44, $b4, $8c, $9c, $d2
	db $d3, $40

RuinsF5_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def $7, $9, 2, RUINS_F4
	warp_def $6, $2, 1, CAPER_CITY

	;xy triggers
	db 0

	;signposts
	db 3
	signpost 6, 2, SIGNPOST_READ, RuinsF5GrappleHookSpot
	signpost 4, 5, SIGNPOST_UP, RuinsF5Chest
	signpost 4, 6, SIGNPOST_UP, RuinsF5Chest

	;people-events
	db 2
	person_event SPRITE_POKE_BALL, 2, 9, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_PURPLE, PERSONTYPE_ITEMBALL, 0, RuinsF5_Item_1, EVENT_RUINS_F5_ITEM_1
	person_event SPRITE_PALETTE_PATROLLER, 4, 8, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_OW_GREEN, PERSONTYPE_TRAINER, 1, RuinsF5_PatrollerGreen, EVENT_RUINS_F5_TRAINER_1

