Boa tarde.
Estou tentando reproduzir o script Pokémon Move de "pota".
mas estou com um problema, pois os monstros podem passar por tudo.
Código:
function pokemonWalk(summon, position, maxDistance, extra)
local path = summon:getPathTo(position,0, maxDistance,false,false,15)if not path then
returnfalse
end
setCreatureIdle(summon:getId(),#path * 500 + 10000)
walkToPosition(summon:getId(), path,1, extra)returntrue
end
function walkToPosition(cid, path, count, extra)
local creature =Creature(cid)if not creature then
returntrue
end
if creature:getCondition(CONDITION_MOVING)== nil then
returntrue
end
local dir = path[count]
creature:move(dir)
count = count +1
addEvent(walkToPosition, creature:getWalkDelay(dir), cid, path, count, extra)
end
function setCreatureIdle(cid, time)
local creature =Creature(cid)if not creature then
returntrue
end
local condition =Condition(CONDITION_MOVING)
condition:setParameter(CONDITION_PARAM_TICKS, time)
creature:addCondition(condition)
end
Question
joshiie25 0
Boa tarde.
Estou tentando reproduzir o script Pokémon Move de "pota".
mas estou com um problema, pois os monstros podem passar por tudo.
Código:
Link to comment
Share on other sites
3 answers to this question
Recommended Posts