HaywardHouse_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

EggAppraiserScript:
	clearevent EVENT_0
	faceplayer
	opentext
	checkevent EVENT_EGG_APPRAISER
	iftrue .skipExplanation
	writetext EggAppraiserIntroduceText
	waitbutton
	setevent EVENT_EGG_APPRAISER
.skipExplanation
	checkitem GOLD_EGG
	iftrue .giveHooh
.checkSilverEgg:
	checkitem SILVER_EGG
	iftrue .giveLugia
	checkevent EVENT_0
	iftrue .checkEggEnd
	checkitem CRYSTAL_EGG
	iftrue .eggAppraiserWrongEgg
	checkitem RUBY_EGG
	iftrue .eggAppraiserWrongEgg
	checkitem SAPPHIRE_EGG
	iftrue .eggAppraiserWrongEgg
	checkitem EMERALD_EGG
	iftrue .eggAppraiserWrongEgg
	checkitem LUCKY_EGG
	iftrue .eggAppraiserWrongEgg
.checkEggEnd
	checkevent EVENT_GOT_HOOH_EGG
	iffalse .notBothEgg
	checkevent EVENT_GOT_LUGIA_EGG
	iffalse .notBothEgg
	jumptext EggAppraiserDoneText

.notBothEgg
	jumptext EggAppraiserNoEggText

.giveHooh
	writetext EggAppraiserHoohEggText
	waitbutton
	checkcode VAR_PARTYCOUNT
	if_equal 6, .noRoom
.getHoohEgg
	takeitem GOLD_EGG
	giveegg HO_OH, 1
	setevent EVENT_GOT_HOOH_EGG
	writetext EggAppraiserGivenEgg
	playwaitsfx SFX_GET_EGG_FROM_DAYCARE_MAN
	setevent EVENT_0
	jump .checkSilverEgg
.noRoom
	jumptext EggAppraiserNoRoomText

.giveLugia
	writetext EggAppraiserLugiaEggText
	waitbutton
	checkcode VAR_PARTYCOUNT
	if_equal 6, .noRoom
.getLugiaEgg
	takeitem SILVER_EGG
	giveegg LUGIA, 1
	setevent EVENT_GOT_LUGIA_EGG
	writetext EggAppraiserGivenEgg
	playwaitsfx SFX_GET_EGG_FROM_DAYCARE_MAN
	jump .checkEggEnd

.eggAppraiserWrongEgg
	jumptext EggAppraiserWrongEggText

EggAppraiserGivenEgg:
	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

EggAppraiserWrongEggText:
	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

EggAppraiserDoneText:
	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

EggAppraiserNoEggText:
	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

EggAppraiserNoRoomText:
	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

EggAppraiserHoohEggText:
	db TX_COMPRESSED, $74, $46, $56, $79, $1a, $be, $9f

	db $10, $05, $24, $68, $8c, $20, $f7, $30, $5d, $cf, $30, $68
	db $7b, $59, $b6, $b7, $bd, $05, $36, $03, $95, $f0
	db $91, $51, $f3, $cf
	db $1a, $68

EggAppraiserLugiaEggText:
	db TX_COMPRESSED, $74, $46, $56, $79, $1a, $be, $9f

	db $10, $05, $24, $68, $8a, $07, $d0, $63, $5c, $17, $73, $cc, $1a
	db $1e, $d6, $6d, $ad, $ef, $41, $4d, $80, $e5, $7c, $24
	db $54, $7c, $f3
	db $c6, $9a

EggAppraiserIntroduceText:
	db TX_COMPRESSED, $6e, $7d, $64, $2f, $9c, $a8, $fa, $c8, $5f, $3e

	db $20, $1d, $4d, $7e, $5a, $4e, $0b, $b9
	db $e5, $ea, $c4, $08, $5e, $8d, $06, $be

	db $20, $1b, $4d, $77, $a3, $24, $40, $83, $64, $7b
	db $d7, $8f, $9e, $51, $35, $67, $35, $9b, $6b, $7b, $d0
	db $4a, $81, $ca, $f8, $49

	db $e0, $02, $4b, $19, $39, $8f, $9c, $d2, $43, $e7
	db $97, $b4, $99, $8e, $9c, $3d, $88, $33, $83
	db $c0, $00, $ef, $14, $d6, $6d, $ad, $ef, $41, $4d
	db $79, $7a, $b3, $80, $e5, $7c, $24
	db $e3, $4d

HaywardHouse_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def 7, 2, 8, HAYWARD_CITY
	warp_def 7, 3, 8, HAYWARD_CITY

	;xy triggers
	db 0

	;signposts
	db 0

	;people-events
	db 1
	person_event SPRITE_R_MANIAC, 3, 5, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, EggAppraiserScript, -1

