Ir para conteúdo

FlavioHulk

Membro
  • Registro em

  • Última visita

Tudo que FlavioHulk postou

  1. FlavioHulk postou uma resposta no tópico em Suporte Tibia OTServer
    Isso é um script "onLogin", os players só receberão os itens caso eles nunca logaram no server, você terá que fazer uma função dentro do NPC script para a entrega dos itens...
  2. Então, justamente nessa linha... Ele tá vendo como erro utilizar not em uma função que puxa número... Ao certo deveria ser assimilado junto com operadores aritméticos, saca? Nesse caso só remover o not e ajustar o operador "<"
  3. local cfg = { level = 400, effect = 30, addLevel = { [1] = {id = SKILL_AXE, quant = 1}, [2] = {id = SKILL_SWORD, quant = 1}, [3] = {id = SKILL_LEVEL, quant = 1}, [4] = {id = SKILL_CLUB, quant = 1} }, storage = 344240, } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, cfg.storage) >= 1 then doPlayerSendTextMessage(cid, 23, "Voce ja usou o item.") doSendMagicEffect(getPlayerPosition(cid), cfg.effect) return true end if getPlayerLevel(cid) < cfg.level then doPlayerSendTextMessage(cid, 23, "Voce nao possui nivel.") doSendMagicEffect(getPlayerPosition(cid), cfg.effect) return true end for i = 1, #cfg.addLevel do local skill = cfg.addLevel[i] doPlayerAddSkill(cid, skill.id, skill.quant) end setPlayerStorageValue(cid, cfg.storage, 1) return true end Primeira observação: A função getPlayerLevel puxa um número, o que funciona com operadores.. Por isso está retornando tal erro... Segunda observação: Quanto ao for, é mais otimizado utilizar um loop numérico ao invés de utilizar o pairs e o ipairs...
  4. local config = { bossName = 'Horestis', bossPos = Position(32943, 32791, 12), posWall = { [1] = Position(32941, 32754, 12), [2] = Position(32942, 32754, 12), [3] = Position(32943, 32754, 12), [4] = Position(32944, 32757, 12) }, randomText = {'Waaaaaah', 'You are too afraid to destroy this object'}, exaustedSeconds = 30 } local jars = { [50006] = { storage = 324329, }, [50007] = { storage = 324330, needValue = 1, msgBreak = 'You need to break the first jar.' }, [50008] = { storage = 324331, needValue = 2, msgBreak = 'You need to break the second jar.' }, [50009] = { storage = 324332, needValue = 3, msgBreak = 'You need to break the third jar.' }, [50010] = { storage = 324333, needValue = 4, msgBreak = 'You need to break the fourth jar.' } } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local jar = jars[item.actionid] if not jar then return false end if item.itemid ~= 13500 then return false end if item.actionid ~= 50006 then if Game.getStorageValue(56530) ~= jar.needValue then player:sendCancelMessage(jar.msgBreak) return true end end if player:hasExhaustion(jar.storage) then player:sendCancelMessage('You need wait 30 minutes to use again.') return true end local chance = math.random(10) if chance ~= 1 then player:say(config.randomText[math.random(#config.randomText)], TALKTYPE_ORANGE_1) player:getPosition():sendMagicEffect(CONST_ME_POFF) player:setExhaustion(jar.storage, config.exaustedSeconds * 60) return true end item:transform(13495) Game.setStorageGlobal(56530, jar.globalValue) Game.setStorageGlobal(56530, math.max(0, Game.getStorageValue(56530)) + 1) if item.actionid == 50006 then for x = 32941, 32944 do local wall = Tile(Position(x, 32754, 12)):getItemById(3514) if wall then wall:remove() end end player:say('The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 2 minutes.', TALKTYPE_ORANGE_1) addEvent(Game.createMonster, 45 * 1000, config.bossName, config.bossPos) end if item.actionid == 50010 then addEvent(function(itemId) for x = 32941, 32944 do Game.createItem(itemId, 1, Position(x, 32754, 12)) end end, 24 * 60 * 60 * 1000, 3514) end return true end Testa aí, depois me fala se há algum bug haha
  5. Você deve ter feito algo errado, mano... o script retorna true, e não há função de transformação...
  6. Isso mesmo! sim, o tempo pra a alavanca retornar ao estado inicial... Só me diga em quanto tempo deverá retornar...
  7. local config = { centerRoom = 33219, -- Posição do SQM Central da Sala rangeX = 10, -- Distância do fim da sala no eixo X rangeY = 10, -- Distância do fim da sala no eixo Y playerPositions = { [1] = {x=33222, y=31671, z=13, stackpos=253}, [2] = {x=33223, y=31671, z=13, stackpos=253}, [3] = {x=33224, y=31671, z=13, stackpos=253}, [4] = {x=33225, y=31671, z=13, stackpos=253} }, newPositions = { [1] = {x=33219, y=31659, z=13}, [2] = {x=33220, y=31659, z=13}, [3] = {x=33221, y=31659, z=13}, [4] = {x=33222, y=31659, z=13} }, demonPositions = { [1] = {x=32224, y=31659, z=13}, [2] = {x=32223, y=31659, z=13}, [3] = {x=32221, y=31657, z=13}, [4] = {x=33219, y=31657, z=13}, [5] = {x=32222, y=31661, z=13}, [6] = {x=32320, y=31661, z=13} } requiredLevel = 100, -- Level minimo time = 10, -- Tempo em segundos } local function roomHasPlayer(centerRoom, rangeX, rangeY) local spectators spectators = getSpectators(centerRoom, rangeX, rangeY, false) return #spectators ~= 0 and true or false end local function cleanRoom(centerRoom, rangeX, rangeY) local spectators spectators = getSpectators(centerRoom, rangeX, rangeY, false) for i = 1, #spectators do local spec = spectators[i] if isMonster(spec.uid) then doRemoveCreature(spec.uid) end end end local function resetLever(pos) doTransformItem(getTileItemById(pos, 1945).uid, 1946) end function onUse(cid, item, frompos, item2, topos) if item.uid ~= 5000 then return false end if item.itemid == 1946 then local storePlayers, playerTile = {} for i = 1, #config.playerPositions do playerTile = getThingfromPos(config.playerPositions[i]) if not playerTile or not isPlayer(playerTile.uid) then doPlayerSendCancel(cid, "You need 4 players.") return true end if getPlayerStorageValue(playerTile.uid, 5000) <= 0 then doPlayerSendCancel(cid, "Someone has already done this quest.") return true end if getPlayerLevel(playerTile.uid) < config.requiredLevel then doPlayerSendCancel(cid, "All the players need to be level ".. config.requiredLevel .." or higher.") return true end storePlayers[#storePlayers + 1] = playerTile end if roomHasPlayer(config.centerRoom, config.rangeX, config.rangeY, false) then doPlayerSendCancel(cid, "A team is already inside the quest room.") return true end cleanRoom(config.centerRoom, config.rangeX, config.rangeY, false) for i = 1, #config.demonPositions do doSummonCreature("Demon", config.demonPositions[i]) end local players for i = 1, #storePlayers do players = storePlayers[i] doSendMagicEffect(config.playerPositions[i], 2) doTeleportThing(players, config.newPositions[i]) end doTransformItem(item.uid,1945) addEvent(resetLever, config.time * 1000, topos) end if item.itemid == 1945 then doPlayerSendCancel(cid, "Wait for switch to reset.") return true end return true end Testa aí, qualquer erro me informa ?
  8. por player ou geral?
  9. Tá faltando a tabela amoebaTask...
  10. Tu configurou corretamente no config.lua? Ativou o mysql no seu windows? Instalou o Xampp ou algum outro?
  11. pode ser database mal configurada, dá uma olhada!
  12. Vi que o script funciona ao logar, certo? E se ele equipar todo o equipamento enquanto estiver online?
  13. FlavioHulk postou uma resposta no tópico em Suporte Tibia OTServer
    O tipo de conta na sua database provalvemente não está setado corretamente..
  14. posta seu playerdeath.lua aqui, ele fica em creaturescripts!
  15. function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getDodgeLevel() >= DODGE.LEVEL_MAX then player:sendTextMessage(MESSAGE_STATUS_WARNING, "Você alcançou o máximo de seu DODGE Skill. \nParabéns!!!!") return true end item:remove(1) player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS) player:setDodgeLevel(math.max(0, player:getDodgeLevel()) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você aumentou sua skill de dodge para ["..player:getDodgeLevel().. "/" ..DODGE.LEVEL_MAX.. "].") return true end
  16. manda seu login.lua aqui, provavelmente você resgistrou corretamente o creaturescripts...
  17. Precisa ser criados essas condições no TFS 1.3...
  18. Não mudou não, é a mesma coisa...
  19. notepad++ eh o melhor pra essa pesquisa... Utiliza o atalho ctrl+shift+f e mostra o caminho da sua pasta...
  20. Para pow kkkk, essa grama tem em Feyrist, no tibia cliente 11 outdated... Só extrair de lá, cara!
  21. Qual server você está usando?
  22. FlavioHulk postou uma resposta no tópico em Suporte Tibia OTServer
    Isso são os scripts, cara, possivelmente não há no servidor
  23. É Xampp, Uniserver, tanto faz... O banco de dados é mysql
  24. @King Laker, utiliza a comparação numerica: for i = 1, #positions do O tempo de resposta e execução é bem mais otimizado, basta fazer os testes de time !

Informação Importante

Confirmação de Termo