• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    Script item para promotion

    Compartir:

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

    1Script item para promotion Empty Script item para promotion Miér Nov 09, 2022 6:57 am

    Diego24

    Diego24
    Nuevo Miembro
    Nuevo Miembro
    Hola, me gustaria saber si podrian ayudarme con un scrip que al automaticamente darle click de te la promotion. Muchas gracias!

    3 participantes

    2Script item para promotion Empty Re: Script item para promotion Miér Nov 09, 2022 8:06 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    aqui tienes un talkaction que lo puedes usar igualmente en un item

    Código:


    local vocations = {
        [1] = 5,
        [2] = 6,
        [3] = 7,
        [4] = 8,
    }


    function onSay(player, words, param)
          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



    Script item para promotion YNU5B25
    3 participantes
    http://www.tibiaface.com

    3Script item para promotion Empty Re: Script item para promotion Miér Nov 09, 2022 4:18 pm

    Diego24

    Diego24
    Nuevo Miembro
    Nuevo Miembro
    Gracias Maya pero que tendria que poner en xml?

    Aparte de eso, me gustaria que la promotion se pudieraa comprar con un item.

    3 participantes

    4Script item para promotion Empty Re: Script item para promotion Miér Nov 09, 2022 4:34 pm

    akane

    akane
    Miembro
    Miembro
    puedes copiar el esquema de algun npc (sam, xodet, etc) y colocar el item que quieres que venda

    3 participantes

    5Script item para promotion Empty Re: Script item para promotion Miér Nov 09, 2022 5:19 pm

    Diego24

    Diego24
    Nuevo Miembro
    Nuevo Miembro
    Es que me gustaria que fuera a travez de un item por sistema de palancas sin necesidad de NCP

    3 participantes

    6Script item para promotion Empty Re: Script item para promotion Miér Nov 09, 2022 5:35 pm

    akane

    akane
    Miembro
    Miembro
    Código:
      ----- Config -----
    local config = {
            cost = 1000, -- Price
            item_id = 7620, -- Rune/Potion
            backpack_id = 2001 -- Backpack
    }

    local name = getItemNameById(7620) -- Same as item_id above
    ----- End Config -----
    function onUse(cid, item, fromPosition, itemEx, toPosition)
            if doPlayerRemoveMoney(cid, config.cost) == TRUE then
                    local bp = doPlayerAddItem(cid, config.backpack_id, 1)
                            doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
                            doSendAnimatedText(fromPosition, "Comprado", TEXTCOLOR_BLACK)
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Tu Haz Comprado Una Backpack De ".. name .."s Por ".. config.cost .." Gold.")
            for i=1,1 do
                            doAddContainerItem(bp, config.item_id, 1) -- You can edit this number, it will give shots per rune.
                    end
                    else
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Tu Necesitas ".. config.cost .." Gold Para Comprar Una Backpack De ".. name .."s.")
                    end
            return TRUE
    end

    ahí tienes un script que funciona por palanca

    Código:
    <action uniqueid="8000" script="bp potion/healthpotion.lua"/>

    ahí le colocas el nombre y la ruta donde guardaste el archivo del script, le colocas el unique id que quieras en el remeres



    o tambièn

    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({0, 1, 2, 3, 5, 6, 7}, pVoc) then
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You must be an Knight to choose this profession!")
        elseif table.contains({1}, pVoc) then
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You alredy have been promoted to a Elite Knight Vocation!")
        elseif table.contains({4}, pVoc) then
            player:setVocation(pVoc + 4)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You have been promoted to a " .. player:getVocation():getName() .. "!")
            player:getPosition():sendMagicEffect(27)
          player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have been promoted")
        end
        return true
    end


    Código:
    <action uniqueid="33600" script="promotionstatue.lua" />

    3 participantes

    Contenido patrocinado


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