LucasFerraz
Systems Analyst
Backpack Tourist Achievement (NPC Sam):
Lua:
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
function OldBackpack(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerItemCount(cid, 3960) >= 1 and getPlayerStorageValue(cid, 21002) < 0 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.", cid)
npcHandler:say("I will mail him about you immediately. Just tell him, his old buddy sam is sending you.", cid)
doPlayerSendTextMessage(cid,22,"Congratulations! You earned the achievement \"Backpack Tourist\".")
setPlayerStorageValue(cid,21002,1)
doPlayerRemoveItem(cid, 3960, 1)
else
npcHandler:say("Thank you for your concern, but I don't think this is my backpack, since you gave it to me already", cid)
end
end
node1 = keywordHandler:addKeyword({'old backpack'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "What? Did you find my old backpack, I've lost it in Uldrak's Rock..."})
node1:addChildKeyword({'yes'}, OldBackpack, {})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ahh, for one moment I tought you have find my old backpack...', reset = true})
npcHandler:addModule(FocusModule:new())
Last edited: