Drk Shadow 48 Postado Agosto 25, 2013 Share Postado Agosto 25, 2013 Bom, eu não contribuo muito com o forum, e nem digo que isso será grande coisa, mais ajudara os preguiçosos u.uBom, atualmente o Danone postou esse sistema:http://www.xtibia.com/forum/topic/219913-price-system-pokemons-pda-by-slicer/#entry1553637Que adiciona um preço nas balls dos pokemons. Exemplo:Bom, na tabela que ele mandou criar agora você so precisa fazer a tabela, va em /lib/configuration.lua e coloque no final, laaaaaa em baixo:pokesPrice = {["Bulbasaur"] = {price = 3000},["Ivysaur"] = {price = 7500},["Venusaur"] = {price = 12000}}ai é so ir colocando, lembrando, se vc n colocar o pokemon vai aparecer "Price: unsellable." Coloque está tabela em data/lib/configuration.lua pokesPrice = {["Charmander"] = {price = 3000},["Charmeleon"] = {price = 8000}, ["Charizard"] = {price = 18000},["Bulbasaur"] = {price = 3000},["Ivysaur"] = {price = 8000},["Venusaur"] = {price = 18000},["Squirtle"] = {price = 3000},["Wartortle"] = {price = 8000},["Blastoise"] = {price = 18000},["Caterpie"] = {price = 50},["Metapod"] = {price = 250},["Butterfree"] = {price = 2000},["Weedle"] = {price = 50},["Kakuna"] = {price = 250},["Beedrill"] = {price = 2000},["Pidgey"] = {price = 60},["Pidgeotto"] = {price = 1500},["Pidgeot"] = {price = 11500},["Rattata"] = {price = 5},["Raticate"] = {price = 2000},["Spearow"] = {price = 100},["Fearow"] = {price = 5100},["Ekans"] = {price = 300},["Arbok"] = {price = 3000},["Pikachu"] = {price = 8000},["Raichu"] = {price = 18000},["Sandshrew"] = {price = 1000},["Sandslash"] = {price = 11000},["Nidoran Female"] = {price = 125},["Nidorina"] = {price = 2250},["Nidoqueen"] = {price = 12250},["Nidoran Male"] = {price = 125},["Nidorino"] = {price = 2250},["Nidoqueen"] = {price = 12250},["Clefairy"] = {price = 8000},["Clefable"] = {price = 18000},["Vulpix"] = {price = 1000},["Ninetales"] = {price = 11000},["Jigglypuff"] = {price = 8000},["Wigglytuff"] = {price = 18000},["Zubat"] = {price = 120},["Golbat"] = {price = 3000},["Oddish"] = {price = 80},["Gloom"] = {price = 2250},["Vileplume"] = {price = 12000},["Paras"] = {price = 60},["Parasect"] = {price = 7250}, ["Venonat"] = {price = 1500},["Venomoth"] = {price = 7250},["Diglett"] = {price = 200},["Dugtrio"] = {price = 3000},["Meowth"] = {price = 300},["Persian"] = {price = 3000},["Psyduck"] = {price = 1500},["Golduck"] = {price = 11500},["Mankey"] = {price = 300},["Primeape"] = {price = 7250},["Growlithe"] = {price = 3500},["Arcanine"] = {price = 60000},["Poliwag"] = {price = 80},["Poliwhirl"] = {price = 3000},["Poliwrath"] = {price = 13000},["Abra"] = {price = 800},["Kadabra"] = {price = 5800},["Alakazam"] = {price = 16000},["Machop"] = {price = 2000},["Machoke"] = {price = 7000},["Machamp"] = {price = 17000},["Bellsprout"] = {price = 80},["Wepinbell"] = {price = 2250},["Victreebel"] = {price = 12000},["Tentacool"] = {price = 300},["Tentacruel"] = {price = 10000},["Geodude"] = {price = 300},["Graveler"] = {price = 5000},["Golem"] = {price = 15000},["Ponyta"] = {price = 1500},["Rapidash"] = {price = 6500},["Slowpoke"] = {price = 400},["Slowbro"] = {price = 8000},["Magnemite"] = {price = 400},["Magneton"] = {price = 5400},["Farfetch'd"] = {price = 7000},["Doduo"] = {price = 600},["Dodrio"] = {price = 5600},["Seel"] = {price = 2000},["Dewgong"] = {price = 12000},["Grimer"] = {price = 300},["Muk"] = {price = 11000},["Shellder"] = {price = 200},["Cloyster"] = {price = 10200},["Gastly"] = {price = 3000},["Haunter"] = {price = 8000},["Gengar"] = {price = 18000},["Onix"] = {price = 6000},["Drowzee"] = {price = 1000},["Hypno"] = {price = 6000},["Krabby"] = {price = 200},["Kingler"] = {price = 5200},["Voltorb"] = {price = 250},["Electrode"] = {price = 3000},["Exeggute"] = {price = 200},["Exeggutor"] = {price = 10000},["Cubone"] = {price = 1000},["Marowak"] = {price = 11000},["Hitmonlee"] = {price = 500000},["Hitmonchan"] = {price = 500000},["Lickitung"] = {price = 60000},["Koffing"] = {price = 300},["Weezing"] = {price = 3000},["Rhyhorn"] = {price = 3000},["Rhydon"] = {price = 13000},["Chansey"] = {price = 40000},["Tangela"] = {price = 10000},["Kangaskhan"] = {price = 120000},["Horsea"] = {price = 200},["Seadra"] = {price = 5500},["Goldeen"] = {price = 200},["Seaking"] = {price = 3000},["Staryu"] = {price = 400},["Starmie"] = {price = 3000},["Mr. Mime"] = {price = 120000},["Scyther"] = {price = 120000},["Jynx"] = {price = 120000},["Electabuzz"] = {price = 120000},["Magmar"] = {price = 120000},["Pinsir"] = {price = 9000},["Tauros"] = {price = 5000},["Magikarp"] = {price = 5},["Gyarados"] = {price = 55000},["Lapras"] = {price = 120000},["Ditto"] = {price = 70000},["Eevee"] = {price = 45000},["Vaporeon"] = {price = 50000},["Jolteon"] = {price = 50000},["Flareon"] = {price = 50000},["Porygon"] = {price = 60000},["Omanyte"] = {price = 20000},["Omastar"] = {price = 75000},["Kabuto"] = {price = 2000},["Kabutops"] = {price = 75000},["Aerodactyl"] = {price = 2000000},["Snorlax"] = {price = 200000},["Dratini"] = {price = 15000},["Dragonair"] = {price = 65000},["Dragonite"] = {price = 125000},-- Segunda Geração["Chikorita"] = {price = 3000},["Bayleef"] = {price = 8000},["Meganium"] = {price = 18000},["Cydaquil"] = {price = 3000},["Quilava"] = {price = 8000},["Typhlosion"] = {price = 18000},["Totodile"] = {price = 3000},["Croconaw"] = {price = 8000},["Feraligatr"] = {price = 18000},["Sentret"] = {price = 250},["Furret"] = {price = 3000},["Hoothoot"] = {price = 1500},["Noctowl"] = {price = 11500},["Ledyba"] = {price = 250},["Ledian"] = {price = 3000},["Spinarak"] = {price = 250},["Ariados"] = {price = 3000},["Crobat"] = {price = 58000},["Chinchou"] = {price = 1000},["Lantuen"] = {price = 6000},["Pichu"] = {price = 3000},["Cleffa"] = {price = 3000},["Igglbuff"] = {price = 3000},["Togepi"] = {price = 15000},["Togetic"] = {price = 25000},["Natu"] = {price = 3000},["Xatu"] = {price = 130000},["Mareep"] = {price = 3000},["Flaaffy"] = {price = 8000},["Ampharos"] = {price = 18000},["Bellossom"] = {price = 12000},["Marill"] = {price = 3000},["Azumarill"] = {price = 13000},["Sudowodo"] = {price = 120000},["politoed"] = {price = 8000},["Hoppip"] = {price = 80},["Skiploom"] = {price = 2250},["Jumpluff"] = {price = 12000},["Aipom"] = {price = 8000},["Sunkern"] = {price = 50},["Sunflora"] = {price = 5000},["Yanma"] = {price = 9000},["Wooper"] = {price = 2000},["Quagsire"] = {price = 12000},["Espeon"] = {price = 50000},["Umbreon"] = {price = 50000},["Murkrow"] = {price = 10000},["Slowking"] = {price = 110000},["Misdreavus"] = {price = 200000},["Wobbuffet"] = {price = 200000},["Girafarig"] = {price = 120000},["Pineco"] = {price = 300},["Forretress"] = {price = 10000},["Dunsparce"] = {price = 3000},["Gligar"] = {price = 8000},["Steelix"] = {price = 110000},["Snubbul"] = {price = 22500},["Granbull"] = {price = 12500},["Qwilfish"] = {price = 10000},["Scizor"] = {price = 220000},["Shuckle"] = {price = 3500},["Heracross"] = {price = 120000},["Sneasel"] = {price = 10000},["Teddiursa"] = {price = 80000},["ursaring"] = {price = 150000},["Slugma"] = {price = 1000},["Magcargo"] = {price = 11000},["Swinub"] = {price = 1000},["Piloswine"] = {price = 11000},["Corsola"] = {price = 9000},["Remoraid"] = {price = 200},["Octillery"] = {price = 10000},["Dilibird"] = {price = 10000},["Mantine"] = {price = 120000},["Skarmory"] = {price = 120000},["Houndour"] = {price = 35000},["Houndoom"] = {price = 13500},["kingdra"] = {price = 70000},["Phanpy"] = {price = 3000},["Donphan"] = {price = 13000},["Porygon2"] = {price = 120000},["Stantler"] = {price = 10000},["Tyrogue"] = {price = 150000},["Hitmontop"] = {price = 500000},["Smoochum"] = {price = 45000},["Elikid"] = {price = 45000},["Magby"] = {price = 45000},["Miltank"] = {price = 120000},["Blissey"] = {price = 140000},["Larvitar"] = {price = 15000},["Pupitar"] = {price = 65000},["Tyranitar"] = {price = 125000}} Está tabela está com todos os preços ja configurados. Va a pasta data/npcs/scripts pegue o arquivo pokemon seller.lua apague tudo que tem dentro dele e no lugar coloque isso: local focus = 0 local talk_start = 0 local conv = 0 local cost = 0 local pname = "" local baseprice = 0 local pokePrice = { ["Charmander"] = 3000, ["Charmeleon"] = 8000, ["Charizard"] = 18000, ["Bulbasaur"] = 3000, ["Ivysaur"] = 8000, ["Venusaur"] = 18000, ["Squirtle"] = 3000, ["Wartortle"] = 8000, ["Blastoise"] = 18000, ["Caterpie"] = 50, ["Metapod"] = 250, ["Butterfree"] = 2000, ["Weedle"] = 50, ["Kakuna"] = 250, ["Beedrill"] = 2000, ["Pidgey"] = 60, ["Pidgeotto"] = 1500, ["Pidgeot"] = 11500, ["Rattata"] = 5, ["Raticate"] = 2000, ["Spearow"] = 100, ["Fearow"] = 5100, ["Ekans"] = 300, ["Arbok"] = 3000, ["Pikachu"] = 8000, ["Raichu"] = 18000, ["Sandshrew"] = 1000, ["Sandslash"] = 11000, ["Nidoran Female"] = 125, ["Nidorina"] = 2250, ["Nidoqueen"] = 12250, ["Nidoran Male"] = 125, ["Nidorino"] = 2250, ["Nidoqueen"] = 12250, ["Clefairy"] = 8000, ["Clefable"] = 18000, ["Vulpix"] = 1000, ["Ninetales"] = 11000, ["Jigglypuff"] = 8000, ["Wigglytuff"] = 18000, ["Zubat"] = 120, ["Golbat"] = 3000, ["Oddish"] = 80, ["Gloom"] = 2250, ["Vileplume"] = 12000, ["Paras"] = 60, ["Parasect"] = 7250, ["Venonat"] = 1500, ["Venomoth"] = 7250, ["Diglett"] = 200, ["Dugtrio"] = 3000, ["Meowth"] = 300, ["Persian"] = 3000, ["Psyduck"] = 1500, ["Golduck"] = 11500, ["Mankey"] = 300, ["Primeape"] = 7250, ["Growlithe"] = 3500, ["Arcanine"] = 60000, ["Poliwag"] = 80, ["Poliwhirl"] = 3000, ["Poliwrath"] = 13000, ["Abra"] = 800, ["Kadabra"] = 5800, ["Alakazam"] = 16000, ["Machop"] = 2000, ["Machoke"] = 7000, ["Machamp"] = 17000, ["Bellsprout"] = 80, ["Wepinbell"] = 2250, ["Victreebel"] = 12000, ["Tentacool"] = 300, ["Tentacruel"] = 10000, ["Geodude"] = 300, ["Graveler"] = 5000, ["Golem"] = 15000, ["Ponyta"] = 1500, ["Rapidash"] = 6500, ["Slowpoke"] = 400, ["Slowbro"] = 8000, ["Magnemite"] = 400, ["Magneton"] = 5400, ["Farfetch'd"] = 7000, ["Doduo"] = 600, ["Dodrio"] = 5600, ["Seel"] = 2000, ["Dewgong"] = 12000, ["Grimer"] = 300, ["Muk"] = 11000, ["Shellder"] = 200, ["Cloyster"] = 10200, ["Gastly"] = 3000, ["Haunter"] = 8000, ["Gengar"] = 18000, ["Onix"] = 6000, ["Drowzee"] = 1000, ["Hypno"] = 6000, ["Krabby"] = 200, ["Kingler"] = 5200, ["Voltorb"] = 250, ["Electrode"] = 3000, ["Exeggute"] = 200, ["Exeggutor"] = 10000, ["Cubone"] = 1000, ["Marowak"] = 11000, ["Hitmonlee"] = 500000, ["Hitmonchan"] = 500000, ["Lickitung"] = 60000, ["Koffing"] = 300, ["Weezing"] = 3000, ["Rhyhorn"] = 3000, ["Rhydon"] = 13000, ["Chansey"] = 40000, ["Tangela"] = 10000, ["Kangaskhan"] = 120000, ["Horsea"] = 200, ["Seadra"] = 5500, ["Goldeen"] = 200, ["Seaking"] = 3000, ["Staryu"] = 400, ["Starmie"] = 3000, ["Mr. Mime"] = 120000, ["Scyther"] = 120000, ["Jynx"] = 120000, ["Electabuzz"] = 120000, ["Magmar"] = 120000, ["Pinsir"] = 9000, ["Tauros"] = 5000, ["Magikarp"] = 5, ["Gyarados"] = 55000, ["Lapras"] = 120000, ["Ditto"] = 70000, ["Eevee"] = 45000, ["Vaporeon"] = 50000, ["Jolteon"] = 50000, ["Flareon"] = 50000, ["Porygon"] = 60000, ["Omanyte"] = 20000, ["Omastar"] = 75000, ["Kabuto"] = 2000, ["Kabutops"] = 75000, ["Aerodactyl"] = 2000000, ["Snorlax"] = 200000, ["Dratini"] = 15000, ["Dragonair"] = 65000, ["Dragonite"] = 125000, -- Segunda Geração ["Chikorita"] = 3000, -- Editado, V1.6 By:Woner (: ["Bayleef"] = 8000, ["Meganium"] = 18000, ["Cydaquil"] = 3000, ["Quilava"] = 8000, ["Typhlosion"] = 18000, ["Totodile"] = 3000, ["Croconaw"] = 8000, ["Feraligatr"] = 18000, ["Sentret"] = 250, ["Furret"] = 3000, ["Hoothoot"] = 1500, ["Noctowl"] = 11500, ["Ledyba"] = 250, ["Ledian"] = 3000, ["Spinarak"] = 250, ["Ariados"] = 3000, ["Crobat"] = 58000, ["Chinchou"] = 1000, ["Lantuen"] = 6000, ["Pichu"] = 3000, ["Cleffa"] = 3000, ["Igglbuff"] = 3000, ["Togepi"] = 15000, ["Togetic"] = 25000, ["Natu"] = 3000, ["Xatu"] = 130000, ["Mareep"] = 3000, ["Flaaffy"] = 8000, ["Ampharos"] = 18000, ["Bellossom"] = 12000, ["Marill"] = 3000, ["Azumarill"] = 13000, ["Sudowodo"] = 120000, ["politoed"] = 8000, ["Hoppip"] = 80, ["Skiploom"] = 2250, ["Jumpluff"] = 12000, ["Aipom"] = 8000, ["Sunkern"] = 50, ["Sunflora"] = 5000, ["Yanma"] = 9000, ["Wooper"] = 2000, ["Quagsire"] = 12000, ["Espeon"] = 50000, ["Umbreon"] = 50000, ["Murkrow"] = 10000, ["Slowking"] = 110000, ["Misdreavus"] = 200000, ["Wobbuffet"] = 200000, ["Girafarig"] = 120000, ["Pineco"] = 300, ["Forretress"] = 10000, ["Dunsparce"] = 3000, ["Gligar"] = 8000, ["Steelix"] = 110000, ["Snubbul"] = 22500, ["Granbull"] = 12500, ["Qwilfish"] = 10000, ["Scizor"] = 220000, ["Shuckle"] = 3500, ["Heracross"] = 120000, ["Sneasel"] = 10000, ["Teddiursa"] = 80000, ["ursaring"] = 150000, ["Slugma"] = 1000, ["Magcargo"] = 11000, ["Swinub"] = 1000, ["Piloswine"] = 11000, ["Corsola"] = 9000, ["Remoraid"] = 200, ["Octillery"] = 10000, ["Dilibird"] = 10000, ["Mantine"] = 120000, ["Skarmory"] = 120000, ["Houndour"] = 35000, ["Houndoom"] = 13500, ["kingdra"] = 70000, ["Phanpy"] = 3000, ["Donphan"] = 13000, ["Porygon2"] = 120000, ["Stantler"] = 10000, ["Tyrogue"] = 150000, ["Hitmontop"] = 500000, ["Smoochum"] = 45000, ["Elikid"] = 45000, ["Magby"] = 45000, ["Miltank"] = 120000, ["Blissey"] = 140000, ["Larvitar"] = 15000, ["Pupitar"] = 65000, ["Tyranitar"] = 125000, } function sellPokemon(cid, name, price) local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) if #getCreatureSummons(cid) >= 1 then selfSay("Back your pokemon to do that!") focus = 0 --alterado v1.8 return true end local storages = {17000, 63215, 17001, 13008, 5700} --alterado v1.8 for s = 1, #storages do if getPlayerStorageValue(cid, storages) >= 1 then selfSay("You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!") focus = 0 return true end end 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 --alterado v1.6 selfSay("Wow! Thanks for this wonderful "..name.."! Take yours "..price.." dollars. Would you like to sell another pokemon?") doRemoveItem(getPlayerSlotItem(cid, 8).uid, 1) --alterado v1.6 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 --alterado v1.6 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 end end end selfSay("You don't have a "..name..", make sure it is in your backpack and it is not fainted and it is not in a Unique Ball!") --alterado v1.6 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 = pokePrice[name] or math.floor(pokemon.level * 150) --alterado v1.6 cost = baseprice 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 Esse eu acho que a maioria ja tem configurado, mais enfim... ;x Bom, como eu disse, ira ajudar mais os preguiçosos, não é nada de mais, Obrigado. ^^ Link para o comentário https://xtibia.com/forum/topic/219992-tutorialpokemon-seller-e-pre%C3%A7os-nos-pokemons/ Compartilhar em outros sites More sharing options...
zedarosquinha 0 Postado Agosto 25, 2013 Share Postado Agosto 25, 2013 Ajuda os preguiçosos "que nem eu" !!! Parabéns, ficou ótimo!! Link para o comentário https://xtibia.com/forum/topic/219992-tutorialpokemon-seller-e-pre%C3%A7os-nos-pokemons/#findComment-1554333 Compartilhar em outros sites More sharing options...
Drk Shadow 48 Postado Agosto 25, 2013 Autor Share Postado Agosto 25, 2013 vlw .-. Link para o comentário https://xtibia.com/forum/topic/219992-tutorialpokemon-seller-e-pre%C3%A7os-nos-pokemons/#findComment-1554362 Compartilhar em outros sites More sharing options...
xandeloko 2 Postado Fevereiro 12, 2014 Share Postado Fevereiro 12, 2014 (editado) aq n deu kra Editado Fevereiro 13, 2014 por xandeloko Link para o comentário https://xtibia.com/forum/topic/219992-tutorialpokemon-seller-e-pre%C3%A7os-nos-pokemons/#findComment-1613330 Compartilhar em outros sites More sharing options...
HenrikDiamond 17 Postado Fevereiro 24, 2014 Share Postado Fevereiro 24, 2014 Ótimo Sistema! parabéns! Link para o comentário https://xtibia.com/forum/topic/219992-tutorialpokemon-seller-e-pre%C3%A7os-nos-pokemons/#findComment-1616249 Compartilhar em outros sites More sharing options...
Posts Recomendados