Udun
Well-Known Member
- Joined
- Jan 5, 2012
- Messages
- 193
- Solutions
- 1
- Reaction score
- 67
Hello all, I have this problem with this npc, must be simple to solve... I need that the npc accept all the items at the same time and give the player a storage id, but the npc doesn't work...
Anybody knows how fix it?
Thanks alot!
Anybody knows how fix it?
Thanks alot!
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
-- XVX FORGER START --
function royal(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerItemCount(cid,11219) and (cid,10033) and (cid,2219) and (cid,8843) >= 1 then
if doPlayerRemoveItem(cid,11219,15), (cid,10033,30), (cid,2219,30), (cid,8843,14) then
npcHandler:say('Well done my friend!', cid)
doPlayerAddItem(cid,2691,5)
setPlayerStorageValue(cid,60146,1)
end
else
npcHandler:say('You dont have all the items.', cid)
end
end
-- XVX FORGER END --
keywordHandler:addKeyword({'mission'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you have {all} the items?"})
local node1 = keywordHandler:addKeyword({'all'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Are you sure?'})
node1:addChildKeyword({'yes'}, royal, {npcHandler = npcHandler, onlyFocus = true, reset = true})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'No you dont!.', reset = true})
npcHandler:addModule(FocusModule:new())