I need know how make that npc reacts for hi etc. which is put in lua file. This is part of my script which doesn't work
I have in xml file nothing about greeting. NPC reacts with default greeting (TFS 0.3.6). Could somebody repair it?
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
----------------------------------------------- Greeting ------------------------------------------------
if (msgcontains(msg, 'hi')) then
if (getPlayerSex(cid) == 0) then
npcHandler:say('Hello beautyful lady, welcome to the atrium of Pumin\'s Domain. We require some information from you before we can let you pass to throne room of {Pumin}, the Lord of Despair?', cid, true)
else
npcHandler:say('Hello sir, welcome to the atrium of Pumin\'s Domain. We require some information from you before we can let you pass to throne room of {Pumin}, the Lord of Despair?', cid, true)
end
npcHandler:addFocus(cid)
[I][B]My code[/B][/I]
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
I have in xml file nothing about greeting. NPC reacts with default greeting (TFS 0.3.6). Could somebody repair it?