;Death Crypt timed script, from script 621

;Param1 xloc, param2 yloc, param3 xend, param4 yend, param5 time

LocX = #PARAM1
LocY = #PARAM2
EndX = #PARAM3
EndY = #PARAM4
Time = #PARAM5

TimeIncrease = 500

PlusX = 0
PlusY = 0
TotalSteps = 0

If EndX > LocX
	PlusX = 1
	TotalSteps = EndX - LocX
ElseIf EndX < LocX
	PlusX = -1
	TotalSteps = LocX - EndX
EndIf
If EndY > LocY
	PlusY = 1
	TotalSteps = EndY - LocY
ElseIf EndY < LocY
	PlusY = -1
	TotalSteps = LocY - EndY
EndIf

;SendMessageToUser(GetUserID("comrade"),"X: "+LocX+" to "+EndX+", Y: "+LocY+" to "+EndY+"",#MSG_SAY)
;SendMessageToUser(GetUserID("comrade"),"Total steps: "+TotalSteps,#MSG_SAY)

Step = 0
While Step < TotalSteps
	Step=Step+1
	LocX = LocX + PlusX
	LocY = LocY + PlusY
	
	;SendMessageToUser(GetUserID("comrade"),"Step: "+Step+"/"+TotalSteps+", X: "+LocX+", Y: "+LocY+"",#MSG_EMOTE)
	
	Timer(622, Time, LocX, LocY, 0)
	Time= Time + TimeIncrease
Wend

Continue = 1