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"] = 200000,
["Hitmonchan"] = 200000,
["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"] = 60000,
["Umbreon"] = 60000,
["Murkrow"] = 10000,
["Slowking"] = 110000,
["Misdreavus"] = 150000,
["Wobbuffet"] = 150000,
["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"] = 200000,
["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("Volte seu Pokémon para fazer isso!")
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("Você não pode fazer isso enquanto está em Flying, Riding, Surfing, Diving ou 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! Obrigado por este maravilhoso "..name.."! Tome os seus "..price.." dollares. Gostaria de vender mais Pokémons?")
doPlayerAddMoney(cid, (price * 100) + ((getItemAttribute(ball, "boost")) * 1500000))
doRemoveItem(getPlayerSlotItem(cid, 8).uid, 1)
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! Obrigado por este maravilhoso "..getItemAttribute(ball, "poke").."! Tome os seus "..price.." dollares. Gostaria de vender mais Pokémons?")
doPlayerAddMoney(cid, (price * 100) + ((getItemAttribute(ball, "boost")) * 1500000))
doRemoveItem(getPlayerSlotItem(cid, 8).uid, 1)
return true
end
end
end
end
selfSay("Você não tem uma "..name..", certifique-se que está na sua mochila e não está desmaiado e ele não está em uma 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('Bem-vindo à minha loja! Eu compro Pokémons de todas as espécies, apenas me diga o nome dos 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 do Pokémon que você gostaria de vender.')
conv = 1
return true
end
if msgcontains(msg, 'no') and conv == 4 and focus == cid then
selfSay('Ok, te vejo por aí, então!')
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 Pokémons 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 pokemon que você está falando! Tem certeza que você soletrou corretamente?")
return true
end
baseprice = pokePrice[name] or math.floor(pokemon.level * 150) --alterado v1.6
cost = baseprice
pname = name
selfSay("Você tem certeza que quer vender um "..name.." por "..cost.." dollares?")
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 belos Pokémons! Venha aqui para vendê-los!",
"Quer vender um pokemon? Veio ao lugar certo!",
"Compro Pokémons! Excelentes ofertas!",
"Cansado de um pokemon? Por que você não vende 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("Tenho outros clientes, fale comigo quando você quiser me vender um Pokémon.")
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
Onde está em Vermelho você substitui para o número que melhor se encaixar.
1500000 = 14k por boost.
Estou tentando fazer com que o preço aumente por stone, se conseguir falo com você.
~edit
Aqui está: http://www.xtibia.com/forum/topic/226685-pdapokemon-seller-que-avalia-o-boost/







info
Grupo: Infante
Registrado: 28/01/12
Posts: 1.6k
Reputação: +262
Gênero: Masculino
Eu gostaria que editassem o NPC que compra Pokes. pagar uma grana a + pelo boost do poke(se possivel).
Script NPC:
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"] = 200000,
["Hitmonchan"] = 200000,
["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"] = 60000,
["Umbreon"] = 60000,
["Murkrow"] = 10000,
["Slowking"] = 110000,
["Misdreavus"] = 150000,
["Wobbuffet"] = 150000,
["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"] = 200000,
["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("Volte seu Pokémon para fazer isso!")
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("Você não pode fazer isso enquanto está em Flying, Riding, Surfing, Diving ou 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! Obrigado por este maravilhoso "..name.."! Tome os seus "..price.." dollares. Gostaria de vender mais Pokémons?")
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! Obrigado por este maravilhoso "..getItemAttribute(ball, "poke").."! Tome os seus "..price.." dollares. Gostaria de vender mais Pokémons?")
doRemoveItem(ball, 1)
doPlayerAddMoney(cid, price * 100)
return true
end
end
end
end
selfSay("Você não tem uma "..name..", certifique-se que está na sua mochila e não está desmaiado e ele não está em uma 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('Bem-vindo à minha loja! Eu compro Pokémons de todas as espécies, apenas me diga o nome dos 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 do Pokémon que você gostaria de vender.')
conv = 1
return true
end
if msgcontains(msg, 'no') and conv == 4 and focus == cid then
selfSay('Ok, te vejo por aí, então!')
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 Pokémons 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 pokemon que você está falando! Tem certeza que você soletrou corretamente?")
return true
end
baseprice = pokePrice[name] or math.floor(pokemon.level * 150) --alterado v1.6
cost = baseprice
pname = name
selfSay("Você tem certeza que quer vender um "..name.." por "..cost.." dollares?")
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 belos Pokémons! Venha aqui para vendê-los!",
"Quer vender um pokemon? Veio ao lugar certo!",
"Compro Pokémons! Excelentes ofertas!",
"Cansado de um pokemon? Por que você não vende 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("Tenho outros clientes, fale comigo quando você quiser me vender um Pokémon.")
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
REP+
Editado Janeiro 2 por FlamesAdmin