Ir para conteúdo

[ Resolvido ]


danilo9317

Posts Recomendados

data/spells/scripts/jump.lua

local TILES = 1 -- x tiles a andar

 

function onCastSpell(cid, var)

local pos = getPosByDir(getCreaturePosition(cid), getPlayerLookDir(cid), TILES)

pos.stackpos = STACKPOS_GROUND

if(getTileThingByPos(pos).uid == 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot jump there.")

return TRUE

end

pos = getClosestFreeTile(cid, pos, FALSE, FALSE)

if(pos == LUA_ERROR or isInArray({pos.x, pos.y}, 0) == TRUE) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")

return TRUE

end

local tmp = getCreaturePosition(cid)

if(doTeleportThing(cid, pos, TRUE) ~= LUA_ERROR and isPlayerGhost(cid) ~= TRUE) then

doSendMagicEffect(tmp, CONST_ME_POFF)

doSendMagicEffect(pos, CONST_ME_POFF)

end

return TRUE

end

 

 

 

data/spells/spells.xml

<instant name="Jump" words="exevo hur jump" lvl="30" mana="150" prem="0" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="jump.lua">

<vocation name="Druid"/>

<vocation name="Elder Druid"/>

<vocation name="Sorcerer"/>

<vocation name="Master Sorcerer"/>

<vocation name="Knight"/>

<vocation name="Elite Knight"/>

<vocation name="Paladin"/>

<vocation name="Royal Paladin"/>

</instant>

 

Espero ter ajudado.

 

Abraços.

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...