Jump to content
  • 0

R> Random Quest NPC


ShiroNaito

Question


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.02
  • Content Count:  65
  • Reputation:   1
  • Joined:  04/04/19
  • Last Seen:  

Good day .. I just want to request a random quest npc where in :

 

case 1: jellopy 200x , garlet 200x apple 200x 

case 2: silk 200x , hairband 1 etc

case 3: different items again 

 

the reason why im looking this npc is I have a daily quest with rewards ..I dont want players to horde requirements and submit it every day ...

 

 

Thankyou 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  


prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	if (!quest_random) {
		quest_random = rand(1, 3);
		mes "You have been assigned with a new quest.";
		next;
	}
	switch(quest_random) {
		case 1:
			setarray .@reward, 4001, 1;
			setarray .@item, 512;
			setarray .@amount, 100;
			break;
		case 2:
			setarray .@reward, 4002, 1;
			setarray .@item, 501, 502, 503;
			setarray .@amount, 3, 1, 2;
			break;
		case 3:
			setarray .@reward, 4003, 1;
			setarray .@item, 512, 503;
			setarray .@amount, 300, 100;
			break;
		default:
			mes "invalid quest.";
			close;
	}
	mes "Quest Requirement(s):";
	.@size = getarraysize(.@item);
	for (.@i = 0; .@i < .@size; .@i++) {
		mes " > "+.@amount[.@i]+"x "+getitemname(.@item[.@i]);
		if (countitem(.@item[.@i]) < .@amount[.@i])
			.@fail++;
	}
	if (!.@fail) {
		next;
		if (select("Submit Quest", "Cancel") == 1) {
			for (.@i = 0; .@i < .@size; .@i++)
				delitem .@item[.@i], .@amount[.@i];
			getitem .@reward[0], .@reward[1];
			quest_random = 0;
		}
	}
	close;
}

try

  • Upvote 3
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.11
  • Content Count:  349
  • Reputation:   12
  • Joined:  04/05/20
  • Last Seen:  

On 8/24/2019 at 3:10 PM, Emistry said:


prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	if (!quest_random) {
		quest_random = rand(1, 3);
		mes "You have been assigned with a new quest.";
		next;
	}
	switch(quest_random) {
		case 1:
			setarray .@reward, 4001, 1;
			setarray .@item, 512;
			setarray .@amount, 100;
			break;
		case 2:
			setarray .@reward, 4002, 1;
			setarray .@item, 501, 502, 503;
			setarray .@amount, 3, 1, 2;
			break;
		case 3:
			setarray .@reward, 4003, 1;
			setarray .@item, 512, 503;
			setarray .@amount, 300, 100;
			break;
		default:
			mes "invalid quest.";
			close;
	}
	mes "Quest Requirement(s):";
	.@size = getarraysize(.@item);
	for (.@i = 0; .@i < .@size; .@i++) {
		mes " > "+.@amount[.@i]+"x "+getitemname(.@item[.@i]);
		if (countitem(.@item[.@i]) < .@amount[.@i])
			.@fail++;
	}
	if (!.@fail) {
		next;
		if (select("Submit Quest", "Cancel") == 1) {
			for (.@i = 0; .@i < .@size; .@i++)
				delitem .@item[.@i], .@amount[.@i];
			getitem .@reward[0], .@reward[1];
			quest_random = 0;
		}
	}
	close;
}

try

Hi I know this thread is old ..I just sent you a message regarding this @Emistry thankyou 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1614
  • Joined:  03/26/12
  • Last Seen:  

5 minutes ago, erjsanmiguel said:

Hi I know this thread is old ..I just sent you a message regarding this @Emistry thankyou 

There is absolutely no reason to resurrect a thread to tell someone that you've sent them a message. They'll see the message just fine without you telling them to go look for it.

/swt

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...