• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    Npc Addoner

    Compartir:

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

    1default Npc Addoner el Vie Feb 27, 2015 12:05 am

    hirako

    hirako
    Miembro
    Miembro
    Hola bueno debido a que en los server v5 y v6 de god maya no hay addoner y debido a una pedicion aca les dejo el npc solo es hacer lo siguiente entrar a


    \data\npc\scripts

    copiar un archivo y pegarlo hay mismo luego nombrarlo como addoner.lua

    luego borran lo que lleva escrito y le pegan el siguiente texto
    Código:
    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)


    function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)             end
    function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)         end
    function onCreatureSay(cid, type, msg)         npcHandler:onCreatureSay(cid, type, msg)     end
    function onThink()                             npcHandler:onThink()                         end

    npcHandler:setMessage(MESSAGE_GREET, "Greetings |PLAYERNAME|. Will you help me? If you do, I'll reward you with nice addons! Just say {addons} or {help} if you don't know what to do.")

    function playerBuyAddonNPC(cid, message, keywords, parameters, node)
        if(not npcHandler:isFocused(cid)) then
            return false
        end
        if (parameters.confirm ~= true) and (parameters.decline ~= true) then
            if(getPlayerPremiumDays(cid) == 0) and (parameters.premium == true) then
                npcHandler:say('Sorry, but this addon is only for premium players!', cid)
                npcHandler:resetNpc()
                return true
            end
            if (getPlayerStorageValue(cid, parameters.storageID) ~= -1) then
                npcHandler:say('You already have this addon!', cid)
                npcHandler:resetNpc()
                return true
            end
            local itemsTable = parameters.items
            local items_list = ''
            if table.maxn(itemsTable) > 0 then
                for i = 1, table.maxn(itemsTable) do
                    local item = itemsTable[i]
                    items_list = items_list .. item[2] .. ' ' .. getItemNameById(item[1])
                    if i ~= table.maxn(itemsTable) then
                        items_list = items_list .. ', '
                    end
                end
            end
            local text = ''
            if (parameters.cost > 0) and table.maxn(parameters.items) then
                text = items_list .. ' and ' .. parameters.cost .. ' gp'
            elseif (parameters.cost > 0) then
                text = parameters.cost .. ' gp'
            elseif table.maxn(parameters.items) then
                text = items_list
            end
            npcHandler:say('Did you bring me ' .. text .. ' for ' .. keywords[1] .. '?', cid)
            return true
        elseif (parameters.confirm == true) then
            local addonNode = node:getParent()
            local addoninfo = addonNode:getParameters()
            local items_number = 0
            if table.maxn(addoninfo.items) > 0 then
                for i = 1, table.maxn(addoninfo.items) do
                    local item = addoninfo.items[i]
                    if (getPlayerItemCount(cid,item[1]) >= item[2]) then
                        items_number = items_number + 1
                    end
                end
            end
            if(getPlayerMoney(cid) >= addoninfo.cost) and (items_number == table.maxn(addoninfo.items)) then
                doPlayerRemoveMoney(cid, addoninfo.cost)
                if table.maxn(addoninfo.items) > 0 then
                    for i = 1, table.maxn(addoninfo.items) do
                        local item = addoninfo.items[i]
                        doPlayerRemoveItem(cid,item[1],item[2])
                    end
                end
                doPlayerAddOutfit(cid, addoninfo.outfit_male, addoninfo.addon)
                doPlayerAddOutfit(cid, addoninfo.outfit_female, addoninfo.addon)
                setPlayerStorageValue(cid,addoninfo.storageID,1)
                npcHandler:say('Here you are.', cid)
            else
                npcHandler:say('You do not have needed items or cash!', cid)
            end
            npcHandler:resetNpc()
            return true
        elseif (parameters.decline == true) then
            npcHandler:say('Not interested? Maybe other addon?', cid)
            npcHandler:resetNpc()
            return true
        end
        return false
    end

    local noNode = KeywordNode:new({'no'}, playerBuyAddonNPC, {decline = true})
    local yesNode = KeywordNode:new({'yes'}, playerBuyAddonNPC, {confirm = true})

    -- citizen (done)
    local outfit_node = keywordHandler:addKeyword({'first citizen addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5878,100}}, outfit_female = 136, outfit_male = 128, addon = 1, storageID = 60001})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second citizen addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5890,100}, {5902,50}, {2480,1}}, outfit_female = 136, outfit_male = 128, addon = 2, storageID = 60002})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- hunter (done)
    local outfit_node = keywordHandler:addKeyword({'first hunter addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5947,1}, {5876,100}, {5948,100}, {5891,5}, {5887,1}, {5889,1}, {5888,1}}, outfit_female = 137, outfit_male = 129, addon = 1, storageID = 60003})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second hunter addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5875,1}}, outfit_female = 137, outfit_male = 129, addon = 2, storageID = 60004})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- knight (done)
    local outfit_node = keywordHandler:addKeyword({'first knight addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5880,100}, {5892,1}}, outfit_female = 139, outfit_male = 131, addon = 1, storageID = 60055})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second knight addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5893,100}, {5924,1}, {5885,1}, {5887,1}}, outfit_female = 139, outfit_male = 131, addon = 2, storageID = 60056})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- mage (done)
    local outfit_node = keywordHandler:addKeyword({'first mage addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{2182,1}, {2186,1}, {2185,1}, {8911,1}, {2181,1}, {2183,1}, {2190,1}, {2191,1}, {2188,1}, {8921,1}, {2189,1}, {2187,1}, {5904,10}, {5809,1}, {2193,20}}, outfit_female = 141, outfit_male = 130, addon = 1, storageID = 60005})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second mage addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5903,1}}, outfit_female = 141, outfit_male = 130, addon = 2, storageID = 60006})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)


    -- summoner (done)
    local outfit_node = keywordHandler:addKeyword({'first summoner addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{2182,1}, {2186,1}, {2185,1}, {8911,1}, {2181,1}, {2183,1}, {2190,1}, {2191,1}, {2188,1}, {8921,1}, {2189,1}, {2187,1}, {5904,10}, {5809,1}, {2193,20}}, outfit_female = 138, outfit_male = 133, addon = 1, storageID = 60009})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second summoner addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5894,70}, {5911,20}, {5883,40}, {5922,35}, {5879,10}, {5881,60}, {5882,40}, {5904,1}, {5905,30}}, outfit_female = 138, outfit_male = 133, addon = 2, storageID = 60010})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)


    -- barbarian (done)
    local outfit_node = keywordHandler:addKeyword({'first barbarian addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5884,1}, {5885,1}, {5910,50}, {5911,50}, {5886,10}}, outfit_female = 147, outfit_male = 143, addon = 1, storageID = 60011})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second barbarian addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5880,100}, {5892,1}, {5893,50}, {5876,50}}, outfit_female = 147, outfit_male = 143, addon = 2, storageID = 60012})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- druid (done)
    local outfit_node = keywordHandler:addKeyword({'first druid addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5896,50}, {5897,50}}, outfit_female = 148, outfit_male = 144, addon = 1, storageID = 60013})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second druid addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5906,100}, {8303,1}, {5940,1}}, outfit_female = 148, outfit_male = 144, addon = 2, storageID = 60014})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- nobleman (done)
    local outfit_node = keywordHandler:addKeyword({'first nobleman addon'}, playerBuyAddonNPC, {premium = false, cost = 150000, items = {}, outfit_female = 140, outfit_male = 132, addon = 1, storageID = 60015})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second nobleman addon'}, playerBuyAddonNPC, {premium = false, cost = 150000, items = {}, outfit_female = 140, outfit_male = 132, addon = 2, storageID = 60016})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- oriental (done)
    local outfit_node = keywordHandler:addKeyword({'first oriental addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5945,1}}, outfit_female = 150, outfit_male = 146, addon = 1, storageID = 60017})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second oriental addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5883,100}, {5895,100}, {5891,2}, {5912,100}}, outfit_female = 150, outfit_male = 146, addon = 2, storageID = 60018})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- warrior (done)
    local outfit_node = keywordHandler:addKeyword({'first warrior addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5925,100}, {5899,100}, {5884,1}, {10020,1}}, outfit_female = 142, outfit_male = 134, addon = 1, storageID = 60019})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second warrior addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5880,100}, {5887,1}}, outfit_female = 142, outfit_male = 134, addon = 2, storageID = 60020})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- wizard (done)
    local outfit_node = keywordHandler:addKeyword({'first wizard addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{2536,1}, {2492,1}, {2488,1}, {2123,1}}, outfit_female = 149, outfit_male = 145, addon = 1, storageID = 60021})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second wizard addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5922,50}}, outfit_female = 149, outfit_male = 145, addon = 2, storageID = 60022})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- assassin (done)
    local outfit_node = keywordHandler:addKeyword({'first assassin addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5912,50}, {5910,50}, {5911,50}, {5913,50}, {5914,50}, {5909,50}, {5886,10}}, outfit_female = 156, outfit_male = 152, addon = 1, storageID = 60023})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second assassin addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5804,1}, {5930,1}}, outfit_female = 156, outfit_male = 152, addon = 2, storageID = 60024})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- beggar (done)
    local outfit_node = keywordHandler:addKeyword({'first beggar addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5883,100}, {2160,2}}, outfit_female = 157, outfit_male = 153, addon = 1, storageID = 60025})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second beggar addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{6107,1}}, outfit_female = 157, outfit_male = 153, addon = 2, storageID = 60026})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- pirate (done)
    local outfit_node = keywordHandler:addKeyword({'first pirate addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{6098,100}, {6126,100}, {6097,100}}, outfit_female = 155, outfit_male = 151, addon = 1, storageID = 60027})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second pirate addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{6101,1}, {6102,1}, {6100,1}, {6099,1}}, outfit_female = 155, outfit_male = 151, addon = 2, storageID = 60028})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- shaman (done)
    local outfit_node = keywordHandler:addKeyword({'first shaman addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5810,5}, {3955,5}, {5015,1}}, outfit_female = 158, outfit_male = 154, addon = 1, storageID = 60029})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second shaman addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{3966,5}, {3967,5}}, outfit_female = 158, outfit_male = 154, addon = 2, storageID = 60030})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- norseman (done)
    local outfit_node = keywordHandler:addKeyword({'first norseman addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{7290,5}}, outfit_female = 252, outfit_male = 251, addon = 1, storageID = 60031})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second norseman addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{7290,10}}, outfit_female = 252, outfit_male = 251, addon = 2, storageID = 60032})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    -- jester (done)(custom)
    local outfit_node = keywordHandler:addKeyword({'first jester addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5912,50}, {5913,50}, {5914,50}, {5909,50}}, outfit_female = 270, outfit_male = 273, addon = 1, storageID = 60033})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second jester addon'}, playerBuyAddonNPC, {premium = false, cost = 0, items = {{5912,50}, {5910,50}, {5911,50}, {5912,50}}, outfit_female = 270, outfit_male = 273, addon = 2, storageID = 60034})
        outfit_node:addChildKeywordNode(yesNode)
        outfit_node:addChildKeywordNode(noNode)

    keywordHandler:addKeyword({'addons'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can give you citizen, hunter, knight, mage, nobleman, summoner, warrior, barbarian, druid, wizard, oriental, pirate, assassin, beggar, shaman, norseman, nighmare, jester, yalaharian and brotherhood addons.'})
    keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To buy the first addon say \'first NAME addon\', for the second addon say \'second NAME addon\'.'})

    npcHandler:addModule(FocusModule:new())

    de hay van a la siguiente carpeta

    /data\npc

    vuelven  y copian y pegan un archivo entran borran todo y le pegan lo siguiente


    Código:
    <?xml version="1.0" encoding="UTF-8"?>
    <npc name="Addons" script="addon.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="130" head="76" body="5" legs="17" feet="76" addons="3"/>
       <parameters>
       <parameter key="message_greet" value="Greetings |PLAYERNAME|. I can sell you many nice addons! Just say 'addons'." />
       </parameters>
    </npc>


    y hay ya tienen su viejo amigo addoner Very Happy

    Ver perfil de usuario

    2default Re: Npc Addoner el Vie Feb 27, 2015 12:07 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    buen aporte gracias +1



    Npc Addoner  YNU5B25
    Ver perfil de usuario https://www.tibiaface.com

    3default Re: Npc Addoner el Lun Sep 14, 2015 12:31 am

    god adrian

    god adrian
    Miembro
    Miembro
    tendras actualizado a las nuevos aspectos? q veo se queda hasta jesster

    Ver perfil de usuario http://sentimientovirtual.com.mx

    4default Re: Npc Addoner el Mar Ene 03, 2017 7:06 pm

    Fosfik

    Fosfik
    Miembro
    Miembro
    Hola que tal, disculpa me aparece bien todo el npc pero al momento de decir por ejemplo "first citizen addon" no me dice nada, y me aparece un error en la consola
    necesito ayuda porfa

    Ver perfil de usuario

    5default Re: Npc Addoner el Mar Ene 03, 2017 7:07 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    [Tienes que estar registrado y conectado para ver este vínculo] escribió:Hola que tal, disculpa me aparece bien todo el npc pero al momento de decir por ejemplo "first citizen addon" no me dice nada, y me aparece un error en la consola
    necesito ayuda porfa

    para que proyecto estas usando este npc que version de distribucion



    Npc Addoner  YNU5B25
    Ver perfil de usuario https://www.tibiaface.com

    6default Re: Npc Addoner el Mar Ene 03, 2017 7:19 pm

    Fosfik

    Fosfik
    Miembro
    Miembro
    para el global v24 protocolo 10.90

    Ver perfil de usuario

    7default Re: Npc Addoner el Mar Ene 03, 2017 9:37 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    [Tienes que estar registrado y conectado para ver este vínculo] escribió:para el global v24 protocolo 10.90

    no sirve para esa version es para version bajas o basadas en tfs 03.7



    Npc Addoner  YNU5B25
    Ver perfil de usuario https://www.tibiaface.com

    8default Re: Npc Addoner el Miér Jul 17, 2019 5:29 pm

    daneraots

    daneraots
    Miembro
    Miembro
    hola megustari que me ayudaran a modificar este script de NPc Addoner, quiero se te venda los addons sin requerir premium

    Ver perfil de usuario http://imperio.servegame.com/

    9default Re: Npc Addoner el Miér Jul 17, 2019 5:39 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    [Tienes que estar registrado y conectado para ver este vínculo] escribió:hola megustari que me ayudaran a modificar este script de NPc Addoner, quiero se te venda los addons sin requerir premium

    si mira en el npc dice una tag en cada addon

    Código:
    premium = false



    Npc Addoner  YNU5B25
    Ver perfil de usuario https://www.tibiaface.com

    10default Re: Npc Addoner el Miér Jul 17, 2019 6:08 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    [Tienes que estar registrado y conectado para ver este vínculo] escribió:hola megustari que me ayudaran a modificar este script de NPc Addoner, quiero se te venda los addons sin requerir premium

    lño siento amigo pero esta noe s una seccion de soprote si usted tiene n problema con el scripts del tema podra publicar tu problema epro si es un tema ajeno al original porfavor cree unt ema en epdido de script o unt ema de ayuda

    rcuerde que por tema es 24 horas, para publicar un tema de ayuda



    Npc Addoner  YNU5B25
    Ver perfil de usuario https://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.

    Temas Recomendados×+

       

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