local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler
nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler
nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler
nCreatureSay(cid, type, msg) end
function onThink() npcHandler
nThink() end
local storage = 4444 --Storage to be needed
local busy = "Sorry, im busy right now" --No quest message
local mission1 = "Oh yes i need help in a mission, you can help me?" --Message dysplayed when you got the right storage
local mission2 = "Fine, search my map!" --Message displayed when you say yes to accept the mission
--Comment, try to watch closely, down at nodes there are the text and you can edit it to the npc respond
local storageset = 4445 --Storage id to be put on 1 when you accept the mission
npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|.") --Greeting message
function storage(cid, message, keywords, parameters, node)
if(cid ~= npcHandler.focus) then
return false
end
if getPlayerStorageValue(cid, storage) == 1 then
npcHandler:say(mission1, cid)
else
npcHandler:say(busy, cid)
npcHandler:resetNpc()
end
return true
end
function storage1(cid, message, keywords, parameters, node)
if(cid ~= npcHandler.focus) then
return false
end
npcHandler:say(mission2, cid)
doSetPlayerStorageValue(cid, storageset, 1)
npcHandler:resetNpc()
return true
end
local node1 = keywordHandler:addKeyword({'raiden'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Raiden is the best scripter
'})
local node2 = keywordHandler:addKeyword({'mission'}, storage)
local node3 = node2:addChildKeyword({'yes'}, storage1)
local node3 = node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'No?, cmon mate'})
npcHandler:addModule(FocusModule:new())