Ir para conteúdo

zipter98

Membro
  • Registro em

  • Última visita

Tudo que zipter98 postou

  1. data/actions/scripts, evolution.lua: Acima de: local minlevel = 0 Adicione: if getItemAttribute(pokeball.uid, "ehditto") then return true end Ficando: if getItemAttribute(pokeball.uid, "ehditto") then return true end local minlevel = 0
  2. Você trocou a linha errada... function convert(time) return {minutes = math.floor(time / 60), seconds = time - math.floor(time / 60) * 60} end function timer(time) if time < 0 or not checkPlayer() then return true end for i = 1, #config.timerPos do doSendAnimatedText(config.timerPos[i], convert(time).minutes..":"..convert(time).seconds, 215) end addEvent(timer, 1000, time - 1) end
  3. Mude o conteúdo da linha 10 por: },
  4. Tá, mas qual o erro? lol
  5. Ah sim, confundi com o interval e mencionei que o time também era em minutos... time -> segundos interval -> minutos A alteração para o tempo restante aparecer em mais de um lugar é a seguinte: Tabela: timerPos = { {x = x, y = y, z = z}, --Posições onde o tempo restante aparecerá. {x = x, y = y, z = z}, {x = x, y = y, z = z}, --etc }, Troque: doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215) por: for i = 1, #config.timerPos do doSendAnimatedText(config.timerPos[i], convert(time).minutes..":"..convert(time).seconds, 215) end Para mostrar o tempo em outros códigos, basta usar as funções: function convert(time) return {minutes = math.floor(time / 60), seconds = time - math.floor(time / 60) * 60} end function timer(time, pos) if time < 0 then return true end doSendAnimatedText(pos, convert(time).minutes..":"..convert(time).seconds, 215) addEvent(timer, 1000, time - 1) end Uso: timer(TEMPO, POSIÇÃO)
  6. function onStatsChange(cid, attacker) if isMonster(cid) and isMonster(attacker) then return false end return true end
  7. local config = { storage = 9721, time = 5, --Tempo para fazer a quest, em minutos. interval = 15, --Tempo para poder usar a alavanca novamente, em minutos. timerPos = {x = x, y = y, z = z}, --Posição onde o tempo restante aparecerá. monster = { name = "monster_name", --Nome do monstro. pos = { {x = x, y = y, z = z}, --Posições onde ele vai nascer. {x = x, y = y, z = z}, {x = x, y = y, z = z}, --etc }, }, player = { {{x = x, y = y, z = z}, {x = x, y = y, z = z}}, --{{posição onde o player deve ficar}, {para onde será teleportado}}, {{x = x, y = y, z = z}, {x = x, y = y, z = z}}, {{x = x, y = y, z = z}, {x = x, y = y, z = z}}, --etc }, area = {{x = x, y = y, z = z}, {x = x, y = y, z = z}}, --{{posição superior esquerda da área}, {posição inferior direita da área}}, } local cidPos = {} function clearArea() for x = config.area[1].x, config.area[2].x do for y = config.area[1].y, config.area[2].y do local pos = {x = x, y = y, z = config.area[1].z} local pid = getTopCreature(pos).uid if pid > 0 then if isPlayer(pid) then doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "You didn't get to the reward room in time.") else doRemoveCreature(pid) end end end end setGlobalStorageValue(config.storage, os.time() + config.interval * 60) end function checkPlayer() for x = config.area[1].x, config.area[2].x do for y = config.area[1].y, config.area[2].y do local pos = {x = x, y = y, z = config.area[1].z} local pid = getTopCreature(pos).uid if isPlayer(pid) then return true end end end return false end function convert(time) return {minutes = math.floor(time / 60), seconds = time - math.floor(time / 60) * 60} end function timer(time) if time < 0 or not checkPlayer() then return true end doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215) addEvent(timer, 1000, time - 1) end function onUse(cid) if getGlobalStorageValue(config.storage) > os.time() then return doPlayerSendCancel(cid, "Wait "..convert(getGlobalStorageValue(config.storage) - os.time()).minutes.."min and "..convert(getGlobalStorageValue(config.storage) - os.time()).seconds.."secs.") elseif checkPlayer() then return doPlayerSendCancel(cid, "There's player(s) doing the quest right now.") end local p = {} for _, pos in pairs(config.player) do local pid = getTopCreature(pos[1]).uid if isPlayer(pid) then p[#p + 1] = pid cidPos[pid] = _ end end if #p < #config.player then return doPlayerSendCancel(cid, "There's some player(s) missing.") end for i = 1, #p do doTeleportThing(p[i], config.player[cidPos[p[i]]][2]) doPlayerSendTextMessage(p[i], 27, "Good luck!") end for _, pos in pairs(config.monster.pos) do doCreateMonster(config.monster.name, pos) end timer(config.time * 60) addEvent(function() clearArea() end, config.time * 60 * 1000) return true end
  8. Sobre o tempo, havia esquecido de executar a função (lol). Arrumei já. Esta outra posição seria o templo? Ou outro lugar específico?
  9. Foi mal, é o sono e a falta de scriptear. Corrigido.
  10. Ops, falta de atenção minha. Corrigido. Quando o tempo acabar, caso o jogador não tenha chegado até a sala de recompensas, ele será teleportado para a posição onde estava quando a alavanca foi usada.
  11. local config = { storage = 9721, time = 5, --Tempo para fazer a quest, em minutos. interval = 15, --Tempo para poder usar a alavanca novamente, em minutos. timerPos = {x = x, y = y, z = z}, --Posição onde o tempo restante aparecerá. monster = { name = "monster_name", --Nome do monstro. pos = { {x = x, y = y, z = z}, --Posições onde ele vai nascer. {x = x, y = y, z = z}, {x = x, y = y, z = z}, --etc }, }, player = { {{x = x, y = y, z = z}, {x = x, y = y, z = z}}, --{{posição onde o player deve ficar}, {para onde será teleportado}}, {{x = x, y = y, z = z}, {x = x, y = y, z = z}}, {{x = x, y = y, z = z}, {x = x, y = y, z = z}}, --etc }, area = {{x = x, y = y, z = z}, {x = x, y = y, z = z}}, --{{posição superior esquerda da área}, {posição inferior direita da área}}, } local cidPos = {} function clearArea() for x = config.area[1].x, config.area[2].x do for y = config.area[1].y, config.area[2].y do local pos = {x = x, y = y, z = config.area[1].z} local pid = getTopCreature(pos).uid if pid > 0 then if isPlayer(pid) then doTeleportThing(pid, config.player[cidPos[pid]][1] or getTownTemplePosition(getPlayerTown(pid))) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "You didn't get to the reward room in time.") else doRemoveCreature(pid) end end end end setGlobalStorageValue(config.storage, os.time() + config.interval * 60) end function checkPlayer() for x = config.area[1].x, config.area[2].x do for y = config.area[1].y, config.area[2].y do local pos = {x = x, y = y, z = config.area[1].z} local pid = getTopCreature(pos).uid if isPlayer(pid) then return true end end end return false end function convert(time) return {minutes = math.floor(time / 60), seconds = time - math.floor(time / 60) * 60} end function timer(time) if time < 0 or not checkPlayer() then return true end doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215) addEvent(timer, 1000, time - 1) end function onUse(cid) if getGlobalStorageValue(config.storage) > os.time() then return doPlayerSendCancel(cid, "Wait "..convert(getGlobalStorageValue(config.storage) - os.time()).minutes.."min and "..convert(getGlobalStorageValue(config.storage) - os.time()).seconds.."secs.") elseif checkPlayer() then return doPlayerSendCancel(cid, "There's player(s) doing the quest right now.") end local p = {} for _, pos in pairs(config.player) do local pid = getTopCreature(pos[1]).uid if isPlayer(pid) then p[#p + 1] = pid cidPos[pid] = _ end end if #p < #config.player then return doPlayerSendCancel(cid, "There's some player(s) missing.") end for i = 1, #p do doTeleportThing(p[i], config.player[cidPos[p[i]]][2]) doPlayerSendTextMessage(p[i], 27, "Good luck!") end for _, pos in pairs(config.monster.pos) do doCreateMonster(config.monster.name, pos) end timer(config.time) addEvent(function() clearArea() end, config.time * 60 * 1000) return true end
  12. Esses tiles pretos que você menciona são os circulados em branco? Os jogadores só poderão passar por tais tiles se tiverem matado todos os monstros da sala?
  13. Esse tempo para usar a alavanca novamente é global ou individual? E como os jogadores entrarão na sala de recompensas?
  14. 1º pedido: -- [( Script created by Matheus for TibiaKing.com )] -- local MENSAGEM = { "FRASE 1", "FRASE 2", "FRASE 3", "FRASE 4", "FRASE 5", } local t = 0 function onThink(interval, lastExecution) if not MENSAGEM[t] then t = 1 end doBroadcastMessage(MENSAGEM[t], 22) t = t + 1 return true end
  15. local vocations = {297, 298, 299} --Vocações. function sendEffect(cid) if isPlayer(cid) and isInArray(vocations, getPlayerVocation(cid)) then doSendMagicEffect(getThingPos(cid), 180) addEvent(sendEffect, 3 * 1000, cid) end end function onLogin(cid) sendEffect(cid) return true end
  16. Na minha opinião, seria mais prático e leve fazer isso por creaturescript. Se preferir: data/creaturescripts/scripts: function sendEffect(cid) if isPlayer(cid) and getPlayerVocation(cid) == 297 then doSendMagicEffect(getThingPos(cid), 180) addEvent(sendEffect, 3 * 1000, cid) end end function onLogin(cid) sendEffect(cid) return true end Tag: <event type="login" name="vocLogin" event="script" value="nome_do_arquivo.lua"/>
  17. Ops, agora que reparei que troquei os argumentos da função lol corrigido
  18. local cfg = { soul = 0, time = 3600, level = 1 } local t = { [{11419}] = {fruit = 2675, NFTree = 4008, fName = "Orange"}, [{5094}] = {fruit = 2676, NFTree = 5092, fName = "Banana"}, [{5096}] = {fruit = 2678, NFTree = 2726, fName = "Coconut"}, [{5157}] = {fruit = 5097, NFTree = 5156, fName = "Mango"} } function onUse(cid, item, frompos, item2, topos) local S = getPlayerSoul(cid) local L = getPlayerLevel(cid) for i, k in pairs(t) do if (isInArray(i, item.itemid) == true) and (S >= cfg.soul) and (L >= cfg.level) then local info = {fromId = k.NFTree, toId = item.itemid, pos = topos} addEvent(function() local i = getTileItemById(info.pos, info.fromId).uid if i > 0 then doTransformItem(i, info.toId) end end, cfg.time * 1000) doTransformItem(item.uid, k.NFTree) doPlayerAddItem(cid, k.fruit, math.random(1, 10)) doPlayerAddSoul(cid, -cfg.soul) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got some "..k.fName..".") elseif (S < cfg.soul) then doPlayerSendCancel(cid, "You do not have soul to harvest the plant.") elseif (L < cfg.level) then doPLayerSendCancel(cid, "You are not in the requiered level to harvest.") end end return true end
  19. local cfg = { soul = 0, time = 3600, level = 1 } local t = { [{11419}] = {fruit = 2675, NFTree = 4008, fName = "Orange"}, [{5094}] = {fruit = 2676, NFTree = 5092, fName = "Banana"}, [{5096}] = {fruit = 2678, NFTree = 2726, fName = "Coconut"}, [{5157}] = {fruit = 5097, NFTree = 5156, fName = "Mango"} } function onUse(cid, item, frompos, item2, topos) local S = getPlayerSoul(cid) local L = getPlayerLevel(cid) for i, k in pairs(t) do if (isInArray(i, item.itemid) == true) and (S >= cfg.soul) and (L >= cfg.level) then addEvent(function() local i = getTileItemById(k.NFTree, topos).uid if i > 0 then doTransformItem(i, item.itemid) end end, cfg.time * 1000) doTransformItem(item.uid, k.NFTree) doPlayerAddItem(cid, k.fruit, math.random(1, 10)) doPlayerAddSoul(cid, -cfg.soul) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got some "..k.fName..".") elseif (S < cfg.soul) then doPlayerSendCancel(cid, "You do not have soul to harvest the plant.") elseif (L < cfg.level) then doPLayerSendCancel(cid, "You are not in the requiered level to harvest.") end end return true end
  20. zipter98 postou uma resposta no tópico em Suporte Tibia OTServer
    local items = {{itemid, count}, {itemid, count}, {itemid, count}, ...} --{{ID_do_item, quantia_requerida}, {ID_do_item, quantia_requerida}, ...} function onSay(cid) local str = "" for _, item in pairs(items) do if str == "" then str = getItemInfo(item[1]).name.." - ["..getPlayerItemCount(cid, item[1]).."/"..item[2].."]" else str = str.."\n"..getItemInfo(item[1]).name.." - ["..getPlayerItemCount(cid, item[1]).."/"..item[2].."]" end end doPlayerPopupFYI(cid, "You have:\n"..str) return true end
  21. <?xml version="1.0" encoding="UTF-8"?> <mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes"> <config name="firstitems_config"><![CDATA[ config = { storage = 30001, items = {1988, 1987, 2382, 2120, 2580, 2550, 7385, 2395, 0} -- 7385 (pokeinfo) -- 2395 (portfoil) ok -- 2382 (pokedex) ok -- 0 (coin case) ok -- 2550 (order) ok -- 1987 (bag) ok -- 1988 (badge case) ok -- 2120 (rope) ok -- 2580 (fishing rod) ok } ]]></config> <event type="login" name="FirstItems" event="script"><![CDATA[ domodlib('firstitems_config') function onLogin(cid) if getPlayerStorageValue(cid, config.storage) > -1 then return true end if getCreatureName(cid) == "Account Manager" then doSetCreatureOutfit(cid, {lookType="511"}, 1) return true end setPlayerStorageValue(cid, config.storage, 1) if getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid > 0 then local bag = getPlayerItemById(cid, false, 1987).uid doAddContainerItem(bag, 12344, 30) doAddContainerItem(bag, 2392, 35) doAddContainerItem(bag, 2160, 1) doAddContainerItem(bag, 12245, 1) doAddContainerItem(bag, 27669, 1) doAddContainerItem(bag, 27670, 1) return true end for _, id in ipairs(config.items) do doPlayerAddItem(cid, id, 1) end local bag = getPlayerItemById(cid, false, 1988).uid doAddContainerItem(bag, 12267, 1) doAddContainerItem(bag, 12266, 1) doAddContainerItem(bag, 12264, 1) doAddContainerItem(bag, 12265, 1) doAddContainerItem(bag, 12263, 1) doAddContainerItem(bag, 12262, 1) doAddContainerItem(bag, 12261, 1) doAddContainerItem(bag, 12260, 1) return true end ]]></event> </mod>
  22. if getThingPos(cid).x == pos.x and getThingPos(cid).y == pos.y and getThingPos(cid).z == pos.z then
  23. function onSay(cid) local str = "" for i = 0, getPlayerInstantSpellCount(cid) - 1 do local spell = getPlayerInstantSpellInfo(cid, i) if str == "" then str = spell.name..":\nLevel: "..spell.level.."\nMl: "..spell.mlevel.."\nMana: "..spell.mana else str = str.."\n"..spell.name..":\nLevel: "..spell.level.."\nMl: "..spell.mlevel.."\nMana: "..spell.mana end end if str ~= "" then doShowTextDialog(cid, 7528, str) end return true end
  24. OK, código alterado.
  25. Hm, troquei uma função. Teste a nova versão do código, se possível.

Informação Importante

Confirmação de Termo