Ninkobi
Owner /Founder of Syphera
I made the NPC Henricus for the Inquisition quest and i get this error
Heres the NPC LUA Code:
Also does anyone know how to make it say 2 things at once, like in real tibia, eg.
You:mission
NPC: Yes I have mission for you it involves killing demons and ...
NPC: Juggernauts and also more ...
NPC: and so on like this xD
Thanks in advance
Code:
[26/08/2008 19:16:05] Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/Henricus.lua
[26/08/2008 19:16:05] data/npc/scripts/Henricus.lua:38: '<eof>' expected near 'end'
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 creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
return false
end
if msgcontains(msg, 'inquisitor') then
selfSay('The churches of the gods entrusted me with the enormous and responsible task to lead the inquisition. I leave the field work to inquisitors who I recruit from fitting people that cross my way.')
talk_state = 1
elseif msgcontains(msg, 'join') and talk_state == 1 then
selfSay('Do you want to join the inquisition?')
talk_state = 2
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerStorageValue(cid,99211) == -1 then
selfSay('So be it. Now you are a member of the inquisition. You might ask me for a mission to raise in my esteem.')
talk_state = 3
setPlayerStorageValue(cid,99211,1)
elseif msgcontains(msg, 'mission') and getPlayerStorageValue(cid,99211) == 1 and getPlayerStorageValue(cid,99212) == -1 then
selfSay('Let\'s see if you are worthy. Take an inquisitor\'s field guide from the box in the back room. ... ')
selfSay('Follow the instructions in the guide to talk to the Thaian guards that protect the walls and gates of the city and test their loyalty. Then report to me about your mission.')
setPlayerStorageValue(cid,99212,1)
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 3) then
selfSay('Good Bye. |PLAYERNAME|!')
talk_state = 0
end
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
end
end
Also does anyone know how to make it say 2 things at once, like in real tibia, eg.
You:mission
NPC: Yes I have mission for you it involves killing demons and ...
NPC: Juggernauts and also more ...
NPC: and so on like this xD
Thanks in advance