SpurgeMart_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

SpurgeMartSignpost1:
SpurgeMartSignpost2:
	opentext
	special Special_SpurgeMartBank
	endtext

SpurgeMartNPC1:
	faceplayer
	opentext
	pokemart 0, 2
	closetext
	end

SpurgeMartNPC2:
	faceplayer
	opentext
	pokemart 0, 3
	closetext
	end

SpurgeMartNPC3:
	faceplayer
	opentext
	pokemart 0, 4
	closetext
	end

SpurgeMartNPC4:
	faceplayer
	opentext
	pokemart 0, 4
	closetext
	end

SpurgeMartNPC5:
	jumptextfaceplayer SpurgeMartNPC5_Text_1779ed

SpurgeMartNPC6:
	faceplayer
	opentext
	writetext SpurgeMartNPC6_Text_177d90
	loadmenudata SpurgeGoldTokenMenuHeader
	verticalmenu
	closewindow
	anonjumptable
	dw .quit
	dw SpurgeMart_177c90
	dw SpurgeMart_177cb8
	dw SpurgeMart_177cd8
	dw .quit

.quit
	jumptext SpurgeMart_177c3c_Text_177eba

SpurgeGoldTokenMenuHeader:
	db $40 ; flags
	db 02, 00 ; start coords
	db 11, 19 ; end coords
	dw .GoldTokenMenu
	db 1 ; default option

.GoldTokenMenu:
	db $80 ; flags
	db 4 ; items
	db "Megaphone    (2)@"
	db "Protein      (2)@"
	db "ConfuseGuard (3)@"
	db "Cancel@"

SpurgeMartNPC7:
	opentext
	pokemart 0, 5
	closetext
	end

SpurgeMartNPC8:
	jumptextfaceplayer SpurgeMartNPC8_Text_1778fd

SpurgeMartNPC9:
	jumptextfaceplayer SpurgeMartNPC9_Text_17793f

SpurgeMartNPC10:
	jumptextfaceplayer SpurgeMartNPC10_Text_177885

SpurgeMartNPC11:
	jumptextfaceplayer SpurgeMartNPC11_Text_177ab3

SpurgeMartNPC12:
	jumptextfaceplayer SpurgeMartNPC12_Text_1778bb

SpurgeMartNPC13:
	jumptextfaceplayer SpurgeMartNPC13_Text_1777d0

SpurgeMartNPC14:
	jumptextfaceplayer SpurgeMartNPC14_Text_177a90

SpurgeMart_177c90:
	opentext
	writetext SpurgeMart_177c90_Text_177dea
	yesorno
	iffalse SpurgeMart_177c9e
	jump SpurgeMart_177ca3

SpurgeMart_177cb8:
	opentext
	writetext SpurgeMart_177c90_Text_177dea
	yesorno
	iffalse SpurgeMart_177c9e
	jump SpurgeMart_177cc6

SpurgeMart_177cd8:
	opentext
	writetext SpurgeMart_177cd8_Text_177e58
	yesorno
	iftrue SpurgeMart_177ce6

SpurgeMart_177c9e:
	jumptext SpurgeMart_177c3c_Text_177eba

SpurgeMart_177ca3:
	takeitem GOLD_TOKEN, 2
	iffalse SpurgeMart_177cb2
	verbosegiveitem MEGAPHONE, 1
	jumptext SpurgeMart_177ca3_Text_177e0a

SpurgeMart_177cc6:
	takeitem GOLD_TOKEN, 2
	iffalse SpurgeMart_177cb2
	verbosegiveitem PROTEIN, 1
	jumptext SpurgeMart_177ca3_Text_177e0a

SpurgeMart_177ce6:
	takeitem GOLD_TOKEN, 3
	iffalse SpurgeMart_177cb2
	givetm TM_SWAGGER + RECEIVED_TM
	jumptext SpurgeMart_177ca3_Text_177e0a

SpurgeMart_177cb2:
	jumptext SpurgeMart_177cb2_Text_177e22

SpurgeMartNPC5_Text_1779ed:
	db TX_COMPRESSED, $6d, $0b, $e7, $3a, $10, $a9, $4d, $58, $5a, $26
	db $7e, $f3, $a8, $9d, $06, $39, $ce, $be, $68, $82, $6b, $3d
	db $0a, $a1, $1d, $32, $58, $28, $93, $59

	db $f8, $03, $ac, $20, $20, $b5, $10, $67, $36, $73, $af
	db $9b, $c0, $82, $d4, $e8, $d4, $8f, $f2, $9c, $69
	db $16, $ab, $a7, $71, $f3, $8a, $44, $0d, $5c
	db $69, $a0

SpurgeMartNPC6_Text_177d90:
	db TX_COMPRESSED, $6e, $7d, $64, $2f, $9f

	db $10, $0e, $50, $b5, $19, $d2, $43, $a7, $59, $4e, $93, $93
	db $79, $84, $1e, $e6, $14, $15, $23, $22, $20, $20
	db $b4, $a9, $3a, $0c, $73, $00, $b4, $4c, $cc, $02
	db $b5, $42, $16, $31, $36, $68
	db $f0, $06, $e9, $1b, $29, $81, $21, $cc, $86, $02, $0b
	db $4f, $55, $a4, $ba
	db $5a, $68

SpurgeMartNPC8_Text_1778fd:
	db TX_COMPRESSED, $50, $1c, $ec, $10, $11, $10, $68, $25
	db $31, $e0, $63, $58, $28, $93, $de, $da, $41, $7e, $2b, $6a
	db $d5, $0e, $e3, $21, $45, $a2, $74, $d0
	db $85, $56, $9d, $24, $ab, $6c, $d7
	db $ea, $68

SpurgeMartNPC9_Text_17793f:
	db TX_COMPRESSED, $50, $17, $ce, $03, $1a, $c1, $44, $27, $72
	db $09, $ee, $5a, $05, $37, $bd, $99, $59, $a1, $07

	db $90, $03, $24, $59, $e6, $33, $af, $9c, $56
	db $09, $eb, $0c, $56, $d0, $29, $b1, $f3, $de

	db $f8, $05, $64, $cc, $a9, $26, $48, $ea, $23, $41, $45, $9e
	db $5e, $75, $05, $45, $d5, $83, $e3, $90, $5d, $c1

	db $c4, $03, $13, $eb, $e7, $7f, $94, $e3, $4f, $88, $43, $43, $bf
	db $3d, $5f, $7b, $03, $84, $1d, $c5, $9e

	db $7c, $01, $89, $c5, $9e, $0d, $20, $f3, $2c, $32, $f5, $48
	db $de, $b4, $9c, $49, $f5, $f3, $b8, $1c, $30, $fc, $40

	db $40, $24, $e0, $57, $93, $59, $e6, $24, $68
	db $7b, $00, $87, $32, $c3, $39, $0f
	db $a9, $a0

SpurgeMartNPC10_Text_177885:
	db TX_COMPRESSED, $29, $23, $44, $c0, $21, $cc, $64, $2d, $2e
	db $de, $21, $83, $1a, $e6, $1a, $3e, $a2, $58
	db $55, $60, $3e, $f6, $3e, $0a, $2b, $1f, $31, $59, $f7, $a0
	db $95, $34, $22, $2c, $f7, $b3, $90, $87, $3e
	db $a6, $80

SpurgeMartNPC11_Text_177ab3:
	db TX_COMPRESSED, $15, $05, $14, $10, $2b, $ee, $d3, $b3, $a1, $06, $34
	db $3d, $69, $34, $1c, $56, $d2, $f9, $35, $a2, $58, $43

	db $e0, $0c, $4e, $33, $a4, $87, $b7, $36, $74
	db $36, $f3, $e1, $59, $cb, $4e, $92, $3e, $7e
	db $a6, $80

SpurgeMartNPC12_Text_1778bb:
	db TX_COMPRESSED, $75, $12, $7a, $b9, $69, $38, $f8, $fa
	db $a4, $f5, $a4, $c1, $44, $1f, $7b, $12, $6b, $38, $34
	db $2a, $7f, $72, $70, $64, $9b, $10, $fe, $f7
	db $aa, $b0, $d5, $bf, $06, $48, $26, $42, $9b, $0f
	db $a9, $a0

SpurgeMartNPC13_Text_1777d0:
	db TX_COMPRESSED, $74, $59, $2d, $60, $86, $4e, $65, $86, $72
	db $76, $f6, $c5, $9d, $b4, $b2, $40, $92
	db $6a, $ae, $75, $f3, $8e, $a2, $b0, $b5, $ca
	db $6d, $56, $01, $5c, $7c, $14, $40, $49

	db $e0, $0d, $d2, $18, $34, $41, $35, $9e, $a9, $ac, $7c, $84, $4d, $67
	db $af, $69, $01, $55, $a0, $a9, $62, $83, $58, $c2, $d2, $3a, $0a

	db $94, $05, $64, $cc, $e1, $0a, $91, $be, $12, $41, $35, $35, $ab, $b1
	db $36, $f2, $77, $33, $67, $43, $70, $38
	db $2a, $10, $b0, $e1, $a4, $1d, $82, $83, $24, $1d, $f1

	db $00, $ea, $e5, $5a, $88, $bd, $b3, $cc, $17
	db $3d, $80, $57, $05, $c0, $c6, $b0, $41, $21, $cb, $08, $78
	db $d3, $40

SpurgeMartNPC14_Text_177a90:
	db TX_COMPRESSED, $75, $19, $d2, $53, $26, $4d, $91, $e4
	db $de, $a9, $3b, $72, $c3, $15, $b4, $0b
	db $8d, $34

SpurgeMart_177c90_Text_177dea:
	db TX_COMPRESSED, $29, $3b, $6e, $1e, $c5, $67, $1c
	db $d7, $ac, $2a, $46, $44, $7e, $02, $0b, $53, $79, $59, $9d
	db $2d, $34

SpurgeMart_177cd8_Text_177e58:
	db TX_COMPRESSED, $29, $3b, $6e, $1e, $c5, $67, $05
	db $93, $d6, $15, $23, $22, $3f, $01, $05, $a9, $bc, $ac, $ce
	db $96, $9a

SpurgeMart_177c3c_Text_177eba:
	db TX_COMPRESSED, $af, $ab, $1f, $29, $b9, $69, $32, $53
	db $c1, $4d

SpurgeMart_177ca3_Text_177e0a:
	db TX_COMPRESSED, $29, $3a, $45, $28, $08, $2d, $7e, $32, $17
	db $cd, $ed, $e7, $46, $4e
	db $34, $d0

SpurgeMart_177cb2_Text_177e22:
	db TX_COMPRESSED, $72, $85, $a8, $43, $3c, $c7, $c2, $b3
	db $7a, $c2, $a4, $64, $44, $b4, $e9, $25, $a7, $6f
	db $d4, $d0

SpurgeMart_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def $23, $14, 8, SPURGE_CITY
	warp_def $23, $15, 8, SPURGE_CITY

	;xy triggers
	db 0

	;signposts
	db 2
	signpost 9, 10, SIGNPOST_RIGHT, SpurgeMartSignpost1
	signpost 9, 11, SIGNPOST_LEFT, SpurgeMartSignpost2

	;people-events
	db 14
	person_event SPRITE_CLERK, 8, 2, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_BROWN, 0, 0, SpurgeMartNPC1, -1
	person_event SPRITE_CLERK, 19, 3, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_OW_YELLOW, 0, 0, SpurgeMartNPC2, -1
	person_event SPRITE_CLERK, 10, 35, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_YELLOW, 0, 0, SpurgeMartNPC3, -1
	person_event SPRITE_CLERK, 12, 36, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_YELLOW, 0, 0, SpurgeMartNPC4, -1
	person_event SPRITE_CLERK, 28, 1, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_RED, 0, 0, SpurgeMartNPC5, -1
	person_event SPRITE_CLERK, 24, 19, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_RED, 0, 0, SpurgeMartNPC6, -1
	person_event SPRITE_CLERK, 30, 38, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_BROWN, 0, 0, SpurgeMartNPC7, -1
	person_event SPRITE_GENTLEMAN, 10, 17, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_BROWN, 0, 0, SpurgeMartNPC8, -1
	person_event SPRITE_R_GAMBLER, 15, 24, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_YELLOW, 0, 0, SpurgeMartNPC9, -1
	person_event SPRITE_FISHER, 11, 33, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_RED, 0, 0, SpurgeMartNPC10, -1
	person_event SPRITE_FISHER, 18, 28, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, 0, 0, 0, SpurgeMartNPC11, -1
	person_event SPRITE_R_JRTRAINERM, 18, 5, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_RED, 0, 0, SpurgeMartNPC12, -1
	person_event SPRITE_TEACHER, 26, 4, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_PURPLE, 0, 0, SpurgeMartNPC13, -1
	person_event SPRITE_YOUNGSTER, 29, 19, SPRITEMOVEDATA_WANDER, 2, 2, -1, -1, PAL_OW_YELLOW, 0, 0, SpurgeMartNPC14, -1

