victormoaz 9 Postado Outubro 19, 2012 Share Postado Outubro 19, 2012 Alguem sabe como funcionar esse npc pokemon collector da versao 1.7 s/ lvl do Slicer? Gostaria de editar os preço... Onde fica a Table de preços dele? Qual lib? Segue Script do npc: local focus = 0 local talk_start = 0 local conv = 0 local cost = 0 local pname = "" local baseprice = 0 function sellPokemon(cid, name, price) local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) for a, b in pairs(pokeballs) do local balls = getItemsInContainerById(bp.uid, b.on) for _, ball in pairs (balls) do if string.lower(getItemAttribute(ball, "poke")) == string.lower(name) then selfSay("Wow! Thanks for this wonderful "..getItemAttribute(ball, "poke").."! Take yours "..price.." dollars. Would you like to sell another pokemon?") doRemoveItem(ball, 1) doPlayerAddMoney(cid, price * 100) return true end --alterado v1.3 end end selfSay("You don't have a "..name..", make sure it is in your backpack and it is not fainted!") return false end function onCreatureSay(cid, type, msg) local msg = string.lower(msg) if string.find(msg, "!") or string.find(msg, ",") then return true end if focus == cid then talk_start = os.clock() end if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) <= 3 then selfSay('Welcome to my store! I buy pokemons of all species, just tell me the name of the pokemon you want to sell.') focus = cid conv = 1 talk_start = os.clock() cost = 0 pname = "" return true end if msgcontains(msg, 'bye') and focus == cid then selfSay('See you around then!') focus = 0 return true end if msgcontains(msg, 'yes') and focus == cid and conv == 4 then selfSay('Tell me the name of the pokemon you would like to sell.') conv = 1 return true end if msgcontains(msg, 'no') and conv == 4 and focus == cid then selfSay('Ok, see you around then!') focus = 0 return true end local common = {"rattata", "caterpie", "weedle", "magikarp"} if conv == 1 and focus == cid then for a = 1, #common do if msgcontains(msg, common[a]) then selfSay('I dont buy such a common pokemon!') return true end end end if msgcontains(msg, 'no') and conv == 3 and focus == cid then selfSay('Well, then what pokemon would you like to sell?') conv = 1 return true end if (conv == 1 or conv == 4) and focus == cid then local name = doCorrectPokemonName(msg) local pokemon = pokes[name] if not pokemon then selfSay("Sorry, I don't know what pokemon you're talking about! Are you sure you spelled it correctly?") return true end baseprice = math.floor(pokemon.level * 150) -- preço baseado em level base cost = baseprice --alterado v1.3 pname = name selfSay("Are you sure you want to sell a "..name.." for "..cost.." dollars?") conv = 3 end if isConfirmMsg(msg) and focus == cid and conv == 3 then if sellPokemon(cid, pname, cost) then conv = 4 else conv = 1 end return true end end local intervalmin = 38 local intervalmax = 70 local delay = 25 local number = 1 local messages = {"Buying some beautiful pokemons! Come here to sell them!", "Wanna sell a pokemon? Came to the right place!", "Buy pokemon! Excellent offers!", "Tired of a pokemon? Why don't you sell it to me then?", } function onThink() if focus == 0 then selfTurn(1) delay = delay - 0.5 if delay <= 0 then selfSay(messages[number]) number = number + 1 if number > #messages then number = 1 end delay = math.random(intervalmin, intervalmax) end return true else if not isCreature(focus) then focus = 0 return true end local npcpos = getThingPos(getThis()) local focpos = getThingPos(focus) if npcpos.z ~= focpos.z then focus = 0 return true end if (os.clock() - talk_start) > 70 then focus = 0 selfSay("I have other clients too, talk to me when you feel like selling a pokemon.") end if getDistanceToCreature(focus) > 3 then selfSay("Good bye then and thanks!") focus = 0 return true end local dir = doDirectPos(npcpos, focpos) selfTurn(dir) end return true end Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/ Compartilhar em outros sites More sharing options...
SmiX 265 Postado Outubro 19, 2012 Share Postado Outubro 19, 2012 Este npc vende POKEMONS por suas repectivas habilidades. Não existe de fato uma tabela de preço. Mas você pode ir na seção de PEDIDOS E DÚVIDAS pra pedir um npc com tabela de preços... Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1366732 Compartilhar em outros sites More sharing options...
Session Start 125 Postado Outubro 19, 2012 Share Postado Outubro 19, 2012 Tem sim uma tabela com preços... ¬¬ pega o npc do meu server local focus = 0 local talk_start = 0 local conv = 0 local cost = 0 local pname = "" local baseprice = 1 local pokePrice = { --- coloque aqui cada poke ["Bulbasaur"] = 3000, ["Squirtle"] = 3000, ["Charmander"] = 3000, ["Ivysaur"] = 4500, ["Venusaur"] = 12000, } function sellPokemon(cid, name, price) local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) if getPlayerSlotItem(cid, 8).uid ~= 0 then if string.lower(getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke")) == string.lower(name) then if not getItemAttribute(getPlayerSlotItem(cid, 8).uid, "unique") then selfSay("Wow! Thanks for this wonderful "..name.."! Take yours "..price.." dollars. Would you like to sell another pokemon?") doRemoveItem(getPlayerSlotItem(cid, 8).uid, 1) doPlayerAddMoney(cid, price * 100) doTransformItem(getPlayerSlotItem(cid, CONST_SLOT_LEGS).uid, 2395) return true end end end for a, b in pairs(pokeballs) do local balls = getItemsInContainerById(bp.uid, b.on) for _, ball in pairs (balls) do if string.lower(getItemAttribute(ball, "poke")) == string.lower(name) then if not getItemAttribute(ball, "unique") then selfSay("Wow! Obrigado por este maravilhoso "..getItemAttribute(ball, "poke").."! Tome seus "..price.." dólares. Gostaria de vender mais pokemon?") doRemoveItem(ball, 1) doPlayerAddMoney(cid, price * 100) return true end end end end selfSay("Você não tem o "..name..", certifique-se que está na sua mochila e não desmaiou.") return false end function onCreatureSay(cid, type, msg) local msg = string.lower(msg) if string.find(msg, "!") or string.find(msg, ",") then return true end if focus == cid then talk_start = os.clock() end if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) <= 3 then selfSay('Bem-vindo à minha loja! Eu compro pokemons de todas as espécies, apenas me diga o nome do Pokémon que você quer vender.') focus = cid conv = 1 talk_start = os.clock() cost = 0 pname = "" return true end if msgcontains(msg, 'bye') and focus == cid then selfSay('Vejo você por aí, então!') focus = 0 return true end if msgcontains(msg, 'yes') and focus == cid and conv == 4 then selfSay('Diga-me o nome dos pokemon você gostaria de vender.') conv = 1 return true end if msgcontains(msg, 'no') and conv == 4 and focus == cid then selfSay('Ok, então nos vemos por aí!') focus = 0 return true end local common = {"rattata", "caterpie", "weedle", "magikarp"} if conv == 1 and focus == cid then for a = 1, #common do if msgcontains(msg, common[a]) then selfSay('Eu não compro pokemon comuns!') return true end end end if msgcontains(msg, 'no') and conv == 3 and focus == cid then selfSay('Bem, então o que pokemon gostaria de vender?') conv = 1 return true end if (conv == 1 or conv == 4) and focus == cid then local name = doCorrectPokemonName(msg) local pokemon = pokes[name] if not pokemon then selfSay("Desculpe, eu não sei o que pokemon que você está falando! Tem certeza de que soletrou corretamente?") return true end baseprice = pokePrice[name] or math.floor(pokemon.level * 150) cost = baseprice pname = name selfSay("Você gostaria de verde "..name.." por "..cost.." dólares?") conv = 3 end if isConfirmMsg(msg) and focus == cid and conv == 3 then if sellPokemon(cid, pname, cost) then conv = 4 else conv = 1 end return true end end local intervalmin = 38 local intervalmax = 70 local delay = 25 local number = 1 local messages = {"Compro alguns pokemons bonitos! Venha aqui para vendê-los!", "Quer vender um pokemon? Veio ao lugar certo!", "Compro pokemon! Ofertas Excelente!", "Cansado de um pokemon? Por que você não vendê-lo para mim?", } function onThink() if focus == 0 then selfTurn(1) delay = delay - 0.5 if delay <= 0 then selfSay(messages[number]) number = number + 1 if number > #messages then number = 1 end delay = math.random(intervalmin, intervalmax) end return true else if not isCreature(focus) then focus = 0 return true end local npcpos = getThingPos(getThis()) local focpos = getThingPos(focus) if npcpos.z ~= focpos.z then focus = 0 return true end if (os.clock() - talk_start) > 70 then focus = 0 selfSay("Eu tenho outros clientes também, se sente e espere a venda dele acabar.") end if getDistanceToCreature(focus) > 3 then selfSay("Adeus então e obrigado!") focus = 0 return true end local dir = doDirectPos(npcpos, focpos) selfTurn(dir) end return true end ~ Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1366740 Compartilhar em outros sites More sharing options...
victormoaz 9 Postado Outubro 19, 2012 Autor Share Postado Outubro 19, 2012 Este npc vende POKEMONS por suas repectivas habilidades. Não existe de fato uma tabela de preço. Mas você pode ir na seção de PEDIDOS E DÚVIDAS pra pedir um npc com tabela de preços... Entendo, alguns pokes estão com preços bons... mas alguns tipo horsea está bem exagerado. =X Tem sim uma tabela com preços... ¬¬ pega o npc do meu server local focus = 0 local talk_start = 0 local conv = 0 local cost = 0 local pname = "" local baseprice = 1 local pokePrice = { --- coloque aqui cada poke ["Bulbasaur"] = 3000, ["Squirtle"] = 3000, ["Charmander"] = 3000, ["Ivysaur"] = 4500, ["Venusaur"] = 12000, } function sellPokemon(cid, name, price) local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) if getPlayerSlotItem(cid, 8).uid ~= 0 then if string.lower(getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke")) == string.lower(name) then if not getItemAttribute(getPlayerSlotItem(cid, 8).uid, "unique") then selfSay("Wow! Thanks for this wonderful "..name.."! Take yours "..price.." dollars. Would you like to sell another pokemon?") doRemoveItem(getPlayerSlotItem(cid, 8).uid, 1) doPlayerAddMoney(cid, price * 100) doTransformItem(getPlayerSlotItem(cid, CONST_SLOT_LEGS).uid, 2395) return true end end end for a, b in pairs(pokeballs) do local balls = getItemsInContainerById(bp.uid, b.on) for _, ball in pairs (balls) do if string.lower(getItemAttribute(ball, "poke")) == string.lower(name) then if not getItemAttribute(ball, "unique") then selfSay("Wow! Obrigado por este maravilhoso "..getItemAttribute(ball, "poke").."! Tome seus "..price.." dólares. Gostaria de vender mais pokemon?") doRemoveItem(ball, 1) doPlayerAddMoney(cid, price * 100) return true end end end end selfSay("Você não tem o "..name..", certifique-se que está na sua mochila e não desmaiou.") return false end function onCreatureSay(cid, type, msg) local msg = string.lower(msg) if string.find(msg, "!") or string.find(msg, ",") then return true end if focus == cid then talk_start = os.clock() end if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) <= 3 then selfSay('Bem-vindo à minha loja! Eu compro pokemons de todas as espécies, apenas me diga o nome do Pokémon que você quer vender.') focus = cid conv = 1 talk_start = os.clock() cost = 0 pname = "" return true end if msgcontains(msg, 'bye') and focus == cid then selfSay('Vejo você por aí, então!') focus = 0 return true end if msgcontains(msg, 'yes') and focus == cid and conv == 4 then selfSay('Diga-me o nome dos pokemon você gostaria de vender.') conv = 1 return true end if msgcontains(msg, 'no') and conv == 4 and focus == cid then selfSay('Ok, então nos vemos por aí!') focus = 0 return true end local common = {"rattata", "caterpie", "weedle", "magikarp"} if conv == 1 and focus == cid then for a = 1, #common do if msgcontains(msg, common[a]) then selfSay('Eu não compro pokemon comuns!') return true end end end if msgcontains(msg, 'no') and conv == 3 and focus == cid then selfSay('Bem, então o que pokemon gostaria de vender?') conv = 1 return true end if (conv == 1 or conv == 4) and focus == cid then local name = doCorrectPokemonName(msg) local pokemon = pokes[name] if not pokemon then selfSay("Desculpe, eu não sei o que pokemon que você está falando! Tem certeza de que soletrou corretamente?") return true end baseprice = pokePrice[name] or math.floor(pokemon.level * 150) cost = baseprice pname = name selfSay("Você gostaria de verde "..name.." por "..cost.." dólares?") conv = 3 end if isConfirmMsg(msg) and focus == cid and conv == 3 then if sellPokemon(cid, pname, cost) then conv = 4 else conv = 1 end return true end end local intervalmin = 38 local intervalmax = 70 local delay = 25 local number = 1 local messages = {"Compro alguns pokemons bonitos! Venha aqui para vendê-los!", "Quer vender um pokemon? Veio ao lugar certo!", "Compro pokemon! Ofertas Excelente!", "Cansado de um pokemon? Por que você não vendê-lo para mim?", } function onThink() if focus == 0 then selfTurn(1) delay = delay - 0.5 if delay <= 0 then selfSay(messages[number]) number = number + 1 if number > #messages then number = 1 end delay = math.random(intervalmin, intervalmax) end return true else if not isCreature(focus) then focus = 0 return true end local npcpos = getThingPos(getThis()) local focpos = getThingPos(focus) if npcpos.z ~= focpos.z then focus = 0 return true end if (os.clock() - talk_start) > 70 then focus = 0 selfSay("Eu tenho outros clientes também, se sente e espere a venda dele acabar.") end if getDistanceToCreature(focus) > 3 then selfSay("Adeus então e obrigado!") focus = 0 return true end local dir = doDirectPos(npcpos, focpos) selfTurn(dir) end return true end ~ Vou tentar seu script... adicionar os pokemons q vai tenso kkkkk... sem falar em pensar num preço para os da 2 geração... mas vamos la Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1366756 Compartilhar em outros sites More sharing options...
Session Start 125 Postado Outubro 19, 2012 Share Postado Outubro 19, 2012 Bem, pelo que entendi você queria uma tabela pra editar os preços dos pokes USHaushSUhsu ai é só vc coloca 1 por 1 '-' do preço que quiser... só tentei ajuda Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1366765 Compartilhar em outros sites More sharing options...
victormoaz 9 Postado Outubro 19, 2012 Autor Share Postado Outubro 19, 2012 @Cleberadm Já ajudou muito... =D Já estou terminando aqui... amanha dou Rep+ to sem hoje =X Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1366768 Compartilhar em outros sites More sharing options...
SmiX 265 Postado Outubro 19, 2012 Share Postado Outubro 19, 2012 @Cleberadm o Npc do server do Slicer n tem preço, você n entendeu o que eu disse ;-/... Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1366773 Compartilhar em outros sites More sharing options...
Session Start 125 Postado Outubro 19, 2012 Share Postado Outubro 19, 2012 Descupe-me, por favor. Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1366774 Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Outubro 19, 2012 Share Postado Outubro 19, 2012 (editado) duvida sanada, topico movido ^^ @smiX o npc do meu serv TEM sim preço e eh oq o cleb passo ali.. o cara q tava usando um antigo paka... ;/ Editado Outubro 19, 2012 por Slicer Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1366775 Compartilhar em outros sites More sharing options...
SmiX 265 Postado Outubro 19, 2012 Share Postado Outubro 19, 2012 @Slicer O que eu falei foi do que ele postou ;-/ e n do novo. Ei cara olha no meu topico o presente que eu deixei lá. Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1366785 Compartilhar em outros sites More sharing options...
AWeskers 14 Postado Novembro 11, 2012 Share Postado Novembro 11, 2012 Amigo achei um bug no seu script. Seguinte: Se você tiver com um poke fóra da ball e vende-lo para o NPC, a ball some mais o poke fica pra fóra ainda, assim dando pra soltar +1 pokemon Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1385176 Compartilhar em outros sites More sharing options...
Stigal 584 Postado Abril 20, 2018 Share Postado Abril 20, 2018 A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta. + Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda. * Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado. Link para o comentário https://xtibia.com/forum/topic/196867-encerrado-npc-pokemon-collector/#findComment-1732620 Compartilhar em outros sites More sharing options...
Posts Recomendados