mandei mensagem la kkk, quando tiver ok eu posto aqui para o pessoal
Ai galera, consegui editar o effect e o cooldown tbm, a spell ta muito boa, @Vodkart muito obrigado mesmo.
Deixei o CD em 5 minutos.
local from, to = {x=947, y=955, z=15}, {x=1055, y=1041, z=15} -- area total do kamui
local from, arena = {x=900, y=895, z=7}, {x=921, y=915, z=7} -- area total da arena
local teleport = {x=1000, y=1000, z=15} -- para onde vai
local blocks = {"tronco"} -- defina o nome dos monstro em minusculo
local storage = 753159
function isInKamuiArea(cid)
return isInRange(getCreaturePosition(cid), from, to) and true or false
end
function isInKamuiArea(cid)
return isInRange(getCreaturePosition(cid), from, arena) and true or false
end
function TeleportToKamui(alvo, pos)
if not isCreature(alvo) then return LUA_ERROR end
doTeleportThing(alvo, pos)
local positionpk = {x=getThingPos(alvo).x+1, y=getThingPos(alvo).y+1, z=getThingPos(alvo).z}
doSendMagicEffect(positionpk, 315) -- cid
end
function onCastSpell(cid, var)
local tempo = 300 -- Tempo de exhaustion em segundos
local sto = 545550 -- Storage de Spell, nunca usar a mesma em outra spell, a menos que não queira usar duas spell juntas!
if exhaustion.check(cid, sto) then
doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, sto) .. " segundos para usar o kamui novamente.")
return false
end
local target = getCreatureTarget(cid)
if target > 0 and isCreature(target) then -- se tiver target
if isMonster(target) then
if isInArray(blocks, getCreatureName(target):lower()) then
doPlayerSendCancel(cid, "voce nao pode usar o kamui neste alvo") return true
end
local positionp = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}
doSendMagicEffect(positionp, 315) -- effect que sai em voce
local positiont = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}
doSendMagicEffect(positiont, 315) -- effect ao usar kamui em um player
local min = ((30) * (getPlayerMagLevel(cid) + getPlayerLevel(cid)))
local max = ((35) * (getPlayerMagLevel(cid) + getPlayerLevel(cid)))
doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT) -- defina combat e effect COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT
addEvent(TeleportToKamui, 700, target,teleport)
elseif isPlayer(target) then
if isInKamuiArea(target) then
doPlayerSendCancel(cid, "voce nao pode usar o kamui em alguem nesta area") return true
end
setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z)
local positionp1 = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}
doSendMagicEffect(positionp1, 315) -- effect que sai em voce
local positiont1 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}
doSendMagicEffect(positiont1, 315) -- effect ao usar kamui em um monstro
local min = ((30) * (getPlayerMagLevel(cid) + getPlayerLevel(cid)))
local max = ((35) * (getPlayerMagLevel(cid) + getPlayerLevel(cid)))
doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT) -- defina combat e effect COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT
addEvent(TeleportToKamui, 700, target, teleport)
end
else
if isInKamuiArea(cid) then
doPlayerSendCancel(cid, "voce nao pode usar o kamui nesta area") return true
end
setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z)
local positionp2 = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}
doSendMagicEffect(positionp2, 315) -- effect ao usar o kamui em voce mesmo
addEvent(TeleportToKamui, 700, cid, teleport)
doCreatureAddHealth(cid, -100)
end
exhaustion.set(cid, sto, tempo)
return true
end
O XML
<instant name="Kamui" words="kamui in" lvl="300" mana="10000" prem="0" needtarget="0" range="4" exhaustion="0" blockwalls="1" needlearn="0" script="kakashi/kamui in.lua">
<vocation id="0"/>
</instant>
O movements do portal é aquele mesmo que ele passou no inicio da spell.