• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    [Pedido] necesito Un npc addons

    Compartir:

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

    1Resuelto [Pedido] necesito Un npc addons Jue Mayo 26, 2016 12:03 am

    Gabriiii

    Gabriiii
    Miembro
    Miembro
    Hola! Amigos de TibiaFace, como estan? Espero que bien... Amigo Necesito una ayuda sobre un NPC de addons, que vende addons [1 y 2] por el Soul de Player...Pora Favor necesito una ayuda.. como solucionar esto..Saludos...  

    2 participantes

    2Resuelto Re: [Pedido] necesito Un npc addons Jue Mayo 26, 2016 12:05 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    y tu npc por que no lo colocas aqui apra que veamos que solucion le damos



    [Pedido] necesito Un npc addons YNU5B25
    2 participantes
    http://www.tibiaface.com

    3Resuelto [Pedido] NPC Addons Jue Mayo 26, 2016 12:11 am

    Gabriiii

    Gabriiii
    Miembro
    Miembro
    La verdad el NPC que tengo es un NPc normal que les vende los addons a cambio de dinero... pero el NPC que vende los addons a CAmbio del SOUL del player no lo tengo brother Sad

    2 participantes

    4Resuelto Re: [Pedido] necesito Un npc addons Jue Mayo 26, 2016 12:14 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    pero colocame aqui tu npc que vende a cambio de dinero para que le agamos unas modificaciones



    [Pedido] necesito Un npc addons YNU5B25
    2 participantes
    http://www.tibiaface.com

    5Resuelto [Pedido] npc Jue Mayo 26, 2016 12:38 am

    Gabriiii

    Gabriiii
    Miembro
    Miembro
    esta es la XML

    Código:
     <?xml version="1.0" encoding="UTF-8"?>
    <npc name="Addons Flee" script="data/npc/scripts/addons2.lua" walkinterval="2000" floorchange="0">
       <health now="100" max="100"/>
       <look type="134" head="78" body="88" legs="0" feet="88" addons="3"/>
    </npc>


    Script

    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, "Hola |PLAYERNAME|. Yo Vendo Todos Los {addons}, Si Necesitas Ayuda Para Los Addons Di {help}.")

    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 = true, cost = 0, items = {{2160,10}}, outfit_female = 136, outfit_male = 128, addon = 1, storageID = 10001})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second citizen addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,8}, {2160,5}}, outfit_female = 136, outfit_male = 128, addon = 2, storageID = 10002})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- hunter (done)
    local outfit_node = keywordHandler:addKeyword({'first hunter addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,4}, {2160,1}, {2160,7}, {2160,5}, {2160,4}, {2160,5}, {2160,1}}, outfit_female = 137, outfit_male = 129, addon = 1, storageID = 10003})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second hunter addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}}, outfit_female = 137, outfit_male = 129, addon = 2, storageID = 10004})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- knight (done)
    local outfit_node = keywordHandler:addKeyword({'first knight addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,15}}, outfit_female = 139, outfit_male = 131, addon = 1, storageID = 10005})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second knight addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,1}, {2160,5}, {2160,7}}, outfit_female = 139, outfit_male = 131, addon = 2, storageID = 10006})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- mage (done)
    local outfit_node = keywordHandler:addKeyword({'first mage addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,1}, {2160,4}, {2160,1}, {2160,3}, {2160,1}, {2160,2}, {2160,1}, {2160,1}, {2160,5}, {2160,2}, {2160,1}, {2160,6}, {2160,3}, {2160,3}, {2160,5}}, outfit_female = 138, outfit_male = 130, addon = 1, storageID = 10007})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second mage addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}}, outfit_female = 138, outfit_male = 130, addon = 2, storageID = 10008})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)


    -- summoner (done)
    local outfit_node = keywordHandler:addKeyword({'first summoner addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}}, outfit_female = 141, outfit_male = 133, addon = 1, storageID = 10009})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second summoner addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,7}, {2160,2}, {2160,4}, {2160,5}, {2160,1}, {2160,6}, {2160,3}, {2160,3}, {2160,5}}, outfit_female = 141, outfit_male = 133, addon = 2, storageID = 10010})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)


    -- barbarian (done)
    local outfit_node = keywordHandler:addKeyword({'first barbarian addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}, {2160,10}, {2160,5}, {2160,5}, {2160,10}}, outfit_female = 147, outfit_male = 143, addon = 1, storageID = 10011})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second barbarian addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,5}, {2160,5}, {2160,5}}, outfit_female = 147, outfit_male = 143, addon = 2, storageID = 10012})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- druid (done)
    local outfit_node = keywordHandler:addKeyword({'first druid addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}}, outfit_female = 148, outfit_male = 144, addon = 1, storageID = 10013})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second druid addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}, {2160,5}}, outfit_female = 148, outfit_male = 144, addon = 2, storageID = 10014})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

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

    -- oriental (done)
    local outfit_node = keywordHandler:addKeyword({'first oriental addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,35}}, outfit_female = 150, outfit_male = 146, addon = 1, storageID = 10017})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second oriental addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}, {2160,2}, {2160,10}}, outfit_female = 150, outfit_male = 146, addon = 2, storageID = 10018})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- warrior (done)
    local outfit_node = keywordHandler:addKeyword({'first warrior addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}, {2160,10}, {2160,5}}, outfit_female = 142, outfit_male = 134, addon = 1, storageID = 10019})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second warrior addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,15}}, outfit_female = 142, outfit_male = 134, addon = 2, storageID = 10020})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- wizard (done)
    local outfit_node = keywordHandler:addKeyword({'first wizard addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,5}, {2160,4}, {2160,8}}, outfit_female = 149, outfit_male = 145, addon = 1, storageID = 10021})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second wizard addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,30}}, outfit_female = 149, outfit_male = 145, addon = 2, storageID = 10022})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- assassin (done)
    local outfit_node = keywordHandler:addKeyword({'first assassin addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}, {2160,5}, {2160,5}, {2160,5}, {2160,5}, {2160,5}, {2160,5}, {2160,1}}, outfit_female = 156, outfit_male = 152, addon = 1, storageID = 10023})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second assassin addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,25}, {2160,15}}, outfit_female = 156, outfit_male = 152, addon = 2, storageID = 10024})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- beggar (done)
    local outfit_node = keywordHandler:addKeyword({'first beggar addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}, {2160,3}, {2160,2}, {2160,10}}, outfit_female = 157, outfit_male = 153, addon = 1, storageID = 10025})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second beggar addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}, {2160,1}}, outfit_female = 157, outfit_male = 153, addon = 2, storageID = 10026})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- pirate (done)
    local outfit_node = keywordHandler:addKeyword({'first pirate addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}, {2160,1}}, outfit_female = 155, outfit_male = 151, addon = 1, storageID = 10027})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second pirate addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,1}, {2160,7}, {2160,1}, {2160,8}}, outfit_female = 155, outfit_male = 151, addon = 2, storageID = 10028})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- shaman (done)
    local outfit_node = keywordHandler:addKeyword({'first shaman addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}, {2160,5}, {2160,10}}, outfit_female = 158, outfit_male = 154, addon = 1, storageID = 10029})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second shaman addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}, {2160,20}}, outfit_female = 158, outfit_male = 154, addon = 2, storageID = 10030})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

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

    -- jester (done)(custom)
    local outfit_node = keywordHandler:addKeyword({'first jester addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,5}, {2160,15}, {2160,5}}, outfit_female = 270, outfit_male = 273, addon = 1, storageID = 10033})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second jester addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,50}, {2160,50}, {2160,50}, {2160,50}}, outfit_female = 270, outfit_male = 273, addon = 2, storageID = 10034})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- demonhunter (done)(custom)
    local outfit_node = keywordHandler:addKeyword({'first demonhunter addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,3}, {2160,4}, {2160,5}, {2160,5}, {2160,10}}, outfit_female = 288, outfit_male = 289, addon = 1, storageID = 10035})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second demonhunter addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}, {2160,15}, {2160,10}}, outfit_female = 288, outfit_male = 289, addon = 2, storageID = 10036})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- nightmare (done)(custom)
    local outfit_node = keywordHandler:addKeyword({'first nightmare addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}}, outfit_female = 269, outfit_male = 268, addon = 1, storageID = 10037})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second nightmare addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}}, outfit_female = 269, outfit_male = 268, addon = 2, storageID = 10038})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- brotherhood (done)(custom)
    local outfit_node = keywordHandler:addKeyword({'first brotherhood addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,150}}, outfit_female = 136, outfit_male = 278, addon = 1, storageID = 10039})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second brotherhood addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}}, outfit_female = 136, outfit_male = 278, addon = 2, storageID = 10040})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)

    -- yalaharian (done)(custom)
    local outfit_node = keywordHandler:addKeyword({'first yalaharian addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}}, outfit_female = 324, outfit_male = 325, addon = 1, storageID = 10041})
    outfit_node:addChildKeywordNode(yesNode)
    outfit_node:addChildKeywordNode(noNode)
    local outfit_node = keywordHandler:addKeyword({'second yalaharian addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,40}}, outfit_female = 324, outfit_male = 325, addon = 2, storageID = 10041})
    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, demonhunter 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())

    2 participantes

    6Resuelto Re: [Pedido] necesito Un npc addons Jue Mayo 26, 2016 12:56 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    revisa si te dunciona ya lo modifique ára que pida soul

    solo modifica en cada addon el cost= 10 de soul lo hice en el citizen

    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, "Hola |PLAYERNAME|. Yo Vendo Todos Los {addons}, Si Necesitas Ayuda Para Los Addons Di {help}.")

                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(getPlayerSoul(cid) >= addoninfo.cost) and (items_number == table.maxn(addoninfo.items)) then
                doPlayerAddSoul(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 = true, cost = 10, items = {{2160,10}}, outfit_female = 136, outfit_male = 128, addon = 1, storageID = 10001})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second citizen addon'}, playerBuyAddonNPC, {premium = true, cost = 10, items = {{2160,10}, {2160,8}, {2160,5}}, outfit_female = 136, outfit_male = 128, addon = 2, storageID = 10002})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- hunter (done)
                local outfit_node = keywordHandler:addKeyword({'first hunter addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,4}, {2160,1}, {2160,7}, {2160,5}, {2160,4}, {2160,5}, {2160,1}}, outfit_female = 137, outfit_male = 129, addon = 1, storageID = 10003})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second hunter addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}}, outfit_female = 137, outfit_male = 129, addon = 2, storageID = 10004})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- knight (done)
                local outfit_node = keywordHandler:addKeyword({'first knight addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,15}}, outfit_female = 139, outfit_male = 131, addon = 1, storageID = 10005})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second knight addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,1}, {2160,5}, {2160,7}}, outfit_female = 139, outfit_male = 131, addon = 2, storageID = 10006})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- mage (done)
                local outfit_node = keywordHandler:addKeyword({'first mage addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,1}, {2160,4}, {2160,1}, {2160,3}, {2160,1}, {2160,2}, {2160,1}, {2160,1}, {2160,5}, {2160,2}, {2160,1}, {2160,6}, {2160,3}, {2160,3}, {2160,5}}, outfit_female = 138, outfit_male = 130, addon = 1, storageID = 10007})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second mage addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}}, outfit_female = 138, outfit_male = 130, addon = 2, storageID = 10008})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)


                -- summoner (done)
                local outfit_node = keywordHandler:addKeyword({'first summoner addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}}, outfit_female = 141, outfit_male = 133, addon = 1, storageID = 10009})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second summoner addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,7}, {2160,2}, {2160,4}, {2160,5}, {2160,1}, {2160,6}, {2160,3}, {2160,3}, {2160,5}}, outfit_female = 141, outfit_male = 133, addon = 2, storageID = 10010})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)


                -- barbarian (done)
                local outfit_node = keywordHandler:addKeyword({'first barbarian addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}, {2160,10}, {2160,5}, {2160,5}, {2160,10}}, outfit_female = 147, outfit_male = 143, addon = 1, storageID = 10011})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second barbarian addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,5}, {2160,5}, {2160,5}}, outfit_female = 147, outfit_male = 143, addon = 2, storageID = 10012})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- druid (done)
                local outfit_node = keywordHandler:addKeyword({'first druid addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}}, outfit_female = 148, outfit_male = 144, addon = 1, storageID = 10013})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second druid addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}, {2160,5}}, outfit_female = 148, outfit_male = 144, addon = 2, storageID = 10014})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

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

                -- oriental (done)
                local outfit_node = keywordHandler:addKeyword({'first oriental addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,35}}, outfit_female = 150, outfit_male = 146, addon = 1, storageID = 10017})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second oriental addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}, {2160,2}, {2160,10}}, outfit_female = 150, outfit_male = 146, addon = 2, storageID = 10018})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- warrior (done)
                local outfit_node = keywordHandler:addKeyword({'first warrior addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}, {2160,10}, {2160,5}}, outfit_female = 142, outfit_male = 134, addon = 1, storageID = 10019})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second warrior addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,15}}, outfit_female = 142, outfit_male = 134, addon = 2, storageID = 10020})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- wizard (done)
                local outfit_node = keywordHandler:addKeyword({'first wizard addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,5}, {2160,4}, {2160,8}}, outfit_female = 149, outfit_male = 145, addon = 1, storageID = 10021})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second wizard addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,30}}, outfit_female = 149, outfit_male = 145, addon = 2, storageID = 10022})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- assassin (done)
                local outfit_node = keywordHandler:addKeyword({'first assassin addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}, {2160,5}, {2160,5}, {2160,5}, {2160,5}, {2160,5}, {2160,5}, {2160,1}}, outfit_female = 156, outfit_male = 152, addon = 1, storageID = 10023})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second assassin addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,25}, {2160,15}}, outfit_female = 156, outfit_male = 152, addon = 2, storageID = 10024})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- beggar (done)
                local outfit_node = keywordHandler:addKeyword({'first beggar addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}, {2160,3}, {2160,2}, {2160,10}}, outfit_female = 157, outfit_male = 153, addon = 1, storageID = 10025})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second beggar addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}, {2160,1}}, outfit_female = 157, outfit_male = 153, addon = 2, storageID = 10026})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- pirate (done)
                local outfit_node = keywordHandler:addKeyword({'first pirate addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,10}, {2160,1}}, outfit_female = 155, outfit_male = 151, addon = 1, storageID = 10027})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second pirate addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,1}, {2160,7}, {2160,1}, {2160,8}}, outfit_female = 155, outfit_male = 151, addon = 2, storageID = 10028})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- shaman (done)
                local outfit_node = keywordHandler:addKeyword({'first shaman addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}, {2160,5}, {2160,10}}, outfit_female = 158, outfit_male = 154, addon = 1, storageID = 10029})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second shaman addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,5}, {2160,20}}, outfit_female = 158, outfit_male = 154, addon = 2, storageID = 10030})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

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

                -- jester (done)(custom)
                local outfit_node = keywordHandler:addKeyword({'first jester addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,10}, {2160,5}, {2160,15}, {2160,5}}, outfit_female = 270, outfit_male = 273, addon = 1, storageID = 10033})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second jester addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,50}, {2160,50}, {2160,50}, {2160,50}}, outfit_female = 270, outfit_male = 273, addon = 2, storageID = 10034})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- demonhunter (done)(custom)
                local outfit_node = keywordHandler:addKeyword({'first demonhunter addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,3}, {2160,4}, {2160,5}, {2160,5}, {2160,10}}, outfit_female = 288, outfit_male = 289, addon = 1, storageID = 10035})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second demonhunter addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}, {2160,15}, {2160,10}}, outfit_female = 288, outfit_male = 289, addon = 2, storageID = 10036})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- nightmare (done)(custom)
                local outfit_node = keywordHandler:addKeyword({'first nightmare addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}}, outfit_female = 269, outfit_male = 268, addon = 1, storageID = 10037})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second nightmare addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}}, outfit_female = 269, outfit_male = 268, addon = 2, storageID = 10038})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- brotherhood (done)(custom)
                local outfit_node = keywordHandler:addKeyword({'first brotherhood addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,150}}, outfit_female = 136, outfit_male = 278, addon = 1, storageID = 10039})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second brotherhood addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}}, outfit_female = 136, outfit_male = 278, addon = 2, storageID = 10040})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)

                -- yalaharian (done)(custom)
                local outfit_node = keywordHandler:addKeyword({'first yalaharian addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,15}}, outfit_female = 324, outfit_male = 325, addon = 1, storageID = 10041})
                outfit_node:addChildKeywordNode(yesNode)
                outfit_node:addChildKeywordNode(noNode)
                local outfit_node = keywordHandler:addKeyword({'second yalaharian addon'}, playerBuyAddonNPC, {premium = true, cost = 0, items = {{2160,40}}, outfit_female = 324, outfit_male = 325, addon = 2, storageID = 10041})
                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, demonhunter 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())



    [Pedido] necesito Un npc addons YNU5B25
    2 participantes
    http://www.tibiaface.com

    7Resuelto npc Jue Mayo 26, 2016 1:10 am

    Gabriiii

    Gabriiii
    Miembro
    Miembro
    no nada, igual sigue pidiendo dinero en vez del soul Sad

    2 participantes

    8Resuelto Re: [Pedido] necesito Un npc addons Jue Mayo 26, 2016 1:43 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    solo es emensaje que dice gold verifica los emnsajes por el npc solo pide soul no dinero



    [Pedido] necesito Un npc addons YNU5B25
    2 participantes
    http://www.tibiaface.com

    9Resuelto npc Jue Mayo 26, 2016 1:52 am

    Gabriiii

    Gabriiii
    Miembro
    Miembro
    Listo ya
    y Como haria para que no pueda pedir ningun items o dinero maya?

    2 participantes

    10Resuelto npc Jue Mayo 26, 2016 2:05 am

    Gabriiii

    Gabriiii
    Miembro
    Miembro
    Listo, Ya pido solamente Soul... Esta Arrelado Very Happy Gracias Brother

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