_Actor = _this select 0
_Centre = _this select 1
_area = _this select 2
_minZ = _this select 3
_maxZ = _this select 4
_freq = _this select 5
_rounds = _this select 6

; Get the old positions for the detonator object
_ActorPos = GetPos _Actor
_oldx = _ActorPos select 0
_oldy = _ActorPos select 1
_oldz = _ActorPos select 2

; Get the centre point positions, once!
_CentrePos = GetMarkerPos _Centre
_cx = _CentrePos select 0
_cy = _CentrePos select 1

; Prepare some values
_areaX2 = _area * 2
_value = (_maxZ - _minZ) * 2

#Update
_rounds = _rounds - 1
; Move the detonator to some random location
_Actor SetPos [_cx + Random(_areaX2) - _area,_cy + Random(_areaX2) - _area, Random(_value) + _minZ]
; Detonate the detonater
_Actor SetDammage 1
; Wait a milli second
~0.01
; Move back the detonater
_Actor SetPos [_oldx,_oldy,_oldz]
_Actor SetDammage 0
~_freq
? (_rounds > 0) : goto "Update"
exit