Slayernight
New Member
- Joined
- Sep 15, 2008
- Messages
- 17
- Reaction score
- 0
Hello folks,
I've got a problem with this NPC :
It doesn't react to my keywords...
Please help me!
I've got a problem with this NPC :
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
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return false
end
if msgcontains(msg, 'rumors') or msgcontains(msg, 'rumor') or msgcontains(msg, 'mission') or msgcontains(msg, 'quest') or msgcontains(msg, 'lost') then
if getPlayerStorageValue(cid, 50005) == -1 then
selfSay('Rumors, quest ??? What are you talking about ?... I did not lost everything...')
elseif (getPlayerStorageValue(cid, 50005) == 1 and getPlayerStorageValue(cid, 50006) == -1) then
selfSay('Ahh... you also heard about it... Well, it\'s too late! Spiders are way too big down there now! You want to go down there?')
talk_state = 1642
elseif (getPlayerStorageValue(cid, 50006) == 1 and getPlayerStorageValue(cid, 50007) == -1) then
selfSay('And, spiders a big uh!')
elseif getPlayerStorageValue(cid, 50007) == 1 then
selfSay('You got it for real??? Woah !!! You are strong...')
end
elseif talk_state == 1642 then
if msgcontains(msg, 'yes') then
selfSay('Alright, take this key to unlock the chest.')
local key = doPlayerAddItem(cid, 2090, 1)
doSetItemActionId(key, 50006)
setPlayerStorageValue(cid, 50006, 1)
elseif msgcontains(msg, 'no') then
selfSay('Then not.')
end
end
talk_state = 0
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
It doesn't react to my keywords...
Please help me!