Xexza
New Member
- Joined
- Sep 3, 2007
- Messages
- 1,053
- Reaction score
- 3
When I ask for lagun permission, he answer correctly, but when I say yes, nothing happens.
Where in the "yes" part did I do wrong?
Where in the "yes" part did I do wrong?
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCdreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return false
end
queststatus1 = getPlayerStorageValue(cid, 9092)
queststatus2 = getPlayerStorageValue(cid, 9094)
if msgcontains(msg, 'lagun permission') then
if queststatus1 == 1 then
selfSay('I got a letter from Talfouk. He wrote that you were coming. So, you need the permission for entering laguna island?')
talk_state = 2
end
if msgcontains(msg, 'lost talon') then
talk_state = 7
if queststatus2 == 1 then
selfSay('Did you find my wonderful talon!?')
else
selfSay('Who are you? I only speak to expected visitors.')
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 2 then
selfSay('OK! There is a test that you must pass, in order to show us your strength. Are you ready to hear your mission?')
talk_state = 3
elseif msgcontains(msg, 'yes') and talk_state == 3 then
selfSay('Good, good. Your mission is to bring back my old talon. It was taken from the minotaurs long ago, but just recently I found out where it was hidden. This talon is special, it has been in generation for thousands of years. Do it sounds too scary for you already, or shall I continue my story? ')
talk_state = 4
elseif msgcontains(msg, 'yes') and talk_state == 4 then
selfSay('Bravery. All I know is that they are hiding it somewhere on the minotaur hills. The hills are located north east of Tharzuk. Are you sure you are brave enough for this mission? ')
talk_state = 5
elseif msgcontains(msg, 'yes') and talk_state == 5 then
selfSay('Excellent, I expect to see you back soon with my valuable talon. Say lost talon when you have it. ')
setPlayerStorageValue(cid, 9094, 1)
elseif msgcontains(msg, 'yes') and talk_state == 7 then
selfSay('Thank you so much. You have proven both lojality and strength. I will now send a letter to Talfouk, then he will give you the travelship-bless to the lagun islands.')
setPlayerStorageValue(cid, 9091, 1)
end
------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
selfSay('Ok, you are not brave enough..')
talk_state = 0
return true
end
return 1
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())