Ir para conteúdo

Mateus Robeerto

Héroi
  • Registro em

  • Última visita

Tudo que Mateus Robeerto postou

  1. Sem informações sobre a versão e o TFS do seu servidor, não podemos ajudá-lo.
  2. Tentei usar o client da versão 11x com o OTClient, mas não consegui entrar, sem sucesso. Você poderia me dar uma orientação sobre como fazer isso com o OTClient?
  3. function onUse(cid, item, frompos, item2, topos) local store = 23562 -- storage q salva o delay local delay = 10 -- tempo em segundos de delay local storage = 23563 local cidade = getPlayerTown(cid) local pos = getTownTemplePosition(cidade) if getPlayerStorageValue(cid, store) - os.time() >= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("Aguarde %.2f minutos para usar novamente.", (getPlayerStorageValue(cid, store) - os.time()) / 60)) return true end if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, 'Voce nao pode teleportar se estiver em battle.') return true end doPlayerSendCancel(cid, "Teleportando!") addEvent(function() doSendMagicEffect(getPlayerPosition(cid), 1004) doTeleportThing(cid, pos) if getPlayerStorageValue(cid, 84929) >= 1 then -- torneio viktor setPlayerStorageValue(cid, 84929, -1) end doRegainSpeed(cid) doPlayerRemoveItem(cid, 2458, 1) setPlayerStorageValue(cid, store, os.time() + delay) end, delay * 1000) return true end
  4. @Fabi MarzanOlha o que eu encontrei no GitHub para modal window... Se não me engano, está correto. Vale a pena dar uma olhada. https://github.com/otland/forgottenserver/pull/27/commits/790ab135d258d4f802b17d76d0ea36f6bee7c3ed
  5. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 magician_pos = {x=1249, y=783, z=6} function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local travelDestinations = { ['dark city'] = {premium = false, level = 0, cost = 200, destination = {x=766, y=1090, z=6}, chance = 50} } local player = Player(cid) local travel = travelDestinations[msg:lower()] if travel then if travel.level > 0 and player:getLevel() < travel.level then npcHandler:say("Sorry, you must be level " .. travel.level .. " to travel to this place.", cid) elseif travel.premium and not player:isPremium() then npcHandler:say("Sorry, to go to " .. msg .. " it is necessary to be VIP.", cid) else local travelCost = travel.cost local success = player:removeTotalMoney(travelCost) if success then local remainingBalance = player:getBankBalance() local message = "" if remainingBalance > 0 then message = ("You paid %d gold for the travel service for %s. Your current balance is %d gold in the bank."):format(travelCost, msg, remainingBalance) else message = ("You paid %d gold for the travel service to %s. Your bank balance is empty."):format(travelCost, msg) end player:sendTextMessage(MESSAGE_INFO_DESCR, message) local mychance = travel.chance or 100 if player:getSlotItem(CONST_SLOT_NECKLACE) and player:getSlotItem(CONST_SLOT_NECKLACE).itemid == 10219 then mychance = 100 end if math.random(1, 100) <= mychance then local pos = travel.destination local magicEffect = CONST_ME_TELEPORT Position(pos):sendMagicEffect(magicEffect) doTeleportThing(cid, pos) npcHandler:say("Bon voyage!", cid) else local pos = magician_pos local magicEffect = CONST_ME_TELEPORT Position(pos):sendMagicEffect(magicEffect) doTeleportThing(cid, pos) npcHandler:say("The boat lost its way and stopped in Magician. Careful!", cid) end else npcHandler:say("You don't have enough money to travel to " .. msg .. ".", cid) end end else npcHandler:say("I don't sail to this city...", cid) end npcHandler:releaseFocus(cid) return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) testado e funcionado OK!!
  6. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 function lowerTable(table) local lowerCaseTable = {} for key, value in pairs(table) do lowerCaseTable[key:lower()] = value end return lowerCaseTable end function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser, msg = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid, msg:lower() local travels = { ['dark city'] = {premium = false, level = 0, cost = 200, destination = {x=766, y=1090, z=6}}, } local travel = lowerTable(travels) if travel[msg] then local player = Player(cid) local var = travel[msg] if var.level > 0 and player:getLevel() < var.level then npcHandler:say("Sorry, you must be level " .. var.level .. " to travel to this place.", cid) elseif var.premium and not isPremium(cid) then npcHandler:say("Sorry, to go to " .. msg .. " it is necessary to be VIP.", cid) else local cost = var.cost local playerMoney = player:getMoney() local playerBankBalance = player:getBankBalance() if playerMoney < cost and playerBankBalance >= cost then player:removeMoney(cost) player:setBankBalance(playerBankBalance - cost) elseif playerMoney < cost and playerBankBalance < cost then npcHandler:say("Sorry, you don't have enough money in your backpack or in the bank.", cid) else player:removeMoney(cost) end npcHandler:say("Bon voyage!", cid) npcHandler:releaseFocus(cid) local playerPos = getCreaturePosition(cid) Position(playerPos):sendMagicEffect(CONST_ME_TELEPORT) doTeleportThing(cid, var.destination) npcHandler:say("The boat lost its way and stopped in Magician, careful!", cid) end else npcHandler:say("I don't sail to this city...", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  7. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 function creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end if getPlayerStorageValue(cid, 10036) == 1 then local shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addBuyableItem({'spellbook'}, 2175, 150, 10, 'spellbook') shopModule:addBuyableItem({'magic lightwand'}, 2163, 100, 10, 'magic lightwand') else local shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addBuyableItem({'small health'}, 8704, 20, 100, 'small health potion') shopModule:addBuyableItem({'health potion'}, 7618, 45, 100, 'health potion') end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) tentar.
  8. local rewards = { {itemid = 2160, count = 300}, {itemid = 2383, count = 1}, {itemid = 2390, count = 1}, {itemid = 10518, count = 1}, {itemid = 2471, count = 1}, {itemid = 2646, count = 1}, {itemid = 2469, count = 1}, {itemid = 2523, count = 1}, {itemid = 2494, count = 1}, {itemid = 8926, count = 1}, {itemid = 7431, count = 1}, {itemid = 7368, count = 1}, {itemid = 8910, count = 1}, {itemid = 2789, count = 100} } function onUse(cid, item, frompos, item2, topos) if item.uid == 1664 then local queststatus = getPlayerStorageValue(cid, 1664) if queststatus == -1 then if getPlayerLevel(cid) >= 300 then doPlayerSendTextMessage(cid, 25, "Parabéns! Você ganhou 3kk e os seguintes itens:") for _, reward in ipairs(rewards) do doPlayerAddItem(cid, reward.itemid, reward.count) end setPlayerStorageValue(cid, 1664, 1) else doPlayerSendTextMessage(cid, 22, "Você precisa ser level 300 para usar este item.") end else doPlayerSendTextMessage(cid, 22, "Você já pegou o bônus.") end end return true end Ou você pode optar por uma alternativa. O script é bastante simples e está otimizado!.
  9. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 function creatureSayCallback(cid, type, msg) function lowerTable(tabela) -- by vodkart local tab = {} for var, ret in pairs(tabela) do tab[var:lower()] = ret end return tab end if not npcHandler:isFocused(cid) then return false end local talkUser, msg = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid, msg:lower() local viagens = { ['dark city'] = {premium = false, level = 0, cost = 200, destination = {x=766, y=1090, z=6}}, } local travel = lowerTable(viagens) if travel[msg] then local player = Player(cid) local var = travel[msg] if var.level > 0 and player:getLevel() < var.level then npcHandler:say("Sorry but you must be level " .. var.level .. " to travel to this place.", cid) return true elseif var.premium and not isPremium(cid) then npcHandler:say("Sorry, to go to " .. msg .. " it is necessary to be VIP.", cid) return true else local cost = var.cost local playerMoney = player:getMoney() local playerBankBalance = player:getBankBalance() if playerMoney < cost and playerBankBalance >= cost then player:withdrawMoneyFromBank(cost) elseif playerMoney < cost and playerBankBalance < cost then npcHandler:say("Sorry, you don't have enough money in your backpack or in the bank.", cid) return true else player:removeMoney(cost) end npcHandler:say("Bon voyage!!", cid) npcHandler:releaseFocus(cid) local playerPos = getCreaturePosition(cid) Position(playerPos):sendMagicEffect(CONST_ME_TELEPORT) doTeleportThing(cid, var.destination) npcHandler:say("The boat lost its way and stopped in Magician, Careful!", cid) end else npcHandler:say("I don't sail to this city...", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  10. Ok, muito obrigado. Vou atualizar o post fixo. Não há commit pelo GitHub. Apenas baixei o TFS 1.5 7.72, peguei alguns códigos e coloquei no 8.6 e compilei de boa... Mas não é difícil, foi menos de 5 minutos. :)
  11. Olá Luciano, eu tinha esquecido desse commit da Sarah. Obrigado! Vou atualizar o post fixo com este link... heheh
  12. local damageTable = { {4, -3}, {9, -2}, {20, -1} } local function createExplosion() local explosion = createConditionObject(CONDITION_FIRE) setConditionParam(explosion, CONDITION_PARAM_DELAYED, 1) for i = 1, #damageTable do local t = damageTable[i] addDamageCondition(explosion, t[1], 1000, t[2]) -- tempo end return explosion end local function explodeCreature(creature) if isCreature(creature) then local explosion = createExplosion() local area = createCombatArea({{1, 1, 1}}) doAreaCombatHealth(creature, 1, getThingPos(creature), area, -1, -30, 5) doAreaCombatCondition(creature, getThingPos(creature), area, explosion, 255) doSendMagicEffect(getThingPos(creature), CONST_ME_EXPLOSIONAREA) end end function onDeath(creature, corpse, killer) if isSummon(creature) or isMonster(creature) then addEvent(explodeCreature, 1, creature) end return true end
  13. Serve sim, basta entrar no meu perfil e você verá que está escrito 'TFS 1.5 8.6'. Ao entrar, baixe apenas a source ou executável teste o servidor do Luciano. Depois, você deve baixar o arquivo 'mount.xml' e enviá-lo para o Luciano. No OTClient, ative via feature e teste. Pronto!
  14. Depende do seu gosto... Se for Znote ou MyAcc, é melhor para UniServer. Se for Gesior limpo, é melhor para a antiga versão do XAMPP 7.x. Particularmente, prefiro Gesior com XAMPP... Já estou satisfeito. espero ter ajudado!
  15. Estou usando o Windows 11 e o executável é de 64 bits, mas estou usando uma versão antiga do XAMPP 7.x. Eu acredito que esteja faltando alguns DLLs no seu computador. Isso já aconteceu comigo quando formatei o meu computador e tentei abrir o executável e o OTClient, mas nada aconteceu. Eu resolvi o problema baixando um programa que automaticamente detecta DLLs corrompidas ou ausentes e as substitui por versões novas. Após usar esse programa, o cliente abriu normalmente e o executável do servidor tambem. https://www.baixesoft.com/download/all-in-one-runtimes
  16. Bom dia! Você resolveu o problema? Qual arquivo você está usando, config.lua.dist ou config.lua? Se for 'dist', basta remover 'dist' e deixar apenas config.lua. Assim, ele abrirá normalmente.
  17. function onLogin(cid) local playerStorageValue = getPlayerStorageValue(cid, 848484) local mlBuffLevel = 0 if playerStorageValue >= 0 and playerStorageValue < 5 then mlBuffLevel = 1 elseif playerStorageValue >= 5 and playerStorageValue < 15 then mlBuffLevel = 2 elseif playerStorageValue >= 15 then mlBuffLevel = 3 end doPlayerAddManaSpent(cid, mlBuffLevel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu um buff de Magic Level: " .. mlBuffLevel) end Será que é parecido assim?
  18. Você só abriu o executável e mais nada, certo? Não instalou o XAMPP? Apenas o que apareceu de erro? Diz que está faltando DLLs? Essa parada do Erro 0xc0000017?
  19. local MAX_PLAYERS_IN_ROOM = 10 local STORAGE_COUNT_KEY = 85565 function onStepIn(cid, item, position, fromPosition) local playerCount = getPlayerStorageValue(cid, STORAGE_COUNT_KEY) or 0 if playerCount < MAX_PLAYERS_IN_ROOM then setPlayerStorageValue(cid, STORAGE_COUNT_KEY, playerCount + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bem-vindo à sala!") return true else doPlayerSendCancel(cid, "A sala está cheia. Você não pode entrar.") return false end end function onStepOut(cid, item, position, fromPosition) local playerCount = getPlayerStorageValue(cid, STORAGE_COUNT_KEY) or 0 if playerCount > 0 then setPlayerStorageValue(cid, STORAGE_COUNT_KEY, playerCount - 1) end end
  20. local MAX_PLAYERS_IN_ROOM = 10 local STORAGE_COUNT_KEY = 85565 function onStepIn(cid, item, position, fromPosition) local playerCount = getStorageValue(STORAGE_COUNT_KEY) or 0 if playerCount < MAX_PLAYERS_IN_ROOM then setStorageValue(STORAGE_COUNT_KEY, playerCount + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bem-vindo à sala!") return true else doPlayerSendCancel(cid, "A sala está cheia. Você não pode entrar.") return false end end function onStepOut(cid, item, position, fromPosition) local playerCount = getStorageValue(STORAGE_COUNT_KEY) or 0 if playerCount > 0 then setStorageValue(STORAGE_COUNT_KEY, playerCount - 1) end end tentar ai.
  21. Para aqueles que estão interessados em adotar a base do Nekiro, gostaria de anunciar que as montarias e a modal widow agora estão disponíveis. Se você deseja implementar sistemas como o de crafting com modal e outros recursos, sinta-se à vontade para fazer o download e testar. É importante observar que o Nekiro não incluiu mapas nesta versão. Portanto, será necessário migrar seus próprios mapas para o TFS 1.5 8.6. Alternativamente, você pode considerar utilizar a base do Luciano, conhecida como STYLLER OT. Após realizar testes, posso confirmar que essa é uma opção bastante interessante. Esta versão já está completa, permitindo que você utilize seus próprios mapas sem dificuldades significativas. Além disso, estou disponibilizando os sprites no formato 13x para a versão 8.6, juntamente com os arquivos items.otb e XML. Quanto à correção de eventuais erros, isso fica a seu critério, mas gostaria de ressaltar que não é uma tarefa difícil de realizar. É com satisfação que compartilho que a source está agora disponível para acesso público. Caso você deseje, pode realizar atualizações através dos commits. Estou preparando uma lista abrangente de atualizações necessárias, pois há muitas modificações a serem feitas. Para acessar a source, por favor, clique no link abaixo: https://www.mediafire.com/file/0680a4b624163pd/TFS-1.5-Downgrades-8.60.rar/file Dentro da SRC que implementei, você encontrará os seguintes recursos: Sistema de Montaria: Agora você pode adicionar essa funcionalidade ao seu servidor. Modal Window: Esta é uma janela modal, proporcionando uma experiência mais interativa para os jogadores. Custom Attributes(Boost e Relfect:: https://github.com/otland/forgottenserver/pull/2807/commits/18f5afa52a36a02ea56dae97b29e683233d15c25. Além disso, gostaria de compartilhar três repositórios no GitHub que podem ser valiosos para você. Três deles são mantidos pelos usuários @Movie e @ralke23 e a Sarah (MillhioreBT). Esses repositórios contêm recursos e scripts úteis que podem aprimorar a experiência do seu servidor. Sinta-se à vontade para explorar e utilizar esses recursos conforme necessário. https://github.com/moviebr/TFS-1.5-Downgrades https://github.com/ralke23/Greed-TFS-1.5-Downgrades https://github.com/MillhioreBT/forgottenserver-downgrade Para os interessados nos sprites 13x para a versão 8.6, estou disponibilizando o link para download abaixo: https://mega.nz/folder/5FQEnT4R#pAbmAAhpBhmcP1jaVkXm8Q Recomendo também o uso do ObjectBuilder_0_5_5-dev para facilitar o processo: https://github.com/punkice3407/ObjectBuilder/releases/tag/v0.5.5 Para aqueles que enfrentam dificuldades na compilação do executável, estou disponibilizando um arquivo para download que pode ajudar: https://www.mediafire.com/file/cxirgq7n1cm2p3i/dlls+e+exe.rar/file Quanto à ativação do sistema de montarias via OTClient, basta acessar o arquivo game_features/features.lua e localizar a linha: 'if(version >= 860) then!' e adicionar abaixo 'g_game.enableFeature(GamePlayerMounts)'. É necessário baixar ambos os arquivos, mounts.xml e outfits.xml, para que o OtClient funcione corretamente. Sem esses arquivos, o cliente pode apresentar bugs ou até mesmo crashar sozinho. É obrigatório o uso desses arquivos. Basta fazer o download e colocá-los na base do Luciano. Basta ir até a pasta data/xml e inserir os arquivos lá. Se você estiver usando seu próprio mapa, os arquivos são igualmente necessários, independentemente de suas preferências. outfits.xml mounts.xml ATENÇÃO: Sobre a base do Luciano ou do Nekiro downgrade que você baixou (schemas.sql), ela está totalmente limpa, sem implementações adicionais. Cabe a você implementar por conta própria. Por exemplo, se você for usar o Znote, ele solicitará o esquema e as colunas necessárias. Isso não são erros, são apenas avisos. Você deve procurar pelas colunas necessárias e inseri-las para que funcione corretamente. Isso não é difícil de fazer. https://github.com/slawkens/myaac https://github.com/gesior/Gesior2012 https://github.com/Znote/ZnoteAAC/tree/v2 Antes de prosseguir com o download, sugiro que realize uma verificação de vírus nos arquivos. Seguem os links para o scan: Scan da SRC https://www.virustotal.com/gui/file/1364b14cab10a34ca7102d3581e427396f8224cc5156d6bc3859b4ebcb155de6?nocache=1 Scan das DLLs e Executável https://www.virustotal.com/gui/file/603c853dbd5b40ff21b0b0004c129e5039c9954277da22722b2980fcbfcbe0ce?nocache=1 IMPORTANTE: Por favor, note que a funcionalidade de montaria e janela modal não está disponível para versão old do client (CipSoft). Infelizmente, não estou oferecendo suporte para essas versões no momento. No entanto, é possível adquirir uma DLL especial que pode ser injetada no client old (CipSoft) para habilitar essas funcionalidades. Caso esteja interessado, conheço um vendedor confiável que oferece essa DLL. Para mais informações, por favor, entre em contato através do Discord: Sharingan.
  22. local msgs = {"use ", ""} function doAlertReady(cid, id, movename, n, cd) if not isCreature(cid) then return true end local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid) if not p or #p <= 0 then return true end for a = 1, #p do if getItemAttribute(p[a], cd) == "cd:"..id.."" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!") return true end end end function onSay(cid, words, param, channel) if param ~= "" then return true end if string.len(words) > 3 then return true end if #getCreatureSummons(cid) == 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need a pokemon to use moves.") return true end local mypoke = getCreatureSummons(cid)[1] local name = getCreatureName(mypoke) local it = string.sub(words, 2, 3) local move = nil if it == "2" then move = movestable[name].move2 elseif it == "3" then move = movestable[name].move3 elseif it == "4" then move = movestable[name].move4 elseif it == "5" then move = movestable[name].move5 elseif it == "6" then move = movestable[name].move6 elseif it == "7" then move = movestable[name].move7 elseif it == "8" then move = movestable[name].move8 elseif it == "9" then move = movestable[name].move9 elseif it == "10" then move = movestable[name].move10 elseif it == "11" then move = movestable[name].move11 elseif it == "12" then move = movestable[name].move12 elseif it == "13" then move = movestable[name].move13 end if not move then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.") return true end if getPlayerLevel(cid) < move.level then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to be at least level "..move.level.." to use this move.") return true end local cdzin = "cm_move"..it.."" if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (move.cd + 2) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..move.name.." again.") return true end local newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd) doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..move.name.."!", TALKTYPE_SAY) local summons = getCreatureSummons(cid) addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin) end tentar!
  23. Vamos la: Abra seu phpmyadmin, selecione sua DB, vá em sql e execute o comando: ALTER TABLE `players` ADD `description` VARCHAR(255) NOT NULL DEFAULT '0'; Vá em data/npc/lib crie npc_resets.lua e adicione: --[[Script made 100% by Nogard, Night Wolf and Linus. You can feel free to edit anything you want, but don't remove the credits]] config = { minlevel = 150, --- Level inical para resetar price = 10000, --- Preço inicial para resetar newlevel = 20, --- Level após reset priceByReset = 0, --- Preço acrescentado por reset percent = 30, ---- Porcentagem da vida/mana que você terá ao resetar (em relação à sua antiga vida total) maxresets = 50, ---- Maximo de resets levelbyreset = 0 --- Quanto de level vai precisar a mais no próximo reset } function getResets(uid) resets = getPlayerStorageValue(uid, 378378) if resets < 0 then resets = 0 end return resets end function addReset(cid) player = Player(cid) resets = getResets(cid) hp = player:getMaxHealth() resethp = hp*(config.percent/100) player:setMaxHealth(resethp) mana = player:getMaxMana() resetmana = mana*(config.percent/100) player:setMaxMana(resetmana) playerid = player:getGuid() player:setStorageValue(378378, resets+1) player:remove() description = resets+1 db.query("UPDATE `players` SET `description` = ' [Reset: "..description.."]' WHERE `players`.`id`= ".. playerid .."") db.query("UPDATE `players` SET `level`="..config.newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") return true end agora em data/npc crie reseter.xml e adicione: <?xml version="1.0" encoding="UTF-8"?> <npc name="Reseter" script="reseter.lua"> <health now="1000" max="1000"/> <look type="133" head="95" body="86" legs="86" feet="38" addons="3"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|.I've been waiting for you to come.. Say 'reset' or 'quantity'" /> <parameter key="message_farewell" value="Cya folk." /> <parameter key="message_walkaway" value="How Rude!" /> </parameters> </npc> vá em data/npc/script crie reseter.lua e adicione: dofile('data/npc/lib/npc_resets.lua') 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 function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local player = Player(cid) local newPrice = config.price + (getResets(cid) * config.priceByReset) local newminlevel = config.minlevel + (getResets(cid) * config.levelbyreset) if msgcontains(msg, 'reset') then if getResets(cid) < config.maxresets then npcHandler:say('You want to reset your character? It will cost '..newPrice..' gp\'s!', cid) npcHandler.topic[cid] = 1 else npcHandler:say('You already reached the maximum reset level!', cid) end elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 1 then if player:getLevel() > newminlevel then if player:removeMoney(newPrice) then addEvent(function() if isPlayer(cid) then addReset(cid) end end, 3000) local number = getResets(cid)+1 local msg ="---[Reset: "..number.."]-- You have reseted! You'll be disconnected in 3 seconds." player:popupFYI(msg) npcHandler.topic[cid] = 0 npcHandler:releaseFocus(cid) else npcHandler:say('Its necessary to have at least '..newPrice..' gp\'s for reseting!', cid) npcHandler.topic[cid] = 0 end else npcHandler:say('The minimum level for reseting is '..newminlevel..'!', cid) npcHandler.topic[cid] = 0 end elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then npcHandler.topic[cid] = 0 npcHandler:releaseFocus(cid) npcHandler:say('Ok.', cid) elseif msgcontains(msg, 'quantity') then npcHandler:say('You have a total of '..getResets(cid)..' reset(s).', cid) npcHandler.topic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Pra mostrar a quantidade de resets no Look vá em: data/events/scripts/player.lua Procure por: function Player:onLook(thing, position, distance) adicione: if thing:isPlayer() then local resets = thing:getStorageValue(378378) if resets < 0 and 0 or resets then description = string.format("%s\nResets: %s.", description, resets > 0 and resets or "0") end end Creditos: Criação: Nogard, Night Wolf TFS 1.+: Linus
  24. local config = { p_time = 3600, } local function givePoints(cid, quant) if getCreatureStorage(cid, 5551) == 1 then if os.time() - getCreatureStorage(cid, 1219) >= config.p_time then doPlayerSendTextMessage(cid, 19, "[ONLINE BONUS] --> Por completar uma hora online você ganhou um Baiak Coin. Seu temporizador foi zerado.") doPlayerAddItem(cid, 6527, 1) doCreatureSetStorage(cid, 1219, 0) doCreatureSetStorage(cid, 1219, os.time()) end else doPlayerSendTextMessage(cid, 19, "Desculpe, você não é elegível para o bônus online.") end return true end

Informação Importante

Confirmação de Termo