RO
dúvida

Duvida em magia (paralyza target e fica dando efect)

Por roriscrave, 20 de abr. de 2014 em Scripts

resolvido
script
4
664
20 de abril de 2014 às 15:18

estou criando uma magia que funciona da seguinte forma.

Você usa magia no jogador e ele fica 'imobilizado' por certo tempo, e eu queria que nesse tempo que o jogador fica 'imovel', ficasse saindo um effect dele, mas nao estou conseguindo colocar.

 

Eu queria que o tempo todo que o jogador fica imovel (5 segundos), ficasse saindo um efeito nele (effect 189).

 

script:

function unparalyze(cid)
return isPlayer(cid) and doCreatureSetNoMove(cid, false)
end


function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
local trapos = getCreaturePosition(target)
local playerpos = getCreaturePosition(cid)
local target = getCreatureTarget(cid)
local pid = getCreatureTarget(cid)

if not isCreature(pid) then
return false, doPlayerSendCancel(cid, 'You may only use this on human targets.')
end
return doCreatureSetNoMove(pid, true), addEvent(unparalyze, 5000, pid), 
doSendMagicEffect(trapos, 189)
end
20 de abril de 2014 às 15:53
Melhor resposta

é pra mandar de 1 em 1 segundo? se for...

 

function unparalyze(cid)
return isPlayer(cid) and doCreatureSetNoMove(cid, false)
end

function magicEfe(cid, times)

if times > 0 and isPlayer(cid) then
	doSendMagicEffect(getCreaturePosition(cid), 189)
	addEvent(magicEfe, 1000, cid, times-1)
end
end


function onCastSpell(cid, var)

local target = getCreatureTarget(cid)

if not isCreature(target) then
	doPlayerSendCancel(cid, 'You may only use this on human targets.')
	return false
end

doCreatureSetNoMove(target, true)
addEvent(unparalyze, 5000, target)
doSendMagicEffect(getCreaturePosition(target), 189)
addEvent(magicEfe, 1000, target, 5)
return true
end
ps: não testei, vê como ta

Editado Abril 20 por Demonbholder

20 de abril de 2014 às 16:38

vlw mano, funcionou certinho 100%

OmegaO
20 de abril de 2014 às 17:30

Tópico movido para a seção de dúvidas e pedidos resolvidos.