I'm working with the Sabrehaven distribution, and I'm trying to recreate the behavior from the Dead Bureaucrats in the PoI quest. For the quest to be accurate, you're supposed to talk with the NPCs and they ask you for your name and vocation.
In Lua, that's super easy:
But Sabrehaven uses the .npc files, and after looking through behaviourdatabse.cpp, I'm at a loss as to how to accomplish this. Here is what my npc file looks like so far:
I know that %N is how you tell the NPC to say the player's name in their dialogue, but it does NOT work the other way around.
To put it simply: what is the .npc format way to do "if msgcontains(msg, player:getName())"?
Thanks
In Lua, that's super easy:
Lua:
if msgcontains(msg, player:getName()) then
if npcHandler.topic[cid] == 1 then
npcHandler:say("Alright |PLAYERNAME|. Vocation?", cid)
npcHandler.topic[cid] = 2
end
end
But Sabrehaven uses the .npc files, and after looking through behaviourdatabse.cpp, I'm at a loss as to how to accomplish this. Here is what my npc file looks like so far:
Code:
Name = "A Dead Bureaucrat"
Outfit = (33,0-0-0-0-0)
Home = [32729,32283,15]
Radius = 2
Behaviour = {
ADDRESS,"hello$",male,! -> "Welcome to the atrium of Pumin's Domain, young man. We require some information from you before we can let you pass. Where do you want to go?"
ADDRESS,"hi$",male,! -> *
ADDRESS,"hello$",female,! -> "Hello beautiful lady, welcome to the atrium of Pumin's Domain. We require some information from you before we can let you pass. Where do you want to go?"
ADDRESS,"hi$",female,! -> *
ADDRESS,"hello$",QuestValue(17514)>0,! -> "You again. I told my master that you wish to end your stupid life in his domain but you need Form 356 to get there. What do you need this time?"
ADDRESS,"hi$",QuestValue(17514)>0,! -> *
ADDRESS,! -> Idle
BUSY,"hello$",! -> "Please wait your turn, %N.", Queue
BUSY,"hi$",! -> *
BUSY,! -> NOP
VANISH,! -> "Good bye and don't forget me!"
"bye" -> "Good bye and don't forget me!", Idle
"farewell" -> *
"job" -> "I'm a bureaucrat who does not even find the time to eat. Just look how bony I am! *SIGH*"
"name" -> "Sorry, I seem to have forgotten it!"
"pumin",QuestValue(17514)<1 -> "Sure, where else. Everyone likes to meet my master, he is a great demon, isn't he? Your name is ...?", Topic=1
"356",QuestValue(17514)=8 -> "INCREDIBLE, you did it!! Have fun at Pumin's Domain!", SetQuestValue(17514,9)
Topic=1,"<WHAT DO I PUT HERE??>" -> "Alright %N. Vocation?", Topic=2
Topic=2,Sorcerer,"sorcerer" -> "Huhu, please don't hurt me with your wand! Reason of your visit?", Topic=3
Topic=2,Druid,"druid" -> "D R U I D, is that right?! What do you want from me?", Topic=3
Topic=2,Paladin,"paladin" -> "A paladin! Great! Reason of your visit?", Topic=3
Topic=2,Knight,"knight" -> "A noble warrior! Reason of your visit?", Topic=3
Topc=3,"pumin",QuestValue(17514)<1 -> "How very interesting. I need to tell that to my master immediately. Please go to my colleagues and ask for Form 356. You will need it in order to proceed.", SetQuestValue(17514,1)
"411",QuestValue(17514)=3 -> "Form 411? You need Form 287 to get that! Do you have it?", Topic=4
"411",QuestValue(17514)=5 -> "Form 411? You need Form 287 to get that! Do you have it?", Topic=5
Topc=4,"no",QuestValue(17514)=3 -> "Oh, what a pity. Go see one of my colleagues. I give you the permission to get Form 287. Bye!", SetQuestValue(17514,4)
Topc=5,"yes",QuestValue(17514)=5 -> "Great. Here you are. Form 411. Come back anytime you want to talk. Bye.", SetQuestValue(17514,6)
I know that %N is how you tell the NPC to say the player's name in their dialogue, but it does NOT work the other way around.
To put it simply: what is the .npc format way to do "if msgcontains(msg, player:getName())"?
Thanks
Last edited: