oshrigames
Active Member
please help me fix this NPC T ^T
problem is i don't get error to the consol so i have no idea where to look for the bug.
this what i manage to find:
npc does spawn, does respond to "hi" but when i say the destenation he don't warp me.
Im using:
TFS 1.2
please let me know if theres anything else you might need to know.
I highly appreciate any help here.
Thanks
problem is i don't get error to the consol so i have no idea where to look for the bug.
this what i manage to find:
npc does spawn, does respond to "hi" but when i say the destenation he don't warp me.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Captain Steven" script="travel.lua" walkinterval="0" floorchange="0">
<health now="150" max="150"/>
<look type="151" head="114" body="57" legs="114" feet="114" addons="3"/>
<parameters>
<parameter key="module_travel" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|. You don't know my ship rotes? say {travel} and I help you!" />
<parameter key="travel_destinations" value="Relencia,1005,1001,5,500;Volcano,963,1114,6,500;Skyknot,1217,901,6,500"/>
</parameters>
</npc>
Lua:
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({'Relencia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Relencia Town for 500 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 500, destination = {x=1005, y=1001, z=5} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local travelNode = keywordHandler:addKeyword({'Volcano'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Volcano Town for 500 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 500, destination = {x=963, y=1114, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local travelNode = keywordHandler:addKeyword({'Skyknot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Skyknot Town for 500 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 500, destination = {x=1217, y=901, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Relencia\', \'Volcano\', \'Skyknot\' for just a small fee.'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
Im using:
TFS 1.2
please let me know if theres anything else you might need to know.
I highly appreciate any help here.
Thanks
Last edited: