Em data/lib, coloque a seguinte função em 050-function.lua:
function isWalkable(pos, creature, proj, pz)-- by Nord
if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
if getTopCreature(pos).uid > 0 and creature then return false end
if getTileInfo(pos).protection and pz then return false, true end
local n = not proj and 2 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end
No código de headbutt, abaixo de:
local lvl = {25, 40, 60, 80, 150, 1000} --lvls
coloque:
local fromPos, toPos, canSummon = {x = pos.x - 1, y = pos.y - 1}, {x = pos.x + 1, y = pos.y + 1}
for x = fromPos.x, toPos.x do
if canSummon then
break
end
for y = fromPos.y, toPos.y do
if isWalkable({x = x, y = y, z = pos.z}, true) then
canSummon = true
break
end
end
end
if not canSummon then
doPlayerSendTextMessage(master, 27, "Sorry, there's no way to create a monster here.")
return true
end


info
Grupo: Campones
Registrado: 29/10/10
Posts: 1
Reputação: 0
Gênero: Masculino
Está dando esse erro qnd executa o headbutt em arvores cujo sqms ao redor esteja ocupado..
[29/12/2015 18:37:09] [Error - Action Interface]
[29/12/2015 18:37:09] In a timer event called from:
[29/12/2015 18:37:09] data/actions/scripts/order.lua:onUse
[29/12/2015 18:37:09] Description:
[29/12/2015 18:37:09] (luaDoCreateMonster) Cannot create monster: Heracross
elseif skill == "headbutt" then --alterado v1.6 local master = getCreatureMaster(sid) local array = {} local lvl = {25, 40, 60, 80, 150, 1000} --lvls for i = 1, #lvl do if getPlayerLevel(master) <= lvl[i] then array = headbutt[lvl[i]] break end end local rand = array[math.random(#array)] for j = 1, rand[2] do local poke = doCreateMonster(rand[1], getClosestFreeTile(sid, pos)) doSetMonsterPassive(poke) doWildAttackPlayer(poke, master) end local item = getTileItemById(pos, 12591) --id do item arvore normal doCreatureSay(sid, "HEADBUTT!", TALKTYPE_MONSTER) markPos(sid, {x=1,y=1,z=7}) doFaceCreature(sid, pos) doSendMagicEffect(getThingPos(item.uid), 118) doTransformItem(item.uid, 12592) --id do item arvore quebrada local function growHead() doTransformItem(getTileItemById(pos, 12592).uid, 12591) --id do item arvore quebrada, arvore normal end addEvent(growHead, choose(5, 10, 20, 30) * 60 * 10) --o tempo pra arvore voltar ao normal varia de 5~30min --mudei jah elseif skill == "dig" then local item = getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}) doCreatureSay(sid, "DIG!", TALKTYPE_MONSTER) markPos(sid, {x=1,y=1,z=7}) doFaceCreature(sid, pos) doSendMagicEffect(getThingPos(item.uid), 3) doTransformItem(item.uid, item.itemid+1) local function closeHole() doTransformItem(getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).uid, item.itemid) end addEvent(closeHole, intervalToRegrowBushAndStones * 1000)não sei se fico claro, sou novo com esse tipo de coisa, caso esteja algo erro por gentileza, me perdoem.