Creon
Well-Known Member
I've been trying to figure this out for some time now, and I simply cannot. The problem is that when you say yes, Hoggle isn't setting the storage to be able to pass through the door. Please help
Lua:
--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(msg == "garden") then
npcHandler:say({'My garden is full of wild-growing plants and my back is aching like hell. Perhaps you are interested in cutting these pest plants ...', 'I\'ll give you 5 shiny pieces of gold for this job. Is this a deal?'} , cid)
talkState[talkUser] = 1
end
if(msg == "yes") then
if(getPlayerStorageValue(cid, 4832) < 2) then
setPlayerStorageValue(cid, 4832, 2)
npcHandler:say({'Excellent. You will have to rattle at the garden gate a bit to get it open, it\'s quite old, you know. Tell me about the garden when you are finished.'} , cid)
talkState[talkUser] = 2
end
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:setCallback(CALLBACK_GREET, greetCallback)--