;SendMessageToUser(#USERID,"This item has been temporarily disabled due to abuse",#MSG_CRITICAL)
;Goto End

If GetUserFlag(#USERID,21)<>0
Goto End
Endif

If GetUserDirection(#USERID)=#DIR_UP
CurrX=GetUserX(#USERID)
CurrY=GetUserY(#USERID)-1
SetUserFlag(#USERID,19,1)
Elseif GetUserDirection(#USERID)=#DIR_DOWN
CurrX=GetUserX(#USERID)
CurrY=GetUserY(#USERID)+1
SetUserFlag(#USERID,19,2)
Elseif GetUserDirection(#USERID)=#DIR_RIGHT
CurrX=GetUserX(#USERID)+1
CurrY=GetUserY(#USERID)
SetUserFlag(#USERID,19,3)
Elseif GetUserDirection(#USERID)=#DIR_LEFT
CurrX=GetUserX(#USERID)-1
CurrY=GetUserY(#USERID)
SetUserFlag(#USERID,19,4)
Endif

TakeItem(#USERID,#TARGETID)
CreateEffect(GetItemFlag2(#TARGETID),1700,90,GetUserDirection(#USERID),GetUserMap(#USERID),CurrX,CurrY,0,0,1))

If GetTileType(GetUserMap(#USERID),CurrX,CurrY)=#TILE_WALL
	SpawnItem(GetUserMap(#USERID),#TARGETID,GetUserX(#USERID),GetUserY(#USERID))
Elseif GetTileType(GetUserMap(#USERID),CurrX,CurrY)=#TILE_DOOR
	SpawnItem(GetUserMap(#USERID),#TARGETID,GetUserX(#USERID),GetUserY(#USERID))
Elseif GetTileType(GetUserMap(#USERID),CurrX,CurrY)=#TILE_NPC
	SpawnItem(GetUserMap(#USERID),#TARGETID,GetUserX(#USERID),GetUserY(#USERID))
Elseif GetTileType(GetUserMap(#USERID),CurrX,CurrY)=#TILE_GODONLY
	SpawnItem(GetUserMap(#USERID),#TARGETID,GetUserX(#USERID),GetUserY(#USERID))
Elseif GetTileType(GetUserMap(#USERID),CurrX,CurrY)=#TILE_WARP
	SpawnItem(GetUserMap(#USERID),#TARGETID,GetUserX(#USERID),GetUserY(#USERID))
Else
	SetUserFlag(#USERID,20,GetUserMap(#USERID))
	SetUserFlag(#USERID,21,1)
	Timer5(209,325,#USERID,CurrX,CurrY,#TARGETID,0)
	Timer(403,2000,#USERID,#TARGETID,0)
Endif

Label End

Continue = 1