--[[
firetopoint.lua:
INTERFACE

point = {0, 0, 0};
shots = 10;
fire_timeout = 5;

END
--]]

function TemplateFireInitialize(Point, Shots, FireTimeout)
	Shots = Shots - 1;
	local function fire()
		if unit.IsShotDone() then
			if Shots > 0 then
				unit.AttackPlace(Point);
				Shots = Shots - 1;
			else
				AIparts:RemovePeriodic("template.Fire");
			end
		end
	end
	unit.AttackPlace(Point);
	if Shots > 0 then
		AIparts:AddPeriodic("template.Fire", FireTimeout, fire);
	end
end

TemplateFireInitialize(point, shots, fire_timeout);
