LaurelCity_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 1

	dbw 5, .set_fly_flag

.set_fly_flag
	setflag ENGINE_FLYPOINT_LAUREL_CITY
	return

LaurelCityHiddenItem:
	dw EVENT_LAUREL_CITY_HIDDENITEM_GOLD_TOKEN
	db GOLD_TOKEN

LaurelCityMagikarpCavernsSign:
	db TX_COMPRESSED, $15, $de, $46, $a5, $ab
	db $11, $4f, $09, $b7, $41, $8d, $64
	db $45, $34

LaurelCityLabSign:
	db TX_COMPRESSED, $6e, $73, $56
	db $74, $f0, $90, $c8, $cc, $96, $34, $5a, $38
	db $d3, $40

LaurelCityNameRaterSign:
	db TX_COMPRESSED, $07, $eb, $e7, $1c, $9b, $66, $bc
	db $54, $f0, $92, $17
	db $ce, $9a

LaurelCityCitySign:
	db TX_COMPRESSED, $29, $27, $19, $1d, $82, $81
	db $c2, $9e, $12, $c2, $0b, $7b, $60
	db $a9, $a0

LaurelCityPokecenterSign:
	jumpstd pokecentersign

LaurelCityMartSign:
	jumpstd martsign

LaurelCityNPC1:
	jumptextfaceplayer .text

.text
	db TX_COMPRESSED, $29, $26, $b3, $c5, $36, $77, $55
	db $bc, $43, $d5, $ab, $05, $2d, $3b, $71, $9d
	db $22, $a5, $98, $30, $c1, $8e, $60, $14, $20, $7d, $47
	db $a9, $a0

LaurelCityNPC2:
	jumptextfaceplayer .text

.text
	db TX_COMPRESSED, $12, $58, $42, $a5, $d0, $44, $fc, $b4
	db $9b, $dd, $0b, $3b, $d8, $c2, $04, $fc, $c7, $3d, $c9, $af
	db $ea, $86, $89, $61, $0c, $32, $58, $ef, $a7, $9f

	db $00, $75, $30, $3d, $5c, $c0, $2b, $96, $91
	db $a1, $ee, $4c, $86, $bd, $b1, $84, $94, $f0
	db $53, $40

LaurelCityNPC3:
	jumptextfaceplayer .text

.text
	db TX_COMPRESSED, $ae, $10, $ea, $88, $48, $44, $40, $88, $32, $1e
	db $5e, $49, $ac, $e2, $cd, $93, $25, $f4, $17
	db $a9, $a0

LaurelCityNPC4:
	jumptextfaceplayer .text

.text
	db TX_COMPRESSED, $75, $78, $a2, $03, $10, $3e, $f4, $17

	db $10, $05, $24, $e3, $08, $13, $f3, $1c, $f7, $26
	db $b7, $ad, $23, $22, $92, $22, $12, $78, $a2, $02, $f9
	db $aa, $40, $57, $70, $38, $41, $66, $d1, $99, $29, $e0

	db $00, $ea, $33, $a4, $a6, $44, $5e, $93, $30, $77
	db $c6, $9a

LaurelCityMagikarpCavernsGuard:
	jumptextfaceplayer .text

.text
	db TX_COMPRESSED, $29, $27, $19, $1d, $82, $c5, $15, $ee, $79
	db $37, $86, $88, $43, $3c, $9e, $65, $86, $19, $2c
	db $d6, $aa, $d2, $34, $46, $74, $18
	db $fd, $4d

LaurelCityTotodileRunsFromGym:
	checkcode VAR_BOXSPACE
	sif false, then
		checkcode VAR_PARTYCOUNT
		sif =, 6
			end
	sendif
	checkflag ENGINE_GULFBADGE
	sif false
		end
	checkevent EVENT_LAUREL_CITY_GOT_TOTODILE
	sif true
		end
	cry TOTODILE
	appear 5
	applymovement 5, .totodile_moves_to_player
	spriteface 0, UP
	spriteface 5, DOWN
	opentext
	writetext .totodile_whines_text
	writetext .totodile_joins_party_text
	playwaitsfx SFX_FANFARE_2
	waitbutton
	givepoke TOTODILE, 15, ORAN_BERRY, 0
	disappear 5
	setevent EVENT_LAUREL_CITY_GOT_TOTODILE
	closetext
	end

.totodile_moves_to_player
	step_down
	step_down
	step_right
	step_end

.totodile_whines_text
	db TX_COMPRESSED, $03, $52, $46, $43, $40
	db $1a, $78, $80

.totodile_joins_party_text
	db TX_COMPRESSED, $28, $36, $1c, $8f, $a7, $13, $a8
	db $7b, $26, $c8, $f2, $79, $96, $19, $4e, $04, $64
	db $54, $08, $2d, $2e, $08, $d5, $d8, $2e
	db $34, $d0

LaurelCityTeleportation:
	opentext
	farwritetext FarText_BillsTeleportationSystem
	checkevent EVENT_REGISTERED_SOUTHERLY
	sif false
		jumptext .nothing_registered_text
	writetext .go_to_southerly_text
	yesorno
	closetext
	sif true
		warp SOUTHERLY_POKECENTER, 5, 5
	end

.nothing_registered_text
	db TX_COMPRESSED, $07, $86, $32, $3b, $19, $a2, $27, $41
	db $8d, $e5, $66, $64, $8b, $3e, $46, $8b, $35, $9e, $78
	db $d3, $40

.go_to_southerly_text
	db TX_COMPRESSED, $6e, $16, $bb, $98, $08, $2d, $4e, $8d, $48, $e5
	db $85, $eb, $3e, $98, $80, $ae, $e5
	db $85, $52, $80, $b5, $69, $35, $f4, $14, $6d, $1d, $82, $a5
	db $a6, $80

LaurelCity_MapEventHeader ;filler
	db 0, 0

;warps
	db 12
	warp_def $11, $2, 4, LAUREL_GATE
	warp_def $b, $f, 1, LAUREL_STICK
	warp_def $b, $22, 15, MAGIKARP_CAVERNS_MAIN
	warp_def $1, $15, 1, ORPHANAGE
	warp_def $5, $16, 1, LAUREL_LAB
	warp_def $1b, $17, 1, LAUREL_POKECENTER
	warp_def $1, $16, 1, SPURGE_HOUSE
	warp_def $3, $2, 1, LAUREL_GYM
	warp_def $15, $12, 2, LAUREL_MART
	warp_def $21, $16, 1, ACANIA_HOUSE
	warp_def $17, $5, 1, LAUREL_NAMERATER
	warp_def $10, $2, 3, LAUREL_GATE

	;xy triggers
	db 1
	xy_trigger 0, $6, $3, $0, LaurelCityTotodileRunsFromGym, $0, $0

	;signposts
	db 8
	signpost 13, 35, SIGNPOST_LOAD, LaurelCityMagikarpCavernsSign
	signpost 6, 20, SIGNPOST_LOAD, LaurelCityLabSign
	signpost 27, 5, SIGNPOST_LOAD, LaurelCityNameRaterSign
	signpost 19, 25, SIGNPOST_LOAD, LaurelCityCitySign
	signpost 21, 12, SIGNPOST_ITEM, LaurelCityHiddenItem
	signpost 27, 24, SIGNPOST_READ, LaurelCityPokecenterSign
	signpost 21, 19, SIGNPOST_READ, LaurelCityMartSign
	signpost 27, 21, SIGNPOST_READ, LaurelCityTeleportation

	;people-events
	db 7
	person_event SPRITE_FIREBREATHER, 12, 8, SPRITEMOVEDATA_WANDER, 1, 1, -1, -1, PAL_OW_RED, 0, 0, LaurelCityNPC1, -1
	person_event SPRITE_GRAMPS, 28, 15, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_BLUE, 0, 0, LaurelCityNPC2, -1
	person_event SPRITE_GRAMPS, 12, 34, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, LaurelCityMagikarpCavernsGuard, EVENT_MAN_BLOCKING_MAGIKARP_CAVERNS
	person_event SPRITE_TOTODILE, 3, 2, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_OW_BLUE, 0, 0, ObjectEvent, EVENT_LAUREL_CITY_HIDDEN_TOTODILE
	person_event SPRITE_LASS, 23, 24, SPRITEMOVEDATA_WANDER, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, LaurelCityNPC3, -1
	person_event SPRITE_LASS, 18, 11, SPRITEMOVEDATA_WANDER, 1, 1, -1, -1, 0, 0, 0, LaurelCityNPC4, -1
	person_event SPRITE_POKE_BALL, 21, 37, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, PAL_OW_YELLOW, 3, TM_ICY_WIND, 0, EVENT_LAUREL_CITY_TM

