local porta = {x=253, y=69, z=7, stackpos = 1}
local toPos, fromPos = {x= 257, y= 75, z= 7},{x= 250, y= 69, z= 7}
local position = {x=math.random(fromPos.x,toPos.x), y=math.random(fromPos.y,toPos.y), z=math.random(fromPos.z,toPos.z)}
local monsters = {"Rat", "Rotworm", "Snake"}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
doTransformItem(item.uid,item.itemid+1)
if getTileItemById(porta, 5734).uid > 0 then doTransformItem(getThingfromPos(porta).uid, 5733) end
for i=1, #monsters do
doCreateMonster(monsters[i], position)
end
elseif item.itemid == 1946 then
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
local m = getTopCreature({x=x, y=y, z=toPos.z}).uid
if m ~= 0 and isMonster(m) then return true end
end
end
doTransformItem(item.uid,item.itemid-1)
if getTileItemById(porta, 5733).uid > 0 then doTransformItem(getThingfromPos(porta).uid, 5734) end
end
return true
end
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino
local porta = {x=253, y=69, z=7, stackpos = 1} local toPos, fromPos = {x= 257, y= 75, z= 7},{x= 250, y= 69, z= 7} local position = {x=math.random(fromPos.x,toPos.x), y=math.random(fromPos.y,toPos.y), z=math.random(fromPos.z,toPos.z)} local monsters = {"Rat", "Rotworm", "Snake"} function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 1945 then doTransformItem(item.uid,item.itemid+1) if getTileItemById(porta, 5734).uid > 0 then doTransformItem(getThingfromPos(porta).uid, 5733) end for i=1, #monsters do doCreateMonster(monsters[i], position) end elseif item.itemid == 1946 then for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do local m = getTopCreature({x=x, y=y, z=toPos.z}).uid if m ~= 0 and isMonster(m) then return true end end end doTransformItem(item.uid,item.itemid-1) if getTileItemById(porta, 5733).uid > 0 then doTransformItem(getThingfromPos(porta).uid, 5734) end end return true endsanado, reportado.