;'Ragnar' NPC script (NPC on Auction House)

If HasItem(#USERID,9) = 1
	If Lower(GetUserMessage(#USERID))="sell"
		PoisonAmount = 0
		While HasItem(#USERID,9) = 1
			PoisonAmount=PoisonAmount+1
			TakeItem(#USERID,9)
		Wend
		AmountOfSilver = Floor(PoisonAmount * 12.5)
		SendMessageToUser(#USERID,"Ragnar says, 'Alright, I'll give you "+AmountOfSilver+" silver for all your slime poison.'",#MSG_SAY)
		SendMessageToUser(#USERID,"You sold your Poison for "+AmountOfSilver+" silver.",#MSG_TELL)
		SetUserSilver(#USERID,GetUserSilver(#USERID)+AmountOfSilver)
	Else
		SendMessageToUser(#USERID,"Ragnar says, 'Hey, is that Slime Poison?! You know, I'd buy that off you at a fair price, if you're willing to [sell] it to me.'",#MSG_SAY)
	EndIf
Else
	SendMessageToUser(#USERID,"Ragnar says, 'Hello there. Nice view from up here, eh? Makes you feel on top of the world.'",#MSG_SAY)
EndIf

Continue = 1