;Death Crypt script trigger, maps 1138 and 1139

WaterEmptied = GetUserFlag(0,35)

If #MAPID = 1139
	SendMessageToUser(#USERID,"Water level is already down.",#MSG_SAY)
ElseIf #MAPID = 1138
	If WaterEmptied = 1
		GoTo WARP
	Else
		SendMessageToMap(1138,"The water has been lowered!",#MSG_EMOTE)
		SendMessageToMap(1142,"The water has been lowered!",#MSG_EMOTE)
		SetUserFlag(0,35,1)
		GoTo WARP
	EndIf
EndIf

GoTo END
Label WARP

userID = GetNextMapUser(0,1138)
While userID <> 0
	WarpUser(userID,1139,#XPOS,#YPOS)
	userID = GetNextMapUser(userID,1138)
Wend

userID = GetNextMapUser(0,1142)
While userID <> 0
	WarpUser(userID,1143,#XPOS,#YPOS)
	userID = GetNextMapUser(userID,1142)
Wend

Label END

Continue = 1