Dankoo
Active Member
- Joined
- Sep 4, 2010
- Messages
- 1,007
- Reaction score
- 27
Crap, already searched my npc libs and I can't find where to put keyword_reply3 ¬¬"
here's one part of my modules.lua:
Where else it could be?
Here's one example of keyword_reply3 on a NPC:
here's one part of my modules.lua:
LUA:
-- Add it to the parseable module list.
Modules.parseableModules['module_keywords'] = KeywordModule
function KeywordModule:new()
local obj = {}
setmetatable(obj, self)
self.__index = self
return obj
end
function KeywordModule:init(handler)
self.npcHandler = handler
end
-- Parses all known parameters.
function KeywordModule:parseParameters()
local ret = NpcSystem.getParameter('keywords')
if(ret ~= nil) then
self:parseKeywords(ret)
end
end
function KeywordModule:parseKeywords(data)
local n = 1
for keys in string.gmatch(data, '[^;]+') do
local i = 1
local keywords = {}
for temp in string.gmatch(keys, '[^,]+') do
table.insert(keywords, temp)
i = i + 1
end
if(i ~= 1) then
local reply = NpcSystem.getParameter('keyword_reply' .. n)
if(reply ~= nil) then
self:addKeyword(keywords, reply)
else
print('[Warning] NpcSystem:', 'Parameter \'' .. 'keyword_reply' .. n .. '\' missing. Skipping...')
end
else
print('[Warning] NpcSystem:', 'No keywords found for keyword set #' .. n .. '. Skipping...')
end
n = n + 1
end
end
Where else it could be?
Here's one example of keyword_reply3 on a NPC:
LUA:
<parameter key="keywords" value="quest;help;blood herb" />
<parameter key="keyword_reply1" value="I have always wanted one of those blood herbs, and I have a chest in my room. You can have the thing in there if you give me a blood herb..." />
<parameter key="keyword_reply2" value="I have always wanted one of those blood herbs, and I have a chest in my room. You can have the thing in there if you give me a blood herb..." />
<parameter key="keyword_reply3" value="Do you have it!? No! I don't trust you! What is my name then?" />