HaywardHouse_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

EggAppraiserScript:
	clearevent EVENT_0
	faceplayer
	opentext
	checkevent EVENT_EGG_APPRAISER
	sif false, then
		writetext .introduction_text
		setevent EVENT_EGG_APPRAISER
	sendif
	writebyte GOLD_EGG
	copyvartobyte wTempNumber
	checkitem 0
	sif true, then
		scall .check_egg
		sif false
			end
		giveegg HO_OH, 1
		setevent EVENT_GOT_HOOH_EGG
		scall .got_egg
	sendif
	writebyte SILVER_EGG
	copyvartobyte wTempNumber
	checkitem 0
	sif true, then
		scall .check_egg
		sif false
			end
		giveegg LUGIA, 1
		scall .got_egg
	sendif
	checkevent EVENT_0
	sif false, then
		checkitem CRYSTAL_EGG
		sif true
			jumptext .invalid_egg_text
		checkitem RUBY_EGG
		sif true
			jumptext .invalid_egg_text
		checkitem SAPPHIRE_EGG
		sif true
			jumptext .invalid_egg_text
		checkitem EMERALD_EGG
		sif true
			jumptext .invalid_egg_text
		checkitem LUCKY_EGG
		sif true
			jumptext .invalid_egg_text
	sendif
	checkevent EVENT_GOT_HOOH_EGG
	sif false
		jumptext .come_back_text
	checkevent EVENT_GOT_LUGIA_EGG
	sif false
		jumptext .come_back_text
	jumptext .no_more_eggs_text

.check_egg
	copybytetovar wTempNumber
	itemtotext 0, 0
	copyvartobyte wCurItem
	writetext .egg_text
	checkcode VAR_PARTYCOUNT
	addvar -6
	sif false
		jumptext .no_room_in_party_text
	copybytetovar wTempNumber
	takeitem ITEM_FROM_MEM
	writebyte 1
	end

.got_egg
	writetext .got_egg_text
	playwaitsfx SFX_GET_EGG_FROM_DAYCARE_MAN
	setevent EVENT_0
	end

.introduction_text
	db TX_COMPRESSED, $6e, $7d, $64, $2f, $9f, $e5, $47, $d6, $42, $f9, $f1

	db $00, $ea, $6b, $f2, $d2, $70, $5d, $cf
	db $2f, $56, $20, $42, $f4, $68, $35, $f1

	db $00, $da, $6b, $bd, $19, $22, $04, $1b, $23, $de
	db $bc, $7c, $f2, $89, $ab, $39, $ac, $db, $5b, $de, $82
	db $54, $0e, $57, $c2, $4f

	db $00, $12, $58, $c9, $cc, $7c, $e6, $92, $1f, $3c
	db $bd, $a4, $cc, $74, $e1, $ec, $41, $9c, $1e
	db $00, $07, $78, $a6, $b3, $6d, $6f, $7a, $0a
	db $6b, $cb, $d5, $9c, $07, $2b, $e1, $27
	db $1a, $78, $80

.egg_text
	db TX_COMPRESSED, $74, $46, $56, $79, $1a, $be, $9f

	db $10, $05, $24, $68, $94, $f2, $83
	db $43, $da, $cd, $b5, $bd, $e8, $29, $b0, $1c, $af, $84
	db $8a, $8f, $9e, $78
	db $d3, $c4

.got_egg_text
	db TX_COMPRESSED, $a7, $8e, $6e, $72, $79
	db $7a, $d2, $70, $f9, $e6, $58, $65, $a4
	db $d5, $08, $d5, $d8, $2e
	db $34, $d0

.invalid_egg_text
	db TX_COMPRESSED, $29, $23, $44, $3e, $79, $a7

	db $80, $03, $ab, $c5, $10, $20, $d9, $1e, $f6, $6f
	db $7a, $f2, $c7, $ca, $6f

	db $c0, $04, $9a, $b8, $3b, $c5, $08, $1b
	db $9a, $f0, $39, $5f, $09, $3f, $10, $15, $ac, $17
	db $1a, $68

.come_back_text
	db TX_COMPRESSED, $6d, $0b, $e7, $15, $eb, $2a, $50, $78, $40, $41
	db $69, $ec, $06, $4c, $c7, $c2, $b3, $88, $10, $6c, $8f
	db $7a, $a8, $f9, $e5, $1e
	db $a6, $80

.no_more_eggs_text
	db TX_COMPRESSED, $75, $32, $12, $53, $25, $a4, $64, $52, $80, $82
	db $d3, $d5, $0f, $bd, $8a, $ce, $6a, $be, $9c, $b0

	db $80, $c0, $64, $cc, $7c, $2b, $38, $81, $06, $c8, $f7
	db $af, $03, $95, $f0, $92, $1f, $3c, $a3

	db $c0, $18, $86, $a8, $ea, $32, $16, $bb, $98, $93, $e8, $8e
	db $34, $d0

.no_room_in_party_text
	db TX_COMPRESSED, $72, $85, $a9, $90, $92, $99, $13, $a0, $c7, $34, $80
	db $9e, $58, $42, $fc, $c0, $2b, $96, $91, $a3

	db $c0, $38, $7a, $7a, $83, $98, $2c, $ce, $20, $2f
	db $9b, $c8, $11, $ac, $9c, $19, $20, $20, $b4
	db $b5, $42, $35, $76, $0b
	db $d4, $d0

HaywardHouse_MapEventHeader:: db 0, 0

.Warps
	db 2
	warp_def 7, 2, 8, HAYWARD_CITY
	warp_def 7, 3, 8, HAYWARD_CITY

.CoordEvents
	db 0

.BGEvents
	db 0

.ObjectEvents
	db 1
	person_event SPRITE_R_MANIAC, 3, 5, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, EggAppraiserScript, -1

