• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Inquisition Quest Henricus

Ninkobi

Owner /Founder of Syphera
Joined
Apr 5, 2008
Messages
206
Reaction score
1
Location
England
I made the NPC Henricus for the Inquisition quest and i get this error
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'
Heres the NPC LUA Code:
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
 
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
    return true    
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Also, for the second question, just use:

Code:
            selfSay('Yes I have mission for you it involves killing demons and ...')
            selfSay('Juggernauts and also more ..')
            selfSay('and so on like this xD')
 
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
    return true    
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Also, for the second question, just use:

Code:
            selfSay('Yes I have mission for you it involves killing demons and ...')
            selfSay('Juggernauts and also more ..')
            selfSay('and so on like this xD')

Code:
            selfSay('Yes I have mission for you it involves killing demons and ...')
            selfSay('Juggernauts and also more ..')
            selfSay('and so on like this xD')
This don't work it just says the last message, but thanks anyway for fixing the NPC, if you can try find out how to do that.
 
Are you sure? I'm quite certain that it works, since I've used it myself. o.O
Yep, I am, Look at this
Code:
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, 'yes') and talk_state == 2 and getPlayerStorageValue(cid,99211) == 1 then
            selfSay('You have already joined the inquisition!')
                talk_state = 3
		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, 'mission') and getPlayerStorageValue(cid,99212) == 1 then
            selfSay('Your current mission is to investigate the reliability of certain guards. Are you done with that mission?')
		elseif msgcontains(msg, 'yes') and getPlayerStorageValue(cid,99216) == 1 and getPlayerStorageValue(cid,99215) == 1 and getPlayerStorageValue(cid,99214) == 1 and getPlayerStorageValue(cid,99213) == 1 and getPlayerStorageValue(cid,99217) == -1 then
					setPlayerStorageValue(cid,99217,1)
            selfSay('Indeed, this is exactly what my other sources told me. Of course I knew the outcome of this investigation in advance. This was just a test. ... ')
            selfSay('Well, now that you\'ve proven yourself as useful, you can ask me for another mission. Let\'s see if you can handle some field duty, too')
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 3) then
			selfSay('Good Bye. |PLAYERNAME|!')
			talk_state = 0
end
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
In-game:
Code:
21:11 God Trix [1337]: hi
21:11 Henricus: Greetings, fellow believer God Trix!
21:11 God Trix [1337]: mission
21:11 Henricus: Your current mission is to investigate the reliability of certain guards. Are you done with that mission?
21:11 God Trix [1337]: yes
21:11 Henricus: Well, now that you've proven yourself as useful, you can ask me for another mission. Let's see if you can handle some field duty, too
 
Back
Top