Ir para conteúdo

tavarb

Membro
  • Registro em

  • Última visita

Tudo que tavarb postou

  1. @Nazo Tu é foda cara, mais uma vez me salvou!
  2. Explicação: Gostaria de um script em que o player só passe pelo tile se tiver uma "x" storage. (TESTEI ALGUNS AQUI DO SITE, MAS NÃO DERAM RESULTADO). O novo jogador nasce no circulo ROSA, e precisa falar com o NPC para receber um pokemon, logo, queria que ele só passasse pelos quadrados LARANJA caso ele já tenha pego um dos pokemons doados pelo NPC. Aqui está o script do NPC. (tenho duvida na storage que ganha após pegar os pokemons, mas creio que seja a "54842". local focus = 0 -- NÃO EDITE ISSO local talk_start = 0 -- NÃO EDITE ISSO local target = 0 -- NÃO EDITE ISSO local following = false -- NÃO EDITE ISSO local attacking = false -- NÃO EDITE ISSO local newbie = 1010101 function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) local health = 1000 local maxhealth = 1000 newbies = getPlayerStorageValue(cid,newbie) msg = string.lower(msg) newperson = getPlayerStorageValue(cid,newbie) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hello, I am Professor Carvalho. I was once a legendary pokemon trainer. Today I {help} beginner coaches and study in the laboratory of Professor Oak.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, wait your turn.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'help') and newbies <= 0 then selfSay('I have a {bulbasaur}, {charmander} and {squirtle}. I can give you one pokemon to help you make your journey, would you like?') talk_state = 1 elseif talk_state == 1 and newbies <= 0 then if msgcontains(msg, 'yes') then selfSay('Ok, so what pokemon you like?') talk_state_s = 2 elseif talk_state_s == 2 then if msgcontains(msg, 'bulbasaur') then addPokeToPlayer(cid, "Bulbasaur", 0, nil, "poke") doPlayerAddItem(cid, 2394, 16) doPlayerAddItem(cid, 2391, 4) doPlayerAddItem(cid, 2393, 1) doPlayerAddItem(cid, 12348, 1) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Bulbasaur, ") selfSay("Here is your Bulbasaur and some supplies.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'charmander') then local description = "Contains a Charmander." local poke1 = "This is Charmander's pokeball. HP = ["..health.."/"..maxhealth.."]" addPokeToPlayer(cid, "Charmander", 0, nil, "poke") doPlayerAddItem(cid, 2394, 14) doPlayerAddItem(cid, 2391, 2) doPlayerAddItem(cid, 12347, 1) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Charmander, ") selfSay("Here is your Charmander and some supplies.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'squirtle') then local description = "Contains a Squirtle." local poke1 = "This is Squirtle's pokeball. HP = ["..health.."/"..maxhealth.."]" addPokeToPlayer(cid, "Squirtle", 0, nil, "poke") doPlayerAddItem(cid, 2394, 18) doPlayerAddItem(cid, 2391, 6) doPlayerAddItem(cid, 2392, 1) doPlayerAddItem(cid, 12346, 1) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Squirtle, ") selfSay("Here is your Squirtle and some supplies.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'no') then selfSay("OK... What you want?") elseif msgcontains(msg, 'bye') then selfSay("OK! Bye...") focus = 0 talk_start = 0 else selfSay("Tell me what pokemon you like?") end elseif msgcontains(msg, 'no') then selfSay("OK... What you want?") talk_state = 0 elseif msgcontains(msg, 'bye') then selfSay("OK! Bye...") focus = 0 talk_start = 0 end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 2 then selfSay('Good bye!') focus = 0 talk_start = 0 end end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Bye...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) >= 2 then selfSay('Good bye then.') focus = 0 end end end Script de npc adaptada pelo @Nazo.
  3. @Nazo Funcionando perfeitamente! Agradeço.
  4. Perfeito, @Nazo , tem como adaptar para colocar uma quantidade mínima de 7 diamonds? Mas mantendo o sistema de (onde cada diamond é um dia premmy).
  5. @Nazo Filé hein, no caso a quantidade de diamonds que tiver será trocável por dias premium né isso? exemplo: o jogador tem 6 diamonds, serão 6 dias premium?
  6. @marcot @Danxi tá funcionando? posso aplicar no meu servidor? TFS 0.3.6 local config = { storageID = 14586, tradeCenter = {pos = {x = 224, y = 307, z = 7}}, cpActionID = {23000, 23001, 23002, 23003, 23004, 23005, 23006, 23007, 23008, 23009}, tcActionID = 22334, } local cities = { pewter = {id = 1, pos = {x = 396, y = 1746, z = 9, stackpos=253}}, cerulean = {id = 2, pos = {x = 396, y = 1746, z = 9, stackpos=253}}, viridian = {id = 3, pos = {x = 396, y = 1746, z = 9, stackpos=253}}, celadon = {id = 4, pos = {x = 396, y = 1746, z = 9, stackpos=253}}, saffron = {id = 5, pos = {x = 396, y = 1746, z = 9, stackpos=253}}, lavender = {id = 6, pos = {x = 396, y = 1746, z = 9, stackpos=253}}, vermilion = {id = 7, pos = {x = 396, y = 1746, z = 9, stackpos=253}}, cinnabar = {id = 8, pos = {x = 396, y = 1746, z = 9, stackpos=253}}, fuchsia = {id = 9, pos = {x = 396, y = 1746, z = 9, stackpos=253}}, } function onStepIn(cid, item, pos) if isSummon(cid) then return false end teleportTo = config.tradeCenter.pos if isInArray (config.cpActionID, item.actionid) then if item.actionid == config.cpActionID[1] then setPlayerStorageValue(cid, config.storageID, cities.pewter.id) elseif item.actionid == config.cpActionID[2] then setPlayerStorageValue(cid, config.storageID, cities.cerulean.id) elseif item.actionid == config.cpActionID[3] then setPlayerStorageValue(cid, config.storageID, cities.viridian.id) elseif item.actionid == config.cpActionID[4] then setPlayerStorageValue(cid, config.storageID, cities.celadon.id) elseif item.actionid == config.cpActionID[5] then setPlayerStorageValue(cid, config.storageID, cities.saffron.id) elseif item.actionid == config.cpActionID[6] then setPlayerStorageValue(cid, config.storageID, cities.lavender.id) elseif item.actionid == config.cpActionID[7] then setPlayerStorageValue(cid, config.storageID, cities.vermilion.id) elseif item.actionid == config.cpActionID[8] then setPlayerStorageValue(cid, config.storageID, cities.cinnabar.id) elseif item.actionid == config.cpActionID[9] then setPlayerStorageValue(cid, config.storageID, cities.fuchsia.id) end elseif item.actionid == config.tcActionID then playerStatus = getPlayerStorageValue(cid, config.storageID) if playerStatus == cities.pewter.id then teleportTo = cities.pewter.pos elseif playerStatus == cities.cerulean.id then teleportTo = cities.cerulean.pos elseif playerStatus == cities.viridian.id then teleportTo = cities.viridian.pos elseif playerStatus == cities.celadon.id then teleportTo = cities.celadon.pos elseif playerStatus == cities.saffron.id then teleportTo = cities.saffron.pos elseif playerStatus == cities.lavender.id then teleportTo = cities.lavender.pos elseif playerStatus == cities.vermilion.id then teleportTo = cities.vermilion.pos elseif playerStatus == cities.cinnabar.id then teleportTo = cities.cinnabar.pos elseif playerStatus == cities.fuchsia.id then teleportTo = cities.fuchsia.pos else teleportTo = cities.cerulean.pos end end if #getCreatureSummons(cid) >= 1 then for i = 1, #getCreatureSummons(cid) do doTeleportThing(getCreatureSummons(cid), teleportTo, false) end end doTeleportThing(cid, teleportTo, false) return true end
  7. Problema: O NPC não consegue criar o pokémon na pokebola (ele coloca a descrição "Charmander/Squirtle/Bulbasaur"(dependendo da escolha) Como está: Ele responde o chat, entrega os devidos itens, mas não é possível colocar a pokebola na hand correta. LARANJA: POKEBOLA LOOK E POKEBOLA. VERMELHO: NÃO É POSSÍVEL COLOCAR NA MÃO. Como preciso: Preciso que o pokemon saia da pokebola certinho. .LUA: local focus = 0 -- NÃO EDITE ISSO local talk_start = 0 -- NÃO EDITE ISSO local target = 0 -- NÃO EDITE ISSO local following = false -- NÃO EDITE ISSO local attacking = false -- NÃO EDITE ISSO local newbie = 1010101 function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) local health = 1000 local maxhealth = 1000 newbies = getPlayerStorageValue(cid,newbie) msg = string.lower(msg) newperson = getPlayerStorageValue(cid,newbie) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hello, I am professor Hoa. I was once a legendary pokemon trainer, now I have switched to studies in the laboratory of Professor Oak.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, wait your turn.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'help') and newbies <= 0 then selfSay('I have a charmander, squirtle anh bulbasaur. I can give you one pokemon to help you make your journey, would you like?') talk_state = 1 elseif talk_state == 1 and newbies <= 0 then if msgcontains(msg, 'yes') then selfSay('Ok, so what pokemon you like?') talk_state_s = 2 elseif talk_state_s == 2 then if msgcontains(msg, 'bulbasaur') then local description = "Contains a Bulbasaur." local poke1 = "This is Bulbasaur's pokeball. HP = ["..health.."/"..maxhealth.."]" item = doCreateItemEx(2219) doItemSetAttribute(item, "poke", poke1) doItemSetAttribute(item, "nome", "Bulbasaur") doItemSetAttribute(item, "description", description) doPlayerAddItemEx(cid, item, true) doTransformItem(item, 15679) doPlayerAddItem(cid, 2394, 16) doPlayerAddItem(cid, 2391, 4) doPlayerAddItem(cid, 2393, 1) doPlayerAddItem(cid, 12348, 1) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Bulbasaur, ") selfSay("Here is your Bulbasaur and some supplies.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'charmander') then local description = "Contains a Charmander." local poke1 = "This is Charmander's pokeball. HP = ["..health.."/"..maxhealth.."]" item = doCreateItemEx(2219) doItemSetAttribute(item, "poke", poke1) doItemSetAttribute(item, "nome", "Charmander") doItemSetAttribute(item, "description", description) doPlayerAddItemEx(cid, item, true) doTransformItem(item, 15679) doPlayerAddItem(cid, 2394, 14) doPlayerAddItem(cid, 2391, 2) doPlayerAddItem(cid, 12347, 1) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Charmander, ") selfSay("Here is your Charmander and some supplies.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'squirtle') then local description = "Contains a Squirtle." local poke1 = "This is Squirtle's pokeball. HP = ["..health.."/"..maxhealth.."]" item = doCreateItemEx(2219) doItemSetAttribute(item, "poke", poke1) doItemSetAttribute(item, "nome", "Squirtle") doItemSetAttribute(item, "description", description) doTransformItem(item, 15679) doPlayerAddItem(cid, 2394, 18) doPlayerAddItem(cid, 2391, 6) doPlayerAddItem(cid, 2392, 1) doPlayerAddItem(cid, 12346, 1) doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, "Squirtle, ") selfSay("Here is your Squirtle and some supplies.") setPlayerStorageValue(cid,newbie,1) elseif msgcontains(msg, 'no') then selfSay("OK... What you want?") elseif msgcontains(msg, 'bye') then selfSay("OK! Bye...") focus = 0 talk_start = 0 else selfSay("Tell me what pokemon you like?") end elseif msgcontains(msg, 'no') then selfSay("OK... What you want?") talk_state = 0 elseif msgcontains(msg, 'bye') then selfSay("OK! Bye...") focus = 0 talk_start = 0 end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 2 then selfSay('Good bye!') focus = 0 talk_start = 0 end end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Bye...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) >= 2 then selfSay('Good bye then.') focus = 0 end end end
  8. @Leohige Deu certo mano, obrigado, como te dou rep?
  9. Explicação: Criei este npc(Ty) para trocar 2 small diamonds(circulado em amarelo) por uma recording camera(circulado em laranja), está tudo funcionando, ele está fazendo a troca, logo, gostaria de acrescentar no npc(Ty) se o "jogador tem certeza que quer fazer essa troca", tipo o Sweety Cyclops do Tibia. Como está: Ty: Hello | PLAYERNAME | I change 2 small diamonds for recording camera. Tavarb: recording camera / camera Ty: You just wap 2 small diamond for 1 recording camera. Como preciso: Ty: Hello | PLAYERNAME | I change 2 small diamonds for recording camera. Tavarb: recording camera / camera Ty: Do you want to trade 2 small diamonds for recording camera? Tavarb: yes / no (CASO YES) Ty: You just wap 2 small diamond for 1 recording camera. (CASO NO) Ty: Ok, good bye. (TIPO ESSE SRIPT) do Sweety Cyclops: local node5 = keywordHandler:addKeyword({'ticket'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade a 50k for a ticket?'}) node5:addChildKeyword({'yes'}, ticket, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true}) SCRIPT DO NPC DO MEU SERVIDOR: 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 local items = { item1 = {2145, 12330}, -- id do small diamond, id da recording camera item2 = {2145, 12330} -- id do small diamond, id da recording camera } local counts = { count1 = {2, 1}, -- 2 small diamonds por uma recording camera count2 = {2, 1} -- 2 small diamonds por uma recording camera } 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, 'camera') then if getPlayerItemCount(cid, items.item1[1]) >= counts.count1[1] then doPlayerRemoveItem(cid, items.item1[1], counts.count1[1]) doPlayerAddItem(cid, items.item1[2], counts.count1[2]) selfSay('You just swap '.. counts.count1[1] ..' '.. getItemNameById(items.item1[1]) ..' for '.. counts.count1[2] ..' '.. getItemNameById(items.item1[2]) ..'.', cid) else selfSay('You need '.. counts.count1[1] ..' '.. getItemNameById(items.item1[1]) ..'.', cid) end elseif msgcontains(msg, 'recording camera') then if getPlayerItemCount(cid, items.item2[1]) >= counts.count2[1] then doPlayerRemoveItem(cid, items.item2[1], counts.count2[1]) doPlayerAddItem(cid, items.item2[2], counts.count2[2]) selfSay('You just swap '.. counts.count2[1] ..' '.. getItemNameById(items.item2[1]) ..' for '.. counts.count2[2] ..' '.. getItemNameById(items.item2[2]) ..'.', cid) else selfSay('You need '.. counts.count2[1] ..' '.. getItemNameById(items.item2[1]) ..'.', cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  10. tavarb postou uma resposta no tópico em Scripts tfs 0.4 (OLD)
    @KekezitoLHP, tem condições de selecionar de uma por uma outfit? Quero adicionar esse sistema no pokémon, logo, minhas outfits estão espalhadas!
  11. tavarb postou uma resposta no tópico em Suporte & Pedidos
    Salve galera, estou criando um servidor com a base do Pokémon Mythology. Segue a imagem do mapa, atualmente
  12. Boa tarde, gostaria de uma script de npc que troque "X" item por dias premium(igual o npc de diamonds do antigo svke), pode ser 1 unidade para 1 dia! Uso a base TFS 0.3.6, agradecido!
  13. Funciona em poketibia 8.54? TFS 0.3.6
  14. Boa noite, gostaria de uma ajuda para ajustar o campo de visão do cliente. Base do ot e cliente: Pokémon Mythology TFS (0.3.6) Imagem do problema:

Informação Importante

Confirmação de Termo