JaeruGuardSupplier_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

JaeruGuardGoldTokenExchange:
	faceplayer
	opentext
	writetext JaeruGuardSupplier_Text_Introduction
	closetext
	loadmenudata GuardMenu
	verticalmenu
	closewindow
	addvar -1
	sif >, 5
		jumptext JaeruGuardSupplier_Text_SaidNo
	opentext
	loadarray .items, 1
	readarray 0
	itemtotext 0, 0
	writetext JaeruGuardSupplier_Text_ConfirmItem
	yesorno
	sif false
		jumptext JaeruGuardSupplier_Text_SaidNo
	sendif
	takeitem GOLD_TOKEN, 5
	sif false
		jumptext JaeruGuardSupplier_Text_NotEnoughTokens
	sendif
	writetext JaeruGuardSupplier_Text_Transaction
	waitbutton
	readarray 0
	verbosegiveitem ITEM_FROM_MEM, 1
	end
.items
	db POISON_GUARD
	db BURN_GUARD
	db FREEZE_GUARD
	db SLEEP_GUARD
	db PRZ_GUARD
	db CONFUSEGUARD

GuardMenu:
	db $40 ; flags
	db 00, 05 ; start coords
	db 15, 19 ; end coords
	dw GuardMenuOptions
	db 1 ; default option

GuardMenuOptions:
	db $80
	db $7
	db "Poison Guard@"
	db "Burn Guard@"
	db "Freeze Guard@"
	db "Sleep Guard@"
	db "Prz Guard@"
	db "ConfuseGuard@"
	db "Cancel@"

JaeruGuardNPC:
	jumptextfaceplayer JaeruGuardNPC_Text

JaeruGuardSupplier_Text_Introduction:
	db TX_COMPRESSED, $62, $7d, $e8, $78

	db $80, $75, $13, $a0, $c7, $2d, $26, $83, $8b, $d5
	db $9b, $c3, $b3, $7d, $12, $d3, $b7, $19, $d2

	db $00, $45, $84, $44, $04, $16, $97, $01, $ca, $f8
	db $48, $f6, $0b, $0b, $f1, $59, $8c, $9c, $cd, $c3, $03, $64

	db $0a, $ab, $3c, $c5, $60, $a3, $26, $bb, $d1
	db $91, $52, $2f, $6d, $a4, $46, $42, $4c, $8e, $c6, $12, $23

	db $88, $07, $4e, $1e, $ce, $9d, $c0, $41, $6a, $27, $41
	db $8d, $ed, $20, $28, $1c, $25, $a4, $d0, $73, $00

	db $ac, $06, $03, $06, $38, $c2, $0f, $73, $0a, $0a, $91, $91
	db $0f, $1e, $b2, $9e

	db $20, $1b, $a4, $6c, $a6, $04, $87, $2a, $0b, $5d
	db $cb, $c0, $82, $d4, $e8, $d4, $8e
	db $94, $1c, $c0

JaeruGuardNPC_Text:
	db TX_COMPRESSED, $15, $05, $33, $b9, $8a, $cd, $9d, $7c, $e6
	db $bc, $c2, $0f, $73, $0a, $0a, $91
	db $91, $53, $21, $ef, $4d, $9b, $0a

	db $fc, $00, $a4, $98, $28, $fe, $e4, $e6, $cc, $06, $41, $d9
	db $bd, $af, $85, $a2, $5c, $0e, $12, $d2, $6f, $fe, $20

	db $20, $2d, $26, $08, $b8, $e0, $c8, $ca, $cf, $23, $57, $d0
	db $4f, $20, $2d, $72, $9b, $81, $6a, $e2, $b0

	db $40, $19, $0f, $7a, $6c, $d8, $56, $89, $82, $c2
	db $fb, $da, $b0, $b4, $4c, $cb, $49, $ca, $82, $be, $e7
	db $d4, $d0

JaeruGuardSupplier_Text_ConfirmItem:
	db TX_COMPRESSED, $50, $1f, $c0, $41, $6a, $55, $a4, $b9, $69
	db $37, $a9, $e5

	db $4a, $00, $a4, $ed, $ca, $87, $de, $c5, $67, $30, $18, $31
	db $bc, $c2, $0f, $73, $0a, $0a, $91, $91, $1e
	db $a6, $80

JaeruGuardSupplier_Text_NotEnoughTokens:
	db TX_COMPRESSED, $12, $6a, $e0, $20, $b5, $32, $12, $53, $22, $74, $18
	db $de, $32, $05, $ae, $53, $18, $41, $ee
	db $55, $14, $15, $23, $22, $38
	db $d3, $40

JaeruGuardSupplier_Text_Transaction:
	db TX_COMPRESSED, $29, $3a, $45, $28, $08, $2d, $71
	db $a6, $80

JaeruGuardSupplier_Text_SaidNo:
	db TX_COMPRESSED, $6d, $0b, $e7, $15, $eb, $2a, $50, $78, $40, $41
	db $69, $e6, $53, $a4, $e4, $e0, $20, $b4, $b8, $f8, $c9, $9e
	db $34, $d0

JaeruGuardSupplier_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def $7, $2, 6, JAERU_CITY
	warp_def $7, $3, 6, JAERU_CITY

	;xy triggers
	db 0

	;signposts
	db 0

	;people-events
	db 2
	person_event SPRITE_GRAMPS, 4, 5, SPRITEMOVEDATA_00, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, JaeruGuardGoldTokenExchange, -1
	person_event SPRITE_SUPER_NERD, 3, 2, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_BROWN, PERSONTYPE_SCRIPT, 0, JaeruGuardNPC, -1

