;'Treok' NPC script

If HasItem(#USERID,495) = 1
	If GetUserFlag(#USERID,45) = 1
		SendMessageToUser(#USERID,"Treok says, 'You got it! Great work, I'd estimate this is worth 1250 silver at least! Here, take your share of 700, and I'll keep the full price of the thing when I sell it.'",#MSG_SAY)
		SetUserSilver(#USERID,GetUserSilver(#USERID)+700)
		SendMessageToUser(#USERID,"You now have "+GetUserSilver(#USERID)+" silver.",#MSG_TELL)
		SetUserFlag(#USERID,45,2)
	EndIf
	TakeItem(#USERID,495)
ElseIf GetUserFlag(#USERID,45) = 0
	If Lower(GetUserMessage(#USERID))="trinket"
		SendMessageToUser(#USERID,"Treok says, 'Yes, worth a bit too, I'd imagine. The entire basement is too dark for me to see a thing, so you go ahead and get it, and I'll deal with finding a buyer.'",#MSG_SAY)
		SetUserFlag(#USERID,45,1)
	Else 
		SendMessageToUser(#USERID,"Treok says, 'Who are you? No, nevermind that. I need you to do something for me. This house here has been unoccupied     since the owner has died a few days ago. The owner had, among other things, a [trinket] that'd be worth a nice sum of",#MSG_SAY)
		SendMessageToUser(#USERID,"silver for you and I, if we can get to it.'",#MSG_SAY)
	EndIf
ElseIf GetUserFlag(#USERID,45) = 1
	SendMessageToUser(#USERID,"Treok says, 'Hurry up and grab the necklace, it's too dark down there for me.'",#MSG_SAY)
Else
	SendMessageToUser(#USERID,"Treok says, 'Nice work, "+GetUserName(#USERID)+"'",#MSG_SAY)
EndIf

Continue = 1