• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Djinn quest greeting... how? I'm using OTHire.

JamesIsAwkward

New Member
Joined
Aug 9, 2013
Messages
27
Reaction score
2
I'm wanting to make a quest similar to RL tibia where you have to learn the greeting for the djinn and greet them with it. I'd like to know how to make the word DJANNI'HAH work instead of hi and open up the next dialog but I can't get him to focus until you say "hi".

Anyone have any idea or have the scripts for this type of thing?
 
I can simply make it where the player says hi first, gets insulted, THEN says DJANNI'HAH.. But how would I "save" that storage? How could I make it where once they said it, that they wouldn't have to say it again?

player: hi
djinn: **** you
player: DJANNI'HAH
djinn: I like you
djinn: want a quest?
player: bye
djinn: bye

player: hi
djinn: wanna quest?


See what I'm saying? xD
 
This thread will get you headed in the right direction.. I also use OTHire and I'm going to actually adapt this myself. I'm trying to find the OTHire equivalent of
npcHandler:addFocus(cid) because OTHire doesn't use it I guess.

If anyone else knows how to adapt this to OTHire you'd be helping us both out!
 
if msgcontains 'hi' then
if storageValue == 1 then
hi
else fuckoff
end
elseif msgcontains 'djannihah' then
setStorageValue
normal stuff
 
I don't think its that easy at least not what I took from his/her question, you have to get rid of this

Code:
npcHandler:addModule(FocusModule:new())

at the bottom of the NPC, which causes them not to focus when you say hi, so you can insert "if msgcontains "whatever" instead of hi.

the problem I'm finding here isn't the overall setup, its the fact that I can't figure out how to make them focus when you say the new word, that link I found used npcHandler:addFocus(cid) but OTHire doesn't use that one. Do you have any idea?
 
yeah xapafe hit it on the head. I followed that link and this is exactly what i want. under the "Using different greetmessages" part.

so i'm a little closer to the solution!
 
npcHandler:addModule(FocusModule:new())

If you use this in the script it will default to "hi" or "hello" as the only 2 words that will take this focus. The idea here is to use another word to get his focus. I've had this issue for a while, there's a handful of NPCs that use this style of script.
 
Had worked through this problem before as well. :p
Posting my solution here in case it helps someone.
https://otland.net/threads/234306/page-23#post-2343058
Code:
function creatureSayCallback(cid, type, msg)
   if msgcontains(msg, 'hail') or msgcontains(msg, 'hello') or msgcontains(msg, 'salutations') and not npcHandler:isFocused(cid) then
      npcHandler:say('I greet thee..', cid, TRUE)
      npcHandler:addFocus(cid)
   end

   .
   .
   . rest of script
   .
   .
   .

   return true
end
 
Back
Top