SilphWarehouseF1_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

SilphWarehouseF1Guard:
	faceplayer
	opentext
	writetext SilphWarehouseF1Guard_Text_NotAllowedUpstairs
	checkitem SHOP_TICKET
	paragraphdelay
	sif false
		jumptext SilphWarehouseF1Guard_Text_NothingOfInterest
	writetext SilphWarehouseF1Guard_Text_WaitIsThatShopTicket
	closetext
	checkcode VAR_FACING
	sif =, RIGHT, then
		applymovement 2, .GuardMovesRightFacesLeft
		moveperson 3, 28, 1
	selse
		applymovement 2, .GuardMovesLeftFacesRight
	sendif
	copybytetovar hOAMUpdate
	pushvar
	loadvar hOAMUpdate, 0
	disappear 2
	appear 3
	checkcode VAR_FACING
	sif =, RIGHT, then
		callasm HandleNPCStep ; force update field 28
		spriteface 3, LEFT
	selse
		special UpdateSprites
	sendif
	popvar	
	copyvartobyte hOAMUpdate
	end

.GuardMovesRightFacesLeft:
	step_right
	turn_head_left
	step_end

.GuardMovesLeftFacesRight:
	step_left
	turn_head_right
	step_end

SilphWarehouseF1GuardMoved:
	db TX_COMPRESSED, $e1, $e9, $ea, $0f, $f0, $c9, $66, $b9, $a8
	db $78, $10, $5a, $95, $0d, $09
	db $f5, $34

SilphWarehouseF1Guard_Text_NotAllowedUpstairs:
	db TX_COMPRESSED, $50, $15, $ac, $17, $e0, $20, $b4, $5c, $70, $81
	db $b7, $b7, $bd, $0d, $47, $98, $d0, $89, $a4
	db $04, $03, $06, $97, $69, $35, $c6, $89, $d3, $42
	db $1e, $04, $16, $8b, $8e, $6c, $50, $3e, $88
	db $4a, $a3, $7c, $47, $42, $08, $cf
	db $c0, $e6

SilphWarehouseF1Guard_Text_NothingOfInterest:
	db TX_COMPRESSED, $29, $26, $b3, $83, $41, $29
	db $8f, $69, $01, $5a, $46, $4e, $63, $42, $25, $a4, $d6
	db $6a, $83, $84, $19, $2c, $d6, $68, $bf
	db $53, $40

SilphWarehouseF1Guard_Text_WaitIsThatShopTicket:
	db TX_COMPRESSED, $62, $1e, $e6, $04, $9e

	db $00, $e9, $12, $d3, $b7, $2d, $27, $14, $24, $22
	db $1e, $28, $6c, $a9, $1d, $d2

	db $80, $76, $98, $f8, $2f, $c1, $dc, $59, $ef, $7a
	db $09, $e1, $a3

	db $88, $02, $97, $a3, $21, $ad, $12, $a4, $86, $6a
	db $cd, $e1, $92, $08, $0a, $10, $68, $40, $c2, $48, $1c
	db $00, $5a, $4e, $28, $48, $44, $42, $86, $ca, $91
	db $db, $da, $b3, $8a, $44, $0d, $44, $96, $18, $ac
	db $c0, $5a, $da, $38, $ca, $75, $f1, $03, $09
	db $10, $f0, $70, $80, $e5, $7c, $24

	db $f0, $0e, $1e, $9e, $a0, $ff, $0c, $96, $6b, $9a
	db $87, $81, $05, $a9, $50, $d0, $9f
	db $53, $c4

	
SilphWarehouseF1_MapEventHeader ;filler
	db 0, 0

;warps
	db 4
	warp_def $11, $8, 1, ROUTE_59
	warp_def $11, $9, 1, ROUTE_59
	warp_def $a, $1b, 1, SILPH_WAREHOUSE_B1F
	warp_def $0, $1b, 1, SILPH_WAREHOUSE_F2

	;xy triggers
	db 0

	;signposts
	db 0

	;people-events
	db 2
	person_event SPRITE_OFFICER, 1, 27, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, SilphWarehouseF1Guard, EVENT_SILPH_WAREHOUSE_GUARD
	person_event SPRITE_OFFICER, 1, 26, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TEXTFP, 0, SilphWarehouseF1GuardMoved, EVENT_SILPH_WAREHOUSE_GUARD_MOVED | $8000

