Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 03/19/21 em todas áreas

  1. [TFS 1.X] AntiBot

    Igorzerah reagiu a Movie por uma resposta no tópico

    1 ponto
    [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
  2. [Action] Script Quest

    Espedito reagiu a MySticaL por uma resposta no tópico

    1 ponto
    Script Quest: --[[ Script: Exemplo de Quest Autor: MySticaL Email: matadormatou275@gmail.com ]] function onUse(cid, item, frompos, item2, topos) -- Não mecha. storage = 938312 -- Storage a cada quest que for criada aumente um numero da storage pra qnd vc pegar o baú de outra quest ñ aparecer que vc já fez. item = 2160 -- Id do item ira ganhar. quantidade = 1 -- Quantidade ira ganhar. level = 5 -- Level que precisa pra fazer. if getPlayerLevel(cid) >= level and getPlayerStorageValue(cid,storage) == -1 then -- Não mecha. doPlayerSendTextMessage(cid,25,"Você ganhou um pouco de dinheiro") -- Mensagem que aparecera quando ganhar o item. doPlayerAddItem(cid, item, quantidade) -- Não mecha. setPlayerStorageValue(cid,storage,1) -- Não mecha. elseif getPlayerLevel(cid) <= level then -- Não mecha doPlayerSendTextMessage(cid,25,"Você precisa ser level 5 ou mais.") -- Mensagem que ira aparecer se o player tiver menos level que o necessario. elseif getPlayerStorageValue(cid,storage) >= 1 then -- Não mecha. doPlayerSendTextMessage(cid,25,"Você já fez está quest") -- Quando tentar pegar mais de uma vez o baú. end return true end Actions.xml <action actionid="3123" event="script" value="script.lua"/> Obs: O actionid="3123" é o que você deve botar no item no Remeres Map Editor Caso você queria criar outra quest aumente a storage no script e o id no actions.xml ! Como configurar ? R- \/ ================================================================================================================================ storage = 938312 -- Storage a cada quest que for criada aumente um numero da storage pra quando você for pegar o baú de outra quest não aparecer que você já fez. ================================================================================================================================ item = 2160 -- Id do item ira ganhar. ====================================================== quantidade = 1 -- Quantidade ira ganhar. ====================================================== level = 5 -- Level que precisa pra fazer. ====================================================== Script bem simples mais irá ajudar alguns membros. Rep não cai o dedo Não sei muito sobre script. 100% Créditos meu caso for postar em outro lugar deixe os créditos para min ! Desculpem o tópico mal arrumado
  3. 1 ponto
    Naruto Rox 2 update Todos os Items a seguir foram Adicionados e Refeitos. ( Desde dos Dropaveis / Raros / Quest ) Processo Que foi Refeito os Items. Castle + Hunt Hunt Castle Novos Talkactions Distro Suja? Aqui não REP+ INGAME OBSERVAÇÕES: Baixar
  4. Player Pisa em X Tile e Morre.

    Espedito reagiu a Cain Jorge por uma resposta no tópico

    1 ponto
    data/movements/Script Crie um Arquivo Chamado tilekill.lua Cola isto Dentro: function onStepIn(cid, item, position, fromPosition) if(not(isPlayer(cid)) and (not(isSummon(cid))) and (not(isNPC(cid)))) or (isMonster(cid) and isSummon(cid) and (not(isPlayer(getCreatureMaster(cid))))) then return false end doCreatureAddHealth(cid, -getCreatureHealth(cid)) doSendMagicEffect(position, CONST_ME_DRAWBLOOD) return true end Em data/movements.xml Adicione isto <movevent type="StepIn" actionid="XXXX,(ID que vai por no Piso)" event="script" value="tilekill.lua"/>
  5. Teleport Scroll System

    Espedito reagiu a ViitinG por uma resposta no tópico

    1 ponto
    Para quem não sabe como funciona o script : Ao dar use em um item writable no caso 1949(configurável),você pode escrever o local que deseja ser teleportado e clicar em OK para ser teleportado para o local,ao ser teleportado o player deve esperar 30 segundos(configurável) para usar novamente o Teleport Scroll. (Testado em 0.3.6 [8.54] e ultima REV da TFS [9.1]) Exemplo : Para você ser teleportado para o trainers,basta escrever Trainers e clicar em OK. Clicando em OK você será teleportado para os trainers e terá que esperar 30 segundos para usar o Teleport Scroll novamente. • Adicionando o script • "data/creaturescripts/scripts/tsviiting.lua" : local t = { ["Temple"] = {pos = {x = 1000, y = 1000, z = 7}, storage = 79402, time = 30}, ["Teleports"] = {pos = {x = 2000, y = 2000, z = 7}, storage = 79402, time = 30}, ["Trainers"] = {pos = {x = 3000, y = 3000, z = 7}, storage = 79403, time = 30} } function onTextEdit(cid, item, newText) if item.itemid == 1949 then if isPlayerPzLocked(cid) then doCreatureSay(cid, "Voce esta com battle!", TALKTYPE_MONSTER) return false end if isInArray({'locations', 'places', 'place'}, newText) then local i = '' for text, x in pairs(t) do i = i .. "\n[" .. text .. "]" end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Locais de teleportes: " .. i) else local p = t[newText] if not p then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Local invalido") return false end local st = p.storage if getCreatureStorage(cid, st) > os.time() then doCreatureSay(cid, "Voce precisa esperar " .. getCreatureStorage(cid, st) - os.time() .. ' segundo(s)' .. (getCreatureStorage(cid, st) - os.time() == 1 and "" or "s") .. " para teleportar novamente.", TALKTYPE_MONSTER) return true end local ti = p.time local pos = p.pos doTeleportThing(cid, pos, true) doSendMagicEffect(pos, CONST_ME_TELEPORT) doCreatureSetStorage(cid, st, os.time() + ti) doCreatureSay(cid, "Voce foi teleportado!", TALKTYPE_MONSTER) end end return true end "data/creaturescripts/creaturescripts.xml" : <event type="textedit" name="TSViitinG" event="script" value="tsviiting.lua"/> "data/creaturescripts/scripts/login.lua" : registerCreatureEvent(cid, "TSViitinG") Creditos : J.Dre / Sonik / Fallen / Shinmaru / ViitinG • Configurando •
  6. 1 ponto
    Olla Galerinha Estou Lhes Trazendo Meu Systema De Pk Em Monstro ! Quem Quiser Aprender Segue Esse Post De Baixo ! Vá Em Data/Monster/ é Procure O Monstro que Vc Quer Deixar Pk e Abrao Como Bloco De Notas Coloque Isto <flag Skull="5" /> Tem 5 Tipos De Skulls 1 pk Nao Aparesse 2 Nao Aparesse Ainda 3 Pk Normal 4 Red 5 Black Segue O Exemplo Há Baixo ! Exemplo ! Flags Yellow e Green ! Bom Ae Esta Meu Systema De Skull Monster ! Boa Sorte Em Seu Ot ! :]
Líderes está configurado para São Paulo/GMT-03:00

Informação Importante

Confirmação de Termo