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)
if(npcHandler.focus ~= cid) then
return false
end
if msgcontains(msg, 'Item name ') then --Edit the item name
selfSay('Did you bring me 10 of item name) --Edit the item name also
talk_state = 1
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getPlayerItemCount(cid,9020) >= 10 then
selfSay('Thanks, here is your reward') --edit this if you want
doPlayerAddItem(cid,X,1) --Edit the X for the item you want to give as reward
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Sure thing, gimme few min. Also did the old 1 work?
selfSay('Did you bring me 10 of item name) --Edit the item name also
-- SIMPLE Quest made by XMarkoX --
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)
if(npcHandler.focus ~= cid) then
return false
end
if msgcontains(msg, 'quest') then --Edit this if u want
selfSay('Did you bring me x,x,x,x,x?') --Edit the item names ALL FIVE
talk_state = 1
elseif msgcontains(msg, 'yes') and talk_state == 1 then
doPlayerTakeItem(cid,X,1) --first item id u have to give to npc
doPlayerTakeItem(cid,X,1) --third item id u have to give to npc
doPlayerTakeItem(cid,X,1) -- Fourth item id
doPlayerTakeItem(cid,X,1) -- fifth item id
selfSay('Thanks, here is your reward') --edit this if you want
doPlayerAddItem(cid,X,1) --Edit the X for the item you want to give as reward
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())