• 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!

adding new npc

Joriku

Working in the mines, need something?
Joined
Jul 16, 2016
Messages
1,175
Solutions
17
Reaction score
481
Location
Sweden
hello, i just added a new hunting place called "Hell" there alot of demons and monsters are, i wounder how i add a new npc or add that place in the boat npc called "Captin" there you can sail for example yalahar,
that i want is to add this new place in "captin" so people can sail there
 
Take any Boat NPC, and change the destination co-ordinates.
Or find one of your boat npc's and paste it here, along with your TFS version and someone might edit the script / explain how to do it.
 
Take any Boat NPC, and change the destination co-ordinates.
Or find one of your boat npc's and paste it here, along with your TFS version and someone might edit the script / explain how to do it.
Here's My Npcs XML File
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain" script="data/npc/scripts/Captain.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="19" body="69" legs="107" feet="50" addons="0"/>
<voices>
<voice text="I know a secret place hihi" interval2="100" margin="1" yell="no"/>
</voices>
<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;" />
<parameter key="keyword_reply1" value="My name is Captain from the Royal Tibia Line." />
<parameter key="keyword_reply2" value="Where do you want to go?" />
<parameter key="keyword_reply3" value="I'm not sailing there. This route is afflicted by a ghost ship! However, I heard that Captain Fearless sails there from Venore." />
<parameter key="message_greet" value="Welcome on board, |PLAYERNAME|. Where may I sail you today?"/>
</parameters>
</npc>

Here's The Lua (The Name Of The Captin In-Game is "Captin" if you want to know that as you can see in this script :)
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({'secret place'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Psst say secret place please'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=1130, y=1245, z=7} })
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? Secret Place? Or Oken?'})
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})


npcHandler:addModule(FocusModule:new())

The New Hunt Spawn Is Called "Hell" And The Pos Is "32284, 31954, 7" <-- There You Come While Sailing
 

Similar threads

Back
Top