Aí vai. Crie um arquivo .xml com o nome do seu NPC. Substitua as mensagens que você quiser (mantenha o {travel} no greet porque é com essa palavra que ele diz os destinos. Mude o nome do NPC também.
<npc name="Barqueiro Nelson" script="data/npc/scripts/barco.lua" floorchange="0" access="0" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="325" head="0" body="114" legs="114" feet="114" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Paz, viajante. Diga {travel} e eu direi para onde posso leva-lo" />
<parameter key="message_walkaway" value="Boa viagem!"/>
<parameter key="message_farewell" value="Boa viagem!"/>
</parameters>
</npc>
Dentro de npcs/scripts coloque esse código em um arquivo que você deve criar com o nome de barco.lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'dragon land'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você quer ir para a Dragon Land por 500gps?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 20, cost = 500, destination = {x=121, y=119, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Boa sorte em suas viagens'})
local travelNode = keywordHandler:addKeyword({'south jungle'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você quer ir para a South Jungle por 500gps?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, cost = 500, destination = {x=193, y=107, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Boa sorte em suas viagens'})
local travelNode = keywordHandler:addKeyword({'dwarven hideout'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você quer ir para Dwarven Hideout por 500gps?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 10, cost = 500, destination = {x=169, y=131, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Boa sorte em suas viagens'})
local travelNode = keywordHandler:addKeyword({'elemental forest'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você quer ir para a Elemental Forest por 500gps?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 30, cost = 500, destination = {x=52, y=108, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Boa sorte em suas viagens'})
local travelNode = keywordHandler:addKeyword({'hell port'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você quer ir para Hell Port por 1000gps?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 60, cost = 1000, destination = {x=47, y=202, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Boa sorte em suas viagens'})
local travelNode = keywordHandler:addKeyword({'central port'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você quer ir para Central Port por 200gps?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, cost = 200, destination = {x=119, y=60, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Boa sorte em suas viagens'})
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu posso levá-lo a \'Dragon Land\', \'Dwarven Hideout\', \'Hell Port\', \'Elemental Forest\', \'Frozen Dungeon\', \'Central Port\', \'Hoover City\' ou \'South Jungle\'.'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
Pra cada
local travelNode = keywordHandler:addKeyword({'central port'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você quer ir para Central Port por 200gps?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 1, cost = 200, destination = {x=119, y=60, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Boa sorte em suas viagens'})
É um local que ele poderá levar. 'central port' é o nome da cidade. text = '...' é o que ele vai dizer pra confirmar se o jogador quer ir. premium = true para precisar de premium e premium = false para jogadores free poderem usar. cost é o custo em gps, destination é a coordenada do lugar. E o último text é o que o NPC manda quando o cara viaja recusa. É só você usar ctrl+c e ctrl+v nessa parte para adicionar novos lugares.
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu posso levá-lo a \'Dragon Land\', \'Dwarven Hideout\', \'Hell Port\', \'Elemental Forest\', \'Frozen Dungeon\', \'Central Port\', \'Hoover City\' ou \'South Jungle\'.'})
No final tem text = '...'
Ali você edita o que o NPC vai falar com o jogador disser travel.





info
Grupo: Campones
Registrado: 17/11/11
Posts: 45
Reputação: 0
Char no Tibia: Claudio Pally
aeew pessoal eu queria um npc que teleporta player free vamos supor para Syots e Carlin é free entao ele teleporta só free e vip, aeew venore, já é só pra vip entenderam ??
Entao no caso o npc vai teleportar pra cidades free todos os player, e para a cidade vip, só player vips...
Meu systema vip eu n sei, era vipdays, mas eu exclui e coloquei um ITEM como vip tlgd? pra quando clikar ganhar vip, alguém pode me falar como ver o systen vip ?
edit#
ta aew meu actions do item que da vip
local cfg = {
Editado Setembro 18 por Claudio14