;'Gravebound' - skill script

UserID = #PARAM1
Map = #PARAM2
XPos = #PARAM3
YPos = #PARAM4
Counter = #PARAM5

If Map <> GetUserMap(UserID)
	GoTo STOP
ElseIf XPos <> GetUserX(UserID)
	GoTo STOP
ElseIF YPos <> GetUserY(UserID)
	GoTo STOP
EndIf

If Counter = 0
	CreateEffect(3,500,0,#DIR_RIGHT,Map,XPos,YPos,0,UserID,0)
	SendMessageToUser(UserID,"You return to the graveyard.",#MSG_EMOTE)
	WarpUser(UserID,9,10,10)
	CreateEffect(3,500,0,#DIR_RIGHT,9,10,10,0,UserID,0)
	SendMessageToMap(Map,GetUserName(UserID)+" returned to the graveyard.",#MSG_EMOTE)
Else
	Timer5(661,5000,#PARAM1,#PARAM2,#PARAM3,#PARAM4,Counter-1)
EndIf

GoTo END
Label STOP
SendMessageToUser(UserID,"You must stay still to warp to the graveyard.",#MSG_CRITICAL)
SetUserFlag(#PARAM1,41,0)

Label END

Continue = 1