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
function travel(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerStorageValue(cid, 63888) == 1 then
npcHandler:say("You can pass the ship you bought access before, have fun.", cid)
elseif doPlayerRemoveMoney(cid, 100000) == TRUE then
setPlayerStorageValue(cid,63888,1)
npcHandler:say("Now you can pass the ship!", cid)
else
npcHandler:say("You don't have enough money.", cid)
end
keywordHandler:moveUp(1)
return true
end
local node5 = keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to travel the island for 100000 gold coins?'})
node5:addChildKeyword({'yes'}, travel)
node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'You should think it over once more.'})
npcHandler:addModule(FocusModule:new())