Postado Julho 22, 2018 6 anos Este é um post popular. Opa boa noite rapaziada, tudo bom? Eu estou treinando um pouco scripts e acabei que tendo a ideia de fazer algo relacionado com as Guilds. Então resolvi trazer 1 sistema de Guild Dungeon Lever para mim treinar Estou em fase de treinamento, então por favor, deem dicas e criticas ao sistema ! Obrigado ... Como o sistema funciona? Terá uma alavanca com local para os jogadores de sua Guild ficarem... O jogador que estiver na posição principal e próxima a alavanca irá clicar na alavanca que fará com que todos entrem na Dungeon. Os jogadores terão um tempo "x" para terminar, porém se o tempo acabar, o jogador será teleportado de volta para a posição principal da alavanca (Aonde o jogador clicou). Como configurar o script? local config = { time = 10, -- 1 Second. (1*60 To Minutes) level = 100, -- Level Necessary. dungeonPos = Position(1454, 909, 7), -- Dungeon Pos. needPos = { [1] = Position(1447, 915, 7), -- Position (where the player will click on the lever) and back position. [2] = Position(1449, 914, 7) }, fromPos = {x = 1449, y = 904, z = 7}, -- Position /\ < from the dungeon toPos = {x = 1456, y = 911, z = 7}, -- Position \/ > from the dungeon Storagetime = 39320, -- Storage Time. StorageDay = 39321, -- Storage Day. Timer = 24*60*60 -- To re-enter in the dungeon. (24hours) } time ------------------ Tempo que os jogadores ficarão dentro da Dungeon. level ----------------- Nível que todos precisam ser para entrar. dungeonPos ------ Posição que todos os jogadores serão teleportados. needPos ------------ Posição que os jogadores devem estar para serem teleportados. fromPos ------------- Posição SUPERIOR ESQUERDO da sala. toPos ----------------- Posição INFERIOR DIREITO da sala. Storagetime -------- Não mexer se não souber. StorageDay ----------- Não mexer se não souber. Timer ------------------ Tempo que o jogador terá que esperar para entrar novamente na Dungeon. Sem mais delongas, vamos ao script: Adicione a linha em: (data/actions/actions.xml) <!-- Script GUILD --> <action actionid="29305" script="Dungeon_Guild.lua" /> Adicione a linha em: (data/actions/scripts/Dungeon_Guild.lua) local config = { time = 5, -- 1 Second. (1*60 To Minutes) inside the dungeon. level = 100, -- Level Necessary. dungeonPos = Position(1454, 909, 7), -- Dungeon Pos. needPos = { [1] = Position(1447, 915, 7), -- Position (where the player will click on the lever) and back position. [2] = Position(1449, 914, 7) }, fromPos = {x = 1449, y = 904, z = 7}, -- Position /\ < from the dungeon toPos = {x = 1456, y = 911, z = 7}, -- Position \/ > from the dungeon Storagetime = 39320, -- Storage Time. StorageDay = 39321, -- Storage Day. Timer = 24*60*60 -- To re-enter in the dungeon. (24hrs) } function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey) local guild = player:getGuild() for i = 1, #config.needPos do local playerTile = Tile(config.needPos[i]):getTopCreature() if not playerTile or not playerTile:isPlayer() then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "You need 2 players and stay on the orange floor.") return true end if not playerTile:getGuild() and not player:getGuild() then player:getPosition():sendMagicEffect(CONST_ME_POFF) return player:sendTextMessage(MESSAGE_STATUS_SMALL, "One of the members does not have guild.") end if playerTile:getLevel() < config.level then player:getPosition():sendMagicEffect(CONST_ME_POFF) return player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level "..config.level.." or higher.") end if player:getGuild():getId() ~= playerTile:getGuild():getId() then player:getPosition():sendMagicEffect(CONST_ME_POFF) return player:sendTextMessage(MESSAGE_STATUS_SMALL, "Only players in your guild can join you.") end if player:getStorageValue(config.Storagetime) - os.time() > 0 and playerTile:getStorageValue(config.Storagetime) - os.time() > 0 then player:getPosition():sendMagicEffect(CONST_ME_POFF) return false end if player:getStorageValue(config.StorageDay) - os.time() > 0 and playerTile:getStorageValue(config.StorageDay) - os.time() > 0 then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You're in cooldown to enter in a dungeon again. Cooldown: %s.", string.diff(player:getStorageValue(config.StorageDay)-os.time()))) return false end local players = {} for x = config.fromPos.x, config.toPos.x do for y = config.fromPos.y, config.toPos.y do for z = config.fromPos.z, config.toPos.z do local tile = Tile(x, y, z) local creature = tile:getTopCreature() if creature and creature:isPlayer() then players[#players+1] = creature end end end end if #players > 0 then player:getPosition():sendMagicEffect(CONST_ME_POFF) return player:sendTextMessage(MESSAGE_STATUS_SMALL, "Already has a guild inside.") end player:teleportTo(config.dungeonPos) playerTile:teleportTo(config.dungeonPos) playerTile:getPosition():sendMagicEffect(50) addEvent(function() player:teleportTo(config.needPos[i]) playerTile:teleportTo(config.needPos[i]) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) playerTile:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:setStorageValue(config.StorageDay, os.time() + config.Timer) playerTile:setStorageValue(config.StorageDay, os.time() + config.Timer) end, config.time*1000) return false end return true end Créditos: @KotZletY E eu Espero que gostem ? ... Edit* Adicionado Tempo para que você possa entrar novamente na Dungeon: Rep+ Editado Maio 10, 2021 4 anos por tataboy67 (veja o histórico de edições) Meus trabalhos: [Movements] TFS 1.1+ Area Hardcore [Movements] TFS 1.1+ Tile Party [Action] TFS 1.1+ Bau diário [Action] TFS 1.1+ Guild Dungeon Lever [Talkactions] TFS 0.3.6 / 0.4 Quest Hunt por Tempo Contato: Discord: Tataboy67#4934
Postado Julho 22, 2018 6 anos Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP. Spoiler Congratulations, your content has been approved! Thank you for your contribution, we of Tibia King we are grateful. Your content will help many other users, you received +1 REP. [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Julho 22, 2018 6 anos Script Top voce podia por uma storage para usarem a alavanca uma vez por dia assim podia fazer uma Daily Guild dugeon
Postado Julho 22, 2018 6 anos Autor 29 minutos atrás, DevMorgan disse: Script Top voce podia por uma storage para usarem a alavanca uma vez por dia assim podia fazer uma Daily Guild dugeon Opa boa ideia ! Vou colocar aqui quando eu estiver com um tempinho ^^ . @DevMorgan @VodkartScript Atualizado ! Meus trabalhos: [Movements] TFS 1.1+ Area Hardcore [Movements] TFS 1.1+ Tile Party [Action] TFS 1.1+ Bau diário [Action] TFS 1.1+ Guild Dungeon Lever [Talkactions] TFS 0.3.6 / 0.4 Quest Hunt por Tempo Contato: Discord: Tataboy67#4934
Postado Agosto 4, 2018 6 anos mt boa ideia daria pra fazer ao inves de guild os players precisam estar de Party ? seria tbm mt complicado passar pra rodar em 0.3.6 ?gostei mt e queria usar em meu servidor '-' claro que com os seus creditos s2'
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.