Jump to content

Recommended Posts

  • Solution

Alguém poderia colocar uma certa quantidade de item nesse script, para ser forjado. Como já ta no script, é de 1 em 1.

Exemplo:

1- necessita de 1 item

2- necessita de 10 item

3- necessita de 10 item

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local Configs = {
----------------------------- Rare ---------------------------------------
    pos_bancada1 = {x=983,y=965,z=8},
    pos_bancada2 = {x=984,y=965,z=8},
    pos_bancada3 = {x=985,y=965,z=8},

    pos_premio1 = {x=983,y=967,z=8},

    item1_craft = {item1=7463},
    item2_craft = {item2=11388},
    item3_craft = {item3=11387},

    item4_craft = {premio=11215, nome_do_item='Pink Hard'},

----------------------------- End ---------------------------------------
}

local Script = {
    stack1 = getItemStackpos(Configs.pos_bancada1,Configs.item1_craft.item1),
    stack2 = getItemStackpos(Configs.pos_bancada2,Configs.item2_craft.item2),
    stack3 = getItemStackpos(Configs.pos_bancada3,Configs.item3_craft.item3),


}

            if Script.stack1 and Script.stack2 and Script.stack3 then
                doCleanTile(Configs.pos_bancada1)
                doCleanTile(Configs.pos_bancada2)
                doCleanTile(Configs.pos_bancada3)
                                addEvent(doCreateItem, 100, Configs.item4_craft.premio, 1, Configs.pos_premio1)
                doPlayerSendTextMessage(cid, 22, "Parabens, Voce Forjou uma"..Configs.item4_craft.nome_do_item.." .")
                doSendMagicEffect(Configs.pos_bancada1, 122)
                doSendMagicEffect(Configs.pos_bancada2, 122)
                doSendMagicEffect(Configs.pos_bancada3, 122)
                return true
            end
        doPlayerSendTextMessage(cid, 28, "Voce nao tem os 3 itens, para Craftar!")

 return true
end

function getItemStackpos(position, id)
    if getTileItemById(position, id).itemid == 0 then 
        return nil 
    end
    for i = 0, 255 do
        local pos = getThingFromPos({x=position.x, y=position.y, z=position.z, stackpos=i})
        if pos.itemid == id then
            return i
        end
    end
end

 

Up

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.

  • Recently Browsing   0 members

    No registered users viewing this page.


  • Similar Content

    • By Tacabala22
      Salve galera, Tudo na paz?
      Utilizo como base do meu servidor o TFS 1.5 Downgrade 8.6 do NEKIRO , baixei esse servidor aqui para remover quests e utilizar no meu.
       
      Copiei os arquivos.
      data\actions\scripts\quests\demon oak
      demonOak.lua
      local config = { demonOakIds = {8288, 8289, 8290, 8291}, sounds = { 'MY ROOTS ARE SHARP AS A SCYTHE! FEEL IT?!?', 'CURSE YOU!', 'RISE, MINIONS, RISE FROM THE DEAD!!!!', 'AHHHH! YOUR BLOOD MAKES ME STRONG!', 'GET THE BONES, HELLHOUND! GET THEM!!', 'GET THERE WHERE I CAN REACH YOU!!!', 'ETERNAL PAIN AWAITS YOU! NICE REWARD, HUH?!?!', 'YOU ARE GOING TO PAY FOR EACH HIT WITH DECADES OF TORTURE!!', 'ARGG! TORTURE IT!! KILL IT SLOWLY MY MINION!!' }, bonebeastChance = 100, bonebeastCount = 10, waves = 15, questArea = { fromPosition = {x = 144, y = 257, z = 7}, toPosition = {x = 163, y = 269, z = 7} }, summonPositions = { {x = 152, y = 260, z = 7}, {x = 149, y = 263, z = 7}, {x = 158, y = 263, z = 7}, {x = 157, y = 259, z = 7}, {x = 158, y = 267, z = 7}, {x = 147, y = 262, z = 7}, {x = 160, y = 261, z = 7}, {x = 155, y = 267, z = 7} }, summons = { [8288] = { [10] = {'Spectre', 'Blightwalker', 'Braindeath', 'Demon', 'Braindeath', 'Demon', 'Braindeath', 'Demon'}, [15] = {'Betrayed Wraith', 'Betrayed Wraith', 'Braindeath', 'Demon'} }, [8289] = { [10] = {'Plaguesmith', 'Plaguesmith', 'Blightwalker', 'Plaguesmith', 'Plaguesmith', 'Dark Torturer', 'Blightwalker', 'Dark Torturer', 'Blightwalker'}, [15] = {'Dark Torturer', 'Blightwalker', 'Braindeath', 'Demon', 'Braindeath', 'Demon'} }, [8290] = { [15] = {'Banshee', 'Plaguesmith', 'Hellhound', 'Plaguesmith', 'Hellhound', 'Plaguesmith', 'Hellhound', 'Grim Reaper', 'Grim Reaper'}, [10] = {'Grim Reaper', 'Braindeath', 'Demon'} }, [8291] = { [8] = {'Plaguesmith', 'Hellhound', 'Hellhound', 'Hellhound', 'Hellhound', 'Hand of Cursed Fate', 'Hand of Cursed Fate'}, [12] = {'Undead Dragon', 'Hand of Cursed Fate', 'Braindeath', 'Demon'} } }, storages = { [8288] = Storage.DemonOak.AxeBlowsBird, [8289] = Storage.DemonOak.AxeBlowsLeft, [8290] = Storage.DemonOak.AxeBlowsRight, [8291] = Storage.DemonOak.AxeBlowsFace } } local function getRandomSummonPosition() return config.summonPositions[math.random(#config.summonPositions)] end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if not isInArray(config.demonOakIds, target.itemid) then return true end local totalProgress = 0 for k,v in pairs(config.storages) do totalProgress = totalProgress + math.max(0, player:getStorageValue(v)) end local spectators, hasMonsters = Game.getSpectators(DEMON_OAK_POSITION, false, false, 9, 9, 6, 6), false for i = 1, #spectators do if spectators[i]:isMonster() then hasMonsters = true break end end local isDefeated = totalProgress == (#config.demonOakIds * (config.waves + 1)) if (config.killAllBeforeCut or isDefeated) and hasMonsters then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need to kill all monsters first.') return true end if isDefeated then player:teleportTo(DEMON_OAK_KICK_POSITION) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Tell Oldrak about your great victory against the demon oak.') player:setStorageValue(Storage.DemonOak.Done, 1) player:setStorageValue(Storage.DemonOak.Progress, 3) return true end local cStorage = config.storages[target.itemid] local progress = math.max(player:getStorageValue(cStorage), 1) if progress >= config.waves + 1 then toPosition:sendMagicEffect(CONST_ME_POFF) return true end local isLastCut = totalProgress == (#config.demonOakIds * (config.waves + 1) - 1) local summons = config.summons[target.itemid] if summons and summons[progress] then -- Summon a single demon on the last hit if isLastCut then Game.createMonster('Demon', getRandomSummonPosition(), false, true) -- Summon normal monsters otherwise else for i = 1, #summons[progress] do Game.createMonster(summons[progress][i], getRandomSummonPosition(), false, true) end end -- if it is not the 5th or 10th there is only a chance to summon bonebeasts elseif math.random(100) >= config.bonebeastChance then for i = 1, config.bonebeastCount do Game.createMonster('Bonebeast', getRandomSummonPosition(), false, true) end end player:say(isLastCut and 'HOW IS THAT POSSIBLE?!? MY MASTER WILL CRUSH YOU!! AHRRGGG!' or config.sounds[math.random(#config.sounds)], TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION) toPosition:sendMagicEffect(CONST_ME_DRAWBLOOD) player:setStorageValue(cStorage, progress + 1) player:say('-krrrrak-', TALKTYPE_MONSTER_YELL, false, player, toPosition) doTargetCombatHealth(0, player, COMBAT_EARTHDAMAGE, -170, -210, CONST_ME_BIGPLANTS) return true end  
      demonOakChest.lua
      local chests = { [9008] = {itemid = 2495, count = 1}, [9009] = {itemid = 8905, count = 1}, [9010] = {itemid = 16111, count = 1}, [9011] = {itemid = 16112, count = 1} } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if chests[item.uid] then if player:getStorageValue(Storage.DemonOak.Done) ~= 2 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It\'s empty.') return true end local chest = chests[item.uid] local itemType = ItemType(chest.itemid) if itemType then local article = itemType:getArticle() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found ' .. (#article > 0 and article .. ' ' or '') .. itemType:getName() .. '.') end player:addItem(chest.itemid, chest.count) player:setStorageValue(Storage.DemonOak.Done, 3) end return true end  
      demonOakGravestone.lua
      function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(Storage.DemonOak.Done) == 2 then player:teleportTo(DEMON_OAK_REWARDROOM_POSITION) DEMON_OAK_REWARDROOM_POSITION:sendMagicEffect(CONST_ME_TELEPORT) return true end end  
      Actions.xml
      <!-- Demon Oak --> <action itemid="8293" script="quests/demon oak/demonOak.lua" /> <action fromuid="9008" touid="9011" script="quests/demon oak/demonOakChest.lua" /> <action uniqueid="9007" script="quests/demon oak/demonOakGravestone.lua" />  
      data\movements\scripts\quests\demon oak
       
      areaDamage.lua
      function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then return true end if math.random(24) == 1 then doTargetCombatHealth(0, player, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS) end return true end  
      entrance.lua
      function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then return true end -- CHECAR SE JÁ TIVER FEITO if player:getStorageValue(Storage.DemonOak.Done) >= 2 then player:teleportTo(DEMON_OAK_KICK_POSITION) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return true end -- CHECAR LEVEL MÍNIMO if player:getLevel() < 120 then player:say("LEAVE LITTLE FISH, YOU ARE NOT WORTH IT!", TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION) player:teleportTo(DEMON_OAK_KICK_POSITION) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return true end -- CHECAR SE TA TUDO CERTO Vou usar mensagens pra descobrir qual é o conflito if (#Game.getSpectators(DEMON_OAK_POSITION, false, true, 9, 9, 6, 6) == 0) then if (player:getItemCount(10305) == 0) then if player:getStorageValue(Storage.DemonOak.Progress) < 1 then player:say("You need finish the demons task!", TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_KICK_POSITION) player:teleportTo(DEMON_OAK_KICK_POSITION) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return true end end if (player:getItemCount(8293) == 0) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Go talk with Odralk and get the Hallowed Axe to kill The Demon Oak.') end player:removeItem(10305, 1) player:teleportTo(DEMON_OAK_ENTER_POSITION) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:setStorageValue(Storage.DemonOak.Progress, 1) player:say("I AWAITED YOU! COME HERE AND GET YOUR REWARD!", TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION) else player:teleportTo(DEMON_OAK_KICK_POSITION) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end return true end  
      squares.lua
      local voices = { 'Release me and you will be rewarded greatefully!', 'What is this? Demon Legs lying here? Someone might have lost them!', 'I\'m trapped, come here and free me fast!!', 'I can bring your beloved back from the dead, just release me!', 'What a nice shiny golden armor. Come to me and you can have it!', 'Find a way in here and release me! Pleeeease hurry!', 'You can have my demon set, if you help me get out of here!' } local startUid = 9000 function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then return true end local status = math.max(player:getStorageValue(Storage.DemonOak.Squares), 0) if item.uid - startUid == status + 1 then player:setStorageValue(Storage.DemonOak.Squares, status + 1) player:say(voices[math.random(#voices)], TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION) end return true end  
      movements.xml
      <!-- Demon Oak Quest --> <movevent event="StepIn" uniqueid="9000" script="quests/demon oak/entrance.lua" /> <movevent event="StepIn" itemid="8292" script="quests/demon oak/areaDamage.lua" /> <movevent event="StepIn" fromuid="9001" touid="9005" script="quests/demon oak/squares.lua" />  
      data\globalevents\scripts\quests\demon oak
       
      voices.lua
      local questArea = { Position(144, 257, 7), Position(163, 269, 7) } local sounds = { 'Release me and you will be rewarded greatefully!', 'What is this? Demon Legs lying here? Someone might have lost them!', 'I\'m trapped, come here and free me fast!!', 'I can bring your beloved back from the dead, just release me!', 'What a nice shiny golden armor. Come to me and you can have it!', 'Find a way in here and release me! Pleeeease hurry!', 'You can have my demon set, if you help me get out of here!' } function onThink(interval, lastExecution) local spectators, spectator = Game.getSpectators(DEMON_OAK_POSITION, false, true, 0, 15, 0, 15) local sound = sounds[math.random(#sounds)] for i = 1, #spectators do spectator = spectators[i] if isInRange(spectator:getPosition(), questArea[1], questArea[2]) then return true end spectator:say(sound, TALKTYPE_MONSTER_YELL, false, 0, DEMON_OAK_POSITION) end return true end  
      globalevents.xml
      <!-- Demon Oak --> <globalevent name="DemonOakVoices" interval="15000" script="quests/demon oak/voices.lua" />  
      data\lib\quests\demonoak
       
      demon_oak.lua
      DEMON_OAK_POSITION = Position(32716, 32351, 7) DEMON_OAK_KICK_POSITION = Position(32716, 32340, 7) DEMON_OAK_ENTER_POSITION = Position(32716, 32347, 7) DEMON_OAK_REWARDROOM_POSITION = Position(32714, 32398, 8)  
      data\lib\lib.lua
      dofile('data/lib/quests/demonoak/demon_oak.lua')  
      E no final está me dando esse erro aqui.
      Lua Script Error: [Test Interface] data/actions/scripts/otbaiak/demonoak.lua data/actions/scripts/otbaiak/demonoak.lua:50: attempt to index field 'DemonOak' (a nil value) stack traceback: [C]: in function '__index' data/actions/scripts/otbaiak/demonoak.lua:50: in main chunk [Warning - Event::checkScript] Can not load script: scripts/otbaiak/demonoak.lua  
      @Atualização.
      Resolvi o problema, script atualizada. Quem quiser utilizar a script fique a vontade. Não sei quem é o autor.
    • By RatPoke150
      .Qual servidor ou website você utiliza como base? pokemon history
       
      Qual o motivo deste tópico? Quero adicionar level system de pokemon
       
       
    • By Alumoz
      .Qual servidor ou website você utiliza como base? 
      Znote
      Qual o motivo deste tópico? 
      Script
       
       
       
      Ola pessoal,
      estou procurando um script tfs 1.3,

      um baú tem 10% de chance de saquear um item (como 10 itens no total, aleatório com chance)
      Se eu obtiver, por exemplo, um item, aumentarei 5% essa chance para 10 + 5 % para obter um item, se eu usar 10 items aumentarei para 10+50%,

      Chance de cada item diferente, como 60% 10 crystal coins, 20% uma bp, 5% uma runa, etc.  removendo o item enquanto estiver usando o baú.


      Não tenho certeza se é possível fazer esse tipo de script
      Eu sei que poderiamos usar atributos como:
      mas nao sei como criar esse tipo de script,
       
      cooldown_storage = 44444 cooldown = 60 * 60 * 2 player:setStorageValue(config.cooldown_storage, os.time() + config.cooldown) _____________________________________________________________________________ local box = Action() local JEWEL = {2152, 2148} local REWARD = {2160} function box.onUse(cid, item, fromPosition, itemEx, toPosition) local randomChance = math.random(1, #REWARD) doPlayerAddItem(cid, REWARD[randomChance], 1) local randomLoot = math.random(1,20) if randomLoot == 1 then doPlayerSendTextMessage(cid, 22, "You found an extra item!") local randomChance = math.random(1, #REWARD) doPlayerAddItem(cid, REWARD[randomChance], 1) end local randomJewel = math.random(1,10) if randomJewel == 1 then doPlayerSendTextMessage(cid, 22, "You found an extra item!") local randomChance = math.random(1, #JEWEL) doPlayerAddItem(cid, JEWEL[randomChance], 1) end doSendMagicEffect(getPlayerPosition(cid), 172) doRemoveItem(item.uid, 1) return true end box:id(18100) box:register()  
       


      Obrigado
       
       
    • By Faelzdanil
      Eu uso o TFS 1.3 do Nekiro pra versão 8.6 e instalei o script de Exercise Weapon, segue a baixo o sistema. Mas estou com alguns problemas:
      1 - Não consigo colocar NPC pra vender os itens 
      2 - Os itens de mago não está dando magic level
      3 - E queria que quando tirasse da mochila, move-se o item parasse também.
       
       
    • By Pacera
      .Qual servidor ou website você utiliza como base? 
      Opentibiabr REVSCRIPT
      Qual o motivo deste tópico? 
      Estou tentando criar as potions do tibia drome que dão x atributos por x tempo, porem nao sei as funções de atributos e função de tempo para atributos. Alguem poderia me ajudar por favor? Obrigado
      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. 

×
×
  • Create New...

Important Information

Confirmação de Termo