Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    73

Tudo que zipter98 postou

  1. Uma opção é a seguinte: Abaixo de: function creatureSayCallback(cid, type, msg) coloque: msg = msg:lower() Assim, a mensagem do jogador será passada para letras minúsculas. Exemplo: "Carlin" seria interpretado como "carlin".
  2. Como não encontrei ligação alguma entre seu tópico e o universo tibiano, movi para o Bar. Se eu tiver entendido o assunto erroneamente, por favor, me avise.
  3. Letras maiúsculas e minúsculas fazem diferença neste caso. Logo, se for configurado "carlin" e você digitar "Carlin" o NPC lhe responderá que a opção não está disponível. Levando isso em consideração, você provavelmente está enviando uma mensagem que não foi configurada na tabela destinations.
  4. local config = { effect = xxx, --Efeito. price = xxx, --Preço para viajar. destinations = { --["message"] = toPos, --Ex.: ["carlin"] = {x = xxx, y = yyy, z = zzz}, ["yalahar"] = {x = x, y = y, z = z}, } } 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) msg = msg:lower() if not npcHandler:isFocused(cid) then return false elseif not config.destinations[msg] then return selfSay("This option isn't available.", cid) elseif getPlayerMoney(cid) < config.price then return selfSay("You do not have enough money.", cid) end doPlayerRemoveMoney(cid, config.price) doTeleportThing(cid, config.destinations[msg]) doSendMagicEffect(getThingPos(cid), config.effect) return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  5. Troque: setPlayerStorageValue(pid, STAFF_VAULT, (getPlayerStorageValue(pid, STAFF_VAULT) < 0 and 0 or getPlayerStorageValue(pid, STAFF_VAULT)) + money) por: setPlayerStorageValue(pid, STAFF_VAULT, money) E troque: func("UPDATE player_storage SET value = value + "..money.." WHERE player_id = "..query:getDataInt("id").." AND key = "..STAFF_VAULT) por: func("UPDATE player_storage SET value = "..money.." WHERE player_id = "..query:getDataInt("id").." AND key = "..STAFF_VAULT)
  6. @Uddy Na verdade, os concursos oficiais ainda não aconteceram.
  7. Código corrigido (primeira página, no meu comentário contendo o sistema). Não entendi muito bem seu pedido. Você quer que ambas as storages sejam resetadas no início do mês?
  8. local effect = xxx --Efeito. function onStepIn(cid) if not isPlayer(cid) then return true end doSendMagicEffect(getThingPos(cid), effect) return true end
  9. Ah, eu tinha entendido errado a explicação da spell. Falha minha, desculpe. Use este código: local times = 3 --Quantos SQMs o jogador irá se mover. function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 2 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onCastSpell(cid) local playerPos = getThingPos(cid) local toPos = { [0] = {x = playerPos.x, y = playerPos.y - times, z = playerPos.z}, [1] = {x = playerPos.x + times, y = playerPos.y, z = playerPos.z}, [2] = {x = playerPos.x, y = playerPos.y + times, z = playerPos.z}, [3] = {x = playerPos.x - times, y = playerPos.y, z = playerPos.z} } local spellToPos = toPos[getCreatureLookDirection(cid)] if isWalkable(spellToPos) then doTeleportThing(cid, spellToPos) else doPlayerSendCancel(cid, "Sorry, destination not possible.") end return true end
  10. Tópico movido para dúvidas / pedidos resolvidos.
  11. Você deve mudar o horário da tag e em seguida recarregar (reload) os globalevents.
  12. Você relogou os personagens? De qualquer maneira, use o seguinte código e poste o que for imprimido na distro. local salary = { --[group_id] = money, } local func = db.executeQuery or db.query function onTime() if os.date("%d") == "1" then print("Script sendo executado no dia.") for group_id, money in pairs(salary) do print("*** Agora, no group id "..group_id.." ***") local query = db.getResult("SELECT id FROM players WHERE group_id = "..group_id) if query:getID() ~= -1 then print("Player(s) encontrado(s) do respectivo group id.") repeat local verify_query = db.getResult("SELECT * FROM player_storage WHERE player_id = "..query:getDataInt("id").." AND key = "..STAFF_VAULT) print("ID: "..query:getDataInt("id")..", nome: "..getPlayerNameByGUID(query:getDataInt("id"))) if verify_query:getID() ~= -1 then func("UPDATE player_storage SET value = value + "..money.." WHERE player_id = "..query:getDataInt("id").." AND key = "..STAFF_VAULT) func("UPDATE player_storage SET value = 0 WHERE player_id = "..query:getDataInt("id").." AND key = "..STAFF_VAULT_LIMITS) verify_query:free() else func("INSERT INTO player_storage VALUES ("..query:getDataInt("id")..", "..STAFF_VAULT..", "..money..")") func("INSERT INTO player_storage VALUES ("..query:getDataInt("id")..", "..STAFF_VAULT_LIMITS..", 0)") end until not query:next() query:free() end end end return true end
  13. zipter98

    Protection

    Por gentileza, poste as funções do seu sistema de resets.
  14. Makes sense. Corrigido.
  15. zipter98

    [Pedido] Border

    Tópico movido para dúvidas / pedidos resolvidos.
  16. Agradeço o interesse pelos meus serviços, mas assuntos relacionados à comercialização de produtos de OTServ são proibidos aqui no fórum. Basicamente, me limito a ajudar na área de suporte.
  17. local times = 3 --Quantos SQMs o jogador irá se mover. function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 2 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function move_creature(cid, i, direction) if not isPlayer(cid) then return true elseif i <= 0 or not isWalkable(getPosByDir(getThingPos(cid), direction)) then return doCreatureSetNoMove(cid, false) end doMoveCreature(cid, direction) addEvent(move_creature, 400, cid, i - 1, direction) --400 = intervalo de tempo entre cada movimento end function onCastSpell(cid) doCreatureSetNoMove(cid, true) move_creature(cid, times, getCreatureLookDirection(cid)) return true end
  18. local drain = xxx --Porcentagem de mana drenada/vida curada. function onCastSpell(cid, var) local mana_drain = getCreatureMana(variantToNumber(var)) * drain / 100 doCreatureAddMana(variantToNumber(var), -mana_drain) doCreatureAddHealth(cid, mana_drain) return true end
  19. O item que garante mais cargas é removido após o uso ou tem um intervalo de tempo para usá-lo novamente?
  20. zipter98

    Alguns scripts

    Não. <event type="statschange" name="nome_do_evento" event="script" value="nome_do_arquivo.lua"/>
  21. @brendoonh No seu código, o grupo 4 não receberá o pagamento mensal devido às duas travessões colocadas. Use esta tabela: local salary = { [4] = 150000000, [5] = 200000000, [6] = 250000000, } E, se possível, teste com mais de um personagem. @Farathor Simplesmente mude o "1" do globalevent pelo dia de hoje e o horário (na tag) pelo desejado. Entretanto, a database só será atualizada quando o personagem deslogar.
  22. As informações que você deu são muito vagas. Qual a base usada? Como o pokémon seria obtido?
  23. Tópico trancado a pedido do autor.
  24. Erros na compilação?
  25. Pelo fato da função não estar sendo encontrada no código Lua, significa que sua instalação não foi bem sucedida. Talvez você tenha esquecido de colocar alguma coisa em luascript.cpp/luascript.h, ou um erro tenha aparecido durante a compilação. Em luascript.cpp, além dessa parte mostrada, você também deve colocar, em logicamente outra parte do arquivo, isso: //setPokemonLevel(cid, level) lua_register(m_luaState, "setPokemonLevel", LuaScriptInterface::luaSetPokemonLevel); E em luascript.h, isso: static int32_t luaSetPokemonLevel(lua_State* L);
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...