;'Dice throwing game' - In starting area tavern

MSG=Lower(GetUserMessage(#USERID))

If MSG="yes"
	Silver = GetUserSilver(#USERID)
	If Silver < 50
		SendMessageToUser(#USERID,"Sohtrop says, 'Hah, come back when you get some silver. We can't play on nill!',#MSG_SAY)
		GoTo END
	EndIf
	
	UserDice1 = Random(1,6)
	UserDice2 = Random(1,6)
	UserTotal = UserDice1 + UserDice2
	PorthosDice1 = Random(Random(1,2),6)
	PorthosDice2 = Random(1,6)
	PorthosTotal = PorthosDice1 + PorthosDice2
	
	SendMessageToUser(#USERID,"Your roll your dice...",#MSG_EMOTE)
	SendMessageToUser(#USERID,"["+UserDice1+"] ["+UserDice2+"] = "+UserTotal,#MSG_SAY)
	SendMessageToUser(#USERID,"Sohtrop rolls his dice...",#MSG_EMOTE)
	SendMessageToUser(#USERID,"["+PorthosDice1+"] ["+PorthosDice2+"] = "+PorthosTotal,#MSG_SAY)
	
	If UserTotal > PorthosTotal
		SetUserSilver(#USERID,Silver+50)
		SendMessageToUser(#USERID,"You won 50 silver.",#MSG_TELL)
	ElseIf PorthosTotal > UserTotal
		SetUserSilver(#USERID,Silver-50)
		SendMessageToUser(#USERID,"You lost 50 silver.",#MSG_TELL)
	Else
		SendMessageToUser(#USERID,"You tied - Neither you nor Sohtrop won anything.",#MSG_TELL)
	EndIf

	GoTo END
ElseIf MSG="rules"
	SendMessageToUser(#USERID,"Sohtrop says, 'The rules are simple, we each roll two dice, and whoever gets the highest total, wins the other gent's 50 silver.'",#MSG_SAY)
ElseIf MSG="no"
	SendMessageToUser(#USERID,"Sohtrop says, 'Some other time then?'",#MSG_SAY)
Else 
	SendMessageToUser(#USERID,"Sohtrop says, 'Care to play a few rounds of dice to pass the time? Say, 50 silver per game?' [yes/no/rules]",#MSG_SAY)
EndIf

Label END

Continue = 1