function onThink(creature)
local tilePos = Tile({x=creature:getPosition().x+math.random(-1, 1), y=creature:getPosition().y+math.random(-1, 1), z=creature:getPosition().z })
if not tilePos then
return true
end
if tilePos:getItemById(1497) or tilePos:getItemById(1499) then
creature:say("Your tricks are older than my minions! You won't trap me! Amuse yourself with my slaves as long was your traps are in place!", TALKTYPE_ORANGE_2)
local xmultiplier
local ymultiplier
local xdistance
local ydistance
local spawnpos
local flag
for i = 1, 20 do
flag = 1
while (flag == 1) do
flag = 0
xmultiplier = math.random(2)
if xmultiplier == 2 then
xmultiplier = -1
end
ymultiplier = math.random(2)
if ymultiplier == 2 then
ymultiplier = -1
end
xdistance = 2
ydistance = 2
for i = 1, 7 do
if math.random(2) == 1 then
if math.random(2) == 1 then
xdistance = xdistance + 1
else
ydistance = ydistance + 1
end
end
end
xdistance = xdistance * xmultiplier
ydistance = ydistance * ymultiplier
spawnpos = Position(33487 + xdistance, 32111 + ydistance, 9)
if Tile(spawnpos):getTopCreature() then
flag = 1
end
end
Game.createMonster("death reaper", spawnpos, false, true)
end
creature:remove()
end
return true
end