Ir para conteúdo

zipter98

Membro
  • Registro em

  • Última visita

Tudo que zipter98 postou

  1. O NPC que garantiria acesso a esta outra área é o mesmo? E o NPC que venderia este outro item é o mesmo? Se preferir, você pode criar outros arquivos com o mesmo código, alterando apenas as configurações e mensagens. A alteração no look, eu mesmo faço.
  2. Código para PDA (que suponho ser a base do servidor Pyros): local config = { count = 100, --Número mínimo de jogadores online para ter double experience. rate = 2, --Rate de EXP. storage = 4091, } function onLogin(cid) if getGlobalStorageValue(config.storage) < 1 and getCreatureName(cid) ~= "Account Manager" then if #getPlayersOnline() >= config.count then broadcastMessage(config.count.." jogadores online! Double experience ativada!") setGlobalStorageValue(config.storage, config.rate) end end return true end function onLogout(cid) if getGlobalStorageValue(config.storage) > -1 and getCreatureName(cid) ~= "Account Manager" then if #getPlayersOnline() - 1 < config.count then broadcastMessage("A double experience foi desativada. :/") setGlobalStorageValue(config.storage, -1) end end return true end Em data/creaturescripts/scripts, no arquivo pokeexp.lua: Abaixo de: local expTotal = math.floor(playerExperienceRate * givenexp * getDamageMapPercent(pk, cid)) adicione: if getGlobalStorageValue(4091) > -1 then expTotal = math.floor(expTotal * getGlobalStorageValue(4091)) end
  3. Ops. Código corrigido.
  4. Na verdade, se o loop fosse quebrado neste momento, o summon seria sempre o mesmo. Supondo que o level do jogador fosse 57, na primeira instância da iteração summon assumiria o valor de Rat. Apenas na segunda o break seria viável. Visto que não há como saber quando seu uso será ou não viável, o recomendado é não usá-lo (neste caso, claro).
  5. Se não se importa, escrevi uma versão deste script mais simplificada e de melhor manipulação. PS: Resolvi postá-la apenas para demonstrar uma outra maneira de escrever o mesmo código, não para remover os créditos do Stinger. local config = { maxSummons = 1, --Limite de summons. summons = { [25] = "Rat", --[level] = "summon", [50] = "Dragon", [75] = "Dragon Lord", [100] = "Demon", }, } function onCastSpell(cid) if #getCreatureSummons(cid) < config.maxSummons then local summon for level, summonName in pairs(config.summons) do if getPlayerLevel(cid) >= level then summon = summonName end end if summon then doConvinceCreature(cid, doSummonCreature(summon, getThingPos(cid))) doCreatureSay(getCreatureSummons(cid)[#getCreatureSummons(cid)], "Cheguei", TALKTYPE_ORANGE_1) end else doSendMagicEffect(getThingPos(cid), 12) doPlayerSendTextMessage(cid, 19, "Voce so pode invocar "..config.maxSummons.." summons.") end return true end
  6. Falta de atenção minha. Código corrigido. Agora vai funcionar perfeitamente.
  7. Depende. Seriam items diferentes para o mesmo propósito? Digo, os items teriam a mesma função de garantir acesso a Saffari Zone?
  8. local config, buyPoke = { diamondId = xxx, --ID do diamond. pokemons = { ["pokemon_name"] = price, --["nome_do_pokémon"] = preço, ["pokemon_name"] = price, --["nome_do_pokémon"] = preço, ["pokemon_name"] = price, --["nome_do_pokémon"] = preço, }, }, "" 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) if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg:lower(), "buy") or msgcontains(msg:lower(), "trade") then local str = "" for poke, price in pairs(config.pokemons) do if str == "" then str = poke.." - "..price.." diamonds" else str = str.."\n"..poke.." - "..price.." diamonds" end end selfSay("Hello, I sell this pokemons. Wanna buy any of them?", cid) doPlayerPopupFYI(cid, "Selling:\n"..str) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "yes") then if talkState[talkUser] == 1 then selfSay("Tell me the name, please.", cid) talkState[talkUser] = 2 return true elseif talkState[talkUser] == 3 then if buyPoke ~= "" then local price = config.pokemons[buyPoke] if doPlayerRemoveItem(cid, config.diamondId, price) then selfSay("Here's your "..buyPoke.."!", cid) addPokeToPlayer(cid, buyPoke, 0, 1, "normal", true) talkState[talkUser] = 0 return true else selfSay("You do not have "..price.." diamonds.", cid) talkState[talkUser] = 0 return true end end end elseif config.pokemons[msg] and talkState[talkUser] == 2 then selfSay("You really wanna buy a "..msg.."? It will cost you "..config.pokemons[msg].." diamonds.", cid) buyPoke = msg talkState[talkUser] = 3 return true elseif msgcontains(msg:lower(), "no") then selfSay("Then bye.", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  9. Desculpe, esqueci do seu pedido. Logo escreverei o código e enviarei aqui.
  10. Não, apenas uma vocação por tabela. Ex.: [1] = {itemid, itemid, itemid, ...}, --[vocation_id] = {items}, [5] = {itemid, itemid, itemid, ...}, --[vocation_id] = {items}, [2] = {itemid, itemid, itemid, ...}, --[vocation_id] = {items}, [6] = {itemid, itemid, itemid, ...}, --[vocation_id] = {items}, [3] = {itemid, itemid, itemid, ...}, --[vocation_id] = {items}, [7] = {itemid, itemid, itemid, ...}, --[vocation_id] = {items}, [4] = {itemid, itemid, itemid, ...}, --[vocation_id] = {items}, [8] = {itemid, itemid, itemid, ...}, --[vocation_id] = {items},
  11. zipter98 postou uma resposta no tópico em Playground (Off-topic)
    *risos*
  12. Qual base você está usando?
  13. function executeClean(interval) doCleanMap() doBroadcastMessage("Game map cleaned, next clean in " .. table.concat(string.timediff(interval / 1000)) .. ".") return true end function onTime() doBroadcastMessage("Game map cleaning within 30 seconds, please pick up your items!") addEvent(executeClean, 240000, interval) return true end Tags: <globalevent name="Clean1" time="6:00" event="script" value="nome_do_arquivo.lua"/> <globalevent name="Clean2" time="12:00" event="script" value="nome_do_arquivo.lua"/> <globalevent name="Clean3" time="16:00" event="script" value="nome_do_arquivo.lua"/> <globalevent name="Clean4" time="23:00" event="script" value="nome_do_arquivo.lua"/>
  14. De nada. Quando o pedido é resolvido (ou a dúvida sanada), é recomendado que você selecione como "Melhor Resposta" aquela que lhe mais ajudou. Assim, o tópico fica destacado com o prefixo "Resolvido".
  15. Tipo assim? local config = { time = 60, --Intervalo de tempo, em segundos. storage = 11000, --Key/storage. } function changeStorage(cid, storage) if isPlayer(cid) then local addValue = isPremium(cid) and 3 or 1 setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) < 1 and addValue or getPlayerStorageValue(cid, storage) + addValue) addEvent(changeStorage, config.time * 1000, cid, storage) end end function onLogin(cid) changeStorage(cid, config.storage) return true end
  16. Saberia dizer qual base você está utilizando? Porque, por exemplo, o sistema de experiência do PDA é um pouco diferente. Assim, o código de double experience deveria ser escrito de outra forma.
  17. Pronto, código corrigido (NPC que vende o Saffari Card). Suponho que agora não hajam mais erros.
  18. Ops, escrevi o código correndo e nem reparei neste erro. Script corrigido (NPC que vende o Saffari Card).
  19. Por acaso você está usando o código em um servidor de Tibia ou algum derivado? Se possível, especifique a base.
  20. Pensarei em outra maneira de fazer o script, e, quando possível, o atualizarei.
  21. A tag do globalevent é a mesma que enviei anteriormente. Já do creaturescript: <event type="login" name="SalaryLogin" event="script" value="nome_do_arquivo.lua"/> E não, não tenho nenhum ot. E agradeço pelo elogio.
  22. Globalevent: local config = { tutorId = 3, --Group ID do tutor. day = "1", --Dia do mês que receberá o salário. diamond = {itemid, count}, --{ID_do_diamond, quantidade}, } function onTime() if os.date("%d") == config.day then local tutors = db.getResult("SELECT name, id, online FROM players WHERE group_id = "..config.tutorId) if tutors:getID() ~= -1 then repeat if tutors:getDataInt("online") > 0 then local player = getPlayerByName(tutors:getDataString("name")) doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "You received "..config.diamond[2].." diamonds.") doPlayerAddItem(cid, config.diamond[1], config.diamond[2]) else db.executeQuery("UPDATE player_storage SET value = 1 WHERE key = 9561 AND player_id = "..tutors:getDataInt("id")) end until not tutors:next() tutors:free() end end return true end Creaturescript: local diamond = {itemid, count} --{ID_do_diamond, quantidade} function onLogin(cid) if getPlayerStorageValue(cid, 9561) > -1 then doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "You received "..diamond[2].." diamonds.") doPlayerAddItem(cid, diamond[1], diamond[2]) setPlayerStorageValue(cid, 9561, -1) end return true end
  23. Sim. Quando eu desocupar, farei os códigos para você.

Informação Importante

Confirmação de Termo