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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerStorageValue(cid, 20036) >= 1 then
selfSay(cid,21,"You don't need to tell me anything else, go and talk to the other soldiers to gather information.")
return true
end
if (msgcontains(msg, 'yes')) then
if getPlayerStorageValue(cid,20035) >= 1 then
selfSay('I see that you want to go through the doors that protect us... Hmm maybe you can help us control this plague of monsters that has increased in recent times... But you will have to talk to the rest of the soldiers to see if there is any information on how to stop this madness... I will help you a bit.', cid)
doPlayerAddMapMark(cid, {x=151, y=580, z=7}, 2, "First Soldier")
setPlayerStorageValue(cid,20036,1)
else
selfSay('You can not be here, Leave please.', cid)
end
elseif (msgcontains(msg, 'no') or msgcontains(msg, 'no') or msgcontains(msg, 'não')) then
selfSay('Do not care about it.', cid)
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())