Jump to content
  • 0
StainSky93

Genius NPC Chatter

Question

I once run into a serve with this NPC.. where you just randomly say anything with the NPC name in front and the Npc will react by answering to you.. I really wanna have such NPC.. but.. well..

I already read the "script_commands" manual.. which is very very long  /wah ...

and hell i make a very messy script in the past  /hmm ..

 

 Can some one help me by just making the script body? I will edit and add the content in it my self... /thx ..

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

//===== rAthena Script =======================================
//= Sample: PCRE
//===== By: ==================================================
//= MouseJstr
//===== Last Updated: ========================================
//= 20100108
//===== Description: ========================================= 
//= Demonstrates PCRE commands.
//============================================================

prontera,152,181,5	script	MouseJstr	763,{

// hello
Lquote0:
        npctalk "How do you do.  Please state your problem.";
        end;

// computer
Lquote1:
        switch(rand(4)) {
		case 0: npctalk "Do computers worry you?"; break;
		case 1: npctalk "What do you think about machines?"; break;
		case 2: npctalk "Why do you mention computers?"; break;
		case 3: npctalk "What do you think machines have to do with your problem?"; break;
	}
        end;

// name
Lquote2:
        npctalk "I am not interested in names";
        end;

// sorry
Lquote3:
	switch(rand(3)) {
		case 0: npctalk "Please don't apologize"; break;
		case 1: npctalk "Apologies are not necessary"; break;
		case 2: npctalk "What feelings do you have when you apologize"; break;
	}
        end;

// I remember [email protected]$
Lquote4:
	switch(rand(6)) {
		case 0: npctalk "Do you often think of "[email protected]$+"?"; break;
		case 1: npctalk "Does thinking of "[email protected]$+" bring anything else to mind?"; break;
		case 2: npctalk "What else do you remember?"; break;
		case 3: npctalk "Why do you recall "[email protected]$+" right now?"; break;
		case 4: npctalk "What in the present situation reminds you of "[email protected]$+"?"; break;
		case 5: npctalk "What is the connection between me and "[email protected]$+"?"; break;
	}
        end;

//    do you remember
Lquote5:
	switch (rand(4)) {
		case 0: npctalk "Did you think I would forget "[email protected]$+" ?"; break;
		case 1: npctalk "Why do you think I should recall "[email protected]$+" now"; break;
		case 2: npctalk "What about "[email protected]$+""; break;
		case 3: npctalk "You mentioned "[email protected]$+""; break;
	}
        end;

// if
Lquote6:
	switch(rand(4)) {
		case 0: npctalk "Do you really think its likely that "[email protected]$+""; break;
		case 1: npctalk "Do you wish that "[email protected]$+"?"; break;
		case 2: npctalk "What do you think about "[email protected]$+"?"; break;
		case 3: npctalk "Really-- if "[email protected]$+"?"; break;
	}
        end;

//  i dreamt
Lquote7:
	switch(rand(3)) {
		case 0: npctalk "Really-- "[email protected]$+""; break;
		case 1: npctalk "Have you ever fantasized "[email protected]$+" while you were awake?"; break;
		case 2: npctalk "Have you dreamt "[email protected]$+" before?"; break;
	}
        end;

//   dream about
Lquote8:
        npctalk "How do you feel about "[email protected]$+" in reality?";
        end;

//  dream
Lquote9:
	switch(rand(4)) {
		case 0: npctalk "What does this dream suggest to you?"; break;
		case 1: npctalk "Do you dream often?"; break;
		case 2: npctalk "What persons appear in your dreams?"; break;
		case 3: npctalk "Don't you believe that dream has to do with your problem?"; break;
	}
        end;

//   my mother
Lquote10:
	switch(rand(2)) {
		case 0: npctalk "Who else in your family "[email protected]$+""; break;
		case 1: npctalk "Tell me more about your family"; break;
	}
        end;

//   my father
Lquote11:
	switch(rand(3)) {
		case 0: npctalk "Your father"; break;
		case 1: npctalk "Does he influence you strongly?"; break;
		case 2: npctalk "What else comes to mind when you think of your father?"; break;
	}
        end;

//   I want
Lquote12:
	switch(rand(3)) {
		case 0: npctalk "What would it mean if you got "[email protected]$+""; break;
		case 1: npctalk "Why do you want "[email protected]$+""; break;
		case 2: npctalk "Suppose you got "[email protected]$+" soon"; break;
	}
        end;

//    I am glad 
Lquote13:
	switch(rand(3)) {
		case 0: npctalk "How have I helped you to be "[email protected]$+""; break;
		case 1: npctalk "What makes you happy just now"; break;
		case 2: npctalk "Can you explain why you are suddenly "[email protected]$+""; break;
	}
        end;

//    I am sad 
Lquote14:
	switch(rand(2)) {
		case 0: npctalk "I am sorry to hear you are depressed"; break;
		case 1: npctalk "I'm sure its not pleasant to be sad"; break;
	}
        end;

//   [email protected] are like "[email protected]$+"
Lquote15:
        npctalk "What resemblance do you see between "[email protected]$+" and "[email protected]$+"";
        end;

//   "[email protected]$+" is like "[email protected]$+"
Lquote16:
	switch(rand(4)) {
		case 0: npctalk "In what way is it that "[email protected]$+" is like "[email protected]$+""; break;
		case 1: npctalk "What resemblance do you see?"; break;
		case 2: npctalk "Could there really be some connection?"; break;
		case 3: npctalk "How?"; break;
	}
        end;

//   alike
Lquote17:
	switch(rand(2)) {
		case 0: npctalk "In what way?"; break;
		case 1: npctalk "What similarities are there?"; break;
	}
        end;

//    same 
Lquote18:
        npctalk "What other connections do you see?";
        end;

//   I was "[email protected]$+"
Lquote19:
	switch(rand(3)) {
		case 0: npctalk "Were you really?"; break;
		case 1: npctalk "Perhaps I already knew you were "[email protected]$+""; break;
		case 2: npctalk "Why do you tell me you were "[email protected]$+" now?"; break;
	}
        end;

//    was I
Lquote20:
	switch(rand(3)) {
		case 0: npctalk "What if you were "[email protected]$+" ?"; break;
		case 1: npctalk "Do you thin you were "[email protected]$+""; break;
		case 2: npctalk "What would it mean if you were "[email protected]$+""; break;
	}
        end;

//    I am
Lquote21:
	switch(rand(2)) {
		case 0: npctalk "In what way are you "[email protected]$+""; break;
		case 1: npctalk "Do you want to be "[email protected]$+" ?"; break;
	}
        end;

//   am I
Lquote22:
	switch(rand(4)) {
		case 0: npctalk "Do you believe you are "[email protected]$+""; break;
		case 1: npctalk "Would you want to be "[email protected]$+""; break;
		case 2: npctalk "You wish I would tell you you are "[email protected]$+""; break;
		case 3: npctalk "What would it mean if you were "[email protected]$+""; break;
	}
        end;

//   am
Lquote23:
	switch(rand(2)) {
		case 0: npctalk "Why do you say AM?"; break;
		case 1: npctalk "I don't understand that"; break;
	}
        end;

//    are you
Lquote24:
	switch(rand(3)) {
		case 0: npctalk "Why are you interested in whether I am "[email protected]$+" or not?"; break;
		case 1: npctalk "Would you prefer if I weren't "[email protected]$+""; break;
		case 2: npctalk "Perhaps I am "[email protected]$+" in your fantasies"; break;
	}
        end;

//   you are 
Lquote25:
        npctalk "What makes you think I am "[email protected]$+" ?";
        end;

//   because
Lquote26:
	switch(rand(3)) {
		case 0: npctalk "Is that the real reason?"; break;
		case 1: npctalk "What other reasons might there be?"; break;
		case 2: npctalk "Does that reason seem to explain anything else?"; break;
	}
        end;

//    were you 
Lquote27:
	switch(rand(3)) {
		case 0: npctalk "Perhaps I was "[email protected]$+""; break;
		case 1: npctalk "What do you think?"; break;
		case 2: npctalk "What if I had been "[email protected]$+""; break;
	}
        end;

//   I can't 
Lquote28:
	switch(rand(2)) {
		case 0: npctalk "Maybe you could "[email protected]$+" now"; break;
		case 1: npctalk "What if you could "[email protected]$+" ?"; break;
	}
        end;

//    I feel 
Lquote29:
        npctalk "Do you often feel "[email protected]$+" ?";
        end;

//    I felt
Lquote30:
        npctalk "What other feelings do you have?";
        end;

//   [email protected]$ I [email protected]$ you [email protected]$
Lquote31:
        npctalk "Perhaps in your fantasy we "[email protected]$+" each other?";
        end;

//   why don't you 
Lquote32:
	switch(rand(3)) {
		case 0: npctalk "Should you "[email protected]$+" yourself?"; break;
		case 1: npctalk "Do you believe I don't "[email protected]$+""; break;
		case 2: npctalk "Perhaps I will "[email protected]$+" in good time"; break;
	}
        end;

//   yes 
Lquote33:
	switch(rand(3)) {
		case 0: npctalk "You seem quite positive"; break;
		case 1: npctalk "You are sure?"; break;
		case 2: npctalk "I understand"; break;
	}
        end;

//    no
Lquote34:
	switch(rand(3)) {
		case 0: npctalk "Why not?"; break;
		case 1: npctalk "You are being a bit negative"; break;
		case 2: npctalk "Are you saying NO just to be negative?"; break;
	}
        end;

//    someone
Lquote35:
        npctalk "Can you be more specific?";
        end;

//    everyone 
Lquote36:
	switch(rand(4)) {
		case 0: npctalk "surely not everyone"; break;
		case 1: npctalk "Can you think of anyone in particular?"; break;
		case 2: npctalk "Who for example?"; break;
		case 3: npctalk "You are thinking of a special person?"; break;
	}
        end;

//  always 
Lquote37:
	switch(rand(4)) {
		case 0: npctalk "Can you think of a specific example?"; break;
		case 1: npctalk "When?"; break;
		case 2: npctalk "What incident are you thinking of?"; break;
		case 3: npctalk "Really-- always?"; break;
	}
        end;

//   what
Lquote38:
	switch(rand(5)) {
		case 0: npctalk "Why do you ask?"; break;
		case 1: npctalk "Does that question interest you?"; break;
		case 2: npctalk "What is it you really want to know?"; break;
		case 3: npctalk "What do you think?"; break;
		case 4: npctalk "What comes to your mind when you ask that?"; break;
	}
        end;

//   perhaps 
Lquote39:
        npctalk "You do not seem quite certain";
        end;

//   are
Lquote40:
	switch(rand(2)) {
		case 0: npctalk "Did you think they might not be "[email protected]$+""; break;
		case 1: npctalk "Possibly they are "[email protected]$; break;
	}
        end;

//   default
Lquote41:
	switch(rand(6)) {
		case 0: npctalk "Very interesting"; break;
		case 1: npctalk "I am not sure I understand you fully"; break;
		case 2: npctalk "What does that suggest to you?"; break;
		case 3: npctalk "Please continue"; break;
		case 4: npctalk "Go on"; break;
		case 5: npctalk "Do you feel strongly about discussing such things?"; break;
	}
        end;

OnInit:
        defpattern 1, "([^:]+):.*\\shello.*", "Lquote0";
        defpattern 1, "([^:]+):.*\\scomputer.*", "Lquote1";
        defpattern 1, "([^:]+):.*\\sname.*", "Lquote2";
        defpattern 1, "([^:]+):.*\\ssorry.*", "Lquote3";
        defpattern 1, "([^:]+):.*\\si\\s+remember\\s+(.*)", "Lquote4";
        defpattern 1, "([^:]+):.*\\sdo\\s+you\\s+remember\\s+(.*)", "Lquote5";
        defpattern 1, "([^:]+):.*\\sif\\s+(.*)", "Lquote6";
        defpattern 1, "([^:]+):.*\\si\\s+dreamt\\s+(.*)", "Lquote7";
        defpattern 1, "([^:]+):.*\\sdream\\s+about\\s+(.*)", "Lquote8";
        defpattern 1, "([^:]+):.*\\sdream\\s+(.*)", "Lquote9";
        defpattern 1, "([^:]+):.*\\smy\\s+mother\\s+(.*)", "Lquote10";
        defpattern 1, "([^:]+):.*\\smy\\s+father\\s+(.*)", "Lquote11";
        defpattern 1, "([^:]+):.*\\si\\s+want\\s+(.*)", "Lquote12";
        defpattern 1, "([^:]+):.*\\si\\s+am\\s+glad\\s+(.*)", "Lquote13";
        defpattern 1, "([^:]+):\\s+(.*)\\s+i\\s+am\\s+sad\\s+(.*)", "Lquote14";
        defpattern 1, "([^:]+):\\s+(.*)\\s+are\\s+like\\s+(.*)", "Lquote15";
        defpattern 1, "([^:]+):\\s+(.*)\\s+is\\s+like\\s+(.*)", "Lquote16";
        defpattern 1, "([^:]+):.*\\salike\\s+(.*)", "Lquote17";
        defpattern 1, "([^:]+):.*\\ssame\\s+(.*)", "Lquote18";
        defpattern 1, "([^:]+):.*\\si\\s+was\\s+(.*)", "Lquote19";
        defpattern 1, "([^:]+):.*\\swas\\s+i\\s+(.*)", "Lquote20";
        defpattern 1, "([^:]+):.*\\si\\s+am\\s+(.*)", "Lquote21";
        defpattern 1, "([^:]+):.*\\sam\\s+i\\s+(.*)", "Lquote22";
        defpattern 1, "([^:]+):.*\\sam\\s+(.*)", "Lquote23";
        defpattern 1, "([^:]+):.*\\sare\\s+you\\s+(.*)", "Lquote24";
        defpattern 1, "([^:]+):.*\\syou\\s+are\\s+(.*)", "Lquote25";
        defpattern 1, "([^:]+):.*\\sbecause\\s+(.*)", "Lquote26";
        defpattern 1, "([^:]+):.*\\swere\\s+you\\s+(.*)", "Lquote27";
        defpattern 1, "([^:]+):.*\\si\\s+(cant|can't|cannot)\\s+(.*)", "Lquote28";
        defpattern 1, "([^:]+):.*\\si\\s+feel\\s+(.*)", "Lquote29";
        defpattern 1, "([^:]+):.*\\si\\s+felt\\s+(.*)", "Lquote30";
        defpattern 1, "([^:]+):.*\\si\\s+(.*)\\s+you\\s+(.*)", "Lquote31";
        defpattern 1, "([^:]+):.*\\swhy\\s+(don't|dont)\\s+you\\s+(.*)", "Lquote32";
        defpattern 1, "([^:]+):.*\\syes\\s+(.*)", "Lquote33";
        defpattern 1, "([^:]+):.*\\sno\\s+(.*)", "Lquote34";
        defpattern 1, "([^:]+):.*\\ssomeone\\s+(.*)", "Lquote35";
        defpattern 1, "([^:]+):.*\\severyone\\s+(.*)", "Lquote36";
        defpattern 1, "([^:]+):.*\\salways\\s+(.*)", "Lquote37";
        defpattern 1, "([^:]+):.*\\swhat\\s+(.*)", "Lquote38";
        defpattern 1, "([^:]+):.*\\sperhaps\\s+(.*)", "Lquote39";
        defpattern 1, "([^:]+):.*\\sare\\s+(.*)", "Lquote40";
        defpattern 1, "([^:]+).*)", "Lquote41";

        activatepset 1;
        end;
}

Taken from /doc/sample/npc_test_pcre.txt

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.