Hey,
For some reason I can't figure out why the NPC won't send the player to the new location if the player does not have gold on them. It gives me the message saying "Removed xxx from bank account." but does not send the player to the destination. Works fine if player has gold in backpack.
Here is the script.
For some reason I can't figure out why the NPC won't send the player to the new location if the player does not have gold on them. It gives me the message saying "Removed xxx from bank account." but does not send the player to the destination. Works fine if player has gold in backpack.
Here is 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
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 voices = {
{ text = 'Passages to Oran and Visten!' }
}
-- Travel
local travelNode = keywordHandler:addKeyword({'oran'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like a trip to Oran for 150 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 2, cost = 150, destination = {x=4068, y=536, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Maybe next time..'})
local travelNode = keywordHandler:addKeyword({'visten'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like a trip to Visten for 130 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 2, cost = 130, destination = {x=1201, y=991, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Maybe next time..'})
-- Basic
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, text = 'My name is Captain Hurcraft.'})
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, text = 'I am the captain of this ship.'})
npcHandler:setMessage(MESSAGE_GREET, 'Welcome to my humble shipcraft, |PLAYERNAME|. Where can I {sail} you today?')
npcHandler:setMessage(MESSAGE_FAREWELL, 'Good bye. Please tell your friends about my service.')
npcHandler:setMessage(MESSAGE_WALKAWAY, 'Good bye then.')
npcHandler:addModule(FocusModule:new())