Em 15/02/2017 at 04:50, gmmachado disse:Preciso de uma spell, que ao usa-la faz o conjurador ir em direção ao alvo, estando ele dentro de uma quantidade máxima de sql.
Grato!
local config = {efeitoTele = 134, -- efeito q ira aparacer a cada teleport.hits = 1, -- quantos hits vai dardelay = 400, -- intervalo de tempo a cada hit}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 trueendfunction getPosDirs(p, dir) -- mkalo return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z}endfunction validPos(pos)tb = {}for i = 1, 8 do newpos = getPosDirs(pos, i) if isWalkable(newpos) then table.insert(tb, newpos) endendtable.insert(tb, pos)return tbendspell58 = {start58 = function (cid, target, markpos, hits) if not isCreature(cid) then return true end if not isCreature(target) or hits < 1 then doTeleportThing(cid, markpos) doSendMagicEffect(getThingPos(cid), config.efeitoTele) return true end posAv = validPos(getThingPos(target)) rand = #posAv == 1 and 1 or #posAv - 1 doSendMagicEffect(getThingPos(cid), config.efeitoTele) doTeleportThing(cid, posAv[math.random(1, rand)]) end}function onCastSpell(cid)local position1 = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}target = getCreatureTarget(cid)if target then spell58.start58(cid, target, getThingPos(cid), config.hits) doSendMagicEffect(position1, 95)endreturn trueend
Quando voce for configurar em spells.xml voce escolhe a quantidade maxima de SQM >> range="10"






info
Grupo: Campones
Registrado: 29/07/15
Posts: 3
Reputação: 0
Preciso de uma spell, que ao usa-la faz o conjurador ir em direção ao alvo, estando ele dentro de uma quantidade máxima de sql.
Grato!