• 0
Sign in to follow this  
even

Requesting for a "Daily supply rewards" NPC script (w/ rotating waiting room,. example: Monday rewards, Tuesday rewards, Wednesday rewards and so on)

Question

Can someone please help me with this NPC script ->  "Daily supply rewards" (w/ rotating waiting room,. example: Monday Rewards, Tuesday Rewards, Wednesday  Rewards and so on). Sorry for my bad English. Thank you.

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 1
prontera,155,180,5	script	Daily Supply	94,{

	mes "[ Daily Supplier ]";	
	if(#DSUPPLY==gettime(DT_YYYYMMDD)){
	mes "You already received your supply today.";
		end;
	}
	mes "Here's your daily Supply!";
	explode([email protected]$,.items$[gettime(DT_DAYOFWEEK)],"|");
	for([email protected]=0;[email protected]<getarraysize([email protected]$);[email protected]+=2)
		getitem atoi([email protected]$[[email protected]]),atoi([email protected]$[[email protected]+1]);
	explode([email protected]$,.bounditems$[gettime(DT_DAYOFWEEK)],"|");
	for([email protected]=0;[email protected]<getarraysize([email protected]$);[email protected]+=2)
		getitembound atoi([email protected]$[[email protected]]),atoi([email protected]$[[email protected]+1]),Bound_Account;
	set #DSUPPLY,gettime(DT_YYYYMMDD);
end;

OnHour00:
	waitingroom callsub(OnCheckDay)+" Supply",0;
end;

end;
OnCheckDay:
	switch(gettime(DT_DAYOFWEEK)){
		case 0: return "Sunday";
		case 1: return "Monday";
		case 2: return "Tuesday";
		case 3: return "Wednesday";
		case 4: return "Thursday";
		case 5: return "Friday";
		case 6: return "Saturday";
		default: return "ERROR!";
			break;
	}
return;

OnInit:
	waitingroom callsub(OnCheckDay)+" Supply",0;
	
	//You can use Copy | (Vertical Bar) to separate items
	// Item ID, Amount{,Item ID,Amount}...
	setarray .items$[0],
			"501|5|502|10|503|15|504|20",	//Sunday
			"601|5|602|3", //Monday
			"501|1", //Tuesday
			"502|1", //Wednesday
			"503|1", //Thursday
			"504|1", //Friday
			"505|1"; //Saturday
	
	setarray .bounditems$,
			"501|5|502|10|503|15|504|20",	//Sunday
			"601|5|602|3", //Monday
			"505|1", //Tuesday
			"504|1", //Wednesday
			"506|1", //Thursday
			"502|1", //Friday
			"501|1"; //Saturday
end;

}

Don't Forget to press Answer and Up Vote ^_~

  • Upvote 3

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, Haruka Mayumi said:
prontera,155,180,5	script	Daily Supply	94,{

	mes "[ Daily Supplier ]";	
	if(#DSUPPLY==gettime(DT_YYYYMMDD)){
	mes "You already received your supply today.";
		end;
	}
	mes "Here's your daily Supply!";
	explode([email protected]$,.items$[gettime(DT_DAYOFWEEK)],"|");
	for([email protected]=0;[email protected]<getarraysize([email protected]$);[email protected]+=2)
		getitem atoi([email protected]$[[email protected]]),atoi([email protected]$[[email protected]+1]);
	explode([email protected]$,.bounditems$[gettime(DT_DAYOFWEEK)],"|");
	for([email protected]=0;[email protected]<getarraysize([email protected]$);[email protected]+=2)
		getitembound atoi([email protected]$[[email protected]]),atoi([email protected]$[[email protected]+1]),Bound_Account;
	set #DSUPPLY,gettime(DT_YYYYMMDD);
end;

OnHour00:
	waitingroom callsub(OnCheckDay)+" Supply",0;
end;

end;
OnCheckDay:
	switch(gettime(DT_DAYOFWEEK)){
		case 0: return "Sunday";
		case 1: return "Monday";
		case 2: return "Tuesday";
		case 3: return "Wednesday";
		case 4: return "Thursday";
		case 5: return "Friday";
		case 6: return "Saturday";
		default: return "ERROR!";
			break;
	}
return;

OnInit:
	waitingroom callsub(OnCheckDay)+" Supply",0;
	
	//You can use Copy | (Vertical Bar) to separate items
	// Item ID, Amount{,Item ID,Amount}...
	setarray .items$[0],
			"501|5|502|10|503|15|504|20",	//Sunday
			"601|5|602|3", //Monday
			"501|1", //Tuesday
			"502|1", //Wednesday
			"503|1", //Thursday
			"504|1", //Friday
			"505|1"; //Saturday
	
	setarray .bounditems$,
			"501|5|502|10|503|15|504|20",	//Sunday
			"601|5|602|3", //Monday
			"505|1", //Tuesday
			"504|1", //Wednesday
			"506|1", //Thursday
			"502|1", //Friday
			"501|1"; //Saturday
end;

}

Don't Forget to press Answer and Up Vote ^_~

Thank you. Your d best!

Share this post


Link to post
Share on other sites
  • 0
On 7/12/2019 at 3:41 PM, Haruka Mayumi said:
prontera,155,180,5	script	Daily Supply	94,{

	mes "[ Daily Supplier ]";	
	if(#DSUPPLY==gettime(DT_YYYYMMDD)){
	mes "You already received your supply today.";
		end;
	}
	mes "Here's your daily Supply!";
	explode([email protected]$,.items$[gettime(DT_DAYOFWEEK)],"|");
	for([email protected]=0;[email protected]<getarraysize([email protected]$);[email protected]+=2)
		getitem atoi([email protected]$[[email protected]]),atoi([email protected]$[[email protected]+1]);
	explode([email protected]$,.bounditems$[gettime(DT_DAYOFWEEK)],"|");
	for([email protected]=0;[email protected]<getarraysize([email protected]$);[email protected]+=2)
		getitembound atoi([email protected]$[[email protected]]),atoi([email protected]$[[email protected]+1]),Bound_Account;
	set #DSUPPLY,gettime(DT_YYYYMMDD);
end;

OnHour00:
	waitingroom callsub(OnCheckDay)+" Supply",0;
end;

end;
OnCheckDay:
	switch(gettime(DT_DAYOFWEEK)){
		case 0: return "Sunday";
		case 1: return "Monday";
		case 2: return "Tuesday";
		case 3: return "Wednesday";
		case 4: return "Thursday";
		case 5: return "Friday";
		case 6: return "Saturday";
		default: return "ERROR!";
			break;
	}
return;

OnInit:
	waitingroom callsub(OnCheckDay)+" Supply",0;
	
	//You can use Copy | (Vertical Bar) to separate items
	// Item ID, Amount{,Item ID,Amount}...
	setarray .items$[0],
			"501|5|502|10|503|15|504|20",	//Sunday
			"601|5|602|3", //Monday
			"501|1", //Tuesday
			"502|1", //Wednesday
			"503|1", //Thursday
			"504|1", //Friday
			"505|1"; //Saturday
	
	setarray .bounditems$,
			"501|5|502|10|503|15|504|20",	//Sunday
			"601|5|602|3", //Monday
			"505|1", //Tuesday
			"504|1", //Wednesday
			"506|1", //Thursday
			"502|1", //Friday
			"501|1"; //Saturday
end;

}

Don't Forget to press Answer and Up Vote ^_~

Im having some error with your script.. would you mind fixing these?? thanks...

2.JPG.2d3bb977dd100327ca60b8e63e3b9be6.JPG

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Brahms said:

Im having some error with your script.. would you mind fixing these?? thanks...

2.JPG.2d3bb977dd100327ca60b8e63e3b9be6.JPG

OnHour00:
	delwaitingroom strnpcinfo(0);
	waitingroom callsub(OnCheckDay)+" Supply",0;
end;

 

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Brahms said:

OnHour00: waitingroom callsub(OnCheckDay)+" Supply",0; end; end;

is this suppose to be 2 end;???

 

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...
Sign in to follow this