;Lounge doors, in the Oisvo Lounge

Rank = 0

VIP_PASS = 247

If GetUserGuildRank(#USERID) = #GUILDRANK_SERVANT
	Rank = 1
ElseIf GetUserGuildRank(#USERID) = #GUILDRANK_MEMBER
	Rank = 2
ElseIf GetUserGuildRank(#USERID) = #GUILDRANK_LORD
	Rank = 3
EndIf
If #XPOS = 4
	SendMessageToUser(#USERID,"The door opens for you.",#MSG_SAY)
	WarpUser(#USERID, 335, 10, 18)
ElseIf #XPOS = 16
	If Rank > 0
		SendMessageToUser(#USERID,"The door opens for you.",#MSG_SAY)
		WarpUser(#USERID, 336, 10, 18)
	ElseIf GetUserAccess(#USERID) > 0
		SendMessageToUser(#USERID,"You command the door open.",#MSG_SAY)
		WarpUser(#USERID, 336, 10, 18)
	Else
		SendMessageToUser(#USERID,"This door is locked.",#MSG_SAY)
	EndIf
ElseIf #XPOS = 7
	If Rank > 1
		SendMessageToUser(#USERID,"The door opens for you.",#MSG_SAY)
		WarpUser(#USERID, 337, 10, 18)
	ElseIf GetUserAccess(#USERID) > 0
		SendMessageToUser(#USERID,"You command the door open.",#MSG_SAY)
		WarpUser(#USERID, 337, 10, 18)
	Else
		SendMessageToUser(#USERID,"This door is locked.",#MSG_SAY)
	EndIf
ElseIf #XPOS = 13
	If Rank > 2
		SendMessageToUser(#USERID,"The door opens for you.",#MSG_SAY)
		WarpUser(#USERID, 338, 10, 18)
	ElseIf GetUserAccess(#USERID) > 0
		SendMessageToUser(#USERID,"You command the door open.",#MSG_SAY)
		WarpUser(#USERID, 338, 10, 18)
	Else
		SendMessageToUser(#USERID,"This door is locked.",#MSG_SAY)
	EndIf
ElseIf #XPOS = 10
	If HasItem(#USERID, VIP_PASS) = 1
		SendMessageToUser(#USERID,"The door opens for you.",#MSG_SAY)
		WarpUser(#USERID, 339, 10, 18)
	ElseIf GetUserAccess(#USERID) > 0
		SendMessageToUser(#USERID,"You command the door open.",#MSG_SAY)
		WarpUser(#USERID, 339, 10, 18)
	Else
		SendMessageToUser(#USERID,"This door is locked.",#MSG_SAY)
	EndIf
EndIf

Continue = 1