• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Pedido] Spell 1.3

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1[Pedido] Spell 1.3 Empty [Pedido] Spell 1.3 Sáb Dic 07, 2019 7:17 pm

    dazel169

    dazel169
    Miembro
    Miembro
    Descripcion escribió:Buenas a todos, quisiera ver si me pudieran apoyar con un script para tfs 1.3 que tenga varios ataques, ahorita tengo este, si causa daño y todo pero la consola me arroja un error, de antemano gracias. Smile

    Código:
    -- SpellCreator generated.

    -- =============== COMBAT VARS ===============
    -- Areas/Combat for 0ms
    local combat0_Brush = createCombatObject()
    setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
    setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
    setCombatArea(combat0_Brush,createCombatArea({{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0},
    {1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
    {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}}))
    function getDmg_Brush(cid, level, maglevel)
       return (10)*-1,(20)*-1
    end
    setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")

    -- Areas/Combat for 500ms
    local combat5_Brush_2 = createCombatObject()
    setCombatParam(combat5_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_POISONAREA)
    setCombatParam(combat5_Brush_2, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
    setCombatArea(combat5_Brush_2,createCombatArea({{0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0},
    {1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0},
    {0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0},
    {0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0},
    {0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0},
    {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1},
    {0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1},
    {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}}))
    function getDmg_Brush_2(cid, level, maglevel)
       return (10)*-1,(20)*-1
    end
    setCombatCallback(combat5_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2")

    -- Areas/Combat for 800ms
    local combat8_Brush_3 = createCombatObject()
    setCombatParam(combat8_Brush_3, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
    setCombatParam(combat8_Brush_3, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
    setCombatArea(combat8_Brush_3,createCombatArea({{0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1},
    {0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1},
    {0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0},
    {0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0},
    {0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0},
    {0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0},
    {0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0},
    {1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0},
    {1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0}}))
    function getDmg_Brush_3(cid, level, maglevel)
       return (10)*-1,(20)*-1
    end
    setCombatCallback(combat8_Brush_3, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_3")

    -- Areas/Combat for 1500ms
    local combat15_Brush_4 = createCombatObject()
    setCombatParam(combat15_Brush_4, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
    setCombatParam(combat15_Brush_4, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
    setCombatArea(combat15_Brush_4,createCombatArea({{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1},
    {1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
    {1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0}}))
    function getDmg_Brush_4(cid, level, maglevel)
       return (10)*-1,(20)*-1
    end
    setCombatCallback(combat15_Brush_4, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_4")

    -- Areas/Combat for 2100ms
    local combat21_Brush_5 = createCombatObject()
    setCombatParam(combat21_Brush_5, COMBAT_PARAM_EFFECT, CONST_ME_YALAHARIGHOST)
    setCombatParam(combat21_Brush_5, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
    setCombatArea(combat21_Brush_5,createCombatArea({{1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1},
    {1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1},
    {0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
    {0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0},
    {0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
    {0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0},
    {0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
    {1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1},
    {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1}}))
    function getDmg_Brush_5(cid, level, maglevel)
       return (10)*-1,(20)*-1
    end
    setCombatCallback(combat21_Brush_5, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_5")

    -- =============== CORE FUNCTIONS ===============
    local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
       if (isCreature(cid)) then
          doCombat(cid, c, var)
          if (dirList ~= nil) then -- Emit distance effects
             local i = 2;
             while (i < #dirList) do
                doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
                i = i + 2
             end      
          end
       end
    end

    function onCastSpell(cid, var)
       local startPos = getCreaturePosition(cid)
       RunPart(combat0_Brush,cid,var)
       addEvent(RunPart,500,combat5_Brush_2,cid,var)
       addEvent(RunPart,800,combat8_Brush_3,cid,var)
       addEvent(RunPart,1500,combat15_Brush_4,cid,var)
       addEvent(RunPart,2100,combat21_Brush_5,cid,var)
       return true
    end

    ERROR:
    Código:
            [C]: in function 'addEvent'
            data/spells/scripts/nuevas/pruebamagia.lua:121: in function <data/spells/scripts/nuevas/pruebamagia.lua:118>

    Lua Script Error: [Spell Interface]
    data/spells/scripts/nuevas/pruebamagia.lua:onCastSpell
    LuaScriptInterface::luaAddEvent(). Argument #4 is unsafe
    stack traceback:
            [C]: in function 'addEvent'
            data/spells/scripts/nuevas/pruebamagia.lua:122: in function <data/spells/scripts/nuevas/pruebamagia.lua:118>

    Lua Script Error: [Spell Interface]
    data/spells/scripts/nuevas/pruebamagia.lua:onCastSpell
    LuaScriptInterface::luaAddEvent(). Argument #4 is unsafe
    stack traceback:
            [C]: in function 'addEvent'
            data/spells/scripts/nuevas/pruebamagia.lua:123: in function <data/spells/scripts/nuevas/pruebamagia.lua:118>

    Lua Script Error: [Spell Interface]
    data/spells/scripts/nuevas/pruebamagia.lua:onCastSpell
    LuaScriptInterface::luaAddEvent(). Argument #4 is unsafe
    stack traceback:
            [C]: in function 'addEvent'
            data/spells/scripts/nuevas/pruebamagia.lua:124: in function <data/spells/scripts/nuevas/pruebamagia.lua:118>
    Imagen Explicativa escribió:Imagen Explicativa: [Pedido] Spell 1.3 Tibiaf10
    Version del Scripts: TFs 1.x

    2 participantes

    2[Pedido] Spell 1.3 Empty Re: [Pedido] Spell 1.3 Sáb Dic 07, 2019 7:47 pm

    [Adm] SevuOT

    [Adm] SevuOT
    Miembro
    Miembro
    Esta es una solución mala, pero ya debería funcionar
    Código:
    -- SpellCreator generated.

    -- =============== COMBAT VARS ===============
    -- Areas/Combat for 0ms
    local combat0_Brush = createCombatObject()
    setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
    setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
    setCombatArea(combat0_Brush,createCombatArea({{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0},
    {1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
    {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}}))
    function getDmg_Brush(cid, level, maglevel)
      return (10)*-1,(20)*-1
    end
    setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")

    -- Areas/Combat for 500ms
    local combat5_Brush_2 = createCombatObject()
    setCombatParam(combat5_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_POISONAREA)
    setCombatParam(combat5_Brush_2, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
    setCombatArea(combat5_Brush_2,createCombatArea({{0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0},
    {1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0},
    {0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0},
    {0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0},
    {0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0},
    {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1},
    {0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1},
    {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}}))
    function getDmg_Brush_2(cid, level, maglevel)
      return (10)*-1,(20)*-1
    end
    setCombatCallback(combat5_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2")

    -- Areas/Combat for 800ms
    local combat8_Brush_3 = createCombatObject()
    setCombatParam(combat8_Brush_3, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
    setCombatParam(combat8_Brush_3, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
    setCombatArea(combat8_Brush_3,createCombatArea({{0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1},
    {0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1},
    {0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0},
    {0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0},
    {0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0},
    {0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0},
    {0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0},
    {1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0},
    {1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0}}))
    function getDmg_Brush_3(cid, level, maglevel)
      return (10)*-1,(20)*-1
    end
    setCombatCallback(combat8_Brush_3, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_3")

    -- Areas/Combat for 1500ms
    local combat15_Brush_4 = createCombatObject()
    setCombatParam(combat15_Brush_4, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
    setCombatParam(combat15_Brush_4, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
    setCombatArea(combat15_Brush_4,createCombatArea({{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1},
    {1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
    {1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0}}))
    function getDmg_Brush_4(cid, level, maglevel)
      return (10)*-1,(20)*-1
    end
    setCombatCallback(combat15_Brush_4, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_4")

    -- Areas/Combat for 2100ms
    local combat21_Brush_5 = createCombatObject()
    setCombatParam(combat21_Brush_5, COMBAT_PARAM_EFFECT, CONST_ME_YALAHARIGHOST)
    setCombatParam(combat21_Brush_5, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
    setCombatArea(combat21_Brush_5,createCombatArea({{1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1},
    {1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1},
    {0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
    {0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0},
    {0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
    {0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0},
    {0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
    {1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1},
    {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1}}))
    function getDmg_Brush_5(cid, level, maglevel)
      return (10)*-1,(20)*-1
    end
    setCombatCallback(combat21_Brush_5, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_5")

    -- =============== CORE FUNCTIONS ===============
    local function RunPart(c, cid, var, dirList, dirEmitPos) -- Part
      if Creature(cid) then
          doCombat(cid, c, var)
          if (dirList ~= nil) then -- Emit distance effects
            local i = 2;
            while (i < #dirList) do
                doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
                i = i + 2
            end     
          end
      end
    end

    function onCastSpell(creature, variant)
      local startPos = creature:getPosition()
      RunPart(combat0_Brush, creature.uid, variant)
      addEvent(RunPart, 500, combat5_Brush_2, creature.uid, variant)
      addEvent(RunPart, 800, combat8_Brush_3, creature.uid, variant)
      addEvent(RunPart, 1500, combat15_Brush_4, creature.uid, variant)
      addEvent(RunPart, 2100, combat21_Brush_5, creature.uid, variant)
      return true
    end

    Tenga en cuenta que ese script es para versiones antiguas, así que no podría estar seguro si te causara otro error, esperemos que no



    Si necesitas hospedaje para tu servidor usa este enlace y mira los buenos planes de Windows y Linux:
    Si tu cuenta de PayPal no esta verificada no importara, igual aceptan pagos con cuentas no verificadas.


    [Pedido] Spell 1.3 TRJEB8aSRYK5IulEU6ilJw
    2 participantes

    3[Pedido] Spell 1.3 Empty Re: [Pedido] Spell 1.3 Sáb Dic 07, 2019 7:52 pm

    dazel169

    dazel169
    Miembro
    Miembro
    Very Happy Resuelto Gracias Very Happy

    2 participantes

    Contenido patrocinado


    2 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).