• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem with quest NPC...

ewcke

Santiria 8.60
Joined
Apr 13, 2009
Messages
39
Reaction score
1
I've got some problems with a NPC I've made. The thing is that i dont know what to do now, or what the cause of the problem could be. Could someone please help me?


ERROR MESSAGE:
[29/12/2009 21:18:41] [Warning - NpcScript::NpcScript] Can not load script: The Oracle.lua
[29/12/2009 21:18:41] The Oracle.lua:18: '}' expected near 's'


NPC SCRIPT 1:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Oracle" script="data/npc/scripts/oracle.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="133" head="20" body="39" legs="45" feet="7" addons="0"/>
</npc>


NPC SCRIPT 2:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() 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({'Leadme'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Im sorry, can you please explain what you mean?'})
travelNode:addChildKeyword({'happypancakeland'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 200, cost = 0, destination = {x=1950, y=1030, z=5} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Okey, it's your desition.'})

keywordHandler:addKeyword({'travle'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Were can i take you my kind sir?.'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
 
Last edited:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Oracle" script="oracle.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="133" head="20" body="39" legs="45" feet="7" addons="0"/>
</npc>

should work :p

@edit
Code:
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({'Leadme'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Im sorry, can you please explain what you mean?'})
travelNode:addChildKeyword({'happypancakeland'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 200, cost = 0, destination = {x=1950, y=1030, z=5} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Okey, it\'s your desition.'})

keywordHandler:addKeyword({'travle'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Were can i take you my kind sir?.'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

Now it has to work ;P
 
Last edited:
Back
Top