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 t = {
{'Thais', {x=32310, y=32210, z=6}},
{'Goroma', {x=31993, y=32564, z=6}},
{'Calassa', {x=31747, y=32720, z=12}},
{'Venore', {x=32952, y=32022, z=6}},
{'Darashia', {x=33289, y=32480, z=6}},
{'Ankrahmun', {x=33092, y=32883, z=6}},
{'Yalahar', {x=601, y=669, z=6}},
{'passage', 'I can take you to Yalahar, Thais, Venore, Ankrahmun, Darashia and Goroma.'},
{'job', 'I am the captain of this ship.'},
{'travel', 'I can only offer you a trip to Yalahar, Thais, Venore, Ankrahmun, Darashia and Goroma.'}
}
for i = 1, #t do
local v = t[i]
if type(v[2]) == 'table' then
local k = keywordHandler:addKeyword({v[1]:lower()}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to ' .. v[1] .. ' for 0 gold coins?'})
k:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = v[2]})
k:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
else
keywordHandler:addKeyword({v[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = v[2]})
end
end
t = nil
npcHandler:addModule(FocusModule:new())