local t = {
[1000] = {
monster = "Warlock",
pos = {
{x = 100, y = 100, z = 7}, -- Top Left Corner of Spawn Area
{x = 100, y = 100, z = 7}, -- Bottom Right Corner of Spawn Area
{x = 100, y = 100, z = 7} -- Where the Player is teleported
}
}
}
function onStepIn(cid, item, position, fromPosition)
local v = t[item.actionid]
if v and not isInRange(getCreaturePosition(v.monster), v.pos[1], v.pos[2]) then
local a, b = v.pos[1], v.pos[2]
local pos = {x=math.random(a.x, b.x), y=math.random(a.y, b.y), z=math.random(a.z, b.z)}
while doCreateMonster(v.monster, pos, false) ~= RETURNVALUE_NOERROR do
pos = {x=math.random(a.x, b.x), y=math.random(a.y, b.y), z=math.random(a.z, b.z)}
end
doTeleportThing(cid, v.pos[3])
end
end