Jump to content
  • 0
PholliCruz

NPC that sells items monthly

Question

Hi good day rathena, i would like to request a NPC that sells different items monthly.

 

for example:

January = apple , jellopy and oridecon

Febraury = elunium , Pharacon and knife

etc.

  • Love 1

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

Try this

 

//========================================================
//	Monthly rotation shop
//========================================================
// Written by PottScilgrim
//========================================================
//	Main NPC:
//		- 	Switches the month and creates an array
//		-	Sets the shop contents as the array
//	Options:
//		- Modify ".customPrice" to 1 if you want to use custom prices for items
//			Edit the .MONTHLYPRICE arrays with your desired prices
//========================================================
prontera,154,179,3	script	Monthly Shop#1	10180,{

	mes .name$;
	mes "Now opening the monthly shop";
	close2; callshop "S_MONTHLYSHOP",1; end;

OnClock0001:
OnInit:

	.customPrice = 0;	// Modify this to 1 if you want to use custom buy prices for items

	.name$ = "[^FF0000 Monthly Shop ^000000]";
	$monthint = gettime(DT_MONTH);
	switch($monthint){
		case 1:	// January
			setarray .MONTHLYSHOP[0],512,909,984;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 2:	// February
			setarray .MONTHLYSHOP[0],985,1010,1201;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 3:	// March
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 4:	// April
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 5:	// May
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 6:	// June
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 7:	// July
			setarray .MONTHLYSHOP[0],985,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 8:	// August
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 9:	// September
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 10:	// October
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 11:	// November
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 12:	// December
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
	}
	npcshopdelitem "S_MONTHLYSHOP",501;
	npcshopadditem "S_MONTHLYSHOP",	.MONTHLYSHOP[0],.MONTHLYPRICE[0],
									.MONTHLYSHOP[1],.MONTHLYPRICE[1],
									.MONTHLYSHOP[2],.MONTHLYPRICE[2];
	end;
}

//========================================================
//	Shop NPC. Don't touch this.
//========================================================
-	shop	S_MONTHLYSHOP		-1,501:-1;

 

Edited by PottScilgrim
  • Love 1

Share this post


Link to post
Share on other sites
  • 0
On 7/13/2020 at 5:04 PM, PottScilgrim said:

Try this

 

//========================================================
//	Monthly rotation shop
//========================================================
// Written by PottScilgrim
//========================================================
//	Main NPC:
//		- 	Switches the month and creates an array
//		-	Sets the shop contents as the array
//	Options:
//		- Modify ".customPrice" to 1 if you want to use custom prices for items
//			Edit the .MONTHLYPRICE arrays with your desired prices
//========================================================
prontera,154,179,3	script	Monthly Shop#1	10180,{

	mes .name$;
	mes "Now opening the monthly shop";
	close2; callshop "S_MONTHLYSHOP",1; end;

OnClock0001:
OnInit:

	.customPrice = 0;	// Modify this to 1 if you want to use custom buy prices for items

	.name$ = "[^FF0000 Monthly Shop ^000000]";
	$monthint = gettime(DT_MONTH);
	switch($monthint){
		case 1:	// January
			setarray .MONTHLYSHOP[0],512,909,984;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 2:	// February
			setarray .MONTHLYSHOP[0],985,1010,1201;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 3:	// March
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 4:	// April
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 5:	// May
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 6:	// June
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 7:	// July
			setarray .MONTHLYSHOP[0],985,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 8:	// August
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 9:	// September
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 10:	// October
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 11:	// November
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
		case 12:	// December
			setarray .MONTHLYSHOP[0],512,512,512;
			if(.customPrice) { setarray .MONTHLYPRICE[0],10,10,10; } else { setarray .MONTHLYPRICE[0],getiteminfo(.MONTHLYSHOP[0],0),getiteminfo(.MONTHLYSHOP[1],0),getiteminfo(.MONTHLYSHOP[2],0); }
			break;
	}
	npcshopdelitem "S_MONTHLYSHOP",501;
	npcshopadditem "S_MONTHLYSHOP",	.MONTHLYSHOP[0],.MONTHLYPRICE[0],
									.MONTHLYSHOP[1],.MONTHLYPRICE[1],
									.MONTHLYSHOP[2],.MONTHLYPRICE[2];
	end;
}

//========================================================
//	Shop NPC. Don't touch this.
//========================================================
-	shop	S_MONTHLYSHOP		-1,501:-1;

 

how to change the costume price?

Share this post


Link to post
Share on other sites
  • 0
13 hours ago, Jaodegwapo said:

how to change the costume price?

Edit .customPrice to 1 so the script knows to use the custom prices rather than the default values.

Then edit the .MONTHLYPRICE[0] arrays from to whatever you want them to cost. 

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.


×
×
  • Create New...

Important Information

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