Ir para conteúdo

Pergunta

então galera meu npc está todo configurado mais a unica coisa que ele fala é I have been expecting you

alguem poderia me ajudar?



meu script

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
       
        if getPlayerStorageValue(cid, 157171) == 4 then
        return true
        end
       
    if((msgcontains(msg, 'hi') or msgcontains(msg, 'ola'))) then
                selfSay('Bem Vindo ao Mundo Pokemon! Voce gostaria de ser um mestre pokemon?', cid)
                talkState[talkUser] = 0
       
        elseif((msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and (getDistanceToCreature(cid) <= 3))then
                doPlayerSetVocation(cid, 1)
                selfSay('Muito Bom! Agora me Fale qual sua cidade natal?', cid)
                talkState[talkUser] = 3
        elseif((msgcontains(msg, 'Saffron')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then
                doPlayerSetTown(cid, 5)
                selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
                talkState[talkUser] = 4
        elseif ((msgcontains(msg, 'Cerulean')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then
                doPlayerSetTown(cid, 4)
                selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
                talkState[talkUser] = 4
        elseif ((msgcontains(msg, 'Fuchsia')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then
                doPlayerSetTown(cid, 9)
                selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
                talkState[talkUser] = 4
        elseif ((msgcontains(msg, 'Lavender')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then
                doPlayerSetTown(cid, 7)
                selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
        elseif ((msgcontains(msg, 'Viridian')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then
                doPlayerSetTown(cid, 2)
                selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
                talkState[talkUser] = 4
        elseif ((msgcontains(msg, 'Pewter')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then
                doPlayerSetTown(cid, 3)
                selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
                talkState[talkUser] = 4
        elseif ((msgcontains(msg, 'Vermilion')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then
                doPlayerSetTown(cid, 8)
                selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
                talkState[talkUser] = 4
        elseif ((msgcontains(msg, 'Cinnabar')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then
                doPlayerSetTown(cid, 10)
                selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
                talkState[talkUser] = 4
        elseif ((msgcontains(msg, 'Celadon')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then
                doPlayerSetTown(cid, 6)
                selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
                talkState[talkUser] = 4
        elseif((msgcontains(msg, 'Charmander') ) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 4)then
                doPokemonToPlayer(cid, "Charmander")
                selfSay('Agora voce tem um pokemon e pode seguir  sua Jornada, Ate Ate logo!', cid)
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                setPlayerStorageValue(cid, 157171, 4)
        elseif((msgcontains(msg, 'Bulbasaur') ) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 4)then
                doPokemonToPlayer(cid, "Bulbasaur")
                selfSay('Agora voce tem um pokemon e pode seguir  sua Jornada, Ate Ate logo!', cid)
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                setPlayerStorageValue(cid, 157171, 4)
        elseif((msgcontains(msg, 'Squirtle') ) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 4)then
                doPokemonToPlayer(cid, "Squirtle")
                selfSay('Agora voce tem um pokemon e pode seguir  sua Jornada, Ate Ate logo!', cid)
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
                setPlayerStorageValue(cid, 157171, 4)
        end
return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

peço desculpas se estiver em local errado

Editado por valakas
Link para o comentário
https://xtibia.com/forum/topic/234851-bug-no-meu-npc/
Compartilhar em outros sites

14 respostass a esta questão

Posts Recomendados

  • 0
  Em 18/06/2015 em 02:06, valakas disse:

premium.lua, mais o npc que esta bugado não é esse é o que esta no topico la em cima

Npc:

<?xml version="1.0" encoding="UTF-8"?>
	<npc name="Oak" script="data/npc/scripts/inicial.lua" walkinterval="0" floorchange="0" access="5" >
	<health now="150" max="150"/>
	<look type="177" head="17" body="54" legs="114" feet="0" addons="2" />
	<parameters>
		<parameter key="message_greet" value="Bem Vindo ao Mundo Pokemon |PLAYERNAME|! Voce gostaria de ser um mestre pokemon?"/>
		<parameter key="message_farewell" value="Tchau! Ate a proxima."/>
	</parameters>
</npc>
inicial.lua:

 

  Mostrar conteúdo oculto

 

Link para o comentário
https://xtibia.com/forum/topic/234851-bug-no-meu-npc/#findComment-1656611
Compartilhar em outros sites

  • 0
  Em 17/06/2015 em 15:52, valakas disse:

então galera meu npc está todo configurado mais a unica coisa que ele fala é I have been expecting you

 

alguem poderia me ajudar?

Tenta assim:

 

  Mostrar conteúdo oculto

 

Link para o comentário
https://xtibia.com/forum/topic/234851-bug-no-meu-npc/#findComment-1656430
Compartilhar em outros sites

  • 0
  Em 17/06/2015 em 19:09, Zet0N0Murmurouu disse:

Poste o Xml dele!

http://pastebin.com/TaHj39ye

  Em 17/06/2015 em 19:32, Bruno Minervino disse:

Tenta assim:

 

  Mostrar conteúdo oculto

 

n funfou aparece a mesma coisa, os outros npc funfa normalmente

Link para o comentário
https://xtibia.com/forum/topic/234851-bug-no-meu-npc/#findComment-1656432
Compartilhar em outros sites

  • 0
  Em 17/06/2015 em 19:47, valakas disse:

http://pastebin.com/TaHj39ye

 

n funfou aparece a mesma coisa, os outros npc funfa normalmente

posta um que funfe pra ver o que está de errado

Link para o comentário
https://xtibia.com/forum/topic/234851-bug-no-meu-npc/#findComment-1656486
Compartilhar em outros sites

  • 0
  Em 17/06/2015 em 20:18, Bruno Minervino disse:

posta um que funfe pra ver o que está de errado

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Dalk" script="data/npc/scripts/premium.lua" walkinterval="3000" floorchange="0" access="5" >
<health now="150" max="150"/>
<look type="259" head="0" body="114" legs="114" feet="0"/>
<parameters>
<parameter key="message_greet" value="Welcome to the diamond store, here you are able to upgrade your account to diamond(10D), change your hometown(5D), change sex(5D) and blessing(3D)."/>
<parameter key="message_farewell" value="Bye! See you next time."/>
</parameters>
</npc>
Link para o comentário
https://xtibia.com/forum/topic/234851-bug-no-meu-npc/#findComment-1656513
Compartilhar em outros sites

  • 0
  Em 17/06/2015 em 22:21, valakas disse:

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Dalk" script="data/npc/scripts/premium.lua" walkinterval="3000" floorchange="0" access="5" >
<health now="150" max="150"/>
<look type="259" head="0" body="114" legs="114" feet="0"/>
<parameters>
<parameter key="message_greet" value="Welcome to the diamond store, here you are able to upgrade your account to diamond(10D), change your hometown(5D), change sex(5D) and blessing(3D)."/>
<parameter key="message_farewell" value="Bye! See you next time."/>
</parameters>
</npc>

 

Posta o arquivo do npc tbm, não só o xml

Link para o comentário
https://xtibia.com/forum/topic/234851-bug-no-meu-npc/#findComment-1656529
Compartilhar em outros sites

  • 0
  Em 17/06/2015 em 23:08, roriscrave disse:

posta o arquivo premium.lua na pasta dos npc

 

 

  Em 18/06/2015 em 00:01, Bruno Minervino disse:

Posta o arquivo do npc tbm, não só o xml

 

premium.lua, mais o npc que esta bugado não é esse é o que esta no topico la em cima

 

  Mostrar conteúdo oculto

Link para o comentário
https://xtibia.com/forum/topic/234851-bug-no-meu-npc/#findComment-1656540
Compartilhar em outros sites

  • 0

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local var_city = {
["saffron"] = 5,
["cerulean"] = 4,
["fuchsia"] = 9,
["viridian"] = 2,
["lavender"] = 7,
["pewter"] = 3,
["vermilion"] = 8,
["cinnabar"] = 10,
["celadon"] = 6
}
local ret_pokes = {"bulbasaur", "charmander", "squirtle"}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser, msg  = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower()
if isInArray({'yes', 'sim', 'si'}, msg) then
if getPlayerStorageValue(cid, 157171) == 2 then
selfSay("Desculpe, mas só pode fazer uma escolha.", cid)
elseif getPlayerStorageValue(cid, 157171) == 1 then
selfSay('Agora escolha seu Pokemon Inicial? {Bulbasaur}, {Charmander} ou {Squirtle} ?', cid)
talkState[talkUser] = 2
else
selfSay("Muito Bom! Agora me Fale qual sua cidade natal? {saffron}, {cerulean} ou {fuchsia} ?", cid)
talkState[talkUser] = 1
end
elseif talkState[talkUser] == 1 then
if var_city[msg] then
doPlayerSetTown(cid, var_city[msg])
setPlayerStorageValue(cid, 157171, 1)
selfSay('Agora escolha seu Pokemon Inicial? {Bulbasaur}, {Charmander} ou {Squirtle} ?', cid)
talkState[talkUser] = 2
else
selfSay("está cidade não está disponivel.", cid)
end
elseif talkState[talkUser] == 2 then
if isInArray(ret_pokes, msg) then
doPokemonToPlayer(cid, msg)
setPlayerStorageValue(cid, 157171, 2)
selfSay('Agora voce tem um pokemon e pode seguir  sua Jornada, Ate Ate logo!', cid) 
talkState[talkUser] = 0
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
else
selfSay('você só pode escolher {Bulbasaur}, {Charmander} ou {Squirtle}!', cid) 
end
elseif msg == "no" and talkState[talkUser] >= 1 then
selfSay("tudo bem então.", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end  
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Editado por Vodkart
Link para o comentário
https://xtibia.com/forum/topic/234851-bug-no-meu-npc/#findComment-1656616
Compartilhar em outros sites

  • 0
  Em 18/06/2015 em 11:52, Bruno Minervino disse:

Npc:

<?xml version="1.0" encoding="UTF-8"?>
	<npc name="Oak" script="data/npc/scripts/inicial.lua" walkinterval="0" floorchange="0" access="5" >
	<health now="150" max="150"/>
	<look type="177" head="17" body="54" legs="114" feet="0" addons="2" />
	<parameters>
		<parameter key="message_greet" value="Bem Vindo ao Mundo Pokemon |PLAYERNAME|! Voce gostaria de ser um mestre pokemon?"/>
		<parameter key="message_farewell" value="Tchau! Ate a proxima."/>
	</parameters>
</npc>
inicial.lua:

 

  Mostrar conteúdo oculto

 

 

 

  Em 18/06/2015 em 12:50, Vodkart disse:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local var_city = {
["saffron"] = 5,
["cerulean"] = 4,
["fuchsia"] = 9,
["viridian"] = 2,
["lavender"] = 7,
["pewter"] = 3,
["vermilion"] = 8,
["cinnabar"] = 10,
["celadon"] = 6
}
local ret_pokes = {"bulbasaur", "charmander", "squirtle"}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser, msg  = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower()
if isInArray({'yes', 'sim', 'si'}, msg) then
if getPlayerStorageValue(cid, 157171) == 2 then
selfSay("Desculpe, mas só pode fazer uma escolha.", cid)
elseif getPlayerStorageValue(cid, 157171) == 1 then
selfSay('Agora escolha seu Pokemon Inicial? {Bulbasaur}, {Charmander} ou {Squirtle} ?', cid)
talkState[talkUser] = 2
else
selfSay("Muito Bom! Agora me Fale qual sua cidade natal? {saffron}, {cerulean} ou {fuchsia} ?", cid)
talkState[talkUser] = 1
end
elseif talkState[talkUser] == 1 then
if var_city[msg] then
doPlayerSetTown(cid, var_city[msg])
setPlayerStorageValue(cid, 157171, 1)
selfSay('Agora escolha seu Pokemon Inicial? {Bulbasaur}, {Charmander} ou {Squirtle} ?', cid)
talkState[talkUser] = 2
else
selfSay("está cidade não está disponivel.", cid)
end
elseif talkState[talkUser] == 2 then
if isInArray(ret_pokes, msg) then
doPokemonToPlayer(cid, msg)
setPlayerStorageValue(cid, 157171, 2)
selfSay('Agora voce tem um pokemon e pode seguir  sua Jornada, Ate Ate logo!', cid) 
talkState[talkUser] = 0
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
else
selfSay('você só pode escolher {Bulbasaur}, {Charmander} ou {Squirtle}!', cid) 
end
elseif msg == "no" and talkState[talkUser] >= 1 then
selfSay("tudo bem então.", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end  
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Vlw galera Ambos ajudaram,

 

Bom saber que ainda existe alguem que ajuda nos forums ^^

Link para o comentário
https://xtibia.com/forum/topic/234851-bug-no-meu-npc/#findComment-1656665
Compartilhar em outros sites

×
×
  • Criar Novo...