PhaceliaTM20_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

PhaceliaTM20NPC:
	faceplayer
	opentext
	checkevent EVENT_GET_TM20
	sif true
		jumptext .already_gave_TM_text
	writetext .before_giving_TM_text
	givetm TM_ENDURE + RECEIVED_TM
	setevent EVENT_GET_TM20
	closetextend

.before_giving_TM_text
	db TX_COMPRESSED, $ac, $99, $59, $e2, $96, $16, $b9, $4f
	db $de, $58, $f9, $4d, $d2

	db $80, $29, $23, $44, $7c, $20, $c7, $2a, $1f
	db $7a, $f2, $4f, $a2, $20, $20, $b4, $b8, $0e, $57, $c2
	db $40, $06, $4c, $b4, $b3, $86, $0c, $64, $89, $1a
	db $1e, $b0, $b5, $ca, $4d, $17, $1f, $08, $31, $a3
	db $d4, $f1, $00

.already_gave_TM_text
	db TX_COMPRESSED, $28, $55, $cd, $16, $20, $d1, $05, $c4, $cb, $4b, $3e

	db $20, $1b, $a4, $c9, $01, $05, $a5, $c0, $72, $be, $12
	db $3c, $d2, $0d, $12, $d2, $34, $47, $c2, $0c, $7f, $83
	db $b0, $15, $04, $94, $c9, $c9, $dc, $52, $20, $59, $52, $3c
	db $bc, $16, $ae, $2b, $05, $01, $05, $a5, $cc, $02, $78
	db $95, $10, $e9, $db, $8f, $84, $18
	db $fd, $4d

PhaceliaTM20_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def $7, $2, 8, PHACELIA_TOWN
	warp_def $7, $3, 8, PHACELIA_TOWN

	;xy triggers
	db 0

	;signposts
	db 0

	;people-events
	db 1
	person_event SPRITE_COOLTRAINER_M, 4, 5, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, PhaceliaTM20NPC, -1

