fiz a última aqui rapidinho pra vc tirar como exemplo.
--<Script by Jhon992>--
local stonesId = {8633,8634,8635,8636} -- ids dos diferente tipos de stones.
local timeRemove = 30 -- tempo para dumir as pedras em segundos.
local stonesPosition = {} -- não mexa.
function createObject(cid, position)
if (isPlayer(cid)) then
if getPlayerLookDir(cid) == 0 then
positions = {x=position.x, y=position.y-1, z=position.z}
elseif getPlayerLookDir(cid) == 1 then
positions = {x=position.x+1, y=position.y, z=position.z}
elseif getPlayerLookDir(cid) == 2 then
positions = {x=position.x, y=position.y+1, z=position.z}
elseif getPlayerLookDir(cid) == 3 then
positions = {x=position.x-1, y=position.y, z=position.z}
end
if isWalkable(positions) then
createStone(positions, stonesId[math.random(1,#stonesId)], cid)
addEvent(createObject, 500, cid, positions)
else
addEvent(removeStones, timeRemove*1000)
end
end
end
function createStone(positions, stone, cid)
doCreateItem(stone, 1, positions)
stonesPosition[(#stonesPosition)+1] = {x=positions.x, y=positions.y, z=positions.z, stackpos=1}
end
function removeStones()
for i=1, #stonesPosition do
for o=1, 2 do
stonesPosition[i] = {x=stonesPosition[i].x, y=stonesPosition[i].y, z=stonesPosition[i].z, stackpos=o}
if isInArray(stonesId, getThingfromPos(stonesPosition[i]).itemid) then
doRemoveItem(getThingfromPos(stonesPosition[i]).uid)
end
end
end
end
function isWalkable(pos, creature, pz, proj) -- 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 not pz then return false end
local n = not proj and 3 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
function onCastSpell(cid, var)
local position = getPlayerPosition(cid)
createObject(cid, position)
end








info
Grupo: Campones
Registrado: 22/11/11
Posts: 3
Reputação: 0
Char no Tibia: Sabaku no Gaara
Eu queria uma spell com movimento stilo essas:
se conseguir fazer manda qualquer uma que é só pra mim aprender a faze-la ;x
8.54