[Encerrado] (Duvida) Npc Pokemon Colletor

BrunooMaciell
em Tópicos Sem Resposta

BrunooMaciell

Bruno Maciel
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 27/08/11Posts: 1919Gênero: MasculinoChar no Tibia: Bruno Maciel

Estou com uma duvida relacionado ao npc pokemon colletor !!

 

Duvida no meu serve o npc colletor da muted ao player quano ele fala o nome do pokemon errado e quando amis ele fala errado amsi o muted crese o valor do numero !!

 

eu queria tirar este muted !!

 

Script

 

local focus = 0

local talk_start = 0

local conv = 0

local cost = 0

local pname = ""

local baseprice = 0

local pokePrice = {

["Bulbasaur"] = 3000, --PS: teve mais coisas mudadas entao.. peguem o script todo!

["Ivysaur"] = 4500, --alterado v1.6

["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 --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

 

Yan Oliveira

Yan18
avatar
Moderador
Moderador

INFOS

Grupo: ModeradorRegistrado: 05/06/12Posts: 2221Gênero: Masculino

Ve se assim ta bom:

 

 

local focus = 0

local talk_start = 0

local conv = 0

local cost = 0

local pname = ""

local baseprice = 0

local pokePrice = {

["Bulbasaur"] = 3000, --PS: teve mais coisas mudadas entao.. peguem o script todo!

["Ivysaur"] = 4500, --alterado v1.6

["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 --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 = 10

local intervalmax = 30

local delay = 5

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

BrunooMaciell

Bruno Maciel
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 27/08/11Posts: 1919Gênero: MasculinoChar no Tibia: Bruno Maciel

/\ este nao tiro ainda o muted do npc

 

=/

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

mano n tem como o npc da muted o.O tem algu errado em outro lugar... ;x

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

falcon02

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 27/10/12Posts: 60Char no Tibia: Skypiea

Npc fodao =O Contrata ele pra ele virar tutor

BrunooMaciell

Bruno Maciel
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 27/08/11Posts: 1919Gênero: MasculinoChar no Tibia: Bruno Maciel

@Slicer

 

sim o meu npc pokemon colletor ta dando erro entao ta dando muted quando fala ou rept o nome do pokemon errado nao sei se e erro memso sei la

 

=/

Stigal

don't ever stop...
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 28/11/10Posts: 3402Gênero: Masculino
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.

VI6MDIG.png

 

"O fracasso é a oportunidade de se começar de novo inteligentemente"

Minhas Redes Sociais: Youtube | Página & Grupo | Steam  | Discord Xtibia | Skype: @mrooger

 

OTpanel