Please help me writes to him adorned helmet and he does not respond Storage in turn is so I do not know what's going on
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
local storage = getPlayerStorageValue(cid, 18256)
local storagee = getPlayerStorageValue(cid, 22111)
if (msgcontains(msg, "old backpack")) then
if (getPlayerItemCount(cid, 3960) >= 1) and doPlayerRemoveItem(cid,3960,1)then
npcHandler:say({'Thank you very much! This brings back good old memories! Please, as a reward, travel to Kazordoon and ask my old friend Kroox to provide you a special dwarven armor. ...', 'I will mail him about you immediately. Just tell him, his old buddy sam is sending you.'}, cid)
setPlayerStorageValue(cid, config.storage, 1)
else
selfSay("You don't have my backpack.", cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser])) then
talkState[talkUser] = 0
selfSay("Bye.", cid)
elseif msgcontains(msg, 'adorned helmet') and storagee == 5 then
if storagee == 5 then
npcHandler:say("Oh, Gregor sent you? I see. It will be my pleasure to adorn your helmet. Please give me some time to finish it.", cid)
setPlayerStorageValue(cid, 22111, 6)
end
elseif msgcontains(msg, 'adorned helmet') and storagee == 6 then
if storagee == 6 then
npcHandler:say("Just in time, Gracz. Your helmet is finished, I hope you like it.", cid)
setPlayerStorageValue(cid, 22111, 7)
if getPlayerSex(cid) == 1 then
doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_RED)
doPlayerAddOutfit(cid, 131, 2)
elseif getPlayerSex(cid) == 0 then
doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_RED)
doPlayerAddOutfit(cid, 139, 2)
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())