• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

How To Add The Npc Who Let Players Travel..

captain.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Fearless" script="data/npc/scripts/all_boat.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="129" head="19" body="69" legs="107" feet="50" addons="0"/>
    <parameters>
        <parameter key="message_greet" value="Welcome on board, Sir |PLAYERNAME|. I can take you to Thais, Carlin, Venore, Abdendriel, Edron, Svargrond, Goroma, Ankrahmun, Darashia, Liberty Bay, Port Hope, Yalahar, Zao and Razachai."/>
        <parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service."/>
    </parameters>
</npc>

all_boat.lua

Code:
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({'edron'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=33175, y=31764, z=6} })

local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.travel, {npcHandler = npcHandler,  level = 1, cost = 0, destination = {x=32954, y=32022, z=6} })
	
local travelNode = keywordHandler:addKeyword({'thais'}, StdModule.travel, {npcHandler = npcHandler,  level = 1, cost = 0, destination = {x=32313, y=32209, z=6} })

local travelNode = keywordHandler:addKeyword({'carlin'}, StdModule.travel, {npcHandler = npcHandler,  level = 1, cost = 0, destination = {x=32387, y=31821, z=6} })

local travelNode = keywordHandler:addKeyword({'abdendriel'}, StdModule.travel, {npcHandler = npcHandler,  level = 1, cost = 0, destination = {x=32734, y=31669, z=6} })

local travelNode = keywordHandler:addKeyword({'goroma'}, StdModule.travel, {npcHandler = npcHandler,  level = 1, cost = 0, destination = {x=31994, y=32564, z=6} })

local travelNode = keywordHandler:addKeyword({'ankrahmun'}, StdModule.travel, {npcHandler = npcHandler,  level = 1, cost = 0, destination = {x=33425, y=32905, z=6} })

local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=32431, y=31163, z=6} })

local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=32707, y=31079, z=6} })
	

local travelNode = keywordHandler:addKeyword({'zao'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=33032, y=31536, z=10} })

local travelNode = keywordHandler:addKeyword({'razachai'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=33018, y=31216, z=5} })

local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=33624, y=32502, z=6} })

local travelNode = keywordHandler:addKeyword({'liberty bay'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=32360, y=32779, z=6} })

local travelNode = keywordHandler:addKeyword({'port hope'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=32864, y=32805, z=6} })



        keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Thais, Carlin, Venore, Abdendriel, Edron, Svargrond, Goroma, Ankrahmun, Darashia, Liberty Bay, Port Hope, Yalahar, Zao and Razachai.'})
        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())
 
If I'm not mistaken I think it goes into your NPC>Scripts folder.. I tried it myself and it only partially worked. After saying 'yes' to being sent to a location, nothing happens for me. Not sure if this is a version issue or what.
 
I'm not sure about the topic poster, but I myself use TFS 9.6 and client 9.6. the exampled boat npc that was already in the NPC folder and scripts, etc.. was almost exactly the same script but I'm getting the same issue as far as saying 'yes' to transport and nothing happens.
 
TFS 0.2 Mystic Spirit?
I tested the data\npc\Boat.xml (All functions are in lua) version on TFS 0.2.14 (Mystic Spirit) and it worked for me.
 
Back
Top