Ir para conteúdo

Movie

Membro
  • Registro em

  • Última visita

Tudo que Movie postou

  1. Nem li o código do amigo acima, apenas adicionei para poder logar. -- Configurações local bonusStorage = 1000 -- Valor do storage para ativar o bônus local bonusHP = 500 -- Quantidade de HP do bônus function onLogin(cid) print("Player Login: " .. getPlayerName(cid)) if getPlayerStorageValue(cid, bonusStorage) == 1 then doCreatureAddHealth(cid, bonusHP) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ganhou um bônus de " .. bonusHP .. " HP!") print("Bônus de HP aplicado para " .. getPlayerName(cid)) end return true end
  2. Tente assim local storages = {13002} local message = [[ ( Guia Nto Hard ) Des�a no subsolo de Konoha e procure por criaturas para batalhar ! 1� Utilize Jutsus para Curar ( Regeneration ) e Atacar ( Throw Kunai ). 2� Utilize a palavra ( skip ) para subir e sair do calabou�o ! ]] function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return end for _, v in ipairs(storages) do if getPlayerStorageValue(cid, v) <= 0 then doPlayerPopupFYI(cid, message) setPlayerStorageValue(cid, 13002, 1) doTeleportThing(cid, fromPosition) return true end end return true end
  3. O Critical funciona através do callback do onHealthChange. O cálculo é feito através dessa seguinte linha: primaryDamage = primaryDamage + math.ceil(primaryDamage * CRITICAL.PERCENT) Caso queira alterar a fórmula, é aí.
  4. É bem simples esse script que você necessita. Apenas a função Game.getSpectators e um if. Não consigo fazer agora para você, mas vai seguindo a lógica que te passei ai.
  5. local templeCicleEff = { eff = 4, delay = 100, [1] = {x = 487, y = 493, z = 7,}, [2] = {x = 493, y = 493, z = 7,}, [3] = {x = 495, y = 493, z = 7,}, [4] = {x = 499, y = 495, z = 7,}, [5] = {x = 501, y = 495, z = 7,}, [6] = {x = 505, y = 495, z = 7,}, } function onThink(cid, interval, lastExecution) for i = 1, 6 do local initialPos = templeCicleEff[i] local finalPos = templeCicleEff[i+1] if i == 6 then finalPos = templeCicleEff[1] end doSendDistanceShoot(initialPos, finalPos, templeCicleEff.eff) end return true end
  6. Novo event adicionado: onChangeZone Link para o commit: https://github.com/moviebr/TFS-1.5-Downgrades/commit/a07dd9d61a53dc32ae9a6f38e062cc22b69806fe
  7. Vai nos arquivos da sua source, procura pro luascript.cpp e veja se o doPlayerSendExtendedOpcode está lá
  8. A função doPlayerSendExtendedOpcode não existe no seu datapack. Tem que adicionar ela ou via source ou via lua.
  9. https://github.com/moviebr/baiakthunder/blob/master/data/scripts/actions/mining.lua https://github.com/moviebr/baiakthunder/blob/master/data/lib/custom/mining.lua
  10. Depois de um bom tempo, resolvi postar novamente aqui. Hoje vou disponibilizar uma datapack com TFS 1.5 para 8.60. Ela está sendo atualizada semanalmente no Github do projeto. Para acompanhar e utilizar clique aqui. Para relatar erros ou sugestões, utilize o GitHub.
  11. Você pode fazer com que ao puxar a alavanca, todos os players envolvidos nisso ganhem uma storage comparado ao tempo. Depois verifique se o tempo passou, daí ele poderá executar o script novamente. Procure por os.time()
  12. Como está o seu changegold.lua?
  13. Se não me engano, essas tabelas são adicionadas na primeira vez que é executada o servidor. Vou conferir, se não estiver coloco em breve. Tudo ainda está em desenvolvimento a pequenos passos, já que só eu estou desenvolvendo, você pode contribuir fazendo um PR
  14. Não entendi... poderia explicar melhor?
  15. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Qual seu TFS?
  16. Movie postou uma resposta no tópico em Suporte Tibia OTServer
    Sim, é possivel!
  17. Manda o script do rank ai
  18. Tenta fazer assim if ((regenerationActivated) && (timeInPz >= timeNow)) {
  19. Só ler as configurações amigo... punishment = { try = { max = 3, reason = "Quantidade excessiva de tentativas.", timePunishment = 1, -- In days players = {}, }, time = { maxTime = 180, -- In seconds reason = "Não respondeu a pergunta dentro do tempo estipulado.", timePunishment = 2, -- In days players = {}, }, }, Fiz um pequeno update no código para: ignorar players que estejam nos Trainers; ignorar players que estejam em protection zone. (Links acima) Não faço esse update nesse tópico pois o sistema de ignorar players nos trainers está linkado com um outro sistema independente presente no Thunder. @Vodkart seria isso que você tinha dito para implementar?
  20. No próprio repositório tem um arquivo sql. Tente com ele
  21. Obrigado pelo comentário! Posso fazer um update no código em breve para adicionar isso... Cenas para os próximos capítulos.
  22. [Anti-Bot] Fiz esse sistema para o Thunder porém vou deixá-lo a parte nesse tópico aqui para quem quiser implementar em seu otserv. Lembrando que esse sistema é para TFS 1.X e qualquer sugestão/problema nesse sistema, deve ser reportado no GitHub. Crie um arquivo na pasta lib com o nome antibot.lua ANTIBOT = { prefix = "[AntiBot] ", questions = { {question = "Qual o ano que começou o COVID-19?", staticAnswer = true, answer = "2019"}, {question = "Qual seu skill atual de Sword?", skill = true, answer = SKILL_SWORD}, {question = "Qual seu skill atual de Club?", skill = true, answer = SKILL_CLUB}, {question = "Qual seu skill atual de Distance?", skill = true, answer = SKILL_DISTANCE}, {question = "Qual seu level atual?", answer = "level"}, {question = "Qual o dia de hoje?", answer = "day"}, }, playerQuestion = {}, messages = { time = "Você possui %s para responder a pergunta.", chat = "Esse chat só pode ser usado durante a verificação.", howAnswer = "Você deve responder somente a resposta, por exemplo: Qual o dia de hoje? Resposta: %d", correctAnswer = "Você acertou a pergunta. Obrigado.", incorrectAnswer = "Você errou a resposta, você ainda possui %d tentativas.", logout = "Você não pode deslogar enquanto hover uma verificação ativa.", }, punishment = { try = { max = 3, reason = "Quantidade excessiva de tentativas.", timePunishment = 1, -- In days players = {}, }, time = { maxTime = 180, -- In seconds reason = "Não respondeu a pergunta dentro do tempo estipulado.", timePunishment = 2, -- In days players = {}, }, }, verification = {40, 60}, -- in minutes } function ANTIBOT:addTry(playerId) local player = Player(playerId) if not player then return false end playerId = player:getId() if not ANTIBOT.punishment.try.players[playerId] then ANTIBOT.punishment.try.players[playerId] = 0 end ANTIBOT.punishment.try.players[playerId] = ANTIBOT.punishment.try.players[playerId] + 1 if ANTIBOT.punishment.try.players[playerId] and ANTIBOT.punishment.try.players[playerId] >= ANTIBOT.punishment.try.max then sendChannelMessage(13, TALKTYPE_CHANNEL_O, ANTIBOT.prefix .. ANTIBOT.punishment.try.reason) ANTIBOT:addPunishment(playerId) end end function ANTIBOT:time(playerId) local player = Player(playerId) if not player then ANTIBOT:reset(playerId) return false end playerId = player:getId() if not ANTIBOT.punishment.time.players[playerId] then ANTIBOT.punishment.time.players[playerId] = 0 ANTIBOT:sendQuestions(playerId) end addEvent(function() if ANTIBOT.punishment.time.players[playerId] and ANTIBOT.punishment.time.players[playerId] >= 0 and ANTIBOT.punishment.time.players[playerId] < ANTIBOT.punishment.time.maxTime then ANTIBOT.punishment.time.players[playerId] = ANTIBOT.punishment.time.players[playerId] + 1 player:sendCancelMessage(ANTIBOT.prefix .. ANTIBOT.messages.time:format(string.diff(ANTIBOT.punishment.time.maxTime - ANTIBOT.punishment.time.players[playerId], true))) ANTIBOT:time(playerId) end end, 1000) if ANTIBOT.punishment.time.players[playerId] and ANTIBOT.punishment.time.players[playerId] >= ANTIBOT.punishment.time.maxTime then ANTIBOT:addPunishment(playerId) end end function ANTIBOT:sendQuestions(playerId) local player = Player(playerId) if not player then return false end playerId = player:getId() random = math.random(#ANTIBOT.questions) ANTIBOT.playerQuestion[playerId] = random player:say("ANTIBOT", TALKTYPE_MONSTER_SAY) player:openChannel(13) addEvent(sendChannelMessage, 500, 13, TALKTYPE_CHANNEL_O, ANTIBOT.prefix .. ANTIBOT.messages.howAnswer:format(os.date("%d"))) addEvent(sendChannelMessage, 800, 13, TALKTYPE_CHANNEL_O, ANTIBOT.prefix .. ANTIBOT.questions[random].question) end function ANTIBOT:reset(playerId) ANTIBOT.punishment.try.players[playerId] = nil ANTIBOT.punishment.time.players[playerId] = nil ANTIBOT.playerQuestion[playerId] = nil end function ANTIBOT:addPunishment(playerId) local player = Player(playerId) if not player then return false end playerId = player:getId() local accountId = getAccountNumberByPlayerName(player:getName()) if accountId == 0 then return false end local resultId = db.storeQuery("SELECT 1 FROM `account_bans` WHERE `account_id` = " .. accountId) if resultId ~= false then result.free(resultId) return false end local timeNow = os.time() if ANTIBOT.punishment.try.players[playerId] and ANTIBOT.punishment.try.players[playerId] >= ANTIBOT.punishment.try.max then db.query("INSERT INTO `account_bans` (`account_id`, `reason`, `banned_at`, `expires_at`, `banned_by`) VALUES (" .. accountId .. ", " .. db.escapeString(ANTIBOT.prefix .. ANTIBOT.punishment.try.reason) .. ", " .. timeNow .. ", " .. timeNow + (ANTIBOT.punishment.try.timePunishment * 86400) .. ", " .. player:getGuid() .. ")") elseif ANTIBOT.punishment.time.players[playerId] and ANTIBOT.punishment.time.players[playerId] >= ANTIBOT.punishment.time.maxTime then db.query("INSERT INTO `account_bans` (`account_id`, `reason`, `banned_at`, `expires_at`, `banned_by`) VALUES (" .. accountId .. ", " .. db.escapeString(ANTIBOT.prefix .. ANTIBOT.punishment.time.reason) .. ", " .. timeNow .. ", " .. timeNow + (ANTIBOT.punishment.time.timePunishment * 86400) .. ", " .. player:getGuid() .. ")") end ANTIBOT:reset(playerId) player:save() player:getPosition():sendMagicEffect(CONST_ME_POFF) player:remove() end Não esqueça de registrar essa lib no arquivo lib.lua Na pasta chachannels/scripts crie um arquivo chamado antibot.lua function onJoin(player) if not ANTIBOT.playerQuestion[player:getId()] then player:sendTextMessage(5, ANTIBOT.prefix .. ANTIBOT.messages.chat) player:getPosition():sendMagicEffect(CONST_ME_POFF) return false end return true end function onLeave(player) if ANTIBOT.playerQuestion[player:getId()] then return false end return true end function onSpeak(player, type, message) if not ANTIBOT.playerQuestion[player:getId()] then sendChannelMessage(13, TALKTYPE_CHANNEL_O, ANTIBOT.prefix .. ANTIBOT.messages.chat) player:getPosition():sendMagicEffect(CONST_ME_POFF) return false end local question = ANTIBOT.questions[ANTIBOT.playerQuestion[player:getId()]] if question.skill then correctAnswer = tonumber(player:getSkillLevel(question.answer)) message = tonumber(message) elseif question.answer == "level" then correctAnswer = tonumber(player:getLevel()) message = tonumber(message) elseif question.answer == "day" then correctAnswer = tonumber(os.date("%d")) message = tonumber(message) elseif question.staticAnswer then message = message:lower() correctAnswer = question.answer:lower() end verification = false if message == correctAnswer then verification = true end if verification then addEvent(sendChannelMessage, 200, 13, TALKTYPE_CHANNEL_O, ANTIBOT.prefix .. ANTIBOT.messages.correctAnswer) ANTIBOT:reset(player:getId()) else ANTIBOT:addTry(player:getId()) addEvent(function() if ANTIBOT.punishment.try.players[player:getId()] and ANTIBOT.punishment.try.players[player:getId()] < ANTIBOT.punishment.try.max and player then sendChannelMessage(13, TALKTYPE_CHANNEL_O, ANTIBOT.prefix .. ANTIBOT.messages.incorrectAnswer:format(ANTIBOT.punishment.try.max - ANTIBOT.punishment.try.players[player:getId()])) end end, 100) end return true end <channel id="13" name="AntiBot" script="antibot.lua" /> Agora na pasta creaturescripts/scripts crie um arquivo chamado antibot.lua function onLogin(player) if player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then return true end player:registerEvent("AntiBot") checkAnti(player:getId()) return true end function checkAnti(playerId) local player = Player(playerId) if not player then return false end min, max = ANTIBOT.verification[1], ANTIBOT.verification[2] random = math.random(min, max) addEvent(function() ANTIBOT:time(player:getId()) checkAnti(player:getId()) end, random * 60 * 1000) end <event type="login" name="AntiBot" script="antibot.lua" /> Agora no arquivo logout.lua na pasta creaturescripts/scripts antes do return true adicione isso if ANTIBOT.punishment.try.players[player:getId()] or ANTIBOT.punishment.time.players[player:getId()] then player:sendTextMessage(MESSAGE_INFO_DESCR, ANTIBOT.prefix .. ANTIBOT.messages.logout) player:getPosition():sendMagicEffect(CONST_ME_POFF) return false end ANTIBOT:reset(player:getId()) Sistema 100% feito por mim. Créditos adicionais ao @Endless e ao @Tottin por testarem
  23. Na ultima atualização houve a adição de um sistema de AntiBot. Para utilizar, baixem a versão atual do repositório. https://github.com/moviebr/baiakthunder/commit/ef766c97ec455f2ac1c03d1a53985e7a3eaa5129
  24. Tenta assim local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureSay(cid,type,msg) npcHandler:onCreatureSay(cid, type, msg) if isInArray({"poem", "ps"}, msg) then npcHandler:say("Do you want to exchange this Poem for a {beach backpack}?", cid) talkState = 1 elseif msgcontains(msg, 'yes') and talkState == 1 then item = getPlayerItemCount(cid,6119) >= 1 if item then if getItemAttribute(item.uid, "description") == "teste" then doPlayerRemoveItem(cid,6119,1) doPlayerAddItem(cid,5949,1) npcHandler:say("here's your item", cid) end else npcHandler:say("You don't have the item", cid) end end end npcHandler:addModule(FocusModule:new())

Informação Importante

Confirmação de Termo