function createPoisonTraps()
	PoisenTraps = {}
	for i = 1,28,1 do
		table.insert(PoisenTraps,GetID("Giftfalle"..i))
	end
	StartSimpleJob("ControllPoisonTraps")
end

function ControllPoisonTraps()
	local trappos
	for i = table.getn(PoisenTraps),1,-1 do
		trappos = GetPosition(PoisenTraps[i])
		if Logic.IsPlayerEntityOfCategoryInArea(1, trappos.X, trappos.Y, 1000, "Serf", "Hero", "Leader","Cannon","Thief") == 1 then			
			table.insert(PoisonPos, {X=trappos.X; Y=trappos.Y; Dauer = 20})
			Logic.CreateEffect(GGL_Effects.FXExplosion , trappos.X, trappos.Y, 0)
			Logic.CreateEffect(GGL_Effects.FXKalaPoison, trappos.X, trappos.Y, 0)
			StartSimpleJob("CreatePoisenNextToIt", trappos, i)
			table.remove(PoisenTraps, i)
		end
	end
	return false
end

function CreatePoisenNextToIt(_position,_number)
	if Counter.Tick2("Trap".._number,5) then
		table.insert(PoisonPos, {X=_position.X+500; Y=_position.Y; Dauer = 20})
		Logic.CreateEffect(GGL_Effects.FXKalaPoison, _position.X+500, _position.Y, 0)
		table.insert(PoisonPos, {X=_position.X-500; Y=_position.Y; Dauer = 20})
		Logic.CreateEffect(GGL_Effects.FXKalaPoison, _position.X-500, _position.Y, 0)
		table.insert(PoisonPos, {X=_position.X; Y=_position.Y+500; Dauer = 20})
		Logic.CreateEffect(GGL_Effects.FXKalaPoison, _position.X, _position.Y+500, 0)
		table.insert(PoisonPos, {X=_position.X; Y=_position.Y-500; Dauer = 20})
		Logic.CreateEffect(GGL_Effects.FXKalaPoison, _position.X, _position.Y-500, 0)
		StartSimpleJob("CreatePoisenNext", _position, _number)
		return true
	end
	return false
end

function CreatePoisenNext(_position,_number)
	if Counter.Tick2("Trapnext".._number,5) then
		table.insert(PoisonPos, {X=_position.X+1000; Y=_position.Y; Dauer = 20})
		Logic.CreateEffect(GGL_Effects.FXKalaPoison, _position.X+1000, _position.Y, 0)
		table.insert(PoisonPos, {X=_position.X-1000; Y=_position.Y; Dauer = 20})
		Logic.CreateEffect(GGL_Effects.FXKalaPoison, _position.X-1000, _position.Y, 0)
		table.insert(PoisonPos, {X=_position.X; Y=_position.Y+1000; Dauer = 20})
		Logic.CreateEffect(GGL_Effects.FXKalaPoison, _position.X, _position.Y+1000, 0)
		table.insert(PoisonPos, {X=_position.X; Y=_position.Y-1000; Dauer = 20})
		Logic.CreateEffect(GGL_Effects.FXKalaPoison, _position.X, _position.Y-1000, 0)
		return true
	end
	return false
end