MilosGreenOrb_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

MilosGreenOrbNPC1:
	faceplayer
	checkevent EVENT_MILOS_RAYQUAZA
	iftrue .alreadyFaught
	opentext
	checkitem GREEN_ORB
	iftrue MilosGreenOrb_2f6d5c
	jumptext MilosGreenOrbNPC1_Text_2f6da9

.alreadyFaught
	jumptext MilosGreenOrbNPC1Faught

MilosGreenOrb_2f6d5c:
	takeitem GREEN_ORB
	writetext MilosGreenOrb_2f6d5c_Text_2f6e91
	waitbutton
	special Special_BattleTowerFade
	playsound SFX_ENTER_DOOR
	waitsfx
	warpfacing UP, MILOS_RAYQUAZA, 4, 7
	opentext
	writetext MilosGreenOrb_2f6d5c_Text_2f6ead
	waitbutton
	setevent EVENT_MILOS_RAYQUAZA
	cry RAYQUAZA
	waitsfx
	writetext MilosGreenOrb_2f6d5c_Text_2f6ed6
	waitbutton
	cry RAYQUAZA
	waitsfx
	applymovement 3, RayquazaMovement
	writecode VAR_BATTLETYPE, BATTLETYPE_NORMAL
	loadwildmon RAYQUAZA, 50
	startbattle
	reloadmapafterbattle
	special Special_BattleTowerFade
	playsound SFX_ENTER_DOOR
	waitsfx
	warpfacing UP, MILOS_GREEN_ORB, 4, 3
	end

RayquazaMovement:
	step_down
	step_down
	step_down
	step_down
	step_end

MilosGreenOrbNPC1_Text_2f6da9:
	db TX_COMPRESSED, $29, $26, $b3, $c5, $36, $03, $95, $f0
	db $91, $eb, $4e, $dc, $64, $f5, $07, $99, $69
	db $30, $15, $6a, $e2, $b3, $ba, $8c, $c9, $18, $4b, $0b, $59
	db $02, $f0, $49, $34, $99, $82, $60, $10, $79, $59

	db $f8, $01, $49, $1a, $22, $14, $81, $4e, $43, $98, $40
	db $d4, $f2, $cd, $03, $c9, $a2, $04, $92, $d2, $34
	db $2a, $b0, $d4, $6b

	db $f0, $07, $57, $06, $88, $0c, $6b
	db $04, $f6, $f3, $ca, $cd, $08, $18, $31, $cd, $26
	db $40, $5a, $4e, $04, $9d, $05, $2a, $d0, $53, $00
	db $ad, $e1, $dc, $b0, $cd, $e5, $66, $72, $c3
	db $34, $02, $bd, $bb, $e9, $c1, $a2, $5a
	db $4d, $e0, $90, $e5, $49, $0c, $48, $7b, $94
	db $2a, $b4, $9c, $61, $2c, $cc, $91, $da, $d5
	db $fa, $9a

MilosGreenOrb_2f6d5c_Text_2f6e91:
	db TX_COMPRESSED, $61, $04, $39, $fc, $11, $d3, $d4, $1c, $64, $2f
	db $9b, $d5, $0e, $d3, $1f, $3f
	db $53, $40

MilosGreenOrb_2f6d5c_Text_2f6ead:
	db TX_COMPRESSED, $15, $d4, $59, $af, $f3, $63, $29, $1f
	db $72, $f2, $75, $11, $66, $2c, $da, $34, $59, $e6
	db $6a, $a5, $7b, $77, $d3
	db $f5, $34

MilosGreenOrb_2f6d5c_Text_2f6ed6:
	db TX_COMPRESSED, $29, $27, $19, $48, $fb, $98, $9d
	db $43, $db, $d4, $06, $3e, $77, $2d
	db $26, $a9, $66, $2c, $da, $1a, $cd, $f3, $25, $a3
	db $d4, $d0

MilosGreenOrbNPC1Faught:
	db TX_COMPRESSED, $29, $27, $19, $4e, $f7, $a6, $4e, $4e, $27
	db $50, $f1, $93, $27, $9f
	db $53, $40

MilosGreenOrb_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def $f, $4, 1, MILOS_TOWERCLIMB
	warp_def $f, $5, 1, MILOS_TOWERCLIMB

	;xy triggers
	db 0

	;signposts
	db 0

	;people-events
	db 1
	person_event SPRITE_SAGE, 2, 4, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_RED, 0, 0, MilosGreenOrbNPC1, EVENT_MILOS_GREEN_ORB_NPC_1

