Olá, estou trazendo uma SPELL que nada mais é a Sombra do Shikamaru no qual quando você clicar no target e falar o nome da SPELL
o mesmo segue todos os movimentos que você fas, igualzinho no ANIME.
A Spell é cancela se o Target entrar PZ, se você sobir algum andar, se o mesmo não puder passar em um obstaculo e sumir da tela,etc..
E obvio que ela dura pouco tempo, esta programada para durar 10 segundos.
Video de uma demonstração da spell:
Então vamos la.
Add isso em creaturescripts/scripts/login.lua:
setPlayerStorageValue(cid, 14755, -1)
Crie um novo arquivo.lua com o nome de kagemane em spells/scripts/kagemane.lua:
local function move(cid, target, playerpos, targetpos, times)
if playerdir ~= getCreatureLookDirection(cid) then
doCreatureSetLookDirection(target, getCreatureLookDirection(cid))
end
if playerpos ~= getCreaturePosition(cid) then
if playerpos.z == getCreaturePosition(cid).z then
local ntpos = getCreaturePosition(cid)
local x,y,z = ntpos.x-playerpos.x,ntpos.y-playerpos.y,ntpos.z-playerpos.z
ntpos = getCreaturePosition(target)
ntpos.x, ntpos.y, ntpos.z = ntpos.x+x,ntpos.y+y,ntpos.z+z
if queryTileAddThing(target, ntpos) == RETURNVALUE_NOERROR and getCreaturePosition(cid).z == getCreaturePosition(target).z then
doMoveCreature(target, getCreatureLookDirection(cid))
end
end
end
local playerpos, targetpos = getCreaturePosition(cid), getCreaturePosition(target)
local times = times+1
if times < 100 then
addEvent(move, 1, cid, target, playerpos, targetpos, times)
else
doCreatureNoMove(target, 0)
doSendDistanceShoot(targetpos, playerpos, 31)
doSendAnimatedText(targetpos, "Livre!", math.random(1,255))
doPlayerSendCancel(cid, "Voce nao tem mais o controle do "..getCreatureName(target)..".")
if (isPlayer(target)) then
doPlayerSendCancel(cid, "Voce foi libertado "..getPlayerName(cid).."da tecnica da sombra.")
setPlayerStorageValue(target, 14755, -1)
end
end
end
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if (isPlayer(target)) or (isMonster(target)) then
if getPlayerStorageValue(cid, 14755) == -1 then
doCreatureSetNoMove(target, 1)
doPlayerSendCancel(cid, "Voce possuiu "..getCreatureName(target)..".")
if (isPlayer(target)) then
doPlayerSendCancel(target, "Voce foi possuido por "..getPlayerName(cid)..".")
setPlayerStorageValue(target, 14755, 1)
end
doSendAnimatedText(getCreaturePosition(target), "Possuido!", math.random(1,255))
local playerpos,playerdir,targetpos = getCreaturePosition(cid), getCreatureLookDir(cid), getCreaturePosition(target)
doSendDistanceShoot(playerpos, targetpos, 31)
doSendMagicEffect(getCreaturePosition(target), CONST_ME_SMALLCLOUDS)
local times = 1
addEvent(move, 1000, cid, target, playerpos, targetpos, times)
else
doPlayerSendCancel(cid, "Você ainda esta sobre a possecao do inimigo.")
end
end
end
Add isso em spells/spells.xml:
<instant name="Kagemane No Jutsu" words="kagemane" lvl="75" mana="800" exhaustion="5000" blockwalls="1" needlearn="0" event="script" value="kagemane.lua"></instant>
E pronto!
Creditos >>> cbrm
Talvez algum a mim por ter trazido ao Xtibia.. uhauhahua.. flw!