Solutions
-
Toruk's post in (Resolvido)[DÚVIDA APENAS] Como saber todas as Storages usadas e configuradas no server todo (mesmo as desativadas) was marked as the answerCtrl+F e vc coloca na 3ª opção (se não me engano). La tem como você digita alguma coisa para ser buscado e seleciona uma pasta pra passar esse scan.
Por fim, ele mostra quantos arquivos foram analisados e quantas incidências da busca
ocorreram.
-
Toruk's post in (Resolvido)0 [AJUDA] Remover tag de desconto da aba donate do site. was marked as the answerSó remover oque está entre o <strike> </strike>
-
Toruk's post in Servidor fica offline todos os dias as 10:00 da manhã was marked as the answerExecuta o server por um arquivo .sh (lembre de ativar uma screen antes para ficar 24h)
Exemplo:
echo "Starting server ..." ulimit -c unlimited while true; do ./nome_do_exec; done
-
Toruk's post in (Resolvido)Servidor travando ao realizar login/logout was marked as the answerEntão, tenho quase certeza que esse é o motivo da travada, não estar conectado em localhost (localhost tem um delay mínimo para o server).
Simplificando, no seu caso, tem o delay do sv mandar a informação para o banco de dados e depois do banco de dados confirmar a informação. (E quanto maior a distância de ambos, mais delay ficará)
Recomendo você fazer o teste usando o server e o mysql na mesma máquina e ver se mesmo assim está dando lag ao dar saveserver ou uma query extensa no servidor.
-
Toruk's post in [Ajuda] Modificar script de mineração! was marked as the answerEntedi, só mudar o target:transform(12706), por:
target:remove() Game.createItem(12706, 1, toPosition)
Script inteiro:
local rewards = { { item = 8298, count = 1, chance = 50 }, { item = 8299, count = 1, chance = 50 }, { item = 8301, count = 1, chance = 50 }, { item = 8302, count = 1, chance = 50 }, { item = 8303, count = 1, chance = 50 }, { item = 8310, count = 1, chance = 50 }, { item = 9971, count = 1, chance = 50 }, { item = 5944, count = 1, chance = 100 } } local storage = 5000 local delay_timer = 5 function onUse(player, item, fromPosition, target, toPosition, isHotkey) local cur_time, cur_storage = os.time(), player:getStorageValue(storage) if cur_storage > cur_time then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can mining again in " .. os.date("!%Hh %Mm %Ss", cur_storage - cur_time) .. ".") return true end local function addBackStone() local tRocks = getTileItemById(toPosition, 12706) if tRocks then doRemoveItem(tRocks.uid, 1) local stones = {12705} local stone = Game.createItem(stones[math.random(#stones)], 1, toPosition) if stone then stone:setActionId(40041) end end end if not target then return false end if not target:isItem() then return false end if target.actionid ~= 40041 then local pos = player:getPosition() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You cannot use it here.') return false end if target.actionid == 40041 then local ran = math.random(100) if ran <= 10 then toPosition:sendMagicEffect(3) target:remove() Game.createItem(12706, 1, toPosition) addEvent(addBackStone, 120000) return true end end local text = "You have found " for i = 1, #rewards do local rand = math.random(1000) if rand <= rewards[i].chance then player:addItem(rewards[i].item, rewards[i].count) if text ~= "You have found " then text = text .. ", " end text = text .. rewards[i].count .. " " .. ItemType(rewards[i].item):getName() end end if text == "You have found " then text = text .. "nothing" end player:sendTextMessage(36, text .. ".") cur_time = cur_time + delay_timer player:setStorageValue(storage, cur_time) return true end
-
Toruk's post in (Ajuda) creaturescripts was marked as the answerSó por o script em data/scripts/creaturescripts:
** Lembre que o script tem que ser escrito em lua (sem por nada em XML) **
local table = { -- [level] = type = "item", id = {ITEM_ID, QUANTIDADE}, msg = "MENSAGEM"}, -- [level] = type = "bank", id = {QUANTIDADE, 0}, msg = "MENSAGEM"}, -- [level] = type = "addon", id = {ID_ADDON_FEMALE, ID_ADDON_MALE}, msg = "MENSAGEM"}, -- [level] = type = "mount", id = {ID_MOUNT, 0}, msg = "MENSAGEM"}, [20] = {type = "item", id = {2160, 2}, msg = "Voce ganhou 2 crystal coins por alcancar o level 20!"}, [30] = {type = "bank", id = {20000, 0}, msg = "Foi depositado em seu bank 20000 gold coints!"}, [40] = {type = "addon", id = {136, 128}, msg = "Voce ganhou o addon citizen full por alcancar o level 40!"}, [60] = {type = "mount", id = {2, 0}, msg = "Voce ganhou a montaria x!"}, } local storage = 15000 local event = CreatureEvent("advanceRewards") function event.onAdvance(player, skill, oldLevel, newLevel) if skill ~= SKILL_LEVEL or newLevel <= oldLevel then return true end for level, _ in pairs(table) do if newLevel >= level and player:getStorageValue(storage) < level then if table[level].type == "item" then player:addItem(table[level].id[1], table[level].id[2]) elseif table[level].type == "bank" then player:setBankBalance(player:getBankBalance() + table[level].id[1]) elseif table[level].type == "addon" then player:addOutfitAddon(table[level].id[1], 3) player:addOutfitAddon(table[level].id[2], 3) elseif table[level].type == "mount" then player:addMount(table[level].id[1]) else return false end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, table[level].msg) player:setStorageValue(storage, level) end end player:save() return true end event:register()
-
Toruk's post in [Ajuda] Criar uma armadura que diminui em porcentagem o dano desse script: was marked as the answerExemplo de como fazer um "check" de armadura:
Sendo 2500 o id do item que está no slot da armor e 0.5 a porcentagem do dano que o player irá receber (nesse caso, 50%).
local player = Player(uid) local random = math.random(arr.minHit, arr.maxHit) local armor = player:getSlotItem(CONST_SLOT_ARMOR) if armor and armor:getId() == 2500 then doCreatureAddHealth(uid, -random*0.5) doSendMagicEffect(pos, 8) return true end
-
Toruk's post in (Resolvido)Duvida Sobre Upgrade de TFS was marked as the answerAo fazer o upgrade de tfs, você terá que adaptar várias coisas, como a nova pasta data/events, e grande parte dos scripts (alguns poderão até funcionar normalmente, porém outros podem gerar erros e não executarem de forma incorreta).
Para fazer a adaptação desses scripts não demanda de um grande conhecimento, mas é algo trabalhoso.
Concluindo, eu meu ponto de vista, se você não deseja editar a parte lua do server, recomendo que não realize a troca da versão do tfs. Pois scripts não compatível poderão causar crashs, lags e bugs.
-
Toruk's post in effect player vip/premium was marked as the answerlocal config = { effect = 30, -- Efeito que vai usar storage = 998899, -- Storage que o player precisa ter tempo = 3, -- Tempo em segundos 1200 - 20 minutos text = 'TRK' } local PremiumEfect = CreatureEvent("PremiumEfect") function PremiumEfect.onLogin(player) player:registerEvent("PremiumEfect") if player:getStorageValue(config.storage) == 1 then SendEffect(player:getId()) end return true end function SendEffect(cid) local player = Player(cid) if not player then return end player:getPosition():sendMagicEffect(config.effect) player:say(config.text, TALKTYPE_MONSTER_SAY) addEvent(SendEffect, config.tempo*1000, player:getId()) return true end PremiumEfect:register()
-
Toruk's post in Criar baú de quest 12.64 was marked as the answerExemplo de um script simples para você adaptar:
(Alterar storage e uid em cada bau).
local storage = 150000 local rewardChest = Action() function rewardChest.onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(storage) < 1 then player:setStorageValue(storage, 1) player:addItem(2160, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a cristal coin.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The chest is empty.") end return true end rewardChest:uid(1500) rewardChest:register()
E para fazer a escolha de baú, basta usar o mesmo storage nos scripts.
-
-
Toruk's post in Qual base usar para um Alternativo do tibia? was marked as the answerEu recomendo usar a src do saiyanking: https://github.com/SaiyansKing/optimized_forgottenserver
Ela tem alguns bugzinhos mas é bem fácil de corrigi-los. O ponto forte dela, é que está muito otimizada, tendo um desempenho muito melhor ao comparado com as src q tem free por ai.
-
Toruk's post in [BUG] pokemon.lua was marked as the answerIsso pode estar ocorrendo caso o player não tenha os itens na conta (bag, fishing rod, etc)
-
Toruk's post in porta premium was marked as the answerAcho q só lendo oq eu postei vc iria saber ...
Globalevent - Scripts ativados em um horário X ou a cada Y segundos.
Movements - Scripts que são ativados ao pisar ou ao sair de um SQM.
Portanto, "function onStepIn", remete-se a ação de pisar em um SQM, sendo um movement.
-
Toruk's post in ALGUEM ME AJUDA! was marked as the answerO problema é q a função *function onLogin(cid)* está duplicada no login.lua
-
Toruk's post in New Magic Shield was marked as the answerEssa adição não depende de um "scripts", mas sim, de alterações na src para torná-la funcional.
Para adicioná-la apenas "visualmente", só fazer alterações no protocolgame.cpp:
1 - Em void ProtocolGame::sendBasicData(), adiciona o byte(0) para determinar que essa byte está ativa.
2 - Em void ProtocolGame::AddPlayerStats(), adiciona 2. Uma para mostrar a mana atual e outra para mostrar a quantidade máxima de mana.
-
Toruk's post in Action Para Quiver was marked as the answerO erro deve estar nesse intervalo. Para corrigir, só fazer a checagem da arrow dentro do quiver.
https://github.com/Fir3element/3777/blob/master/src/player.cpp#L311-L324
-
Toruk's post in (Resolvido)Erro de análise : erro de sintaxe, '$' inesperado em C: \ xampp \ htdocs \ config \ config.php na linha 4 was marked as the answerAltere seu $config['site']['serverPath'] para:
$config['site']['serverPath'] = "C:/Users/Usuario/Desktop/narutibia/Server/"
-
Toruk's post in (Resolvido)Experience Scroll e Caixa com recompensa radomica was marked as the answerTente isso:
function onUse(cid, item, fromPos, itemEx, toPos) local exp = 500000 doPlayerAddExp(cid, exp) doSendPlayerTextMessage(cid, 22, "You have gained ".. exp .." experience points.") doRemoveItem(item.uid) return false end
-
Toruk's post in (Resolvido)Efeito giratório no templo was marked as the answerNice, porém se vc quiser ainda dar uma "melhorada no code" da pra deixar apenas a função onThink (sem a função ()), asism:
Eu, particularmente, odeio scripts com funções desnecessárias.
local templeCicleEff = { eff = 20, delay = 100, [1] = {x = 155, y = 154, z = 7,}, -- topLeft [2] = {x = 154, y = 156, z = 7,}, -- bottomLeft [3] = {x = 157, y = 157, z = 7,}, -- bottomRight [4] = {x = 158, y = 154, z = 7,}, -- topRight } function onThink(interval, lastExecution) for i = 1, 4 do addEvent(function() local initialPos = templeCicleEff[i] local finalPos = templeCicleEff[i+1] if i == 4 then finalPos = templeCicleEff[1] end doSendDistanceShoot(initialPos, finalPos, templeCicleEff.eff) if i == 4 then sendTempleCicleEff(templeCicleEff.eff) end end, templeCicleEff.delay) end end
Have a nice day!
-
Toruk's post in (Resolvido)Erro tibia alguem? was marked as the answerSeu Tibia.dat e Tibia.spr estão incompatíveis com o item.otb do servidor