Ir para conteúdo
  • Cadastre-se

NPC DE VIAGEM PARA OT 8.6 COM VÁRIOS DESTINOS


Posts Recomendados

Porfavor galera alguem me passa o script de um npc de barco com vários destinos ja estou procurando faz tempo e todos os que eu testei não funfaram no meu ot, agradeço muito se alguem me ajudar meu ot ta com portais e fica triste isso!!

Se Ajudei Clique no rep_up.png ao Lado, Não Custa nada :D!!

Link para o post
Compartilhar em outros sites

blz foi mal!!

Se Ajudei Clique no rep_up.png ao Lado, Não Custa nada :D!!

Link para o post
Compartilhar em outros sites

"data/npc/Captain Barco" :

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Barco" script="captainbarcoc.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="23" body="46" legs="106" feet="42" addons="0"/>
    <parameters>
        <parameter key="module_travel" value="1"/>
		<parameter key="message_greet" value="Ola |PLAYERNAME|. Eu posso levar voce para alguns lugares, fale {travel}."/>
        <parameter key="travel_destinations" value="NOMEDACIDADE,33193,31984,7,0;NOMEDACIDADE,32954,32022,6,0;NOMEDACIDADE,32285,32891,6,0."/>
</parameters>
</npc>

"data/npc/scripts/captainbarco" :

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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 onPlayerEndTrade(cid)				npcHandler:onPlayerEndTrade(cid)			end
function onPlayerCloseChannel(cid)			npcHandler:onPlayerCloseChannel(cid)		end

npcHandler:addModule(FocusModule:new())

 

<parameter key="travel_destinations" value="NOMEDACIDADE,33193,31984,7,0;

Nome da cidade para onde o player vai ser teleportado.

Coordenadas para onde o player vai ser teleportado.

Quando vai custar a viagem para o local de destino.
 

Link para o post
Compartilhar em outros sites

O exemplo do Vitin é bom, e tem esse tbem que tu define o script ... 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'That is quite a long unprofitable travel. I\'ll bring you to Yalahar for 400 gold though. Is that ok with you?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 400, destination = {x=32803, y=31270, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Maybe another time, then.'})

npcHandler:addModule(FocusModule:new())

Ai para adcionar outros locais é só colocar o código abaixo antes da ultima linha e mudar o nome da city e o destino (x,y,z)

local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'That is quite a long unprofitable travel. I\'ll bring you to Yalahar for 400 gold though. Is that ok with you?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 400, destination = {x=32803, y=31270, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Maybe another time, then.'})

É isso ai!

Link para o post
Compartilhar em outros sites

aff n ta dando!! ta dando erro eles são pra ot 8.60?

Se Ajudei Clique no rep_up.png ao Lado, Não Custa nada :D!!

Link para o post
Compartilhar em outros sites

ele até chega a conversar mais não viaja!! quando diz o nome da cidade ele n responde mais nada.

Se Ajudei Clique no rep_up.png ao Lado, Não Custa nada :D!!

Link para o post
Compartilhar em outros sites

af..

Se Ajudei Clique no rep_up.png ao Lado, Não Custa nada :D!!

Link para o post
Compartilhar em outros sites

sinceramente cara n sei oq ta rolando!!

Se Ajudei Clique no rep_up.png ao Lado, Não Custa nada :D!!

Link para o post
Compartilhar em outros sites
Link para o post
Compartilhar em outros sites

não ta dando erro no distro n mano, tipo eu falo com o npc ele responde mais quando seleciono um destino e digo yes n ta viajando! :/

Se Ajudei Clique no rep_up.png ao Lado, Não Custa nada :D!!

Link para o post
Compartilhar em outros sites

Tente assim (esse foi testado em 10.37)

Crie em data/npcs/scripts/ um arquivo chamado destination.lua e coloque isso dentro:

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
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
        
        
        -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
	local travelNode = keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Thais?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32310, y=32210, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

        local travelNode = keywordHandler:addKeyword({'carlin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Carlin?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32387, y=31820, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
        
	local travelNode = keywordHandler:addKeyword({'ab\'dendriel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Ab\'dendriel?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32734, y=31668, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

        local travelNode = keywordHandler:addKeyword({'gray island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Gray Island?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33196, y=31984, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
        			
        
	local travelNode = keywordHandler:addKeyword({'port hope'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Port Hope?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32527, y=32784, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

	local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Svargrond?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32341, y=31108, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

	local travelNode = keywordHandler:addKeyword({'liberty bay'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Liberty Bay?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32285, y=32892, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

            

			local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Venore?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32954, y=32022, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
        
	local travelNode = keywordHandler:addKeyword({'ankrahmun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Ankrahmun free?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33092, y=32883, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

	local travelNode = keywordHandler:addKeyword({'cormaya'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Cormaya?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33288, y=31956, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

        keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where do you want to go? To Thais, Carlin, Ab\'Dendriel, Venore, Port Hope, Ankrahmun, Liberty Bay or the isle Cormaya?'})
        keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I\'m the captain of this sailing ship.'})
		keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I\'m the captain of this sailing ship.'})


npcHandler:addModule(FocusModule:new())

 

Depois crie em data/npcs/ um arquivo xml com o nome Captain Teste.xml e coloque isso dentro:

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Teste" script="Destination.lua" walkinterval="2000" floorchange="0">
  <health now="100" max="100" />
  <look type="129" head="19" body="113" legs="95" feet="115" addons="0" />
<parameters>
<parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service." />
<parameter key="message_walkaway" value="Good bye. Recommend us if you were satisfied with our service." />
 <parameter key="module_keywords" value="1" />
 <parameter key="keywords" value="name;edron;yalahar;" />
 <parameter key="keyword_reply1" value="My name is Captain Teste from the Royal Tibia Line." />
 <parameter key="keyword_reply2" value="This is Edron. Where do you want to go?" />
  <parameter key="keyword_reply3" value="I'm sorry, but we don't serve this route. However, I heard that Wyrdin here in Edron is looking for adventurers to go on a trip to Yalahar for him." />
 <parameter key="message_greet" value="Welcome on board, |PLAYERNAME|. Where may I {sail} you today?"/>
</parameters>
</npc>

 

Se não funfar é porque você esta fazendo algo errado!

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo