kokokoko
Veteran OT User
- Joined
- Feb 4, 2008
- Messages
- 921
- Reaction score
- 257
Problem's bolded.
The npc wont reply when i say 'yes' after finishing the first quest and asking for quest again.
Looks like my quest2_start = 1 is bugged, but can a variable be bugged?
Code:
Thanks in advance,
//Kokokoko
The npc wont reply when i say 'yes' after finishing the first quest and asking for quest again.
Looks like my quest2_start = 1 is bugged, but can a variable be bugged?
Code:
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 onCreatureDisappear(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
-- Makes sure the npc reacts when you say hi, bye etc.
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
function creatureSayCallback(cid, type, msg)
quest = getPlayerStorageValue(cid, 7007)
pos = getPlayerPosition(cid)
voc = getPlayerVocation(cid)
sorcerer = 1
druid = 2
paladin = 3
knight = 4
AXE = 0000
SWORD = 0000
CLUB = 0000
IceCityName = "Iceta"
NameOfGuy = "Raff Glenham"
msg = string.lower(msg)
if msgcontains(msg, 'quest') or msgcontains(msg, 'help') then
if quest < 1 then
selfSay('While i was asleep, a rotten frost troll stole my inkewll. Now i can not write my delivery letters to\nthe resource handlers i buy my raw material from!\nThe frost troll must have given it to the\nstrongest one among them.')
selfSay('Please bring me my inkwell from the trolls.')
setPlayerStorageValue(cid, 7007, 1)
elseif quest == 1 then
if doPlayerRemoveItem(cid, 7490, 1) == 1 then
selfSay('Thank you for bringing back my inkwell!\nAnd i haven\'t forgot about your reward!')
doSendMagicEffect(pos, 27)
if voc == sorcerer then
doPlayerAddItem(cid, 2189, 1)
setPlayerStorageValue(cid, 7007, 2)
elseif voc == druid then
doPlayerAddItem(cid, 2185, 1)
setPlayerStorageValue(cid, 7007, 2)
elseif voc == paladin then
doPlayerAddItem(cid, 2547, 55)
setPlayerStorageValue(cid, 7007, 2)
elseif voc == knight then
selfsay('Do you want an axe, a sword or a club, ' .. getPlayerName(cid) .. '?')
talk_state = 27
if msgcontains(msg, 'axe') and talk_state == 27 then
doPlayerAddItem(cid, AXE)
setPlayerStorageValue(cid, 7007, 2)
elseif msgcontains(msg, 'sword') and talk_state == 27 then
doPlayerAddItem(cid, SWORD)
setPlayerStorageValue(cid, 7007, 2)
elseif msgcontains(msg, 'club') and talk_state == 27 then
doPlayerAddItem(cid, CLUB)
setPlayerStorageValue(cid, 7007, 2)
end
else
selfSay('Eh.. I\'m sorry. I do not have any reward for you, my friend.')
end
else
selfSay('You haven\'t brought me my lost inkwell.\nI am sure their strongest member has got it!\nPlease try to find it for me.')
end
[B]elseif quest == 2 then
selfSay('You helped me get my inkwell back.\nI trust you a little.\nCould you bring this letter to ' .. NameOfGuy .. ' in ' .. IceCityName .. '?')
quest2_start = 1
if msgcontains(msg, 'yes') and quest2_start == 1 then
selfSay('Ok. Do not lose the letter. If you do, i will have to charge you if you want a second chance.')
doPlayerAddItem(cid, 1784, 1)
setPlayerStorageValue(cid, 7007, 3)
end[/B]
elseif quest == 3 then
selfSay('You need another letter?')
talk_state = 2
if quest == 4 then
selfSay('Thank you! Here. I want you to have this.')
doPlayerAddItem(cid, 2552, 1)
end
end
elseif msgcontains(msg, 'bye') then
selfSay('Good bye, ' .. getPlayerName(cid) .. '. Please come back soon,\ni could use some help around here.')
end
return 1
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Thanks in advance,
//Kokokoko