Postado Janeiro 22, 2018 7 anos Autor 1 minuto atrás, Luan Zero disse: O effect é para sair no target? Ou em você? ao redor do target se possível
Postado Janeiro 22, 2018 7 anos 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 Janeiro 22, 2018 7 anos 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) thendoSendMagicEffect(positions, effect)endendend local function No_Move_Target()if isCreature(target) thendoCreatureSetNoMove(target, 0)endreturn TRUEend if isPlayer(cid) and exhaustion.check(cid, storage) == TRUE thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar novamente.")return falseend exhaustion.set(cid, storage, exausted)doCreatureSetNoMove(target, 1)doAddCondition(target, condition)addEvent(No_Move_Target, tempo*1000)local t = 0while t <= tempo*1000 doaddEvent(Efect, t)t = t+300endreturn trueend 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 Janeiro 22, 2018 7 anos por samuelandrade45 (veja o histórico de edições)
Postado Janeiro 22, 2018 7 anos 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 Janeiro 22, 2018 7 anos por Luan Zero (veja o histórico de edições)
Postado Janeiro 22, 2018 7 anos Autor 3 minutos atrás, Luan Zero disse: 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:
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.