MilosB2Fb_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 1
	dbw MAPCALLBACK_TILES, SetBlocksB2fb

SetBlocksB2fb:
	checkevent EVENT_0
	sif true
		scall MilosB2Fb_RedOff
	checkevent EVENT_1
	sif true
		scall MilosB2Fb_YellowOff
	checkevent EVENT_2
	sif true
		scall MilosB2Fb_GreenOff
	checkevent EVENT_3
	sif true
		scall MilosB2Fb_BrownOff
	return

MilosB2Fb_RedOn:
	changeblock $c, $6, $6a
	changeblock $8, $a, $6a
	changeblock $0, $12, $6a
	changeblock $12, $16, $6a
	changeblock $8, $1e, $6a
	changeblock $c, $8, $67
	changeblock $c, $a, $68
	changeblock $4, $10, $67
	changeblock $4, $12, $68
	changeblock $12, $18, $67
	changeblock $12, $1a, $68
	changeblock $4, $6, $83
	changeblock $18, $16, $83
	changeblock $c, $1e, $83
	end

MilosB2Fb_RedOff:
	changeblock $c, $6, $6b
	changeblock $8, $a, $6b
	changeblock $0, $12, $6b
	changeblock $12, $16, $6b
	changeblock $8, $1e, $6b
	changeblock $c, $8, $52
	changeblock $c, $a, $51
	changeblock $4, $10, $52
	changeblock $4, $12, $51
	changeblock $12, $18, $52
	changeblock $12, $1a, $51
	changeblock $4, $6, $50
	changeblock $18, $16, $50
	changeblock $c, $1e, $50
	end

MilosB2Fb_YellowOn:
	changeblock $4, $16, $76
	changeblock $c, $14, $7d
	changeblock $c, $16, $7e
	changeblock $2, $1a, $7d
	changeblock $2, $1c, $7e
	end

MilosB2Fb_YellowOff:
	changeblock $4, $16, $77
	changeblock $c, $14, $52
	changeblock $c, $16, $51
	changeblock $2, $1a, $52
	changeblock $2, $1c, $51
	end

MilosB2Fb_GreenOn:
	changeblock $c, $12, $7b
	changeblock $6, $1a, $4c
	changeblock $30, $18, $30
	end

MilosB2Fb_GreenOff:
	changeblock $c, $12, $36
	changeblock $6, $1a, $50
	changeblock $30, $18, $52
	changeblock $30, $1a, $51
	end

MilosB2Fb_BrownOn:
	changeblock $10, $16, $33
	changeblock $12, $1e, $33
	changeblock $12, $22, $4d
	changeblock $a, $12, $4d
	changeblock $8, $18, $49
	changeblock $8, $1a, $48
	end

MilosB2Fb_BrownOff:
	changeblock $10, $16, $32
	changeblock $12, $1e, $32
	changeblock $12, $22, $82
	changeblock $a, $12, $82
	changeblock $8, $18, $52
	changeblock $8, $1a, $51
	end

MilosB2FbRedSwitch:
	opentext
	farwritetext MilosB2F_Text_PulledSwitch
	playwaitsfx SFX_STOP_SLOT
	toggle EVENT_0, MilosB2Fb_RedOff, MilosB2Fb_RedOn
	reloadmappart
	closetextend

MilosB2FbYellowSwitch:
	opentext
	farwritetext MilosB2F_Text_PulledSwitch
	playwaitsfx SFX_STOP_SLOT
	toggle EVENT_1, MilosB2Fb_YellowOff, MilosB2Fb_YellowOn
	reloadmappart
	closetextend

MilosB2FbGreenSwitch:
	opentext
	farwritetext MilosB2F_Text_PulledSwitch
	playwaitsfx SFX_STOP_SLOT
	toggle EVENT_2, MilosB2Fb_GreenOff, MilosB2Fb_GreenOn
	reloadmappart
	closetextend

MilosB2FbBrownSwitch:
	opentext
	farwritetext MilosB2F_Text_PulledSwitch
	playwaitsfx SFX_STOP_SLOT
	toggle EVENT_3, MilosB2Fb_BrownOff, MilosB2Fb_BrownOn
	reloadmappart
	closetextend

MilosB2FbLatinSign1:
	jumptext .text

.text
	text "INVICTVS MANEO"
	done

MilosB2FbLatinSign2:
	jumptext .text

.text
	text "NON PROGREDI EST"
	line "REGREDI"
	done

MilosB2FbLatinSign3:
	jumptext .text

.text
	text "SEMPER FORTIS"
	done

MilosB2FbLatinSign4:
	jumptext .text

.text
	text "HONOR VIRTVTIS"
	line "PRAEMIVM"
	done

MilosB2FbJumpingShoes:
	opentext
	writetext .found_item_text
	playwaitsfx SFX_DEX_FANFARE_80_109
	disappear 2
	writetext .description_text
	setevent EVENT_JUMPING_SHOES
	playsound SFX_STRENGTH
	toggle EVENT_0, MilosB2Fb_RedOff, MilosB2Fb_RedOn
	toggle EVENT_1, MilosB2Fb_YellowOff, MilosB2Fb_YellowOn
	toggle EVENT_2, MilosB2Fb_GreenOff, MilosB2Fb_GreenOn
	toggle EVENT_3, MilosB2Fb_BrownOff, MilosB2Fb_BrownOn
	reloadmappart
	earthquake 20
	jumptext .all_switches_flipped_text

.found_item_text
	db TX_COMPRESSED, $72, $85, $a9, $80, $5a, $26, $65, $a4
	db $de, $13, $2d, $3e, $20, $64, $e6, $28, $48, $4d, $1c
	db $69, $a0

.description_text
	db TX_COMPRESSED, $6e, $93, $24, $04, $16, $a2, $cf, $59, $4c
	db $d7, $90, $fe, $f7, $b3, $9d, $11, $f8, $21, $66, $84
	db $00, $ae, $58, $65, $38, $d3, $e2, $20, $41, $8d
	db $6f, $0e, $f8
	db $d3, $c4

.all_switches_flipped_text
	db TX_COMPRESSED, $73, $a6, $05, $3c

	db $40, $70, $8d, $95, $21, $93, $98, $d0, $89, $69
	db $37, $90, $90, $9a, $22, $cc, $18, $d6, $83
	db $c8, $0d, $ef, $60, $70, $96, $93
	db $79, $15, $0e, $d9, $49, $a3
	db $8d, $34

MilosB2Fb_GreenPatroller:
	trainer EVENT_MILOS_B2FB_TRAINER_1, PATROLLER, 13, .before_battle_text, .battle_won_text

	db TX_COMPRESSED, $6d, $6a, $e5, $a4, $e0, $44, $58, $df, $1a, $1f, $2f
	db $78, $10, $5a, $84, $33, $cc, $d8, $b3, $de
	db $aa, $59, $ef, $47, $60, $a3, $29, $36, $54

	db $bc, $00, $4c, $b4, $8b, $95, $24, $33, $56, $70, $10, $5a
	db $7a, $a1, $da, $42, $d5, $c0, $41, $69, $73, $27, $ab
	db $54, $0e, $57, $c2, $4f, $c4, $b4, $9a
	db $5a, $68

.before_battle_text
	db TX_COMPRESSED, $76, $9f, $c1, $de, $28, $08, $2d, $4d, $e7, $46, $4f

	db $00, $75, $11, $b5, $4b, $48, $d1, $19, $0b, $e3, $27, $3e

	db $00, $dc, $e6, $f7, $b3, $23, $cf

	db $80, $3a, $c2, $02, $0b, $52, $d2, $32, $29, $4c, $02
	db $b7, $b6, $20, $d9, $09, $33, $01, $05, $a2, $e3
	db $55, $c9, $dd, $8c, $9c, $c1, $1a, $8b, $8f, $9f

	db $c0, $5a, $4c, $90, $10, $5a, $70, $f6, $2b
	db $37, $91, $b9, $e8, $28, $f8, $d1, $7a, $a4, $64
	db $f5, $34

.battle_won_text
	db TX_COMPRESSED, $29, $3b, $78, $a0, $8d, $b4, $9d, $8d, $9f

	db $00, $72, $85, $a2, $e3, $82, $36, $d2, $76, $36
	db $7d, $4d

MilosB2Fb_BlackPatroller:
	trainer EVENT_MILOS_B2FB_TRAINER_2, PATROLLER, 2, .before_battle_text, .battle_won_text

	db TX_COMPRESSED, $74, $59, $06, $4b, $58, $f9, $68, $64, $e7, $f1, $5b
	db $56, $f1, $02, $ac, $39, $05, $2a, $d2, $5a, $25
	db $85, $53, $44, $c9, $ad, $17, $a4, $cc, $7c, $e9, $e0
	db $a6, $80

.before_battle_text
	db TX_COMPRESSED, $6d, $d2, $40, $41, $6a, $08, $d0, $51, $01, $7c
	db $de, $db, $b3, $25, $8c, $24, $96, $18, $f9
	db $80, $a9, $23, $e9, $c7, $50, $42, $ce, $cc, $99
	db $7a, $d3, $b7, $1d, $4c, $84, $94, $c8, $ce, $ac, $e9
	db $69, $a0

.battle_won_text
	db TX_COMPRESSED, $72, $1e, $f6, $5e, $f5, $4b, $f2, $d3, $b7
	db $89, $e5, $21, $93, $3b, $1a, $26, $1a, $35, $d3
	db $c1, $4d

MilosB2Fb_MapEventHeader:: db 0, 0

.Warps: db 2
	warp_def 3, 19, 4, MILOS_B1F
	warp_def 3, 27, 4, MILOS_F1

.CoordEvents: db 0

.BGEvents: db 17
	signpost 6, 12, SIGNPOST_LEFT, MilosB2FbRedSwitch
	signpost 10, 8, SIGNPOST_LEFT, MilosB2FbRedSwitch
	signpost 22, 18, SIGNPOST_LEFT, MilosB2FbRedSwitch
	signpost 30, 8, SIGNPOST_LEFT, MilosB2FbRedSwitch
	signpost 18, 0, SIGNPOST_LEFT, MilosB2FbRedSwitch
	signpost 22, 4, SIGNPOST_LEFT, MilosB2FbYellowSwitch
	signpost 18, 13, SIGNPOST_RIGHT, MilosB2FbGreenSwitch
	signpost 22, 17, SIGNPOST_RIGHT, MilosB2FbBrownSwitch
	signpost 30, 19, SIGNPOST_RIGHT, MilosB2FbBrownSwitch
	signpost 5, 7, SIGNPOST_UP, MilosB2FbLatinSign1
	signpost 6, 7, SIGNPOST_READ, MilosB2FbLatinSign1
	signpost 21, 9, SIGNPOST_UP, MilosB2FbLatinSign2
	signpost 22, 9, SIGNPOST_READ, MilosB2FbLatinSign2
	signpost 34, 15, SIGNPOST_READ, MilosB2FbLatinSign3
	signpost 33, 15, SIGNPOST_UP, MilosB2FbLatinSign3
	signpost 26, 43, SIGNPOST_READ, MilosB2FbLatinSign4
	signpost 25, 43, SIGNPOST_UP, MilosB2FbLatinSign4

.ObjectEvents: db 5
	person_event SPRITE_POKE_BALL, 30, 20, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_PURPLE, PERSONTYPE_SCRIPT, 4, MilosB2FbJumpingShoes, EVENT_JUMPING_SHOES
	person_event SPRITE_POKE_BALL, 40, 54, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 1, SACRED_ASH, EVENT_MILOS_B2FB_ITEM_SACRED_ASH
	person_event SPRITE_POKE_BALL, 26, 48, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_ITEMBALL, 1, DAWN_STONE, EVENT_MILOS_B2FB_ITEM_DAWN_STONE
	person_event SPRITE_PALETTE_PATROLLER, 6, 31, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_GREEN, PERSONTYPE_GENERICTRAINER, 1, MilosB2Fb_GreenPatroller, EVENT_MILOS_B2FB_TRAINER_1
	person_event SPRITE_PALETTE_PATROLLER, 14, 0, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_OW_SILVER, PERSONTYPE_GENERICTRAINER, 1, MilosB2Fb_BlackPatroller, EVENT_MILOS_B2FB_TRAINER_2

