Ir para conteúdo

Featured Replies

  • Respostas 22
  • Visualizações 1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado
Spoiler

local tempo = 2 -- tempo do paralyze em segundos
local effect = 58 -- efeito que vai sair ao redor do player
local exausted = 8 -- exhausted em segundos
local storage = 13098 -- storage do exausted

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -5000)

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)

local function Efect()
if not isCreature(target) then return true end
local positions = {
[1] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[2] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[3] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[4] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[5] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[6] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[7] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[8] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z}
}
for i=1, #positions do
if isWalkable(positions) then
doSendMagicEffect(positions, effect)
end
end
end

local function No_Move_Target()
if isCreature(target) then
doCreatureSetNoMove(target, 0)
end
return TRUE
end

if isPlayer(cid) and exhaustion.check(cid, storage) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar novamente.")
return false
end

exhaustion.set(cid, storage, exausted)
doCreatureSetNoMove(target, 1)
doAddCondition(target, condition)
addEvent(No_Move_Target, tempo*1000)
local t = 0
while t <= tempo*1000 do
addEvent(Efect, t)
t = t+300
end
return true
end

Esse aqui funcionou perfeitamente, certifique-se que tem o efeito 58 em seu servidor

Postado
  • Autor
6 minutos atrás, Luan Zero disse:
  Ocultar conteúdo

local tempo = 2 -- tempo do paralyze em segundos
local effect = 58 -- efeito que vai sair ao redor do player
local exausted = 8 -- exhausted em segundos
local storage = 13098 -- storage do exausted

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -5000)

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)

local function Efect()
if not isCreature(target) then return true end
local positions = {
[1] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[2] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[3] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[4] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[5] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[6] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[7] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z},
[8] = {x=getCreaturePosition(target).x+2, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z}
}
for i=1, #positions do
if isWalkable(positions) then
doSendMagicEffect(positions, effect)
end
end
end

local function No_Move_Target()
if isCreature(target) then
doCreatureSetNoMove(target, 0)
end
return TRUE
end

if isPlayer(cid) and exhaustion.check(cid, storage) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar novamente.")
return false
end

exhaustion.set(cid, storage, exausted)
doCreatureSetNoMove(target, 1)
doAddCondition(target, condition)
addEvent(No_Move_Target, tempo*1000)
local t = 0
while t <= tempo*1000 do
addEvent(Efect, t)
t = t+300
end
return true
end

Esse aqui funcionou perfeitamente, certifique-se que tem o efeito 58 em seu servidor

tem o effect sim ele aparece no /z mas não aparece na magia

 

deu esse erro nesse script ae

[22/01/2018 21:24:37] data/spells/scripts/Earth/earth trap.lua:26: attempt to call global 'isWalkable' (a nil value)
[22/01/2018 21:24:37] stack traceback:
[22/01/2018 21:24:37]     data/spells/scripts/Earth/earth trap.lua:26: in function <data/spells/scripts/Earth/earth trap.lua:13>
 

o outro funcionava mas não aparecia o effect

8 minutos atrás, samuelandrade45 disse:

tem o effect sim ele aparece no /z mas não aparece na magia

 

deu esse erro nesse script ae

[22/01/2018 21:24:37] data/spells/scripts/Earth/earth trap.lua:26: attempt to call global 'isWalkable' (a nil value)
[22/01/2018 21:24:37] stack traceback:
[22/01/2018 21:24:37]     data/spells/scripts/Earth/earth trap.lua:26: in function <data/spells/scripts/Earth/earth trap.lua:13>
 

o outro funcionava mas não aparecia o effect

 

nenhum tá funcionando agora só da esse erro ai do isWalkable

Editado por samuelandrade45 (veja o histórico de edições)

Postado

LOisfc3.png

 

No que mandei primeiro, funcionou o efeito tranquilo aqui, qual tfs você está utilizando? Testei em uma 0.4 e uma 0.3.6 e funcionou nos dois.

 

 

</instant>
    <instant name="Trap" words="trap" lvl="300" maglv="120" mana="1200" prem="0" needtarget="1" range="5" exhaustion="0" blockwalls="1" needlearn="0" script="trap.lua">
        <vocation id="1"/>

 

no seu jogo está assim? no spells.xml?

 

Editado por Luan Zero (veja o histórico de edições)

Postado
  • Autor
3 minutos atrás, Luan Zero disse:

LOisfc3.png

 

No que mandei primeiro, funcionou o efeito tranquilo aqui, qual tfs você está utilizando? Testei em uma 0.4 e uma 0.3.6 e funcionou nos dois.

 

 

</instant>
    <instant name="Trap" words="trap" lvl="300" maglv="120" mana="1200" prem="0" needtarget="1" range="5" exhaustion="0" blockwalls="1" needlearn="0" script="trap.lua">
        <vocation id="1"/>

 

no seu jogo está assim? no spells.xml?

 

mudei pra esse mas o effect não aparece é o erro do isWalkable continua :/

 

2 minutos atrás, samuelandrade45 disse:

 

erro.thumb.png.38741acfc6af0ca2797aa6b8639dd862.png

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo