Hello, Im working on real Tibias Djinn quest at the moment, this npc Umar from the marids (blue djinn quest) Is suppose to only reply to you if you have talked to Melchior about the word of greeting (done) it adds the storagevalue 29364(snacka) then you are able to talk to Umar (this npc) that will let you pass the quest doors inside the djinn tower. Umar should only reply to Djanni'hah unless you have joined them, then he will reply to Hi as usual.
This works somewhat but he wont reply to Join and sometimes when you greet him with Djanni'hah he will emediaetly ungreet you, sometimes he doesn't.
Anyone know why this happends?
btw
will print the these messages
Hope anyone can help me
Cheers
//Massen
This works somewhat but he wont reply to Join and sometimes when you greet him with Djanni'hah he will emediaetly ungreet you, sometimes he doesn't.
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 greetCallback(cid)
local nome2 = getCreatureName(cid)
if (getPlayerStorageValue(cid, 29361) == 1) then
npcHandler:setMessage(MESSAGE_GREET, "Still alive, ".. nome2 .."?")
return true
else
return false
end
end
-- doPlayerAddExp(cid,addexp)
-- doSendAnimatedText(getCreaturePosition(cid), ' ' .. addexp .. ' ', TEXTCOLOR_WHITE)
function creatureSayCallback(cid, type, msg)
--- CONFIG ---
local nome = getCreatureName(cid)
local marid = getPlayerStorageValue(cid, 29361)
local nopledge = getPlayerStorageValue(cid, 29360)
local snacka = getPlayerStorageValue(cid, 29364)
local chain = getPlayerStorageValue(cid, 29362)
local mission1={"Whoa? You know the word! Amazing, " .. nome .. " ...","I should go and tell Fa'hradin. ...","Well. Why are you here anyway, " .. nome .. "?"}
local mission2={"Oh. Ok. Welcome then. You may pass. ...","And don't forget to kill some Efreets, now and then."}
local mission3={"Whoa! A human! This is no place for you, ".. nome ..". ...,","Go and play somewhere else."}
local DELAY = 9
local EVENT
--- CONFIG END ---
if msgcontains(msg, 'djanni\'hah') or msgcontains(msg, 'DJANNI\'HAH') then
if (chain==0) and (marid==0) and (snacka==1) and (nopledge==0) and (getDistanceToCreature(cid) < 4) then
npcHandler:addFocus(cid)
addEvent(function(cid) if isPlayer(cid) then talkstate=1 end end, 12100, cid)
talk_var=doNPCTalkALot(mission1,6000)
elseif msgcontains(msg, 'djanni\'hah') or msgcontains(msg, 'DJANNI\'HAH') then
if (chain==0) and (marid==0) and (snacka==0) and (nopledge==0) and (getDistanceToCreature(cid) < 4) then
talk_var=doNPCTalkALot(mission3,6000) -- Inte pratat med melchior, inte valt efreet inte startat chain eller valt marid.
elseif msgcontains(msg, 'djanni\'hah') or msgcontains(msg, 'DJANNI\'HAH') then -- Valt efreet!
if (nopledge>=1) then
selfSay('Shove off, little one! Humans are not welcome here, '.. nome ..'!')
talkstate=0
elseif msgcontains(msg, 'join') and talkstate==1 then -- quest start
selfSay('Are you sure? You pledge loyalty to king Gabel, who is... you know. And you are willing to never ever set foot on Efreets\' territory, unless you want to kill them? Yes?')
talkstate=2
elseif (msgcontains(msg, 'yes')) and talkstate==2 then -- first continue
talk_var=doNPCTalkALot(mission2,6000)
setPlayerStorageValue(cid,29361,1) -- Dörr
setPlayerStorageValue(cid,29362,1) -- Chain
talkstate=0
end
end
end
end
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Anyone know why this happends?
btw
Lua:
talk_var=doNPCTalkALot(mission2,6000)
Lua:
local mission2={"Oh. Ok. Welcome then. You may pass. ...","And don't forget to kill some Efreets, now and then."}
Hope anyone can help me
Cheers
//Massen