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, 'quest')) then
selfSay('Ok, you can started "mission"?', cid)
end
---------------------------------------------------------
if(msgcontains(msg, 'mission')) then
selfSay('TEXT', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'TEXT HERE') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,1237) > 0) then
else
if(doPlayerRemoveItem(cid, ITEMID, 1) == TRUE) then
setPlayerStorageValue(cid,1237,1)
[B]doPlayerAddExperience (cid, 10000000~~)[/B]
selfSay('YOUR TEXT HERE', cid)
else
selfSay(' YOUR TEXT HERE ', cid)
end
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())