croix
Member
- Joined
- Aug 26, 2011
- Messages
- 123
- Reaction score
- 13
My quest NPCs are working atm, but they're not really smooth since (this npc for example) will always say
and firstly after the character says "help" the npc message will change, next time i visit the NPC he will still start by saying these words.
How do I edit my formatting so it loads storage when character says hi and actually responds with what I want the NPC to respond?
- if the quest is started but not finished, etc
Any help is appreciated! - Here's my .lua, the version is tfs 1.3 for tibia 8.6 (nekiro downgrade.)
Code:
My friend Rihanna has gone missing, last time I saw her was under the sewers here in the city! Can you please help me find her?
How do I edit my formatting so it loads storage when character says hi and actually responds with what I want the NPC to respond?
Code:
Have you found her yet?
Any help is appreciated! - Here's my .lua, the version is tfs 1.3 for tibia 8.6 (nekiro downgrade.)
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
-- QUEST --
function Task1(cid, message, keywords, parameters, node)
local stor1 = 25578 -- this is the same STOR1 from quests.xml
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerStorageValue(cid,stor1) < 0 then
npcHandler:say('I will be waiting for you! I hope you can find her..',cid)
setPlayerStorageValue(cid, stor1, 1)
elseif getPlayerStorageValue(cid, stor1) == 1 then
npcHandler:say('Have you found her?',cid)
elseif getPlayerStorageValue(cid, stor1) == 4 then
npcHandler:say('Thank you for finding her! Now I need to put my moves in.. Here, take this a reward!',cid)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2463, 1)
setPlayerStorageValue(cid, stor1, 5)
doSendMagicEffect(getCreaturePosition(cid), 13)
elseif getPlayerStorageValue(cid, stor1) == 5 then
npcHandler:say('Thank you for finding Rihanna!',cid)
end
end
local node1 = keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "My friend Rihanna has gone missing, last time I saw her was under the sewers here in the city! Can you please help me find her?"})
node1:addChildKeyword({'yes'}, Task1, {})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Very well then.', reset = true})
npcHandler:addModule(FocusModule:new())