-------------------
--- NPC MISSAO ----
--- by:Neerd ---
-------------------
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 onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,5537) == -1 then
selfSay('Quero que voce leve este Ruby ao Prof Button.', cid)
selfSay('Voce pode me fazer este favor?? se poder fale {sim}',cid)
talkState[talkUser] = 1
else
selfSay('Voce ja me fez, este favor.',cid)
end
elseif(msgcontains(msg, 'sim') and talkState[talkUser] == 1) then
doPlayerAddItem(cid,8858,1)
selfSay('Voce pode encontralo lá no laboratorio, de onde voce veio.',cid)
setPlayerStorageValue(cid,5537,1)
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())