Werewolf
Forbidden Ascension
- Joined
- Jul 15, 2012
- Messages
- 886
- Reaction score
- 123
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onThink() npcHandler:onThink() end
local playerID = 0
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid)
end
-- Npc Name That this Quest is Used with --
-- NPC4 --
function onCreatureSay(cid, type, msg)
npcHandler:setMessage(MESSAGE_FAREWELL, "Slaves keep running away. Sigh..")
if (getPlayerStorageValue(cid,45001) < 3) then
npcHandler:setMessage(MESSAGE_GREET, "I can't talk to you unless NPC3 been talked to.")
elseif (getPlayerStorageValue(cid,45001) == 3) then
npcHandler:setMessage(MESSAGE_GREET, "SAY {leader}")
elseif (getPlayerStorageValue(cid,45001) >= 4) then
npcHandler:setMessage(MESSAGE_GREET, "Well? What was his reply. Speak slave.")
end
npcHandler:onCreatureSay(cid, type, msg)
end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return FALSE
end
playerID = cid
if (getPlayerStorageValue(cid,45001) == 3) then
if msgcontains(msg, 'leader') then
if (getPlayerStorageValue(cid,45001) == 3) then
npcHandler:say("say {door}",cid)
else
npcHandler:say("Huh?",cid)
end
elseif msgcontains(msg, "door") then
if (getPlayerStorageValue(cid,45001) == 3) then
setPlayerStorageValue(cid,45001,4)
local door = 45002 -- door actionID
setPlayerStorageValue(cid, door.Storage, 1) -- Door
npcHandler:say("Go through door",cid)
else
npcHandler:say("What was that?",cid)
end
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
the npc works for the most part, however it gives the first storage id to continue the quest however it does not give the storage id for the door, and the script ends there and npc does not respond to go through the door.