Jump to content
  • 0

Simple Information NPC Script that has Menus


romanticnerd

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   1
  • Joined:  10/17/20
  • Last Seen:  

Hi guys,

 

I need some assistance with a script. I am a newbie though, I don't know how to make a script from scratch cause I normally get them from here and just edit it to suit what I need.

 

So yeah, what I wanted to do was have an NPC that Players can talk to get information from.

 

There would probably be 3 - 5 options like:

Quests

VIP Info

etc

etc

 

I know how to include the messages like these

	mes "[Pepito]";

 

What I don't know is how to make a selection like a menu on what info the want to know more about. Thanks a lot guys!

Edited by romanticnerd
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

Goto rAthena-Master/doc/script_commands for guide everything you need for scripting is there

Ex:

 

	switch(select("This is Label and it will go to Case 1:This is Label and it will go to Case 2")) {
		case 1:
			mes "You said yes!";
			break;
		case 2:
			mes "Aww, why?";
			break;
	}
	close;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

prontera,145,193,3	script	Dogoo	508,{

while(1){
	mes .name$;
	mes "Hello there nyaa~ring";
	mes "I'm a hired guide by gee-gee here.";
	mes "I help people that have trouble or lost on what to do.";
	next;
	.@menu$ = "";
	for(.@i=0;.@i<getarraysize(.GuideMenu$);.@i++);
		.@menu$ = .@menu$ + .GuideMenu$ + ":";
	.@menu$ = .@menu$ + "> Just passing by..";
	.@select = select(.@menu$)-1;
	if(.@select >= getarraysize(.GuideMenu$)){
		mes .name$;
		mes "I see, Hope you have a fun adventures to come.";
		end;
	}
	callsub OnGuideSelect,.@select;
	next;
}
end;

OnGuideSelect:
	//arg(0) = Selected Context;
	.@size = getarraysize(getd(".GuideContext_"+getarg(0)+"$"));
	for(.@i=0;.@i<.@size;.@i++){
		mes .name$;
		mes getd(".GuideContext_"+getarg(0)+"$["+.@i+"]");
		next;
	}
return;

OnInit:
	.name$ = "[ ^FF5500Dogoo^000000 ]";
	
	setarray .GuideMenu$[0],
					"> This is Menu 1","> This is Menu 2","> This is Menu 3";
	
	setarray .GuideContext_0$[0],	//This is Menu 1
					"Menu 1 - First Bubble.",
					"Menu 1 - Second Bubble.",
					"Menu 1 - Third Bubble";
	
	setarray .GuideContext_1$[0],	//This is Menu 2
					"Menu 2 - First Bubble.",
					"Menu 2 - Second Bubble";
                                 
	setarray .GuideContext_2$[0],	//This is Menu 3
					"Menu 3 - First Bubble.",
					"Menu 3 - Second Bubble",
					"Menu 3 - Third Bubble.",
					"Menu 3 - Fourth Bubble";
                                 
end;
}

All you need to do is create .GuideContext_(MenuNumber-1)$[0],

Edited by Haruka Mayumi
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...