• 0
ShiroNaito

R> Random Quest NPC

Question

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 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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 [email protected], 4001, 1;
			setarray [email protected], 512;
			setarray [email protected], 100;
			break;
		case 2:
			setarray [email protected], 4002, 1;
			setarray [email protected], 501, 502, 503;
			setarray [email protected], 3, 1, 2;
			break;
		case 3:
			setarray [email protected], 4003, 1;
			setarray [email protected], 512, 503;
			setarray [email protected], 300, 100;
			break;
		default:
			mes "invalid quest.";
			close;
	}
	mes "Quest Requirement(s):";
	[email protected] = getarraysize([email protected]);
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) {
		mes " > "[email protected][[email protected]]+"x "+getitemname([email protected][[email protected]]);
		if (countitem([email protected][[email protected]]) < [email protected][[email protected]])
			[email protected]++;
	}
	if ([email protected]) {
		next;
		if (select("Submit Quest", "Cancel") == 1) {
			for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
				delitem [email protected][[email protected]], [email protected][[email protected]];
			getitem [email protected][0], [email protected][1];
			quest_random = 0;
		}
	}
	close;
}

try

  • Upvote 1

Share this post


Link to post
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.

Loading...