Duuhzinhow 30 Postado Maio 7, 2015 Share Postado Maio 7, 2015 (editado) Alguem poderia colocar condowl de 15 segundos nessa spell para mim? Quero tambem que coloque o (distanceeffect 29) e o (effect 34).. remove_time = 4 local item_id = 1285 function onCastSpell(cid, var) local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll) then doCreateItem(item_id, 1, posAll) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll.x,y=posAll.y,z=posAll.z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end Ja adicionei no function.lua >> V function getCooldown(cid, spellname) local storage = tostring(getPlayerStorageValue(cid, 40001)) local spellname = '"' .. spellname .. '"' return string.find(storage, spellname) and tonumber(string.match(storage, "%d+", string.find(storage, spellname) + #spellname)) - os.time() or 0 end function setCooldown(cid, spellname, seconds) local storage = getPlayerStorageValue(cid, 40001) == -1 and "" or tostring(getPlayerStorageValue(cid, 40001)) local spellname = '"' .. spellname .. '"' if string.find(storage, spellname) then local gsub = string.gsub(storage, string.match(storage, "%d+", string.find(storage, spellname) + #spellname), tostring(os.time() + seconds)) setPlayerStorageValue(cid, 40001, gsub) else setPlayerStorageValue(cid, 40001, storage .. spellname .. " " .. tostring(seconds + os.time()) .. " ") end end function isExhausted(cid, spellname) return getCooldown(cid, spellname) > 0 end Agradeço desde ja, rep+ Vitera is comming... Fique ligado Editado Maio 8, 2015 por Duuhzinhow Link para o comentário Compartilhar em outros sites More sharing options...
0 Wend ll 268 Postado Maio 7, 2015 Share Postado Maio 7, 2015 o cooldown fica na tag que vc adiciona no spells.xml.. é no exhaust "1000" onde 1000 é o tempo em milisegundos (1000 milisegundos = 1 segundo) Link para o comentário Compartilhar em outros sites More sharing options...
0 Duuhzinhow 30 Postado Maio 7, 2015 Autor Share Postado Maio 7, 2015 (editado) o cooldown fica na tag que vc adiciona no spells.xml.. é no exhaust "1000" onde 1000 é o tempo em milisegundos (1000 milisegundos = 1 segundo) Isso é exaust. Vitera is comming... Fique ligado Editado Maio 8, 2015 por Duuhzinhow Link para o comentário Compartilhar em outros sites More sharing options...
0 CaioValverde 1 Postado Maio 7, 2015 Share Postado Maio 7, 2015 Tambem estou atrás de como coloco cooldown T_T Link para o comentário Compartilhar em outros sites More sharing options...
0 Wend ll 268 Postado Maio 7, 2015 Share Postado Maio 7, 2015 (editado) Isso é exaust. Tente assim: remove_time = 4 local item_id = 1285 local cooldown = 10 function onCastSpell(cid, var) if os.time() - getPlayerStorageValue(cid, 19329) >= cooldown then doPlayerSetStorageValue(cid, 19329, os.time()) local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end Ali onde está: local cooldown = 10 é o tempo do cd Tambem estou atrás de como coloco cooldown T_T Mim mande a script da spell que vejo pra você ^^ Editado Maio 7, 2015 por AnnaFeeh Link para o comentário Compartilhar em outros sites More sharing options...
0 Duuhzinhow 30 Postado Maio 7, 2015 Autor Share Postado Maio 7, 2015 (editado) Tente assim: remove_time = 4 local item_id = 1285 local cooldown = 10 function onCastSpell(cid, var) if os.time() - getPlayerStorageValue(cid, 19329) >= cooldown then doPlayerSetStorageValue(cid, 19329, os.time()) local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end Ali onde está: local cooldown = 10 é o tempo do cd Mim mande a script da spell que vejo pra você ^^ Não funcionou Se tentar novamente tente adicionar os efeitos que pedi se possivel kk vlw Vitera is comming... Fique ligado Editado Maio 8, 2015 por Duuhzinhow Link para o comentário Compartilhar em outros sites More sharing options...
0 Wend ll 268 Postado Maio 7, 2015 Share Postado Maio 7, 2015 Não funcionou Se tentar novamente tente adicionar os efeitos que pedi se possivel kk vlw Eu testei assim e funcionou aqui: remove_time = 4 local item_id = 1285 function onCastSpell(cid, var) if exhaustion.check(cid, 23006) == false then exhaustion.set(cid, 23006, 10) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]") return false end local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end depois que resolvemos esse problema do cooldown ai adiciono os efeitos kk Link para o comentário Compartilhar em outros sites More sharing options...
0 Duuhzinhow 30 Postado Maio 7, 2015 Autor Share Postado Maio 7, 2015 (editado) Eu testei assim e funcionou aqui: remove_time = 4 local item_id = 1285 function onCastSpell(cid, var) if exhaustion.check(cid, 23006) == false then exhaustion.set(cid, 23006, 10) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]") return false end local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end depois que resolvemos esse problema do cooldown ai adiciono os efeitos kk Ae mano kkk condowl funcionou, rep+ agora só colocar os efeitos :3 Vitera is comming... Fique ligado Editado Maio 8, 2015 por Duuhzinhow Link para o comentário Compartilhar em outros sites More sharing options...
0 Wend ll 268 Postado Maio 9, 2015 Share Postado Maio 9, 2015 Ae mano kkk condowl funcionou, rep+ agora só colocar os efeitos :3 Teste assim: remove_time = 4 local item_id = 1285 function onCastSpell(cid, var) if exhaustion.check(cid, 23006) == false then exhaustion.set(cid, 23006, 10) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]") end doSendMagicEffect(getThingPos(cid), 34) return false end local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end só adicionei o effect, para adiciona o distance effect eu preciso sabe se o seu servidor tem essa função: doSendDistanceEffect(fromPos, toPos, distance_effect) Link para o comentário Compartilhar em outros sites More sharing options...
0 Duuhzinhow 30 Postado Maio 9, 2015 Autor Share Postado Maio 9, 2015 (editado) Teste assim: remove_time = 4 local item_id = 1285 function onCastSpell(cid, var) if exhaustion.check(cid, 23006) == false then exhaustion.set(cid, 23006, 10) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]") end doSendMagicEffect(getThingPos(cid), 34) return false end local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end só adicionei o effect, para adiciona o distance effect eu preciso sabe se o seu servidor tem essa função: doSendDistanceEffect(fromPos, toPos, distance_effect) Deu esse erro aqui mano Data/spells/script/novas/prision.lua:31: '<eof>' expected near 'end' em relaçao ao distance effect,acredito que tem sim kkkk Vitera is comming... Fique ligado Editado Maio 9, 2015 por Duuhzinhow Link para o comentário Compartilhar em outros sites More sharing options...
0 Wend ll 268 Postado Maio 9, 2015 Share Postado Maio 9, 2015 Deu esse erro aqui mano em relaçao ao distance effect,acredito que tem sim kkkk testei aqui: remove_time = 4 local item_id = 1285 function onCastSpell(cid, var) if exhaustion.check(cid, 23006) == false then exhaustion.set(cid, 23006, 10) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]") doSendMagicEffect(getThingPos(cid), 34) return false end local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end sobre o distance effect é essa função ai que você está procurando: doSendDistanceEffect(fromPos, toPos, distance_effect) Tem 3 argumentos essa função fromPos é de onde sai o distance effect toPos é pra onde ele vai. fromPos = de onde vai sair o distance effect, você vai trocar ele pela posição em que você quer que o distance effect saia. toPos = pra onde o distance effect vai, você vai trocar ele pela posição em que você quer que o distance effect atinja distance_effect = numero do distance effect, o efeito, a animação, como preferir chamar. Link para o comentário Compartilhar em outros sites More sharing options...
0 Duuhzinhow 30 Postado Maio 10, 2015 Autor Share Postado Maio 10, 2015 testei aqui: remove_time = 4 local item_id = 1285 function onCastSpell(cid, var) if exhaustion.check(cid, 23006) == false then exhaustion.set(cid, 23006, 10) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]") doSendMagicEffect(getThingPos(cid), 34) return false end local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end sobre o distance effect é essa função ai que você está procurando: doSendDistanceEffect(fromPos, toPos, distance_effect) Tem 3 argumentos essa função fromPos é de onde sai o distance effect toPos é pra onde ele vai. fromPos = de onde vai sair o distance effect, você vai trocar ele pela posição em que você quer que o distance effect saia. toPos = pra onde o distance effect vai, você vai trocar ele pela posição em que você quer que o distance effect atinja distance_effect = numero do distance effect, o efeito, a animação, como preferir chamar. Tem como voce fazer pra sair o efeito, tipo.. em cima das pedras que vai criar ao redor do target? e coloca o distanceeffect ja tmb kkkk, como voce esta me ajudando ja vou dando rep+ :3 Vitera is comming... Fique ligado Link para o comentário Compartilhar em outros sites More sharing options...
0 Wend ll 268 Postado Maio 11, 2015 Share Postado Maio 11, 2015 Tem como voce fazer pra sair o efeito, tipo.. em cima das pedras que vai criar ao redor do target? e coloca o distanceeffect ja tmb kkkk, como voce esta me ajudando ja vou dando rep+ :3 Teste assim: remove_time = 4 local item_id = 1285 function onCastSpell(cid, var) if exhaustion.check(cid, 23006) == false then exhaustion.set(cid, 23006, 10) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]") return false end local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) doSendMagicEffect(posAll[i], 34) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end Você quer por que o magic effect saia do player e vá pras rocks ou o contrário? Se for do player pra rock o fromPos seria getThingPos(cid) e toPos o posAll, se for o contrário basta inverter as posições (fromPos = posAll e toPos = getThingPos(cid)) Link para o comentário Compartilhar em outros sites More sharing options...
0 Duuhzinhow 30 Postado Maio 11, 2015 Autor Share Postado Maio 11, 2015 Teste assim: remove_time = 4 local item_id = 1285 function onCastSpell(cid, var) if exhaustion.check(cid, 23006) == false then exhaustion.set(cid, 23006, 10) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]") return false end local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) doSendMagicEffect(posAll[i], 34) end end addEvent(removeItem, remove_time*1000, posAll) return true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end Você quer por que o magic effect saia do player e vá pras rocks ou o contrário? Se for do player pra rock o fromPos seria getThingPos(cid) e toPos o posAll, se for o contrário basta inverter as posições (fromPos = posAll e toPos = getThingPos(cid)) Mano o efeito pra sair em cima das pedras deu certo, rep + quero tipo, colocar um distance effect, que saia do player e va para o target... entendeu? kkkk Link para o comentário Compartilhar em outros sites More sharing options...
0 CaioValverde 1 Postado Maio 11, 2015 Share Postado Maio 11, 2015 o que essa spell faz? Link para o comentário Compartilhar em outros sites More sharing options...
0 GGAT20 3 Postado Maio 11, 2015 Share Postado Maio 11, 2015 Tenta isso se for oque eu to pensando ta certo porque testei aqui mas com uns efeitos fedorentos. remove_time = 6 local item_id = 1285 local efeitodistancia = 29 local magikeffect = 34 local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, efeitodistancia) function onCastSpell(cid, var) if exhaustion.check(cid, 23006) == false then exhaustion.set(cid, 23006, 10) else doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]") return false end local pos = getThingPosition(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) doSendMagicEffect(posAll[i], magikeffect) end end addEvent(removeItem, remove_time*1000, posAll) return doCombat(cid, combat, var) and true end function isWalkable(pos, creature, pz, proj) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) 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 removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Duuhzinhow 30
Alguem poderia colocar condowl de 15 segundos nessa spell para mim? Quero tambem que coloque o (distanceeffect 29) e o (effect 34)..
remove_time = 4
Fique ligadoLink para o comentário
Compartilhar em outros sites
20 respostass a esta questão
Posts Recomendados