local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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)
-- 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, 'hi') or msgcontains(msg, 'quest') then
selfSay('Do you know about the ruthless seven?')
talk_state = 1
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getPlayerLevel(cid) >= 100 then and getPlayerItemCount(cid,2160) >= 1 then
if doPlayerTakeItem(cid,2160,1) == 0 then
selfSay('Now we are in buisness. Ask me about the ruthless seven')
end
elseif msgcontains(msg, 'ruthless seven') or msgcontains(msg, 'mission') then
selfSay('i want this to be a whole story with more questions etc.')
end
elseif msgcontains(msg, 'ruthless seven') or msgcontains(msg, 'mission') then
selfSay('i want this to be a whole story with more questions etc.')
end
elseif msgcontains(msg, 'ruthless seven') or msgcontains(msg, 'mission') then
selfSay('i want this to be a whole story with more questions etc.')
end
elseif msgcontains(msg, 'ruthless seven') or msgcontains(msg, 'mission') then
selfSay('i want this to be a whole story with more questions etc.')
end
elseif msgcontains(msg, 'ruthless seven') or msgcontains(msg, 'mission') then
selfSay('i want this to be a whole story with more questions etc.')
end
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
selfSay('STOP WASTING MY TIME!')
talk_state = 0
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())