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 storage = 89907
local storagehenrick = 89906
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'information')) then
if getPlayerStorageValue(cid, storage) == 1 then
selfSay('Oh, I see that you are one of Henricks buddy. Bring me {10 wolf paws}... Could you do that?', cid)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid, storage) == 2 then
selfSay('You\'ve helped me enought. Thanks.', cid)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid, storage) == 4 then
selfSay('You have my 10 wolf paws?', cid)
talkState[talkUser] = 1
else
selfSay('Speak to Henrick for more information about the quest.', cid)
end
---------------------------------------
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1 and getPlayerStorageValue(cid,storage) == 1) then
selfSay('Great! Go get them now.', cid)
setPlayerStorageValue(cid, storage,4)
talkState[talkUser] = 0
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1 and getPlayerStorageValue(cid,storage) == 4) then
if getPlayerItemCount(cid, 5897) >= 10 then
doPlayerRemoveItem(cid, 5897, 10)
selfSay('Great! here are your reward. [QUEST END]', cid)
setPlayerStorageValue(cid, storage, 2)
setPlayerStorageValue(cid, storagehenrick, 3)
doPlayerAddMoney(cid, 3000)
talkState[talkUser] = 0
else
selfSay('You don\'t have my 10 wolf paws...', cid)
end
---------------------------------------
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())