Ir para conteúdo

zipter98

Herói
  • Total de itens

    2553
  • Registro em

  • Última visita

  • Dias Ganhos

    73

Tudo que zipter98 postou

  1. zipter98

    Npc Outfit

    Você simplesmente copiou o script e colou? Testei aqui, e tá funcionando perfeitamente. 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 local cfg = { qnt = 5, --Quantidade de diamonds necessários. diamond_id = 2145, } if(msgcontains(msg, 'diamond')) then selfSay("Olá, eu vendo outfits por diamonds. Você gostaria de comprar uma Assasin outfit, por uma quantia de "..cfg.qnt.." "..getItemNameById(cfg.diamond_id)..".", cid) talkState[talkUser] = 1 return true elseif(msgcontains(msg, 'yes')) and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, 158790) < 1 then if getPlayerItemCount(cid, cfg.diamond_id) >= cfg.qnt then selfSay('Sua roupa esta pronta, pode vestir!', cid) setPlayerStorageValue(cid, 158790,1) doPlayerRemoveItem(cid, cfg.diamond_id, cfg.qnt) talkState[talkUser] = 0 return true else selfSay("Você não tem "..cfg.qnt.." "..getItemNameById(cfg.diamond_id).."...", cid) talkState[talkUser] = 0 return true end else selfSay("Você já tem essa roupa.", cid) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  2. É como comentaram. Basta colocar chaves entre a(s) palavra(s) desejadas. Porém, só funcionará (este caso que vou mencionar, é no arquivo .lua), se a mensagem do NPC estiver configurada pra mandar pro player, no canal NPCs. Como você mencionou que as frases vem em amarelo, suponho que esteja assim nas falas: selfSay("mensagem"). Mude para selfSay("mensagem", cid). Um exemplo: selfSay("Olá, {tudo} bem?", cid). A mensagem será enviada ao jogador no canal NPCs (em azul), sendo que a palavra tudo estará num tom mais forte de azul.
  3. Ops, foi erro meu mesmo. function onUse(cid, item, frompos, item2, topos) local config = { pz = "yes", -- players precisam estar em protection zone para usar? ("yes" or "no"). battle = "yes", -- players deve estar sem battle ("yes" or "no") pos = {x=1053, y=1049, z=7}, tempo = 10, } if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE end if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.") return TRUE end if item.itemid == 5957 then if getPlayerStorageValue(cid, 102911) > os.time() then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 102911) - os.time().." segundo(s) para teleportar novamente.") end doPlayerSendTextMessage(cid,25,"Você foi teleportado para o CP de Saffron!") doPlayerRemoveItem(cid, 13691, 1) doTeleportThing(cid,config.pos) doSendMagicEffect(getCreaturePosition(cid), 6) setPlayerStorageValue(cid, 102911, os.time() + config.tempo * 60 * 1000) end return 1 end Ou function onUse(cid, item, frompos, item2, topos) local config = { pz = "yes", -- players precisam estar em protection zone para usar? ("yes" or "no"). battle = "yes", -- players deve estar sem battle ("yes" or "no") pos = {x=1053, y=1049, z=7}, tempo = 10, } if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE end if getPlayerStorageValue(cid, 102911) > os.time() then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 102911) - os.time().." segundo(s) para teleportar novamente.") end if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.") return TRUE end if item.itemid == 5957 then doPlayerSendTextMessage(cid,25,"Você foi teleportado para o CP de Saffron!") doPlayerRemoveItem(cid, 13691, 1) doTeleportThing(cid,config.pos) doSendMagicEffect(getCreaturePosition(cid), 6) setPlayerStorageValue(cid, 102911, os.time() + config.tempo * 60 * 1000) end return 1 end O sendcancel vai aparecer em segundos, não se assuste com o número que aparecerá.
  4. Como assim? Você quer mudar a cor das falas dos NPCs, pra qualquer uma desejada? Ou que seja tipo um whisper, como na print?
  5. Força do hábito colocar cfg, desculpe. function onUse(cid, item, frompos, item2, topos) local config = { pz = "yes", -- players precisam estar em protection zone para usar? ("yes" or "no"). battle = "yes", -- players deve estar sem battle ("yes" or "no") pos = {x=1053, y=1049, z=7}, tempo = 10, } if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE end if getPlayerStorageValue(cid, 102911) > os.time() then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 102911) - os.time().." segundo(s) para teleportar novamente.") end if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.") return TRUE end if item.itemid == 5957 then doPlayerSendTextMessage(cid,25,"Você foi teleportado para o CP de Saffron!") doPlayerRemoveItem(cid, 13691, 1) doTeleportThing(cid,config.pos) doSendMagicEffect(getCreaturePosition(cid), 6) setPlayerStorageValue(cid, 102911, config.tempo * 60 * 1000) end return 1 end Ou function onUse(cid, item, frompos, item2, topos) local config = { pz = "yes", -- players precisam estar em protection zone para usar? ("yes" or "no"). battle = "yes", -- players deve estar sem battle ("yes" or "no") pos = {x=1053, y=1049, z=7}, tempo = 10, } if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE end if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.") return TRUE end if item.itemid == 5957 then if getPlayerStorageValue(cid, 102911) > os.time() then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 102911) - os.time().." segundo(s) para teleportar novamente.") end doPlayerSendTextMessage(cid,25,"Você foi teleportado para o CP de Saffron!") doPlayerRemoveItem(cid, 13691, 1) doTeleportThing(cid,config.pos) doSendMagicEffect(getCreaturePosition(cid), 6) setPlayerStorageValue(cid, 102911, config.tempo * 60 * 1000) end return 1 end
  6. Tenta: function onUse(cid, item, frompos, item2, topos) local config = { pz = "yes", -- players precisam estar em protection zone para usar? ("yes" or "no"). battle = "yes", -- players deve estar sem battle ("yes" or "no") pos = {x=1053, y=1049, z=7}, tempo = 10, } if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE end if getPlayerStorageValue(cid, 102911) > os.time() then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 102911) - os.time().." segundo(s) para teleportar novamente.") end if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.") return TRUE end if item.itemid == 5957 then doPlayerSendTextMessage(cid,25,"Você foi teleportado para o CP de Saffron!") doPlayerRemoveItem(cid, 13691, 1) doTeleportThing(cid,config.pos) doSendMagicEffect(getCreaturePosition(cid), 6) setPlayerStorageValue(cid, 102911, cfg.tempo * 60 * 1000) end return 1 end Ou function onUse(cid, item, frompos, item2, topos) local config = { pz = "yes", -- players precisam estar em protection zone para usar? ("yes" or "no"). battle = "yes", -- players deve estar sem battle ("yes" or "no") pos = {x=1053, y=1049, z=7}, tempo = 10, } if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE end if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.") return TRUE end if item.itemid == 5957 then if getPlayerStorageValue(cid, 102911) > os.time() then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 102911) - os.time().." segundo(s) para teleportar novamente.") end doPlayerSendTextMessage(cid,25,"Você foi teleportado para o CP de Saffron!") doPlayerRemoveItem(cid, 13691, 1) doTeleportThing(cid,config.pos) doSendMagicEffect(getCreaturePosition(cid), 6) setPlayerStorageValue(cid, 102911, cfg.tempo * 60 * 1000) end return 1 end
  7. local config = { pz = "yes", -- players precisam estar em protection zone para usar? ("yes" or "no"). battle = "yes", -- players deve estar sem battle ("yes" or "no") pos = {x=1053, y=1049, z=7}, tempo = 10, -- tempo em minutos de exhaust strg = 50030, -- storage que salva o tempo (não precisa mexer) } function onUse(cid, item, frompos, item2, topos) if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa estar em protection zone pra poder teleportar.") return TRUE end if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce precisa estar sem battle pra poder teleportar.") return TRUE end if exhaustion.check(cid, strg) then doPlayerSendCancel(cid, "Voce precisa aguardar "..exhaustion.get(cid, strg).." segundos para usar novamente este item.") return TRUE end if item.itemid == 5957 then doPlayerSendTextMessage(cid,25,"Voce foi teleportado para o CP de Saffron!") doPlayerRemoveItem(cid, 13691, 1) doTeleportThing(cid,config.pos) doSendMagicEffect(getCreaturePosition(cid), 6) exhaustion.set(cid, config.strg, config.tempo * 60) end return 1 end
  8. zipter98

    Npc Outfit

    Se o script do GuhPk não funcionar, tente esse: 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 local cfg = { qnt = xxx, --Quantidade de diamonds necessários. diamond_id = 2145, } if(msgcontains(msg, 'diamond')) then selfSay("Olá, eu vendo outfits por diamonds. Você gostaria de comprar uma Assasin outfit? Custo:"..cfg.qnt.." "..getItemNameById(cfg.diamond_id)..".", cid) talkState[talkUser] = 1 return true elseif(msgcontains(msg, 'yes')) and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, 158790) < 1 then if getPlayerItemCount(cid, cfg.diamond_id) >= cfg.qnt then selfSay('Sua roupa esta pronta, pode vestir!', cid) setPlayerStorageValue(cid, 158790,1) doPlayerRemoveItem(cid, cfg.diamond_id, cfg.qnt) talkState[talkUser] = 0 return true else selfSay("Você não tem "..cfg.qnt.." "..getItemNameById(cfg.diamond_id).."...", cid) talkState[talkUser] = 0 return true end else selfSay("Você já tem essa roupa.", cid)) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  9. Poderia postar seu goback.lua, localizado na pasta actions do seu servidor?
  10. zipter98

    VIP Tile

    Tenta dessa maneira, data/movements/scripts, crie um arquivo com extensão .lua, nomeie-o viptile, e coloque neste o seguinte conteúdo: function onStepIn(cid, item, position, fromPosition) local to_no = {x = 1000, y = 1000, z = 7} local to_yes = {x = xxx, y = yyy, z = zzz} --Para onde será teleportado na área VIP. local timenow = os.time() local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60)) if quantity > 0 then doPlayerSendTextMessage(cid, 27, "Bem vindo à área VIP!") doTeleportThing(cid, to_yes) else doPlayerSendCancel(cid, "Você não é VIP...") doTeleportThing(cid, to_no) end return true end Agora, em data/movements, abra o arquivo movements.xml, e coloque a seguinte tag: <movevent type="StepIn" actionid="401921" event="script" value="viptile.lua"/> Depois, basta configurar no seu map editor o tile desejado com o actionid configurado na tag. (não se esqueça de verificar se esse actionid já está em uso no seu servidor; caso já esteja, basta colocar, então, um outro actionid na tag.)
  11. zipter98

    VIP Tile

    Qual seu vip system?
  12. data/talkactions/scripts, crie um arquivo .lua, com o nome clan, e coloque neste o seguinte conteúdo: data/talkactions, talkactions.xml <talkaction log="yes" words="!entrarclan;!rankclan;!trocarclan" event="script" value="clan.lua"/> Testado em PDA by Slicer, v1.9.
  13. Configurou no pokemon moves.lua?
  14. Se estiver usando PDA, data/monster/pokes/Shiny, abra o arquivo .xml do pokémon desejado. Tomando como exemplo o Scyther, você verá algo assim, logo na segunda linha: <monster name="Scyther" Mude para <monster name="Shiny Scyther"
  15. Tenta assim: function getSkillAttribute(cid, attribute) local a = {1, 4, 7, 8, 9, 5, 6} local final = {} for b = 1, #a do if getPlayerSlotItem(cid, a[b]).uid > 0 then table.insert(final, a[b]) end end local total = 0 for c = 1, #final do if getItemAttribute(getPlayerSlotItem(cid, final[c]).uid, attribute) then total = total + getItemAttribute(getPlayerSlotItem(cid, final[c]).uid, attribute) end end return total end
  16. Qual servidor base você usa? E pode postar seu exp2.0?
  17. Opa, obrigado (:
  18. Isso já é outro caso '-' Pra esse teleport, é só mudar o quê eu mudei no catch.lua. (o string.find próximo ao doRemoveItem) e.e
  19. Na hora tinha até esquecido dessa possibilidade. Obrigado por lembrar xd
  20. O que tem adicionar uma ball nova? '-' Eu só peguei o seu script ali, e adicionei o teleport. Acho que não removi nada importante e.e
  21. Tenta assim:
  22. Olá, Esse script não é nada complexo, mas, como a maioria dos que vejo sobre Shiny Stone é necessário fazer tabelas para definir os pokémons que irão evoluir e talz, achei melhor fazer este aqui, que é mais simples. As configurações já estão indicadas no script. Ah, pra quem não sabe, Shiny Stone transforma o pokémon na sua versão shiny. Vá em data/actions/scripts, crie um arquivo com extensão .lua, nomeie-o shinystone, e adicione o seguinte conteúdo: Agora, em data/actions, abra actions.xml, e adicione a tag: <action itemid="id da shiny stone" event="script" value="shinystone.lua" allowfaruse="1"/> Só isso, qualquer erro, só postar. Testei aqui, e está funcionando perfeitamente. Testado em PDA by Slicer sem level, v1.9. Ah, só mais uma complementação: só está evoluindo pokémons que sua versão shiny tenha "Shiny " antes do nome. Por exemplo, "Shiny Electabuzz". Se em seu server os shinies não tiverem o prefixo "Shiny", obviamente, o pokémon não irá evoluir.
  23. Pode postar seu catch.lua? data/actions/scripts.
  24. Caso seu servidor possua as funções utilizadas na proteção, basta adicionar isso em seu catch.lua, data/actions/scripts. if string.find(getItemNameById(item2.itemid), "articuno") then return doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end Com essa proteção, o player será teleportado para o templo, e só. Não irá conseguir tacar ball. É isso que você quer?
  25. Se você tiver mencionado sobre, quando achar/capturar um shiny, venha, por exemplo, Shiny Electabuzz, e não Electabuzz, basta ir no arquivo .xml do pokémon na pasta data/monster/pokes/Shiny, e onde você encontrar, tomando como exemplo o arquivo do Shiny Electabuzz, <monster name="Electabuzz" você muda pra <monster name="Shiny Electabuzz"
  • Quem Está Navegando   0 membros estão online

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