• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    firstitems

    Compartir:

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

    1firstitems Empty firstitems Jue Mar 12, 2015 12:49 am

    Invitado

    Anonymous
    Invitado
    tengo un problema con mi ot es que los pj me nacen sin item

    2firstitems Empty Re: firstitems Jue Mar 12, 2015 2:16 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    bueno primero te vas a data\creaturescripts\scripts\ copia cualquier archivo y renombras por firstitem.lua y pegas esto dentro

    Código:
    -- Without Rookgaard
    local config = {
       [1] = {
          --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
          items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
          --container rope, shovel, mana potion
          container = {{2120, 1}, {2554, 1}, {7620, 1}}
       },
       [2] = {
          --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf
          items = {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
          --container rope, shovel, mana potion
          container = {{2120, 1}, {2554, 1}, {7620, 1}}
       },
       [3] = {
          --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet
          items = {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}},
          --container rope, shovel, health potion, bow, 50 arrow
          container = {{2120, 1}, {2554, 1}, {7618, 1}, {2456, 1}, {2544, 50}}
       },
       [4] = {
          --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf
          items = {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
          --container jagged sword, daramian mace, rope, shovel, health potion
          container = {{8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 1}}
       }
    }

    function onLogin(player)
       local targetVocation = config[player:getVocation():getId()]
       if not targetVocation then
          return true
       end

       if player:getLastLoginSaved() ~= 0 then
          return true
       end

       for i = 1, #targetVocation.items do
          player:addItem(targetVocation.items[i][1], targetVocation.items[i][2])
       end

       local backpack = player:addItem(1988)
       if not backpack then
          return true
       end

       for i = 1, #targetVocation.container do
          backpack:addItem(targetVocation.container[i][1], targetVocation.container[i][2])
       end
       return true
    end

    luego añades esta tag en data\creaturescripts\creaturescripts.xml

    Código:
       <event type="login" name="FirstItems" script="others/firstitems.lua"/>



    firstitems YNU5B25
    http://www.tibiaface.com

    3firstitems Empty Re: firstitems Jue Mar 12, 2015 10:19 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    remplaza este por el otro

    Código:
    -- With Rookgaard

    --[[
    local firstItems = {2050, 2382}

    function onLogin(cid)
       local player = Player(cid)
       if player:getLastLoginSaved() <= 0 then
          for i = 1, #firstItems do
             player:addItem(firstItems[i], 1)
          end
          player:addItem(player:getSex() == 0 and 2651 or 2650, 1)
          player:addItem(1987, 1)
          player:addItem(2674, 1)
       end
       return true
    end
    ]]--

    -- Without Rookgaard

    local config = {
        [1] = {
            --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
            {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
            --container rope, shovel, mana potion
            {{2120, 1}, {2554, 1}, {7620, 1}, {2160, 5}}
        },
        [2] = {
            --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf
            {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
            --container rope, shovel, mana potion
            {{2120, 1}, {2554, 1}, {7620, 1}, {2160, 5}}
        },
        [3] = {
            --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet
            {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}},
            --container rope, shovel, health potion, bow, 50 arrow
            {{2120, 1}, {2554, 1}, {7618, 1}, {2456, 1}, {2544, 50}, {2160, 5}}
        },
        [4] = {
            --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf
            {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
            --container jagged sword, daramian mace, rope, shovel, health potion
            {{8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 1}, {2160, 5}}
        }
    }

    function onLogin(cid)
        local player = Player(cid)
        local targetVocation = config[player:getVocation():getId()]
        if not targetVocation then
            return true
        end
     
        if player:getLastLoginSaved() == 0 then
            for i = 1, #targetVocation[1] do
                player:addItem(targetVocation[1][i][1], targetVocation[1][i][2])
            end
       
            local backpack = player:addItem(1988)
            for i = 1, #targetVocation[2] do
                backpack:addItem(targetVocation[2][i][1], targetVocation[2][i][2])
            end
        end
        return true
    end

    @zileno



    firstitems YNU5B25
    http://www.tibiaface.com

    Contenido patrocinado


    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).