Posta o script e eu digo ondi mudar
- Fórum
- xTibia - Notícias e Suporte
- Soluções
- Archived
- Como Ajustar O Npc De Barco Para As Citys Do Meu Ot?
info
Grupo: Visconde
Registrado: 15/03/08
Posts: 295
Reputação: +1

Posta o script e eu digo ondi mudar
Bom, tinha um arquivo intitulado de thy boat.xml e tinha issu dentro:
<npc name="Roxanne, A Pirata" script="data/npc/scripts/thy boat.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1"><health now="150" max="150"/>
<look type="155" head="79" body="128" legs="114" feet="0" addons="3"/>
<parameters>
</parameters>
</npc>
eu entrava no RME e colocava ela no mapa, qndo eu iniciava ela naum aparecia no mapa. Tudo bem vamos tentar arrumar, fui no script e o thy boat.lua tava assim:
local focus = 0local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
if getPlayerPremium(cid) then
selfSay('Ola ' .. getCreatureName(cid) .. '! Eu posso te levar para Murnia, Saaha,Venga,Thyrania e Icya. Lembrando que a viagem custa 50 gps.')
focus = cid
talk_start = os.clock()
else
selfSay('Desculpe mas somente quem eh premium pode viajar no meu barco.')
focus = 0
talk_start = 0
end
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'murnia') then
if pay(cid,50) then
travel(cid, 883, 582, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
end
elseif msgcontains(msg, 'saaha') then
if pay(cid,50) then
travel(cid, 104, 412, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
end
elseif msgcontains(msg, 'venga') then
if pay(cid,50) then
travel(cid, 432, 420, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
end
elseif msgcontains(msg, 'icya') then
if pay(cid,50) then
travel(cid, 761, 730, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
end
elseif msgcontains(msg, 'thyrania') then
if pay(cid,50) then
travel(cid, 107, 28, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 20 then
if focus > 0 then
selfSay('...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('...')
focus = 0
end
end
end
não interdi porcaria nenhuma, eu tenhu outro ot intaum fui pegar o npc dele só q ele tava ajustado para o outro ot e tava assim:
<?xml version="1.0"?><npc name="Captain Antonio" script="data/npc/scripts/boat_mystic.lua" access="3">
<look type="151" head="114" body="94" legs="114" feet="0" addons="3"/>
<parameters>
<parameter key="module_travel" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|. Levo voce para Carlin, Ab'Dendriel, New Island, Thais, Edron, Ankrahmun, Venore, Port Hope, Svargrond, Evento."/>
<parameter key="travel_destinations" value="carlin,732,637,6,100;ab'dendriel,1080,488,6,100;
ab,1080,488,6,100;new island,1483,2834,6,100;thais,387,1354,6,100;edron,1608,470,6,100;ankrahmun,1532,
1012,6,100;venore,1137,880,6,100;port hope,1521,1380,6,100;svargrond,781,181,6,100;evento,649,361,6,100;"/>
</parameters>
</npc>
mudei para o meu ot e ficou assim:
<?xml version="1.0"?><npc name="Captain Antonio" script="data/npc/scripts/boat_mystic.lua" access="3">
<look type="151" head="114" body="94" legs="114" feet="0" addons="3"/>
<parameters>
<parameter key="module_travel" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|. Levo voce para Thyrania, Saaha, Murnia, Venga, Icya."/>
<parameter key="travel_destinations" value="Thyrania,71,33,8,100;Saaha,101,395,8,100;Murnia,844,561,7,100;Venga,402,434
,7,100;Icya,795,712,7,100;"/>
</parameters>
</npc>
ele aparece no meu ot, só q qndo falo com ele ele me responde, fala as cidades mais eu respondo falando o nome das cidade e naum acontece nada, ele naum responde, naum fala c eu naum tenhu dinheiro ou qnto custa a passagen, já tentei falando travel aparece em inglês mais naum dah nada tbm. Toda vez q alterei o meu npc naum o alterei no RME, pelo mapa mas tenhu quase certeza q naum eh issu, e as cordenadas e coloquei saum do templo das cidade.
Mtu obrigado pela atenção e compreenssão
info
Grupo: Campones
Registrado: 04/10/06
Posts: 65
Reputação: +1
Char no Tibia: Bebado On Menera

elseif msgcontains(msg, 'icya') then
if pay(cid,50) then
travel(cid, 761, 730, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
end
Tá escrito isso por ai!
dai xo ti explica!
elseif msgcontains(msg, 'Venore') then // Onde que ta entre aspas eh o nome que voce ira falar para o npc entender!
if pay(cid,50) then // Numero 50 (Voce pode trocalo , eh o valor que a pessoa ira pagar para viajar)
travel(cid, 761, 730, 6) // 761, 730, 6 ( São as coordenadas por dai você muda para o tmplo da cidade exemplo: 160 54 7 Ficaria assim: travel(cid, 160, 54, 7)
selfSay('Let\'s go!') // Mensagem que ele ira falar quando vc tiver pagado para ser teleportado
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.') // Mensagem que aparecera quando voce nao tiver o dinheiro
end
OUTRA COISA Que tá ai e ti explicarei!
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 thenif getPlayerPremium(cid) then
selfSay('Ola ' .. getCreatureName(cid) .. '! Eu posso te levar para Murnia, Saaha,Venga,Thyrania e Icya. Lembrando que a viagem custa 50 gps.')
focus = cid
talk_start = os.clock()
else
selfSay('Desculpe mas somente quem eh premium pode viajar no meu barco.')
focus = 0
talk_start = 0
end
EXPLICANDO....
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then // não mexa ~~> explicando: Aqui fala que para iniciar a conversação com o npc
a mensagem tera conter a palavra 'hi' ![]()
if getPlayerPremium(cid) then // Aqui eh a funcao que so o playerpremium ira ir //não mexa
selfSay('Ola ' .. getCreatureName(cid) .. '! Eu posso te levar para Murnia, Saaha,Venga,Thyrania e Icya. Lembrando que a viagem custa 50 gps.') // Aqui tipo não tem necessidade ninhuma mais tipo, dai voce poe otra cidade com otro nome e seu player nem irá saber entao vamo mudar de jeito que os player reconheça
Faz de conto que a cidade eh "XTIBIA,Tibia,CLAW,Argax"
Iria fica assim
EXEMPLO:
"selfSay('Ola ' .. getCreatureName(cid) .. '! Eu posso te levar para XTIBIA,Tibia,CLAW,Argax. Lembrando que a viagem custa 50 gps.')"
focus = cid // não mexa
talk_start = os.clock() //não mexa
else //não mexa
selfSay('Desculpe mas somente quem eh premium pode viajar no meu barco.') //Mensagem si o player nao for premium!
focus = 0 //não mexa
talk_start = 0 //não mexa
end //não mexa
Editado Dezembro 16 por Clawpower
aow, eu coloquei o npc Captain Antonio, esse eh o script dele:
<?xml version="1.0"?><npc name="Captain Antonio" script="data/npc/scripts/thy boat.lua" access="3">
<look type="151" head="114" body="94" legs="114" feet="0" addons="3"/>
<parameters>
<parameter key="module_travel" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|. Levo voce para Thyrania, Saaha, Murnia, Venga, Icya."/>
<parameter key="travel_destinations" value="Thyrania,71,33,8,100;Saaha,101,395,8,100;Murnia,844,561,7,100;Venga,402,434
,7,100;Icya,795,712,7,100;"/>
</parameters>
</npc>
e coloquei o script do thy boat:
( não postarei o script do thy boat pq eh mtu grande, ele está logo mais ali em cima da página)
e qndo eu falo com ele dh o seguinte erro na página do server:
[17/12/2008 12:00:30] Lua Script Error: [Npc interface]
[17/12/2008 12:00:30] data/npc/scripts/thy boat.lua:onCreatureSay
[17/12/2008 12:00:30] data/npc/lib/npc.lua:43: attempt to perform arithmetic on global 'cx' (a table value)
[17/12/2008 12:00:30] stack traceback:
[17/12/2008 12:00:30] data/npc/lib/npc.lua:43: in function 'getDistanceToCreature'
[17/12/2008 12:00:30] data/npc/scripts/thy boat.lua:39: in function <data/npc/scripts/thy boat.lua:36>
[17/12/2008 12:00:32] Lua Script Error: [Npc interface]
[17/12/2008 12:00:32] data/npc/scripts/thy boat.lua:onCreatureSay
[17/12/2008 12:00:32] data/npc/lib/npc.lua:43: attempt to perform arithmetic on global 'cx' (a table value)
[17/12/2008 12:00:32] stack traceback:
[17/12/2008 12:00:32] data/npc/lib/npc.lua:43: in function 'getDistanceToCreature'
[17/12/2008 12:00:32] data/npc/scripts/thy boat.lua:39: in function <data/npc/scripts/thy boat.lua:36>
[17/12/2008 12:00:34] Lua Script Error: [Npc interface]
[17/12/2008 12:00:34] data/npc/scripts/thy boat.lua:onCreatureSay
[17/12/2008 12:00:34] data/npc/lib/npc.lua:43: attempt to perform arithmetic on global 'cx' (a table value)
[17/12/2008 12:00:34] stack traceback:
[17/12/2008 12:00:34] data/npc/lib/npc.lua:43: in function 'getDistanceToCreature'
[17/12/2008 12:00:34] data/npc/scripts/thy boat.lua:39: in function <data/npc/scripts/thy boat.lua:36>
[17/12/2008 12:00:35] Lua Script Error: [Npc interface]
[17/12/2008 12:00:35] data/npc/scripts/thy boat.lua:onCreatureSay
[17/12/2008 12:00:35] data/npc/lib/npc.lua:43: attempt to perform arithmetic on global 'cx' (a table value)
[17/12/2008 12:00:35] stack traceback:
[17/12/2008 12:00:35] data/npc/lib/npc.lua:43: in function 'getDistanceToCreature'
[17/12/2008 12:00:35] data/npc/scripts/thy boat.lua:39: in function <data/npc/scripts/thy boat.lua:36>
o qual eu acho q tem bastante a ver com o NPC eh o OnCreatureSays, mais sei lá, alguém poderia dar uma idéia???
Editado Dezembro 17 por Argax
info
Grupo: Campones
Registrado: 04/10/06
Posts: 65
Reputação: +1
Char no Tibia: Bebado On Menera

Faz assim /s Roxanne, A Pirata
Vai dar certinho sim ![]()
Si qusier que configuro pra vc mi add msn
loizinho_10@hotmail.com
Editado Dezembro 17 por Clawpower



info
Grupo: Campones
Registrado: 17/11/08
Posts: 2
Reputação: 0
Tenho um ot, já está funcionando quase q por completo mas o npc do barco qndo conversa com ele ele fala de cidades como venore, carlin mais naum tenhu essa cidade no meu ot como fasso para ajustá-lo ao meu ot com as cidade q eu tenho??
desde já muito obrigado