Ir para conteúdo
  • Cadastre-se

(Resolvido)Ajuda Com Script de Transform ( Narutibia 8.54 )


Ir para solução Resolvido por Yugami,

Posts Recomendados

Galera, estou com dificuldades de alterar uma spell no meu OTServer, a spell ao ser usada adiciona um effect no player, porém além do effect eu queria que ela mudasse o outfit, a duração do effect e do outfit seriam as mesmas.

Vou postar o script que estou usando:

 

local tempo = 60 -- tempo em segundos.
local effect = {208} -- effect no player, caso queira apenas 1, basta remover os outros numeros.
     
local ml = 35 -- quantos ira aumentar o skill de ML
local skillfist = 35 -- quantos ira aumentar o skill de Fist
local skillsword = 35 -- quantos ira aumentar o skill de Sword
local skillaxe = 35 -- quantos ira aumentar o skill de Axe
local skillclub = 35 -- quantos ira aumentar o skill de Club
local skilldistance = 35 -- quantos ira aumentar o skill de Distance
local skillshield = 35 -- quantos ira aumentar o skill de Shield
local health = 80 -- A cada 1 segundo quantos aumentar de vida
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
     
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword)
setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)
setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)
setCombatCondition(combat, condition)
     
local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_SPEED, 250)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
     
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000)
setCombatCondition(combat, condition)
            
function magicEffect2(tempo2,tempo3,cid)
if (isCreature(cid)) then
    if getPlayerStorageValue(cid, 102053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then
        for i=1, #effect do
        local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
doSendMagicEffect(position, effect)
        end
    end
end
end
                  
function onCastSpell(cid, var)
local position129 = {x=getPlayerPosition(cid).x+2, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
if getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
    doCombat(cid, combat, var)
    tempo2 = 0
    while (tempo2 ~= (tempo*1000)) do
        addEvent(magicEffect2, tempo2, tempo2, tempo*1000, cid)
        tempo2 = tempo2 + 300
    end
    setPlayerStorageValue(cid, 102053,1) -- storage verifica transformado, quando = 1 player esta transformado.
    doCreatureSay(cid, "Kyuubi Furie", TALKTYPE_MONSTER)
    doSendMagicEffect(position129, 130)
else
    doPlayerSendCancel(cid, "Sorry, you are transformed.")
end
end
 
Fico agrecido desde de já, e darei REP+ a todos que ajudarem.
OBS: e meu segundo tópico no forum.
Link para o post
Compartilhar em outros sites
  • Solução

tente assim.

local tempo = 60 -- tempo em segundos.
local effect = {208} -- effect no player, caso queira apenas 1, basta remover os outros numeros.
local outfit = {lookType = 608} -- outfit que ira dar


local ml = 35 -- quantos ira aumentar o skill de ML
local skillfist = 35 -- quantos ira aumentar o skill de Fist
local skillsword = 35 -- quantos ira aumentar o skill de Sword
local skillaxe = 35 -- quantos ira aumentar o skill de Axe
local skillclub = 35 -- quantos ira aumentar o skill de Club
local skilldistance = 35 -- quantos ira aumentar o skill de Distance
local skillshield = 35 -- quantos ira aumentar o skill de Shield
local health = 80 -- A cada 1 segundo quantos aumentar de vida
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
     
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword)
setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)
setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)
setCombatCondition(combat, condition)


local condition = createConditionObject(CONDITION_OUTFIT)


setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)


addOutfitCondition(condition, outfit)


setCombatCondition(combat, condition)


     
local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_SPEED, 250)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
     
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000)
setCombatCondition(combat, condition)
            
function magicEffect2(tempo2,tempo3,cid)
if (isCreature(cid)) then
    if getPlayerStorageValue(cid, 102053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then
        for i=1, #effect do
        local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
doSendMagicEffect(position, effect[i])
        end
    end
end
end
                  
function onCastSpell(cid, var)
local position129 = {x=getPlayerPosition(cid).x+2, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
if getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
    doCombat(cid, combat, var)
    tempo2 = 0
    while (tempo2 ~= (tempo*1000)) do
        addEvent(magicEffect2, tempo2, tempo2, tempo*1000, cid)
        tempo2 = tempo2 + 300
    end
    setPlayerStorageValue(cid, 102053,1) -- storage verifica transformado, quando = 1 player esta transformado.
    doCreatureSay(cid, "Kyuubi Furie", TALKTYPE_MONSTER)
    doSendMagicEffect(position129, 130)
else
    doPlayerSendCancel(cid, "Sorry, you are transformed.")
end
end

 

Projeto/Serviços que desenvolvi durante esse Tempo.

[SERVIDOR] - NTO By Madara Rinnegan - Criado em 2014

Link para o post
Compartilhar em outros sites

Muito obrigado, era exatamente isso que eu queria!


Cara, so mais uma coisa:

1° : onde eu troco o effect que fica no player, porque eu troco la no local effect e ele nao muda no jogo.

2°: como eu mudo o effect que faz quando usa a transform.

Se tiver como ajudar fico agradecido.


UP!


UP

Link para o post
Compartilhar em outros sites

Basta procurar pelas linhas que tenham:

doSendMagicEffect(POSIÇÃO, EFEITO)

Dependendo da posição, vc sabe qual é o efeito que vai ser lançado em tal local e assim pode alterá-lo.

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Link para o post
Compartilhar em outros sites

Vo tentar, qualquer coisa te dou um toque!


Cara, e o seguinte:

        addEvent(magicEffect2, tempo2, tempo2, tempo*1000, cid)

Nessa linha do escript na parte "magiceffect2" se eu mudar o 2 por outro ele altera o effect, porém so vai do 0 ao 4 os effects.

Voce nao sabe alterar pro script mudar o effect na linha:

local effect = {208}

Se puder ajeitar pra mim fico grato.


Ja consegui resolver!

Se quiser REP+ pela atenção basta me ensinar a dar REP+! xD 

OBS: Sou novato!

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Tofames
      Hi,
      Para devolver o que recebi aqui, colocarei para si um sistema de transformação a trabalhar na TFS 1.X.
      (Testei em 1.4.2) 
       
      MUDANÇA DE SOURCE NECESSÁRIA PARA O BOM FUNCIONAMENTO!
      Havia algo dentro do código TFS (e provavelmente outras distros) que não estava funcionando corretamente e depois que eu informei, eles se fundiram em tfs principais, então já está dentro do TFS 1.5, mas não está em versões mais antigas.
      Trata-se de refrescar a velocidade do jogador após a transformação, se você não tiver isso, então sua velocidade do vocations.xml baseSpeed não é refrescada.
      Você precisa adicionar isto às sources:
      https://github.com/otland/forgottenserver/pull/4215/files
      se você não tem acesso às sources, eu tenho um meio de contornar isso, mas não vou inundar este posto, então escreva em pv.
       
      Créditos: 
      Erexo (guião original)
      Itutorial (TFS 1.X),
      Tofame (alteração: talkaction --> spell; source mudanças; correções do scripts)
       

      transform system.mp4  
      no final do global.lua:
      --[[ voc = from vocation newVoc = to vocation looktype = new outfit revertLooktype = current outfit level = lvl needed to transform rage = soul needed to transform (you can disable it, just type 0) kiToTrans = mana to transform addHp = maxHp added when you transform addKi = maxMana added effectOn = magic effect when you use transform aura = magic effect when you have current transform (can be disabled, just type 0). type nil in this version constant = if transform is constant (when it is, player dont lose transform/outfit and maxHp/Mana, and cannot use revert) --]] exhaust_transform = {} -- [1-8] naruto, transform = { [1] = {voc = 1, newVoc = 2, from_looktype = 2, looktype = 3, level = 50, rage = 0, mana = 50, addHealth = 450, addMana = 450, effect = 76, aura = nil, constant = false}, [2] = {voc = 2, newVoc = 3, from_looktype = 3, looktype = 4, level = 100, rage = 0, mana = 50, addHealth = 500, addMana = 500, effect = 76, aura = nil, constant = false}, [3] = {voc = 3, newVoc = 4, from_looktype = 4, looktype = 5, level = 150, rage = 0, mana = 50, addHealth = 650, addMana = 650, effect = 76, aura = nil, constant = false}, [4] = {voc = 4, newVoc = 5, from_looktype = 5, looktype = 6, level = 200, rage = 0, mana = 50, addHealth = 800, addMana = 800, effect = 76, aura = nil, constant = false}, [5] = {voc = 5, newVoc = 6, from_looktype = 6, looktype = 7, level = 250, rage = 0, mana = 50, addHealth = 900, addMana = 900, effect = 76, aura = nil, constant = false}, [6] = {voc = 6, newVoc = 7, from_looktype = 7, looktype = 8, level = 300, rage = 0, mana = 50, addHealth = 1000, addMana = 1000, effect = 76, aura = nil, constant = false}, [7] = {voc = 7, newVoc = 8, from_looktype = 8, looktype = 9, level = 400, rage = 0, mana = 50, addHealth = 1500, addMana = 1500, effect = 76, aura = nil, constant = false}, [8] = {voc = 8, newVoc = 9, from_looktype = 9, looktype = 10, level = 500, rage = 0, mana = 50, addHealth = 1500, addMana = 1500, effect = 76, aura = nil, constant = false} -- end naruto transforms } spells/scripts/revert.lua
      local combat = Combat() combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false) function onCastSpell(player, variant) local pid = player:getId() local TRANS = transform[player:getVocation():getId() - 1] -- - [player:getVocation():getId() - 4] domyslnie, should be -1. if not TRANS then player:sendCancelMessage("You cannot revert.") return false end local outfit = player:getOutfit() outfit.lookType = TRANS.from_looktype if TRANS.constant then player:setOutfit(outfit) else player:setOutfit(outfit, false) end exhaust_transform[pid] = 1 player:setMaxHealth(player:getMaxHealth() - TRANS.addHealth) player:setMaxMana(player:getMaxMana() - TRANS.addMana) player:setVocation(TRANS.voc) player:save() return combat:execute(player, variant) end spells/scripts/transform.lua
      local combat = Combat() combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false) function onCastSpell(player, variant) local effectPosition = Position(player:getPosition().x, player:getPosition().y, player:getPosition().z) local pid = player:getId() local TRANS = transform[player:getVocation():getId()] if not TRANS then player:sendCancelMessage("You cannot transform.") return false end if TRANS.effect == 76 then effectPosition = Position(player:getPosition().x + 2, player:getPosition().y, player:getPosition().z) end if player:getLevel() < TRANS.level then player:sendCancelMessage("You must reach level "..TRANS.level.." to transform.") return false end if player:getSoul() < TRANS.rage then player:sendCancelMessage("You need "..TRANS.rage.." to transform.") return false end if player:getMana() < TRANS.mana then player:sendCancelMessage("You need "..TRANS.mana.." to transform.") return false end local outfit = player:getOutfit() outfit.lookType = TRANS.looktype if TRANS.constant then player:setOutfit(outfit) else player:setOutfit(outfit, false) end player:addSoul(-TRANS.rage) player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth) player:setMaxMana(player:getMaxMana() + TRANS.addMana) effectPosition:sendMagicEffect(TRANS.effect) player:setVocation(TRANS.newVoc) player:save() return combat:execute(player, variant) end spells.xml:
      <instant group="support" spellid="175" name="Revert" words="revert" level="1" mana="10" aggressive="0" selftarget="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="revert.lua" /> <instant group="support" spellid="175" name="Transform" words="transform" level="1" mana="10" aggressive="0" selftarget="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="transform.lua" />  
       
      As coisas abaixo são opcionais, adicione-as se você quiser ter aura. Se você não estiver usando, deixe a aura = nil em global.lua
      Também observei que isso poderia causar atrasos/screen freeze, por isso não recomendo o uso de aura.
       
      globalevents.xml adicionar linha:
      <globalevent name="TransformEffects" interval="2000" script="TransformEffects.lua"/> TransformEffects.lua (data/globalevents/scripts/TransformEffects.lua):
      function onThink(interval) for _, player in pairs(Game.getPlayers()) do if player then TRANS = transform[player:getVocation():getId()] if TRANS then if TRANS.aura ~= nil then player:getPosition():sendMagicEffect(TRANS.aura) end end end end return true end  
      edit:
      só consigo falar um pouco de espanhol e muito bem em inglês, por isso uso DEEPL para falar portugês.
    • Por New Narutibia
      Galera, to com um problema no seguinte script do meu OTServ.
      Acontece que, quando eu crio 2 scripts iguals desse script em questao o effect que eu uso no ultimo script criado fica nos outros.
      Ex: Criei o script "narutotransform1" e o "narutotransfor2", ambos com esse script porém com o effect diferente,  porem quando vou utilizalos o effect do ultimo tambem esta no primeiro, ou seja , esta igual.
      OBS: Estou mudando o effect na linha "local effect = {40}".
       
      local tempo = 60 -- tempo em segundos. local effect = {40} -- effect no player, caso queira apenas 1, basta remover os outros numeros. local outfit = {lookType = 392} -- outfit que ira dar local ml = 35 -- quantos ira aumentar o skill de ML local skillfist = 35 -- quantos ira aumentar o skill de Fist local skillsword = 35 -- quantos ira aumentar o skill de Sword local skillaxe = 35 -- quantos ira aumentar o skill de Axe local skillclub = 35 -- quantos ira aumentar o skill de Club local skilldistance = 35 -- quantos ira aumentar o skill de Distance local skillshield = 35 -- quantos ira aumentar o skill de Shield local health = 80 -- A cada 1 segundo quantos aumentar de vida local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)       local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml) setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword) setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield) setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit) setCombatCondition(combat, condition) local condition = createConditionObject(CONDITION_OUTFIT) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) addOutfitCondition(condition, outfit) setCombatCondition(combat, condition)       local condition = createConditionObject(CONDITION_HASTE) setConditionParam(condition, CONDITION_PARAM_SPEED, 250) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setCombatCondition(combat, condition)       local condition = createConditionObject(CONDITION_REGENERATION) setConditionParam(condition, CONDITION_PARAM_SUBID, 1) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health) setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000) setCombatCondition(combat, condition)              function magicEffect2(tempo2,tempo3,cid) if (isCreature(cid)) then     if getPlayerStorageValue(cid, 102053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then         for i=1, #effect do         local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} doSendMagicEffect(position, effect[i])         end     end end end                    function onCastSpell(cid, var) local position129 = {x=getPlayerPosition(cid).x+2, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} if getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then     doCombat(cid, combat, var)     tempo2 = 0     while (tempo2 ~= (tempo*1000)) do         addEvent(magicEffect2, tempo2, tempo2, tempo*1000, cid)         tempo2 = tempo2 + 300     end     setPlayerStorageValue(cid, 102053,1) -- storage verifica transformado, quando = 1 player esta transformado.     doCreatureSay(cid, "Kyuubi Furie", TALKTYPE_MONSTER)     doSendMagicEffect(position129, 130) else     doPlayerSendCancel(cid, "Sorry, you are transformed.") end end   Se alguem poder ajudar, fico grato desde já. Dou REP+
    • Por Sekk
      Bom gente, eu tenho um sistema no meu ot de Multi Element Shield, eu postei aqui no TK alguns dias atras, porém, sempre aparece isso no distro:
      Eu já to ficando com raiva disso, o distro não aparece nenhum erro, mas essa droga fica me atrapalhando a visão kkkk
       
      Se quiserem dar uma olhada nos scripts, ai vai:
      Meu actions.xml


        Agora o script do arquivo transformshield.lua que está em data/actions/scripts
       
    • Por psychonaut
      deleta
    • Por drmasters
      Olá Pessoal, tudo bem?
      Gostaria de saber se alguém poderia compartilhar um script de Transform, Igual do DBZ mas pra Tibia 8.6!
      Por exemplo, Sou um sorcerer falo !tranform lvl 40 , Viro Sorcerer 2 , Ganho Vida, Mana, muda minha Outfitt.
       
      Espero que tenham entendido! é igual o do DBZ mesmo! 
      Abraços Pessoal!
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo