;'Sealed Darkness' - Item use script, item 484

Target = GetUserID(GetUserMessage(#USERID))
If Target < 1
	GiveItem(#USERID,484)
	SendCombatMessage(#USERID,"Type the name of the player to use this on. ")
	GoTo END
ElseIf IsOnline(Target) = 0
	GiveItem(#USERID,484)
	SendCombatMessage(#USERID,GetUserName(Target)+" is not online! ")
	GoTo END
ElseIf GetUserMap(Target) = 1190
	GiveItem(#USERID,484)
	SendCombatMessage(#USERID,"Type the name of the player to use this on. ")
	GoTo END
EndIf

If GetUserAccess(#USERID) < 5
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY 
		GiveItem(#USERID,484)
		SendCombatMessage(#USERID,"You can't use this here! ")
		GoTo END
	ElseIf GetUserAccess(Target) > GetUserAccess(#USERID) 
		GiveItem(#USERID,484)
		SendCombatMessage(#USERID,"Can't use this on "+GetUserName(Target)+"! ")
		GoTo END
	ElseIf GetUserMap(Target) <> #MAPID
		GiveItem(#USERID,484)
		SendCombatMessage(#USERID,GetUserName(Target)+" is too far away! ")
		GoTo END
	EndIf
EndIf

Timer5(640,30000,Target,GetUserMap(Target),GetUserX(Target),GetUserY(Target),0)
WarpUser(Target,1190,#XPOS,#YPOS)
SendMessageToMap(#MAPID,GetUserName(Target)+" was trapped in darkness!",#MSG_CRITICAL)
SendMessageToUser(Target,GetUserName(#USERID)+" has trapped you in darkness!",#MSG_CRITICAL)

Label END

Continue = 1