
If Floor(#PARAM2+Floor(#PARAM2/10))=GetUserFlag(0,16)
	If #PARAM3=1
		SendMessageToMap(683,"Auctioneer says, '"+GetItemName(GetUserFlag(0,17))+" is going for "+#PARAM2+" once...'", #MSG_SAY)
	Elseif #PARAM3=2
		SendMessageToMap(683,"Auctioneer says, '"+GetItemName(GetUserFlag(0,17))+" is going for "+#PARAM2+" twice...'", #MSG_SAY)
	Elseif #PARAM3=3
		SendMessageToMap(683,"Auctioneer says, '"+GetItemName(GetUserFlag(0,17))+" has been sold to "+GetUserName(#PARAM1)+" for "+#PARAM2+" silver!'", #MSG_SAY)
		SendMessageToAll(GetUserName(#PARAM1)+" has won the "+GetItemName(GetUserFlag(0,17))+" for "+#PARAM2+" silver!", #MSG_SERVER)
		RemoveItemAtXY(683,10,5)
		
		SendMessageToUser(#PARAM1,"Your "+GetItemName(GetUserFlag(0,17))+" has been added to your inventory.", #MSG_TELL)
		GiveItem(#PARAM1,GetUserFlag(0,17))
		SetUserFlag(0,16,0)

		;If it's less than 0, some NPC is running the event
		If GetUserFlag(1,16) > 0
			SendMessageToUser(GetUserFlag(1,16),"You earn "+#PARAM2+" silver from selling "+GetItemName(GetUserFlag(0,17))+".", #MSG_TELL)
			SetUserSilver(GetUserFlag(1,16),GetUserSilver(GetUserFlag(1,16))+#PARAM2)
		EndIf
		;If the NPC 'Regulus' is running the event, add the silver amount to
		;the amount of silver the user has spent at Regulus'

		If GetUserFlag(1,16) = -1
			SetUserFlag(#PARAM1,44,GetUserFlag(#PARAM1,44) + #PARAM2)
		EndIf
	Endif
Endif
Continue = 1

