;'Kutfroat' - NPC script

ENFORCER = 341
DIAMOND = 342
LOVELETTER = 343

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
	SendMessageToUser(#USERID,"Kutfroat says, 'Good evening, "+GetUserName(#USERID)+".'",#MSG_SAY)
	GoTo END
EndIf

If HasItem(#USERID, DIAMOND) = 1
	SendMessageToUser(#USERID,"Kutfroat says, 'Bring that diamond to my love, in her desert hideaway! Any moment you waste, is a moment longer my heart dies to itself...'",#MSG_SAY)
ElseIf HasItem(#USERID, LOVELETTER) = 1
	SendMessageToUser(#USERID,"Kutfroat says, 'You've done it! Thank you, thank you! Here, take this armor as a reward, I'm no fighting man and it's useless to me.'",#MSG_SAY)
	TakeItem(#USERID,LOVELETTER)
	SendMessageToUser(#USERID,"Kutfroat has given you Enforcer Armor",#MSG_TELL)
	GiveItem(#USERID,ENFORCER)
ElseIf HasItem(#USERID, ENFORCER) = 1
	SendMessageToUser(#USERID,"Kutfroat says, 'You've forever gained my gratitude, "+GetUserName(#USERID)+".'",#MSG_SAY)
Else
	MSG=Lower(GetUserMessage(#USERID))
	If MSG="yes"
		SendMessageToUser(#USERID,"Kutfroat says, 'Thank you, thank you! Quick, here's the diamond, take it to my love in the sand dunes.'",#MSG_SAY)
		If IsInvFull(#USERID) = 0
			SendMessageToUser(#USERID,"A Diamond has been added to your inventory.",#MSG_TELL)
			GiveItem(#USERID, DIAMOND)
		Else
			SendMessageToUser(#USERID,"Your inventory is full. Get rid of some items and try again.",#MSG_CRITICAL)
		EndIf
	ElseIf MSG="no"
		SendMessageToUser(#USERID,"Kutfroat says, 'Dang, I thought I could count on you.'",#MSG_SAY)
	Else
		SendMessageToUser(#USERID,"Kutfroat says, 'Hey, I need someone to bring a gift to my love who is in the desert, but cannot go myself. Will you help? [yes/no]'",#MSG_SAY)
	EndIf
EndIf

Label END

Continue = 1