ATENÇÃO:
NÃO DOU DIREITO À NINGUÉM DE POSTAR ESTE SCRIPT EM OUTRO LUGAR, SEM MINHA PERMISSÃO.
MEU MSN: eitorlaba@hotmail.com
Pretexto:
Sem muita explicação, eu coloquei um vídeo que explica melhor o que o script faz.
Explicando:
O script é basicamente um ataque que tem uma rota controlada por você, usando ctrl + setas, para direcionar o ataque.
Tempo de controle limitado
Não tem efeito em proction-zone
Os danos são: level do jogador (min), e level do jogador x 3 (max)
Mana gasta: level do jogador x 6
Bugs:
Às vezes o script tira a mana do jogador mas não cria o ataque :S
Script:
[data/actions/scripts/cattack.lua]
function onUse(cid, item, fromPosition, itemEx, toPosition) minMana = getPlayerLevel(cid) * 6 onoff = 4956 quantx = 0 quanty = 0 function setAxis() o = getPlayerPosition(cid) xe = o.x ye = o.y ze = o.z tempo = 3 velocidade = 150 end function doEffect() pos = {x=xe+quantx,y=ye+quanty,z=ze} if getPlayerMana(cid) < minMana then setPlayerStorageValue(cid,work,0) setPlayerStorageValue(cid,onoff,0) elseif getTilePzInfo(pos) == FALSE then local ef = 6 of = 2 doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, pos, 0, -getPlayerLevel(cid), -getPlayerLevel(cid) * 3, ef) -- doPlayerSendCancel(cid,"x = "..xe+quantx..", y = "..ye+quanty..", z = "..ze.."") else doSendMagicEffect(pos,of) -- doPlayerSendCancel(cid,"x = "..xe+quantx..", y = "..ye+quanty..", z = "..ze.."") end addEvent(checkDir,velocidade) end function checkPer() if getPlayerStorageValue(cid,work) == 1 then checkTime() end end function checkTime() if tempo > 0 then doEffect() else stop() end end function stop() posi = {x=xe+quantx,y=ye+quanty,z=ze} doSendMagicEffect(posi,49) doSendAnimatedText(posi,"...",TEXTCOLOR_YELLOW) setPlayerStorageValue(cid,onoff,0) doPlayerSetNoMove(cid,0) addEvent(doPlayerSendCancel,800,cid,"Tempo restante: 0.") end function minusTime() if getPlayerStorageValue(cid,onoff) == 0 then elseif tempo > 0 then doPlayerSendCancel(cid,"Tempo restante: "..tempo..".") tempo = tempo - 1 addEvent(minusTime,1000) elseif tempo == 0 then stop() end end function checkDir() po = getCreatureLookDirection(cid) if po == NORTH then quanty = quanty - 1 elseif po == SOUTH then quanty = quanty + 1 elseif po == WEST then quantx = quantx - 1 elseif po == EAST then quantx = quantx + 1 end checkPer() end if getTilePzInfo(getPlayerPosition(cid)) == TRUE then doSendAnimatedText(getPlayerPosition(cid),"PZ!",TEXTCOLOR_YELLOW) setPlayerStorageValue(cid,work,0) setPlayerStorageValue(cid,onoff,0) elseif getPlayerMana(cid) < minMana then doSendAnimatedText(getPlayerPosition(cid),"MANA",TEXTCOLOR_LIGHTBLUE) doPlayerSendCancel(cid,"Você precisa de "..minMana.." de mana para isso.") setPlayerStorageValue(cid,work,0) setPlayerStorageValue(cid,onoff,0) elseif getPlayerStorageValue(cid,onoff) == 0 then setPlayerStorageValue(cid,work,1) setPlayerStorageValue(cid,onoff,1) doPlayerAddMana(cid,-minMana) doPlayerSetNoMove(cid,1) setAxis() minusTime() checkDir() else doPlayerSendCancel(cid,"Contagem cancelada.") setPlayerStorageValue(cid,work,0) setPlayerStorageValue(cid,onoff,0) doPlayerSetNoMove(cid,0) end return TRUE end
"velocidade = 150": velocidade em milisegundos
"tempo = 3": tempo em segundos
Tag:
[data/actions/actions.xml]
<action itemid="xxx" script="cattack.lua"/>
Note: xxx é o ID do item que será utilizado.
Vídeo: