;Item pickup script

ENFORCER = 341
DIAMOND = 342
LOVELETTER = 343

If HasItem(#USERID,ENFORCER) = 1
	While HasItem(#USERID,DIAMOND) = 1
		TakeItem(#USERID,DIAMOND)
	Wend
	While HasItem(#USERID,LOVELETTER) = 1
		TakeItem(#USERID,LOVELETTER)
	Wend
EndIf
If HasItem(#USERID,DIAMOND) = 1
	While HasItem(#USERID,DIAMOND) = 1
		TakeItem(#USERID,DIAMOND)
	Wend
	GiveItem(#USERID,DIAMOND)
EndIf
If HasItem(#USERID,LOVELETTER) = 1
	While HasItem(#USERID,LOVELETTER) = 1
		TakeItem(#USERID,LOVELETTER)
	Wend
	GiveItem(#USERID,LOVELETTER)
EndIf

AVERAGE = GetUserStrength(#USERID) + GetUserWisdom(#USERID)
AVERAGE = AVERAGE + GetUserStrength(#USERID) + GetUserWisdom(#USERID)
AVERAGE = Floor(AVERAGE / 4)

;Can't do the quest, if over average level 20.
If AVERAGE > 20
	TakeItem(#USERID,DIAMOND)
	TakeItem(#USERID,LOVELETTER)
EndIf

Continue = 1