OwsauriStatEXP_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

OwsauriStatEXPNPC:
	faceplayer
	opentext
	writetext .introduction_text
	yesorno
	sif false
		closetextend
	checkmoney 0, 500
	sif =, 2
		jumptext .not_enough_money_text
	takemoney 0, 500
	writetext .choose_a_mon_text
	special Special_SelectMonFromParty
	iffalse .refund
	writetext .which_stat_text
	loadmenudata .menu
	verticalmenu
	closewindow
	sif true
		jumptext OwsauriStatEXP_ShowEXP
.refund
	givemoney 0, 500
	closetextend

.introduction_text
	db TX_COMPRESSED, $53, $0a, $e0, $9a, $d7, $05, $b1, $60, $58, $8e, $a3, $3a
	db $47, $ac, $fb, $d8, $08, $2d, $4b, $49, $c5, $17
	db $b6, $00, $5d, $4e, $88, $35, $8c, $c8, $c9, $c0, $e1, $02, $43
	db $78, $38, $40, $41, $69, $70, $1c, $af, $84, $9e

	db $00, $e8, $96, $6b, $34, $59, $e6
	db $96, $9a

.not_enough_money_text
	db TX_COMPRESSED, $50, $15, $ac, $17, $e0, $20, $b5, $32, $12, $53
	db $1e, $4e, $83, $1c, $32, $05, $ae, $53, $1f, $09, $0c, $17
	db $a9, $a0

.choose_a_mon_text
	db TX_COMPRESSED, $6d, $48, $42, $83, $9b, $01, $ca, $f8
	db $48, $f0, $20, $b5, $2a, $d2, $5c, $7c, $e5
	db $85, $53, $29, $36, $54
	db $bd, $4f, $10

.which_stat_text
	db TX_COMPRESSED, $6e, $91, $b2, $98, $8b, $db, $99, $0c, $04, $16
	db $9e, $ab, $49, $71, $f3, $96, $18, $ca, $4d, $95, $2a
	db $5a, $68

.menu
	db $40 ; flags
	db 00, 05 ; start coords
	db 11, 19 ; end coords
	dw .options
	db 1 ; default option

.options
	db $80
	db $5
StatExpStatNames:
	db "HP@"
	db "Attack@"
	db "Defense@"
	db "Speed@"
	db "Special@"

OwsauriStatEXP_ShowEXP:
	start_asm
	push bc
	ld a, [wPartyMenuCursor]
	dec a
	ld bc, PARTYMON_STRUCT_LENGTH
	ld hl, wPartyMon1 + MON_HP_EXP
	rst AddNTimes
	ld a, [hScriptVar]
	dec a
	push af
	add a, a
	ld c, a
	ld b, 0
	add hl, bc
	ld de, wTempNumber
	ld a, [hli]
	ld [de], a
	inc de
	ld a, [hl]
	ld [de], a
	ld a, "@"
	ld hl, wStringBuffer1
	ld c, 8 ; b is already 0
	call ByteFill
	pop af
	ld hl, StatExpStatNames
	call GetNthString
	ld d, h
	ld e, l
	ld hl, wStringBuffer1
	call PlaceString
	pop bc
	ld hl, .text
	ret

.text
	db TX_COMPRESSED, $07, $22, $0b, $84, $d6, $f8, $5c
	db $5e, $73, $00
	deciram wTempNumber, 2, 5
	db TX_COMPRESSED, $07, $44, $d0, $5b, $16, $c5, $90
	db $b7, $4d

OwsauriStatEXP_MapEventHeader ;filler
	db 0, 0

;warps
	db 2
	warp_def $7, $2, 5, OWSAURI_CITY
	warp_def $7, $3, 5, OWSAURI_CITY

	;xy triggers
	db 0

	;signposts
	db 0

	;people-events
	db 1
	person_event SPRITE_PHARMACIST, 3, 5, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_OW_YELLOW, PERSONTYPE_SCRIPT, 0, OwsauriStatEXPNPC, -1

