• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    Chest que da vocation

    Compartir:

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

    1Chest que da vocation Empty Chest que da vocation Miér Oct 13, 2021 6:00 am

    akane

    akane
    Miembro
    Miembro
    Hola a todos, busco un script que al darle use a x ítem me de una vocación nueva para otx 3.10

    2 participantes

    2Chest que da vocation Empty Re: Chest que da vocation Miér Oct 13, 2021 2:27 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    aqui tienes algo

    Código:


    function onUse(player, item, fromPosition, target, toPosition, isHotkey)

        if player:getLevel() >= 10000 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You must be atleast level 10000 to use this item!")
            return true
        end
     
        local pVoc = player:getVocation():getId()
        if table.contains({1, 2, 3, 4}, pVoc) then
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You must buy first promotion to use this item!")
        elseif table.contains({9, 10, 11, 12}, pVoc) then
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You alredy have been promoted to a epic vocation!")
        elseif table.contains({5, 6, 7, 8}, pVoc) then
          --  item:remove(1)
            player:setVocation(pVoc + 4)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You have been promoted to a " .. player:getVocation():getName() .. "!")
            player:getPosition():sendMagicEffect(27)
        end
        return true
    end


    aqui tienes otro


    Código:


    local vocations = {
        [1] = 5,
        [2] = 6,
        [3] = 7,
        [4] = 8,
        [5] = 9,    ------- epic vocations.xml
        [6] = 10,
        [7] = 11,
        [8] = 12,
    }


    function onUse(player, item, fromPosition, target, toPosition, isHotkey)
          local vocation = player:getVocation()
          local vocID = vocation:getId()
          local PromotionPrice = 20000
          if vocations[vocID] then
          if player:removeMoney(PromotionPrice) then
          player:setVocation(Vocation(vocations[vocID]))
          player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been promoted!.")
          player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
        else
        player:sendCancelMessage("Sorry, You don't have enough money.")
        end
        else
        player:sendCancelMessage("Sorry, you are already promoted.")
        end
        return true
    end



    Chest que da vocation YNU5B25
    2 participantes
    http://www.tibiaface.com

    3Chest que da vocation Empty Re: Chest que da vocation Miér Oct 13, 2021 3:46 pm

    akane

    akane
    Miembro
    Miembro
    el primer script me da error ya que edité el lvl a 100 en vez de 10k, pero aun así sobrepasando el lvl 100 no me dá la vocacion y dice que tengo que ser arriba de 100

    2 participantes

    4Chest que da vocation Empty Re: Chest que da vocation Miér Oct 13, 2021 5:38 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    prueba asi


    Código:


    function onUse(player, item, fromPosition, target, toPosition, isHotkey)

        if player:getLevel() >= 100 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You must be atleast level 100 to use this item!")
            return true
        end
     
        local pVoc = player:getVocation():getId()
        if table.contains({1, 2, 3, 4}, pVoc) then
       
       
            player:setVocation(pVoc + 4)
          
          player:getPosition():sendMagicEffect(27)
          
          else
          player:sendTextMessage(MESSAGE_INFO_DESCR, "You alredy have been promoted")
          end
          
          
        return true
    end



    Chest que da vocation YNU5B25
    2 participantes
    http://www.tibiaface.com

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