SweetScentFromMenu:
	ld hl, SweetScentScript
	call QueueScript
	ld a, $1
	ld [wFieldMoveSucceeded], a
	ret

SweetScentScript:
	reloadmappart
	special UpdateTimePals
	callasm GetPartyNick
	writetext SweetScentText
	waitbutton
	closetext

	farscall FieldMovePokepicScript

	callasm SweetScentEncounter
	sif false
		jumptext SweetScentNothingHere
	randomwildmon
	startbattle
	reloadmapafterbattle
	end

SweetScentEncounter:
	callba CanUseSweetScent
	jr nc, .no_battle
	callba GetMapEncounterRate
	ld a, b
	and a
	jr z, .no_battle
	callba ChooseWildEncounter
	jr nz, .no_battle
	jr .start_battle

.start_battle
	ld a, $1
	jr .load_var

.no_battle
	xor a
	ld [wBattleType], a
.load_var
	ld [hScriptVar], a
	ret

SweetScentText:
	; used SWEET SCENT!
	text_jump _SweetScentText

SweetScentNothingHere:
	; Looks like there's nothing here…
	text_jump _SweetScentNothingHere
