Ir para conteúdo
  • Cadastre-se

L3K0T

Moderador
  • Total de itens

    2088
  • Registro em

  • Última visita

  • Dias Ganhos

    83

Tudo que L3K0T postou

  1. logout: local storage = 55512 -- Storage para controlar a spell local stages = {20, 30, 40} -- Tempos de duração para cada estágio em segundos local remainingTime = exhaustion.get(cid, storage) -- Obtém o tempo restante da spell local stage = 1 for i, stageDuration in ipairs(stages) do if remainingTime <= stageDuration then stage = i break end remainingTime = remainingTime - stageDuration end -- Salva o estágio e o tempo restante da spell no storage do jogador setPlayerStorageValue(cid, storage, stage)
  2. local storage = 55512 -- Storage para controlar a spell local stage = getPlayerStorageValue(cid, storage) if stage and stage > 0 then local waittimes = {20, 30, 40, 50} -- Tempos de espera para cada estágio em segundos local remainingTime = (waittimes[stage] - (os.time() - getPlayerStorageValue(cid, storage .. "time"))) -- Tempo restante em segundos if remainingTime > 0 then addEvent(function() doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você está sob o efeito do estágio " .. stage .. " da spell.") end, 1000
  3. function onCastSpell(cid, var) local storage = 55512 -- Storage para controlar a spell local stage = getPlayerStorageValue(cid, storage) or 0 -- Obtém o estágio atual da spell, se não houver nenhum, assume 0 local waittimes = {20, 30, 40} -- Tempos de espera para cada estágio em segundos if stage > 0 then doPlayerSendCancel(cid, "Você já está sob o efeito da spell.") return false end if not isCreature(cid) then return false end -- Definir o estágio inicial da spell setPlayerStorageValue(cid, storage, 1) stage = 1
  4. function onCastSpell(cid, var) local waittime = 310 -- Tempo de exhaustion local storage = 55512 -- Storage para controlar a spell -- Verificar se o jogador já usou a spell if getPlayerStorageValue(cid, storage) > 0 then if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.") end return false end if not isCreature(cid) then return false end exhaustion.set(cid, storage, waittime) setPlayerStorageValue(cid, storage,
  5. function onCastSpell(cid, var) local waittime = 310 -- Tempo de exhaustion local storage = 55512 -- Storage para controlar a spell -- Verificar se o jogador já usou a spell if getPlayerStorageValue(cid, storage) > 0 then if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.") end return false end if (not isCreature(cid)) then return false end exhaustion.set(cid, storage, waittime) setPlayerStorageValue(cid
  6. precisa ter um moveitem instalado no seu servidor OU Tente algo como isso void Teleport::__addThing(Creature* actor, int32_t, Thing* thing) { if (!thing || thing->isRemoved()) return; Tile* destTile = g_game.getTile(destination); if (!destTile) return; if (Creature* creature = thing->getCreature()) { g_game.addMagicEffect(creature->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost()); creature->getTile()->moveCreature(actor, creature, destTile); g_game.addMagicEffect(destTile->g
  7. local COLOR_RED = 180 -- Defina a cor que você está usando local tableBoss = { ["Amazon"] = {seconds = 10, newBoss = "Amazon"} } local function timer(position, duration) local t = duration addEvent(function() if t > 0 then doSendAnimatedText(position, tostring(t), COLOR_RED) t = t - 1 timer(position, t) else -- Respawn do boss após a contagem regressiva addEvent(doCreateMonster, 1000, tableBoss["Amazon"].newBoss, position) end end, 1000) end function onKill(cid, target, damage, flags) if isPlayer(target) then return true end local boss = tableBoss[getCreatu
  8. posta sua lib 032-position pra nos ver que tipo de pos vc usa
  9. Não jogar itens pelo teleportes C++ Bom.. o nome já diz, qualquer um que jogar itens nos teleportes do seu otserv, o mesmo será removido, como aquelas lixeiras, porem esse sistema é pela source, descartando scripts .LUA. Em teleporte.cpp ache: void Teleport::__addThing(Creature* actor, int32_t, Thing* thing) { if(!thing || thing->isRemoved()) return; Tile* destTile = g_game.getTile(destination); if(!destTile) return; if(Creature* creature = thing->getCreature()) { g_game.addMagicEffect(creature->getPo
  10. function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return false end local playerPosition = getCreaturePosition(cid) local vocation = getPlayerVocation(cid) -- Defina as habilidades correspondentes para cada vocação local skillsToTrain = { [0] = {1, 2}, -- Vocação sem classe [1] = {1, 2}, -- Knight [2] = {3}, -- Paladin [3] = {4}, -- Sorcerer [4] = {4}, -- Druid [5] = {4}, -- Master Sorcerer [6] = {4} -- Elder Druid } local minSkill = 10 -- Substitua 10 pelo valor mínim
  11. [0] = {1, 2}, -- Vocação sem classe vai trenr skill 1 e 2 [1] = {1, 2}, -- Knight vai trenr skill 1 e 2 [2] = {3}, -- Paladin vai trenr skill 3 [3] = {4}, -- Sorcerer vai trenarr skill 4 ml [4] = {4}, -- Druid vai trenarr skill 4 ml [5] = {4}, -- Master Sorcerer vai trenarr skill 4 ml [6] = {4} -- Elder Druid vai trenarr skill 4 ml coloquei tempo em tempo pra subir local skillEvents = {} -- Tabela para armazenar os eventos temporizados por jogador function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then
  12. Isso está ocorrendo porque o contêiner com o ID `bagId` não foi criado antes de tentar adicionar itens a ele. function onUse(cid, item, frompos, item2, topos) local itemids = { [1] = 26383, -- cabeça [4] = 26384, -- armadura [5] = 26387, -- direita [6] = 26388, -- esquerda [7] = 26385, -- pernas [8] = 26386 -- botas } local storage = 26427 -- armazenamento usado para salvar se o jogador já usou ou não local outfit = 907 -- visual a ser dado local novaVocação = 10 -- ID da nova vocação ao usar o arma
  13. function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return false end local playerPosition = getCreaturePosition(cid) local vocation = getPlayerVocation(cid) -- Defina as habilidades correspondentes para cada vocação local skillsToTrain = { [0] = {1, 2}, -- Vocação sem classe [1] = {1, 2}, -- Knight [2] = {3}, -- Paladin [3] = {4}, -- Sorcerer [4] = {4}, -- Druid [5] = {4}, -- Master Sorcerer [6] = {4} -- Elder Druid } local minSkill = 10 -- Substitua 10 pelo valor mínim
  14. É um tutorial ou você precisa de suporte sobre o mesmo, eu nao entendi??
  15. Isso?? local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) function damage(cid, level, maglevel, targetPosition) local min = 1000000000 local max = 1000000000 return -min, -max, getDirectionTo(targetPosition) -- Retorna também a direção para o alvo end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "damage") function onCastSpell(cid, var) local target = variantToPosition(va
  16. Como diz o título? Você pode gerar as funções do seu TFS em um arquivo de texto. Para fazer isso, basta ir em uma das bibliotecas (LIB) e adicionar o seguinte código no final. -- Função para obter todas as funções disponíveis no ambiente Lua function getLuaFunctions() local function iterateTable(tbl, prefix) local str = "" for key, value in pairs(tbl) do if type(value) == 'function' then str = str .. prefix .. key .. ',' elseif type(value) == 'table' then str = str .. iterateTable(value, pr
  17. function onStepIn(creature, item, position, fromPosition) local skillToTrain = SKILL_SWORD -- Substitua SKILL_SWORD pela habilidade que você deseja treinar local minSkill = 10 -- Substitua 10 pelo valor mínimo da habilidade para começar a treinar local gainChance = 50 -- Chance de ganhar skill, em porcentagem local requiredItemID = 1234 -- Substitua 1234 pelo ID do item necessário para treinar if creature:isPlayer() then local player = creature:getPlayer() -- Verifica se o jogador está equipado com o item necessário if player:getSlotItem(CO
  18. Meio q pausa o console, parece tipo aquele negócio de segundo plano, tente ver na propriedade do console algo que bloqueia ao minimizar saca?
  19. Bom pra trabalhar no offline, já pra servidor online público é meio complicado só por ser windows rsrs Parabéns
  20. Pode ser o banco de dados caindo e voltando aí da erro ninguém entra
  21. function onSay(cid, words, param, channel) local t = {} for i = 1, getPlayerInstantSpellCount(cid) do local spell = getPlayerInstantSpellInfo(cid, i - 1) if(spell.mlevel ~= 1) then if(spell.manapercent > 0) then spell.mana = spell.manapercent .. "%" end table.insert(t, spell) end end table.sort(t, function(a, b) return a.mlevel < b.mlevel end) local text, prevLevel = "", -1 for i, spell in ipairs(t) do local line = "" if(prevLevel ~= spell.mlevel) then if(i ~=
  22. <?php if (!defined('INITIALIZED')) exit; // Função para verificar se é hora de resetar os highscores function deveResetarHighscores() { // Coloque aqui a lógica para determinar se é hora de resetar os highscores // Por exemplo, verificar se passou uma certa quantidade de tempo desde o último reset // Retorne true se for hora de resetar, caso contrário, retorne false $lastResetTimestamp = /* Coloque aqui o timestamp do último reset */; $interval = 5 * 60; // 5 minutos em segundos $currentTimestamp = time(); // Verifica se passou o intervalo de tempo definido des
  23. Lib function table.unserialize(str) if(type(str) ~= 'string' or str:len() == 0) then return {} end return loadstring("return " .. str)() end
  24. local POLL_STORAGE = 80000 local OPTIONS_STORAGE = 80001 local PLAYER_STORAGE = 80000 function table.serialize(tbl) local str = "{" local sep = "" for k, v in pairs(tbl) do str = str .. sep if type(k) == "number" then str = str .. "[" .. k .. "]" else str = str .. k end str = str .. "=" if type(v) == "table" then str = str .. table.serialize(v) elseif type(v) == "number" or type(v) == "boolean" then str = str .. tostring(v) else str = str .. string.format("%q
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo