;Frost Palace trap - timed script

UserID = #PARAM1
Damage = Random(3,GetUserMaxHP(UserID)/2)
Damage = Damage - Floor(GetUserEndurance(UserID) * 0.35)
If Damage < 3
	Damage = 3
EndIf

If GetUserHP(UserID) < Damage
	SendMessageToAll("* "+GetUserName(UserID)+" has died from hypothermia!",#MSG_CRITICAL)
	SetUserHP(UserID,1)
EndIf

SendCombatMessage(UserID,"Jolts of ice run down your back ")
If GetUserAccess(UserID) < 5
	DamageUser(UserID,Damage)
EndIf

If #PARAM2 < 20
	If Random(0,Floor(#PARAM2*#PARAM2) * 25) = 0
		Timer(538,Random(5000,15000),UserID,#PARAM2+1,0)
	EndIf
EndIf

Continue = 1