Jump to content

Scripting Alguém me ajuda com algumas alterações nesse script?


Recommended Posts

Alguém poderia me ajudar a mudar algumas coisas nesse script?

gostaria de remover essa quantidade de items deixando apenas 1

e que eu consiga coloca varios items diferente mas a quantidade precisa ser apenas 1 por exemplo item= {2160,EXEMPLO1,EXEMPLO2,EXEMPLO3{x=906, y=588, z=7}}}

 

 

 

 

 

 

 

 

 

 

local lvl = 1
local stor_time = 68767
local hours = 1
local pos_die = {x=905, y=571, z=6} 
local t = {
        {vocations = {1, 1},Pos = {{x=912, y=583, z=7},{x=904, y=573, z=6}},item= {9020,{x=906, y=578, z=7}}}, -- DRUNK
    {vocations = {1, 1},Pos = {{x=910, y=579, z=7},{x=904, y=575, z=6}},item= {9020,{x=906, y=588, z=7}}}, -- PARALYZE
    {vocations = {1, 1},Pos = {{x=902, y=579, z=7},{x=906, y=575, z=6}},item= {9020,{x=907, y=584, z=7}}}, -- BRUISER
    {vocations = {1, 1},Pos = {{x=910, y=587, z=7},{x=906, y=573, z=6}},item= {9020,{x=905, y=584, z=7}}}, -- HEAL
    {vocations = {1, 1},Pos = {{x=900, y=583, z=7},{x=905, y=574, z=6}},item= {9020,{x=905, y=582, z=7}}}, -- ATK
    {vocations = {1, 1},Pos = {{x=902, y=587, z=7},{x=904, y=573, z=6}},item= {9020,{x=907, y=582, z=7}}} -- DISTANCE

}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local check = {}
    local items = {}
    for _, k in ipairs(t) do
        local x = getTopCreature(k.Pos[1]).uid
        local v = getTileItemById(k.item[2], k.item[1])
        if x == 0 or not isPlayer(x) or getPlayerLevel(x) < lvl or isInArray(k.vocations, getPlayerVocation(x)) == FALSE or getPlayerStorageValue(x, stor_time) - os.time() > 0 then
            doPlayerSendCancel(cid, 'Está faltando player, alguém não possui level '..lvl..' ou não está transformado no maximo.') return true
        elseif v.uid == 0 then
        doPlayerSendCancel(cid, "Todos os itens precisa estar na posição.") return true end
        table.insert(check, x)
        table.insert(items, v)
    end
    local sort = check[math.random(1, #check)]
    for k, tid in ipairs(check) do
        doSendMagicEffect(getCreaturePosition(tid), CONST_ME_POFF)
        if tid ~= sort then 
            doTeleportThing(tid, t[k].Pos[2])
            
        else
            doTeleportThing(tid, pos_die)
        end
        doSendMagicEffect(getCreaturePosition(tid), CONST_ME_TELEPORT)
        setPlayerStorageValue(tid, stor_time, os.time()+hours*1)
    end
    for _, remove in ipairs(items) do
        doRemoveItem(remove.uid)
    end
    doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
    return true
end

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By alexalex
      ea galera um gosto, meu topico e pra voces me ajudar com um sistema como wander of shinobi! eu preciso uns script da transform!! 
      eu quero um sistema de transform temporal por exemplo q cuamndo o character nao tenha chakra vai revertir e vai precisar de novo mais chakra pra pode se transformar de novo
       
      e outro pedido e pra as transform permanente (agora nao por tempo ou chakra). Nao quero o comando "transform" pra todas as vocacaoes, quero que cada transformacao seja individual com diferente nome pra cada lvl do transform E editar o comando transform por exemplo "naruto chakra kyubi" em o lvl 50...
       
      se me ajudar vou dar adm em meu projetoo!! muito obrigado! boa noite:)
       
       
       
       

    • By ADM Alef
      .Qual servidor ou website você utiliza como base? 
       
      Qual o motivo deste tópico? 
      Preciso do script do npc jack springer 
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • By ADM Alef
      .Qual servidor ou website você utiliza como base? 
      Queria tirar do script a opçao de viajar apenas com gold para viajar sem gold,não lembro como faz kjkkkkkkkkkkkkkkkkkkkkkk
       
      Qual o motivo deste tópico? 
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
       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 local voices = { {text = 'Passages to Carlin, Ab\'Dendriel, Edron, Venore, Port Hope, Liberty Bay, Yalahar, Roshamuul, Krailos, Oramond and Svargrond.'} } npcHandler:addModule(VoiceModule:new(voices)) -- Travel local function addTravelKeyword(keyword, cost, destination, action, condition) if condition then keywordHandler:addKeyword({keyword}, StdModule.say, {npcHandler = npcHandler, text = 'I\'m sorry but I don\'t sail there.'}, condition) end local travelKeyword = keywordHandler:addKeyword({keyword}, StdModule.say, {npcHandler = npcHandler, text = 'Do you seek a passage to ' .. keyword:titleCase() .. ' for |TRAVELCOST|?', cost = cost, discount = 'postman'}) travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, cost = cost, discount = 'postman', destination = destination}, nil, action) travelKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'We would like to serve you some time.', reset = true}) end addTravelKeyword('carlin', 110, Position(32387, 31820, 6), function(player) if player:getStorageValue(Storage.Postman.Mission01) == 1 then player:setStorageValue(Storage.Postman.Mission01, 2) end end) addTravelKeyword('ab\'dendriel', 130, Position(32734, 31668, 6)) addTravelKeyword('edron', 160, Position(33175, 31764, 6)) addTravelKeyword('venore', 170, Position(32954, 32022, 6)) addTravelKeyword('port hope', 160, Position(32527, 32784, 6)) addTravelKeyword('roshamuul', 210, Position(33494, 32567, 7)) addTravelKeyword('svargrond', 180, Position(32341, 31108, 6)) addTravelKeyword('liberty bay', 180, Position(32285, 32892, 6)) addTravelKeyword('yalahar', 200, Position(32816, 31272, 6), nil, function(player) return player:getStorageValue(Storage.SearoutesAroundYalahar.Thais) ~= 1 and player:getStorageValue(Storage.SearoutesAroundYalahar.TownsCounter) < 5 end) addTravelKeyword('oramond', 150, Position(33479, 31985, 7)) addTravelKeyword('krailos', 230, Position(33492, 31712, 6)) -- Kick keywordHandler:addKeyword({'kick'}, StdModule.kick, {npcHandler = npcHandler, destination = {Position(32320, 32219, 6), Position(32321, 32210, 6)}}) -- Basic keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, text = 'My name is Captain Bluebear from the Royal Tibia Line.'}) keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, text = 'I am the captain of this sailing-ship.'}) keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, text = 'I am the captain of this sailing-ship.'}) keywordHandler:addKeyword({'ship'}, StdModule.say, {npcHandler = npcHandler, text = 'The Royal Tibia Line connects all seaside towns of Tibia.'}) keywordHandler:addKeyword({'line'}, StdModule.say, {npcHandler = npcHandler, text = 'The Royal Tibia Line connects all seaside towns of Tibia.'}) keywordHandler:addKeyword({'company'}, StdModule.say, {npcHandler = npcHandler, text = 'The Royal Tibia Line connects all seaside towns of Tibia.'}) keywordHandler:addKeyword({'tibia'}, StdModule.say, {npcHandler = npcHandler, text = 'The Royal Tibia Line connects all seaside towns of Tibia.'}) keywordHandler:addKeyword({'good'}, StdModule.say, {npcHandler = npcHandler, text = 'We can transport everything you want.'}) keywordHandler:addKeyword({'passenger'}, StdModule.say, {npcHandler = npcHandler, text = 'We would like to welcome you on board.'}) keywordHandler:addKeyword({'trip'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To {Carlin}, {Ab\'Dendriel}, {Venore}, {Port Hope}, {Liberty Bay}, {Svargrond}, {Yalahar}, {Roshamuul}, {Oramond} or {Edron}?'}) keywordHandler:addKeyword({'route'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To {Carlin}, {Ab\'Dendriel}, {Venore}, {Port Hope}, {Liberty Bay}, {Svargrond}, {Yalahar}, {Roshamuul}, {Oramond} or {Edron}?'}) keywordHandler:addKeyword({'passage'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To {Carlin}, {Ab\'Dendriel}, {Venore}, {Port Hope}, {Liberty Bay}, {Svargrond}, {Yalahar}, {Roshamuul}, {Oramond} or {Edron}?'}) keywordHandler:addKeyword({'town'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To {Carlin}, {Ab\'Dendriel}, {Venore}, {Port Hope}, {Liberty Bay}, {Svargrond}, {Yalahar}, {Roshamuul}, {Oramond} or {Edron}?'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To {Carlin}, {Ab\'Dendriel}, {Venore}, {Port Hope}, {Liberty Bay}, {Svargrond}, {Yalahar}, {Roshamuul}, {Oramond} or {Edron}?'}) keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To {Carlin}, {Ab\'Dendriel}, {Venore}, {Port Hope}, {Liberty Bay}, {Svargrond}, {Yalahar}, {Roshamuul}, {Oramond} or {Edron}?'}) keywordHandler:addKeyword({'go'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To {Carlin}, {Ab\'Dendriel}, {Venore}, {Port Hope}, {Liberty Bay}, {Svargrond}, {Yalahar}, {Roshamuul}, {Oramond} or {Edron}?'}) keywordHandler:addKeyword({'ice'}, StdModule.say, {npcHandler = npcHandler, text = 'I\'m sorry, but we don\'t serve the routes to the Ice Islands.'}) keywordHandler:addKeyword({'senja'}, StdModule.say, {npcHandler = npcHandler, text = 'I\'m sorry, but we don\'t serve the routes to the Ice Islands.'}) keywordHandler:addKeyword({'folda'}, StdModule.say, {npcHandler = npcHandler, text = 'I\'m sorry, but we don\'t serve the routes to the Ice Islands.'}) keywordHandler:addKeyword({'vega'}, StdModule.say, {npcHandler = npcHandler, text = 'I\'m sorry, but we don\'t serve the routes to the Ice Islands.'}) keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, text = 'I\'m not sailing there. This route is afflicted by a ghostship! However I\'ve heard that Captain Fearless from Venore sails there.'}) keywordHandler:addKeyword({'darama'}, StdModule.say, {npcHandler = npcHandler, text = 'I\'m not sailing there. This route is afflicted by a ghostship! However I\'ve heard that Captain Fearless from Venore sails there.'}) keywordHandler:addKeyword({'ghost'}, StdModule.say, {npcHandler = npcHandler, text = 'Many people who sailed to Darashia never returned because they were attacked by a ghostship! I\'ll never sail there!'}) keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, text = 'This is Thais. Where do you want to go?'}) npcHandler:setMessage(MESSAGE_GREET, 'Welcome on board, |PLAYERNAME|. Where can I {sail} you today?') npcHandler:setMessage(MESSAGE_FAREWELL, 'Good bye. Recommend us if you were satisfied with our service.') npcHandler:setMessage(MESSAGE_WALKAWAY, 'Good bye then.') npcHandler:addModule(FocusModule:new())  
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • By Lethal M
      .Qual servidor ou website você utiliza como base? 
      TFS 1.3 GLOBAL 12.60
       
       
      @EDIT Já solucionei o problema, tive que usar os id ja existentes no vocations.xml, utilizei as voc 5~8 (promotions) e as 9~12 (downport) podem fechar o topico
       
       
       
       
       
       
      Qual o motivo deste tópico? 
       
      Quando novas vocations atingem o level do summon (200+) , o servidor fechar sem mostrar erros... 
      Alguem pode me ajudar a adicionar as novas vocations no creaturescript do Familiars?
       
       

      creaturescripts/others/familiars.lua
       


      vocations.xml
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • By isac001
      Alguém me ajuda quero um NPC, que pede 3 itens e dar 1!
       
      id dos itens pedidos: 13386, 12713, 13400.
      id do item que ele dar em troca: 12714.
       
      Obrigado!
       
  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...

Important Information

Confirmação de Termo