Postado Setembro 3, 2021 3 anos @Nother n sou mto bom com spells, não manjo nada, mas vamo seguindo os testes... é que estou pelo celular e o computador do escritório kkkk sem tibia nem nada, só bloco de nota msm xD local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui local teleport = {x=1000, y=1000, z=15} -- para onde vai local blocks = {"demon", "hydra"} -- 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 TeleportToKamui(alvo, pos) if not isCreature(alvo) then return LUA_ERROR end doTeleportThing(alvo, pos) doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui end function onCastSpell(cid, var) local target = getCreatureTarget(cid) if not target then -- executa no cid if isInKamuiArea(cid) then doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true end setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, cid, teleport) elseif target and isCreature(target) then -- se tiver target if isMonster(target) then if isInArray(blocks, getCreatureName(target):lower()) then doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true end doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target,teleport) elseif isPlayer(target) then if isInKamuiArea(target) then doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true end setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target, teleport) end end return true end (nao botei dano ainda) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Setembro 3, 2021 3 anos Autor 6 minutos atrás, Vodkart disse: @Nother n sou mto bom com spells, não manjo nada, mas vamo seguindo os testes... é que estou pelo celular e o computador do escritório kkkk sem tibia nem nada, só bloco de nota msm xD local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui local teleport = {x=1000, y=1000, z=15} -- para onde vai local blocks = {"demon", "hydra"} -- 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 TeleportToKamui(alvo, pos) if not isCreature(alvo) then return LUA_ERROR end doTeleportThing(alvo, pos) doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui end function onCastSpell(cid, var) local target = getCreatureTarget(cid) if not target then -- executa no cid if isInKamuiArea(cid) then doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true end setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, cid, teleport) elseif target and isCreature(target) then -- se tiver target if isMonster(target) then if isInArray(blocks, getCreatureName(target):lower()) then doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true end doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target,teleport) elseif isPlayer(target) then if isInKamuiArea(target) then doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true end setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target, teleport) end end return true end (nao botei dano ainda) Que isso, so oque vc ja fez aqui e mais doque eu faria em um ano kkk, seguinte, agora a spell com needtarget 0 pega no alvo mas não pega em mim, o effect agora esta funcionando nos 2.
Postado Setembro 3, 2021 3 anos @Nother local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui local teleport = {x=1000, y=1000, z=15} -- para onde vai local blocks = {"demon", "hydra"} -- 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 TeleportToKamui(alvo, pos) if not isCreature(alvo) then return LUA_ERROR end doTeleportThing(alvo, pos) doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui end function onCastSpell(cid, var) 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 a spell neste monstro") return true end doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target,teleport) elseif isPlayer(target) then if isInKamuiArea(target) then doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true end setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target, teleport) end else if isInKamuiArea(cid) then doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true end setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, cid, teleport) end return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Setembro 3, 2021 3 anos Autor 3 minutos atrás, Vodkart disse: @Nother local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui local teleport = {x=1000, y=1000, z=15} -- para onde vai local blocks = {"demon", "hydra"} -- 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 TeleportToKamui(alvo, pos) if not isCreature(alvo) then return LUA_ERROR end doTeleportThing(alvo, pos) doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui end function onCastSpell(cid, var) 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 a spell neste monstro") return true end doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target,teleport) elseif isPlayer(target) then if isInKamuiArea(target) then doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true end setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui addEvent(TeleportToKamui, 300, target, teleport) end else if isInKamuiArea(cid) then doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true end setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, cid, teleport) end return true end Perfeito, dessa vez deu direitinho, agora só falta os detalhezinhos do effect pois ele fica na cabeça a esquerda dos personagens, e o dano no alvo, mas já esta ótimo, não precisa fazer com pressa se estiver ocupado.
Postado Setembro 3, 2021 3 anos Solução testa o dano local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui local teleport = {x=1000, y=1000, z=15} -- para onde vai local blocks = {"demon", "hydra"} -- 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 TeleportToKamui(alvo, pos) if not isCreature(alvo) then return LUA_ERROR end doTeleportThing(alvo, pos) doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui end function onCastSpell(cid, var) 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 a spell neste monstro") return true end doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui local min = (getPlayerLevel(cid) * 2 + getPlayerMagLevel(cid) * 20) * 5 local max = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8 doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT) -- defina combat e effect COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT addEvent(TeleportToKamui, 300, target,teleport) elseif isPlayer(target) then if isInKamuiArea(target) then doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true end setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui local min = (getPlayerLevel(cid) * 2 + getPlayerMagLevel(cid) * 20) * 5 local max = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8 doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT) -- defina combat e effect COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT addEvent(TeleportToKamui, 300, target, teleport) end else if isInKamuiArea(cid) then doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true end setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z) doSendMagicEffect(getCreaturePosition(cid), 4) -- cid addEvent(TeleportToKamui, 300, cid, teleport) doCreatureAddHealth(cid, -100) end return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
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.