I would like my boat NPC to only allow the right vocations to travel to a city as I work with Races.
This code works and is from my Ab'Dendriel boat NPC making it possible to travel from Ab to Venore.
My problem is that Venore is a Neutral Town, so Humans from Carlin can also travel there.
Right now, none can travel back, it must stay that way UNLESS Humans (Voc 1,2,3,4) allows to only travel to Carlin and Elfs (Voc 5,6,7) allows to get to Ab only. Anyone?
The Script:
Thanks in Advance.
Kind Regards,
Eldin.
This code works and is from my Ab'Dendriel boat NPC making it possible to travel from Ab to Venore.
My problem is that Venore is a Neutral Town, so Humans from Carlin can also travel there.
Right now, none can travel back, it must stay that way UNLESS Humans (Voc 1,2,3,4) allows to only travel to Carlin and Elfs (Voc 5,6,7) allows to get to Ab only. Anyone?
The Script:
Code:
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({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to travel to Venore for 100 gold?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 20, cost = 100, destination = {x=1081, y=1047, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then what are you doing on my ship?'})
keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Venore.'})
keywordHandler:addKeyword({'passage'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Venore.'})
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Venore.'})
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I\'m the captain of this ship!'})
keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I\'m the captain of this ship!'})
npcHandler:addModule(FocusModule:new())
Thanks in Advance.
Kind Regards,
Eldin.