Postado Agosto 19, 2016 8 anos Yo boyz! Eu estava atrás desse sistema há um tempo e não achava em lugar nenhum. Estudei bastante sobre lua e depois de um tempo eu consegui fazer eu mesmo, então vou disponibilizá-lo para vocês. Eu testei o sistema em PDA (PokeXCyan) TFS 1.0, mas deve funcionar para outras bases. O script em si não é complexo, é apenas chato de adicionar os itens na tabela. Eu vou deixar a tabela que eu fiz com os itens que tem no servidor para qual eu fiz o script aqui embaixo como spoiler, para caso você queira poupar tempo. Spoiler local NPCPrice = { ["seed"] = {price = 30}, ["electric box"] = {price = 150}, ["sandbag"] = {price = 150}, ["comb"] = {price = 150}, ["fur"] = {price = 150}, ["ruby"] = {price = 300}, ["essence of fire"] = {price = 30}, ["small stone"] = {price = 30}, ["pot of moss bug"] = {price = 150}, ["screw"] = {price = 30}, ["straw"] = {price = 100}, ["water gem"] = {price = 30}, ["remains of magikarp"] = {price = 100}, ["teeth"] = {price = 150}, ["bottle of poison"] = {price = 30}, ["water pendant"] = {price = 100}, ["feather"] = {price = 150}, ["pair of leaves"] = {price = 150}, ["apple bite"] = {price = 60}, ["bat wing"] = {price = 150}, ["pot of lava"] = {price = 150}, ["fire pendant"] = {price = 100}, ["bug venom"] = {price = 100}, ["bug antenna"] = {price = 150}, ["venom pendant"] = {price = 100}, ["pot of venom"] = {price = 150}, ["iron bracelet"] = {price = 150}, ["ice orb"] = {price = 150}, ["gosme"] = {price = 150}, ["darkness gem,"] = {price = 30}, ["bug gosme"] = {price = 80}, ["enchanted gem,"] = {price = 30}, ["horn"] = {price = 150}, ["venom piece"] = {price = 150}, ["big wing"] = {price = 500}, ["dragon tail"] = {price = 500}, ["purple tail"] = {price = 500}, ["majesty wing"] = {price = 500}, ["alligator skin"] = {price = 500}, ["big egg"] = {price = 500}, ["teel feather"] = {price = 50000}, ["red feather"] = {price = 50000}, ["yellow feather"] = {price = 50000}, ["registeel orb"] = {price = 50000}, ["white rune"] = {price = 500}, ["foxtail"] = {price = 500}, ["pot with fire"] = {price = 350}, ["water orb"] = {price = 350}, ["iron piece"] = {price = 350}, ["gyarados tail"] = {price = 500}, ["bulb"] = {price = 350}, ["long fang"] = {price = 400}, ["turtle hull"] = {price = 350}, ["dragon tooth"] = {price = 1000}, ["iron pin"] = {price = 400}, ["mimic clothes"] = {price = 1000}, ["scythe"] = {price = 1000}, ["buzz tail"] = {price = 1000}, ["bird beak"] = {price = 200}, ["rat tail"] = {price = 200}, ["longhorn"] = {price = 350}, ["luck medalion"] = {price = 350}, ["wool ball"] = {price = 400}, ["psyduck mug"] = {price = 350}, ["punch toy"] = {price = 500}, ["twisted spoon"] = {price = 350}, ["future orb"] = {price = 250}, ["champion belt"] = {price = 400}, ["slowpoke tail"] = {price = 300}, ["imam"] = {price = 250}, ["stick slash"] = {price = 300}, ["traces of ghost"] = {price = 350}, ["onix tail"] = {price = 300}, ["bone"] = {price = 250}, ["big tongue"] = {price = 500}, ["power orb"] = {price = 250}, ["bracelet"] = {price = 250}, ["star"] = {price = 200}, ["magma orb"] = {price = 250}, ["shell"] = {price = 200}, ["iron bar"] = {price = 250}, ["bag of poison dust"] = {price = 250}, ["steel wing"] = {price = 500}, ["green orb"] = {price = 250}, ["steel ore"] = {price = 400}, ["charizard wing"] = {price = 600}, ["magma box"] = {price = 400}, ["giant turtle hull"] = {price = 600}, ["red gyarados tail"] = {price = 10000}, ["crystal tail"] = {price = 1000}, ["Helix Fossil"] = {price = 150000}, ["Dome Fossil"] = {price = 150000}, ["Old Amber"] = {price = 500000}, ["green apple bite"] = {price = 400}, ["leaf pendant"] = {price = 350}, ["bone mask"] = {price = 400}, ["pikachu tail"] = {price = 300}, ["raichu tail"] = {price = 500}, ["blue vines"] = {price = 350}, ["stone orb"] = {price = 250}, ["locksmith of shell"] = {price = 200}, ["crab claw"] = {price = 200}, ["noctowl own"] = {price = 500}, ["togepi egg"] = {price = 400}, ["pinsir horn"] = {price = 350}, ["ice bra"] = {price = 500}, ["xatu wing"] = {price = 500}, ["snake tail"] = {price = 350}, ["seahorse tail"] = {price = 300}, ["strange sting"] = {price = 300}, ["tentacle"] = {price = 300}, ["strange rock"] = {price = 250}, ["skarmory wing"] = {price = 600}, ["scizor claw"] = {price = 600}, ["star gem"] = {price = 500}, ["tyranitar tail"] = {price = 600}, ["small tail"] = {price = 300}, ["magmar foot"] = {price = 1000}, ["red wing"] = {price = 500}, ["gligar claw"] = {price = 350}, ["insect foot"] = {price = 350}, ["strange wing"] = {price = 400}, ["mantine tail"] = {price = 400}, ["small tusk"] = {price = 350}, ["nidoran male ear"] = {price = 250}, ["skin tail"] = {price = 200}, ["sting hand"] = {price = 200}, ["aipom hand"] = {price = 250}, ["ledyba wing"] = {price = 200}, ["strange antenna"] = {price = 250}, ["squirry tail"] = {price = 250}, ["point of light"] = {price = 300}, ["kangaskhan ear"] = {price = 500}, ["strange flower"] = {price = 350}, ["great petal"] = {price = 350}, ["great flower"] = {price = 500}, ["fire tail"] = {price = 400}, ["strange horn"] = {price = 350}, ["piece of coral"] = {price = 350}, ["shuckle armor"] = {price = 350}, ["plant tail"] = {price = 250}, ["sea tail"] = {price = 250}, ["helicopter leaves"] = {price = 200}, ["strange spike"] = {price = 200}, ["bag of pollem"] = {price = 200}, ["Heart Stone"] = {price = 5000}, ["Leaf Stone"] = {price = 5000}, ["Water Stone"] = {price = 5000}, ["Fire Stone"] = {price = 5000}, ["Metal Stone"] = {price = 10000}, ["Crystal Stone"] = {price = 10000}, ["Ancient Stone"] = {price = 10000}, ["Venom Stone"] = {price = 5000}, ["Thunder Stone"] = {price = 5000}, ["Rock Stone"] = {price = 5000}, ["Punch Stone"] = {price = 5000}, ["Coccon Stone"] = {price = 5000}, ["Darkness Stone"] = {price = 5000}, ["Earth Stone"] = {price = 5000}, ["Enigma Stone"] = {price = 5000}, ["Ice Stone"] = {price = 5000}, ["Boost Stone"] = {price = 20000}, ["Mega Stone"] = {price = 50000}, } Essa tabela deve ser adicionada no começo do código em creaturescripts/look.lua. Caso queira adicionar o sistema para pokémon também, basta você pegar a tabela que está localizada em npc/pokemon seller.lua. Ao código: Em look.lua, procure por: elseif getItemAttribute(thing.uid, "unique") then substitue o else return true end que está "linkado" a esse IF por elseif NPCPrice[iname.name] then local qnt = 0 if thing.type == 0 then qnt = 1 else qnt = thing.type end local p = getThingPos(thing.uid) local calculo = NPCPrice[iname.name].price * qnt table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, "\n"..iname.description.." Price: $"..calculo..".") if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false else return true end Ficando assim: Spoiler elseif getItemAttribute(thing.uid, "unique") then local p = getThingPos(thing.uid) table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, " It's an unique item.\n"..iname.description) if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif NPCPrice[iname.name] then local qnt = 0 if thing.type == 0 then qnt = 1 else qnt = thing.type end local p = getThingPos(thing.uid) local calculo = NPCPrice[iname.name].price * qnt table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, "\n"..iname.description.." Price: $"..calculo..".") if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false else return true end Caso queira que o preço no look funcione para pokémon também, procure por table.insert(str, "It is genderless.") tem 3 linhas iguais a esse no look.lua. A linha na qual eu me refiro é a primeira encontrada no arquivo. Depois do end, adicione: local boosts = getItemAttribute(thing.uid, "boost") or 0 local precocertos = 0 if boosts > 50 then precocertos = ((gastostones[50] * 5) * 400) + ((boosts - 50) * 100000) else precocertos = ((gastostones[boosts] * 5) * 400) end if getItemAttribute (thing.uid, "ehditto") then pokename = "Ditto" end local pokeCost = pokePrice[pokename] or math.floor(pokes[pokename].level * 150) if pokename == "Ditto" then table.insert (str, " Not sellable.") elseif pokes[pokename] then if boosts == 0 then table.insert (str, " Price: $"..pokeCost) else table.insert (str, " Price: $"..pokeCost.. " + $"..precocertos.. " (BOOST)") end end E pronto, o preço no look está adicionado ao seu servidor. @EDIT: Vou postar também o script do Pokémon Seller, porque ele estava bugado no meu servidor, provavelmente estará no servidor de vocês também. npcs/scripts pokemon seller.lua Spoiler local focus = 0 local talk_start = 0 local conv = 0 local cost = 0 local pname = "" local baseprice = 0 local pokePrice = { ["Charmeleon"] = 10000, -- 1TD ["Charizard"] = 50000, -- 5TD ["Ivysaur"] = 10000, -- 1TD ["Venusaur"] = 50000, -- 5TD ["Wartortle"] = 10000, -- 1TD ["Blastoise"] = 50000, -- 5TD ["Caterpie"] = 200, -- 2HD ["Metapod"] = 3000, -- 30 HD ["Butterfree"] = 9000, -- 90 HD ["Weedle"] = 200, -- 2 HD ["Kakuna"] = 3000, -- 30 HD ["Beedrill"] = 9000, -- 90 HD ["Pidgey"] = 200, -- 2HD ["Pidgeotto"] = 6000, -- 60HD ["Pidgeot"] = 30000, -- 3TD ["Rattata"] = 50, -- 50DL ["Raticate"] = 2200, -- 22HD ["Spearow"] = 200, -- 2HD ["Fearow"] = 10000, -- 1TD ["Ekans"] = 1000, -- 10HD ["Arbok"] = 8000, -- 80HD ["Pikachu"] = 5000, -- 50HD ["Raichu"] = 12000, -- 1TD E 20HD ["Sandshrew"] = 1000, -- 10HD ["Sandslash"] = 10000, -- 1TD ["Nidoran Female"] = 800, -- 8HD ["Nidorina"] = 4000, -- 40HD ["Nidoqueen"] = 15000, -- 1TD E 50HD ["Nidoran Male"] = 800, -- 8HD ["Nidorino"] = 4000, -- 40HD ["Nidoqueen"] = 15000, -- 1TD E 50HD ["Clefairy"] = 6000, -- 60HD ["Clefable"] = 15000, -- 1TD E 50HD ["Vulpix"] = 1000, -- 10HD ["Ninetales"] = 9000, -- 90HD ["Jigglypuff"] = 6000, -- 60HD ["Wigglytuff"] = 15000, -- 1TD E 50 HD ["Zubat"] = 900, -- 9HD ["Golbat"] = 6000, -- 60HD ["Oddish"] = 800, -- 8HD ["Gloom"] = 8000, -- 80HD ["Vileplume"] = 13000, -- 1TD E 30HD ["Paras"] = 600, -- 6HD ["Parasect"] = 8000, -- 80HD ["Venonat"] = 600, -- 6HD ["Venomoth"] = 10000, -- 1TD ["Diglett"] = 200, ["Dugtrio"] = 3000, ["Meowth"] = 300, ["Persian"] = 3000, ["Psyduck"] = 500, ["Golduck"] = 8500, ["Mankey"] = 300, ["Primeape"] = 7000, ["Growlithe"] = 3500, ["Arcanine"] = 10000, ["Poliwag"] = 80, ["Poliwhirl"] = 2500, ["Poliwrath"] = 8000, ["Abra"] = 600, ["Kadabra"] = 3800, ["Alakazam"] = 9000, ["Machop"] = 500, ["Machoke"] = 2500, ["Machamp"] = 8000, ["Bellsprout"] = 80, ["Wepinbell"] = 1600, ["Victreebel"] = 7000, ["Tentacool"] = 300, ["Tentacruel"] = 10000, ["Geodude"] = 300, ["Graveler"] = 3500, ["Golem"] = 8000, ["Ponyta"] = 500, ["Rapidash"] = 6500, ["Slowpoke"] = 400, ["Slowbro"] = 3700, ["Magnemite"] = 400, ["Magneton"] = 3800, ["Farfetch'd"] = 4500, ["Doduo"] = 600, ["Dodrio"] = 5000, ["Seel"] = 400, ["Dewgong"] = 6800, ["Grimer"] = 300, ["Muk"] = 7000, ["Shellder"] = 200, ["Cloyster"] = 7000, ["Gastly"] = 300, ["Haunter"] = 1800, ["Gengar"] = 8000, ["Onix"] = 800, ["Drowzee"] = 400, ["Hypno"] = 6000, ["Krabby"] = 200, ["Kingler"] = 5200, ["Voltorb"] = 250, ["Electrode"] = 4200, ["Exeggute"] = 200, ["Exeggutor"] = 8000, ["Cubone"] = 400, ["Marowak"] = 7000, ["Hitmonlee"] = 10000, ["Hitmonchan"] = 10000, ["Lickitung"] = 10000, ["Koffing"] = 300, ["Weezing"] = 3500, ["Rhyhorn"] = 700, ["Rhydon"] = 7000, ["Chansey"] = 7000, ["Tangela"] = 2000, ["Kangaskhan"] = 10000, ["Horsea"] = 200, ["Seadra"] = 2500, ["Goldeen"] = 200, ["Seaking"] = 3000, ["Staryu"] = 400, ["Starmie"] = 5000, ["Mr. Mime"] = 10000, ["Scyther"] = 15000, ["Jynx"] = 15000, ["Xmas Jynx"] = 50000, ["Electabuzz"] = 10000, ["Magmar"] = 10000, ["Pinsir"] = 5000, ["Tauros"] = 5000, ["Magikarp"] = 5, ["Gyarados"] = 9000, ["Lapras"] = 10000, ["Ditto"] = 50000, ["Eevee"] = 3000, ["Vaporeon"] = 6000, ["Jolteon"] = 6000, ["Flareon"] = 6000, ["Porygon"] = 6000, ["Omanyte"] = 2000, ["Omastar"] = 7500, ["Kabuto"] = 2000, ["Kabutops"] = 7500, ["Aerodactyl"] = 20000, ["Snorlax"] = 20000, ["Dratini"] = 800, ["Dragonair"] = 5500, ["Dragonite"] = 15000, -- Segunda Geração ["Bayleef"] = 4000, ["Meganium"] = 8000, ["Quilava"] = 4000, ["Typhlosion"] = 8000, ["Croconaw"] = 4000, ["Feraligatr"] = 8000, ["Sentret"] = 250, ["Furret"] = 3500, ["Hoothoot"] = 500, ["Noctowl"] = 7000, ["Ledyba"] = 250, ["Ledian"] = 3800, ["Spinarak"] = 250, ["Ariados"] = 4500, ["Crobat"] = 8000, ["Chinchou"] = 700, ["Lanturn"] = 5500, ["Pichu"] = 500, ["Cleffa"] = 500, ["Igglybuff"] = 500, ["Togepi"] = 500, ["Togetic"] = 6000, ["Natu"] = 500, ["Xatu"] = 7000, ["Mareep"] = 300, ["Flaaffy"] = 3200, ["Ampharos"] = 8000, ["Bellossom"] = 7000, ["Marill"] = 3000, ["Azumarill"] = 7000, ["Sudowoodo"] = 10000, ["Politoed"] = 8000, ["Hoppip"] = 80, ["Skiploom"] = 2200, ["Jumpluff"] = 7500, ["Aipom"] = 1500, ["Sunkern"] = 50, ["Sunflora"] = 3400, ["Yanma"] = 3000, ["Wooper"] = 2000, ["Quagsire"] = 6000, ["Espeon"] = 6000, ["Umbreon"] = 6000, ["Murkrow"] = 600, ["Slowking"] = 10000, ["Misdreavus"] = 7500, ["Wobbuffet"] = 15000, ["Girafarig"] = 7500, ["Pineco"] = 300, ["Forretress"] = 6200, ["Dunsparce"] = 2500, ["Gligar"] = 3000, ["Steelix"] = 15000, ["Snubbull"] = 500, ["Granbull"] = 6000, ["Qwilfish"] = 4000, ["Scizor"] = 20000, ["Shuckle"] = 3000, ["Heracross"] = 10000, ["Sneasel"] = 2000, ["Teddiursa"] = 1000, ["Ursaring"] = 10000, ["Slugma"] = 900, ["Magcargo"] = 7000, ["Swinub"] = 700, ["Piloswine"] = 7500, ["Corsola"] = 4000, ["Remoraid"] = 200, ["Octillery"] = 6000, ["Delibird"] = 5000, ["Mantine"] = 12000, ["Skarmory"] = 12000, ["Houndour"] = 800, ["Houndoom"] = 7500, ["kingdra"] = 10000, ["Phanpy"] = 600, ["Donphan"] = 7800, ["Porygon2"] = 8000, ["Stantler"] = 4500, ["Tyrogue"] = 2000, ["Hitmontop"] = 10000, ["Smoochum"] = 450, ["Elekid"] = 600, ["Magby"] = 600, ["Miltank"] = 9000, ["Blissey"] = 10000, ["Larvitar"] = 1000, ["Pupitar"] = 5800, ["Tyranitar"] = 12000, -- Especiais ["Snowman Snorlax"] = 50000, ["Christmas Raichu"] = 20000, -- Megas ["Mega Alakazam"] = 50000, ["Mega Gengar"] = 50000, ["Mega Charizard"] = 50000, ["Mega Blastoise"] = 50000, ["Mega Venusaur"] = 50000, ["Mega Tyranitar"] = 50000, ["Mega Aerodactyl"] = 50000, ["Mega Blaziken"] = 50000, ["Mega Gyarados"] = 50000, } local gastostones = { [0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 6, [6] = 8, [7] = 10, [8] = 12, [9] = 15, [10] = 18, [11] = 21, [12] = 24, [13] = 28, [14] = 32, [15] = 36, [16] = 40, [17] = 45, [18] = 50, [19] = 55, [20] = 60, [21] = 66, [22] = 72, [23] = 78, [24] = 84, [25] = 91, [26] = 98, [27] = 105, [28] = 112, [29] = 120, [30] = 128, [31] = 136, [32] = 144, [33] = 153, [34] = 162, [35] = 171, [36] = 180, [37] = 190, [38] = 200, [39] = 210, [40] = 220, [41] = 231, [42] = 242, [43] = 253, [44] = 264, [45] = 276, [46] = 288, [47] = 300, [48] = 312, [49] = 325, [50] = 338, } 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[s]) >= 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 local boosts = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "boost") or 0 local pricemsgss = 0 if boosts > 50 then pricemsgss = price + ((gastostones[50] * 5) * 400) + ((boosts - 50) * 100000) else pricemsgss = price + ((gastostones[boosts] * 5) * 400) end 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 "..pricemsgss.." dollars. Would you like to sell another pokemon?") doPlayerAddMoney(cid, pricemsgss*100) doRemoveItem(getPlayerSlotItem(cid, 8).uid, 1) --alterado v1.6 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 local boost = getItemAttribute(ball, "boost") or 0 local pricemsg = 0 if boost > 50 then pricemsg = price + ((gastostones[50] * 5) * 400) + ((boost - 50) * 100000) else pricemsg = price + ((gastostones[boost] * 5) * 400) end 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 "..pricemsg.." dollars. Would you like to sell another pokemon?") doPlayerAddMoney(cid, pricemsg*100) doRemoveItem(ball, 1) 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 if conv == 1 and focus == cid then if string.lower(name) == "ditto" then selfSay('I dont buy that pokemon!') return true end end local boosts = 0 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 boosts = getItemAttribute(ball, "boost") or 0 if getItemAttribute (ball, "ehditto") then selfSay ("Are you trying to confuse me? I'll not buy anything of you while you are with that Ditto!") return true end end if getPlayerSlotItem(cid, 8).uid ~= 0 and getItemAttribute (getPlayerSlotItem(cid, 8).uid, "poke") == name then boosts = getItemAttribute(getPlayerSlotItem (cid, 8).uid, "boost") or 0 end if getPlayerSlotItem (cid, 8).uid ~= 0 then if getItemAttribute (getPlayerSlotItem(cid, 8).uid, "ehditto") then selfSay ("Are you trying to confuse me? I'll not buy anything of you while you are with that Ditto!") return true end end end local pricemsgs = 0 if boosts > 50 then pricemsgs = ((gastostones[50] * 5) * 400) + ((boosts - 50) * 100000) else pricemsgs = ((gastostones[boosts] * 5) * 400) 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 + "..pricemsgs.." dollars (boost)?") 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 Editado Agosto 26, 2016 8 anos por Talesigorvr (veja o histórico de edições) Não dou suporte via PM, crie um tópico caso tenha dúvidas. Isso previne que outras pessoas com a mesma dúvida criem tópicos desnecessários.
Postado Agosto 20, 2016 8 anos Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP. Spoiler Congratulations, your content has been approved! Thank you for your contribution, we of Tibia King we are grateful. Your content will help many other users, you received +1 REP. ➥ Regras | Seções OTServ | Seções BOT
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.