// @unloadnpc vanilla
// @loadnpc npc/thor/woe_rental.txt

prontera,161,191,4	script	vanilla	8W_SOLDIER,{

if ( Class == Job_Knight || Class == Job_Priest || Class == Job_Wizard || Class == Job_Blacksmith || Class == Job_Hunter || Class == Job_Assassin || Class == Job_Crusader || Class == Job_Monk || Class == Job_Sage || Class == Job_Rogue || Class == Job_Alchemist || Class == Job_Bard || Class == Job_Dancer ) {

}
else {
	mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ])");
	mes("Sorry, only Pre-Trans Class:");
	for ( .@i = 0; .@i < getarraysize(.class); ++.@i ) {
		mes("- "+CStr(jobname( .class[.@i] ), "RED"));
	}
	close();
}

while(1) {
	mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
	if (!$vanilla && getgmlevel() < .GMAccess) {
		mes("Sorry, shop is still close.  Please check back later");
		close();
	}
	mes("Please select:");
	next();
	switch(select(
	 ((getgmlevel() >= .GMAccess)?"> ^FF0000GM Menu^000000:":":")+
	 " > Weapon:"+
	 " > Armor:"+
	 " > Garment:"+
	 " > Shoes:"+
	 " > Shield:"+
	 " > Accessories:"+
	 " > Headgears:"+
	 " > ^777777Close^000000"
	)) {
	case 1: // GM Menu
		mes("[^0000ffBTA GM Setup^000000]");
		while(1) {
		switch(select(
			((!$vanilla)?"Status [ ^ff0000Inactive^000000 ]:":"Status [ ^28bf00Active^000000 ]:")+
			"Card Cost [ ^28bf00"+.cprice+"^000000 ]:"+
			"Weapon Cost [ ^28bf00"+.wprice+"^000000 ]:"+
			"Armor Cost [ ^28bf00"+.aprice+"^000000 ]:"+
			"Garment Cost [ ^28bf00"+.gprice+"^000000 ]:"+
			"Shield Cost [ ^28bf00"+.sprice+"^000000 ]:"+
			"Footgear Cost [ ^28bf00"+.fgprice+"^000000 ]:"+
			"Accessories Cost [ ^28bf00"+.accprice+"^000000 ]:"+
			"Headgear Cost [ ^28bf00"+.hgprice+"^000000 ]:"+
	 	 	"- ^777777Close^000000"
			)) {	
			case 1: if (!$vanilla) { 
					$vanilla = 1;
					dispbottom("Vanilla WOE Shop is now active");
				} else { 
					$vanilla = 0;
					dispbottom("Vanilla WoE Shop is now disabled");
				} break;
			case 2: input .cprice,0; break;
			case 3: input .wprice,0; break;
			case 4: input .aprice,0; break;
			case 5: input .gprice,0; break;
			case 6: input .sprice,0; break;
			case 7: input .fgprice,0; break;
			case 8: input .accprice,0; break;
			case 9: input .hgprice,0; break;
			default:
				close();
			}
		}
		break;
	case 2: // Weapons
		.@menu$ = "";
		.@wcard0 = 0; .@wcard1 = 0; .@wcard2 = 0; .@wcard3 = 0;
		for( .@i = 0; .@i < getarraysize(.weapon); .@i++ )
			.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.weapon[.@i])+" [ "+getitemslots(.weapon[.@i])+" ]:";
		.@select = select( .@menu$ ) - 1;
		.@w_weapon = .weapon[.@select];

		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You selected: "+CStr(getitemname(.@w_weapon),"RED")+" ["+getitemslots(.@w_weapon)+"]");

		// Get Cards
		for( .@s = 0; .@s < getitemslots(.@w_weapon); ++.@s){
			.@menu$ = "";
			for( .@i = 0; .@i < getarraysize(.wcard); .@i++ ) {
				.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.wcard[.@i])+":";
			}
			.@select = select( .@menu$ ) - 1;
			set getd(".@wcard"+.@s),.wcard[.@select];
			mes("Card #"+(.@s+1)+": "+CStr(getitemname(getd(".@wcard"+.@s)),"RED"));
		}
		next();
		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You have selected:");
		if (getiteminfo(.@w_weapon,13) == 1) {
			mes("^28bf00"+@itemname2_info$[0] +callfunc( "getitemname2", .@w_weapon, 1, 10, 0, .@wcard0, .@wcard1, .@wcard2, .@wcard3, 0 )+"^000000");
		} else {
			mes("^28bf00"+@itemname2_info$[0] +callfunc( "getitemname2", .@w_weapon, 1, 7, 0, .@wcard0, .@wcard1, .@wcard2, .@wcard3, 0 )+"^000000");
		}
		.@totalcost = .wprice + (getitemslots(.@w_weapon)*.cprice);
		if (.@totalcost) {
			mes("Would you like to proceed buying this item at ^ff0000"+callfunc("F_InsertComma", .@totalcost )+"^000000z ?");	
		} else {
			mes("Would you like to proceed?");
		}
	
		if (select("No, thanks", "Yes, I'm sure") == 2) {
			if (.@totalcost) {			
				if (Zeny < .@totalcost ) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Your bag is too heavy, isn't it?");
					mes("Come to me again");
					mes("after emptying your bag.");
					close();
				}
				else if (checkweight(.@w_weapon,1) == 0) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("- Wait !! -");
					mes("- You have too many items, so it's -");
					mes("- impossible to have more. -");
					mes("- Come to me again -");
					mes("- after emptying some of it. -");
					close();
				}

				Zeny = Zeny - .@totalcost;
			}
			specialeffect(154, AREA, playerattached());	
			if (getiteminfo(.@w_weapon,13) == 1) {
				rentitem2(.@w_weapon,10800,1,10,0,.@wcard0,.@wcard1,.@wcard2,.@wcard3);
			}
			else {
				rentitem2(.@w_weapon,10800,1,7,0,.@wcard0,.@wcard1,.@wcard2,.@wcard3);
			}
			close2();
			break;
		}
		else {
			close2();
			break;
		}
	case 3: // Armors
		.@menu$ = "";
		.@acard0 = 0; .@acard1 = 0; .@acard2 = 0; .@acard3 = 0;
		for( .@i = 0; .@i < getarraysize(.armor); .@i++ )
			.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.armor[.@i])+" [ "+getitemslots(.armor[.@i])+" ]:";
		.@select = select( .@menu$ ) - 1;
		.@w_armor = .armor[.@select];

		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You selected: "+CStr(getitemname(.@w_armor),"RED")+" ["+getitemslots(.@w_armor)+"]");

		// Get Cards
		for( .@s = 0; .@s < getitemslots(.@w_armor); ++.@s){
			dispbottom("Select Card #"+(.@s));
			.@menu$ = "";
			for( .@i = 0; .@i < getarraysize(.acard); .@i++ ) {
				.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.acard[.@i])+":";
			}
			.@select = select( .@menu$ ) - 1;
			set getd(".@acard"+.@s),.acard[.@select];
			mes("Card #"+(.@s+1)+": "+CStr(getitemname(getd(".@acard"+.@s)),"RED"));
		}
		next();
		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You have selected:");
		mes("^28bf00"+@itemname2_info$[0] +callfunc( "getitemname2", .@w_armor, 1, 7, 0, .@acard0, .@acard1, .@acard2, .@acard3, 0 )+"^000000");
		.@totalcost = .aprice + (getitemslots(.@w_armor)*.cprice);
		if (.@totalcost) {
			mes("Would you like to proceed buying this item at ^ff0000"+callfunc("F_InsertComma", .@totalcost )+"^000000z ?");
		} else {	
			mes("Would you like to proceed?");
		}
	
		if (select("No, thanks", "Yes, I'm sure") == 2) {
			if (.@totalcost) {
				if (Zeny < .@totalcost ) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Your bag is too heavy, isn't it?");
					mes("Come to me again");
					mes("after emptying your bag.");
					close();
				}
				else if (checkweight(.@w_armor,1) == 0) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("- Wait !! -");
					mes("- You have too many items, so it's -");
					mes("- impossible to have more. -");
					mes("- Come to me again -");
					mes("- after emptying some of it. -");
					close();
				}
				set Zeny, Zeny - .@totalcost;
			}
			specialeffect(154, AREA, playerattached());	
			rentitem2 .@w_armor,10800,1,7,0,.@acard0,.@acard1, .@acard2, .@acard3;
			close2();
			break;
		}
		else {
			close2();
			break;
		}
	case 4: // Garment
		.@menu$ = "";
		.@gcard0 = 0; .@gcard1 = 0; .@gcard2 = 0; .@gcard3 = 0;
		for( .@i = 0; .@i < getarraysize(.garment); .@i++ )
			.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.garment[.@i])+" [ "+getitemslots(.garment[.@i])+" ]:";
		.@select = select( .@menu$ ) - 1;
		.@w_garment = .garment[.@select];

		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You selected: "+CStr(getitemname(.@w_garment),"RED")+" ["+getitemslots(.@w_garment)+"]");

		// Get Cards
		for( .@s = 0; .@s < getitemslots(.@w_garment); ++.@s){
			dispbottom("Select Card #"+(.@s));
			.@menu$ = "";
			for( .@i = 0; .@i < getarraysize(.gcard); .@i++ ) {
				.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.gcard[.@i])+":";
			}
			.@select = select( .@menu$ ) - 1;
			set getd(".@gcard"+.@s),.gcard[.@select];
			mes("Card #"+(.@s+1)+": "+CStr(getitemname(getd(".@gcard"+.@s)),"RED"));
		}
		next();
		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You have selected:");
		mes("^28bf00"+@itemname2_info$[0] +callfunc( "getitemname2", .@w_garment, 1, 7, 0, .@gcard0, .@gcard1, .@gcard2, .@gcard3, 0 )+"^000000");
		.@totalcost = .gprice + (getitemslots(.@w_garment)*.cprice);
		if (.@totalcost) {
			mes("Would you like to proceed buying this item at ^ff0000"+callfunc("F_InsertComma",.@totalcost )+"^000000z ?");
		} else {
			mes("Would you like to proceed?");	
		}
		if (select("No, thanks", "Yes, I'm sure") == 2) {
			if (.@totalcost) {
				if (Zeny < .@totalcost ) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Your bag is too heavy, isn't it?");
					mes("Come to me again");
					mes("after emptying your bag.");
					close();
				}
				else if (checkweight(.@w_garment,1) == 0) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("- Wait !! -");
					mes("- You have too many items, so it's -");
					mes("- impossible to have more. -");
					mes("- Come to me again -");
					mes("- after emptying some of it. -");
					close();
				}
				Zeny = Zeny - .@totalcost;
			}
			specialeffect(154, AREA, playerattached());	
			if(.@w_garment== 2508) {
				rentitem2(.@w_garment,10800,1,7,0,8149,0,0,0);
			} else {
				if (!getitemslots(.@w_garment)) {
					rentitem2(.@w_garment,10800,1,7,0,8149,0,0,0);
				} else {
					rentitem2(.@w_garment,10800,1,7,0,.@gcard0, .@gcard1, .@gcard2, .@gcard3);
				}
			}
			close2();
			break;
		}
		else {
			close2();
			break;
		}
	case 5: // Shoes
		.@menu$ = "";
		.@fgcard0 = 0; .@fgcard1 = 0; .@fgcard2 = 0; .@fgcard3 = 0;
		for( .@i = 0; .@i < getarraysize(.shoes); .@i++ )
			.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.shoes[.@i])+" [ "+getitemslots(.shoes[.@i])+" ]:";
		.@select = select( .@menu$ ) - 1;
		.@w_shoes = .shoes[.@select];

		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You selected: "+CStr(getitemname(.@w_shoes),"RED")+" ["+getitemslots(.@w_shoes)+"]");

		// Get Cards
		for( .@s = 0; .@s < getitemslots(.@w_shoes); ++.@s){
			dispbottom("Select Card #"+(.@s));
			.@menu$ = "";
			for( .@i = 0; .@i < getarraysize(.fgcard); .@i++ ) {
				.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.fgcard[.@i])+":";
			}
			.@select = select( .@menu$ ) - 1;
			set getd(".@fgcard"+.@s),.fgcard[.@select];
			mes("Card #"+(.@s+1)+": "+CStr(getitemname(getd(".@fgcard"+.@s)),"RED"));
		}
		next();
		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You have selected:");
		mes("^28bf00"+@itemname2_info$[0] +callfunc( "getitemname2", .@w_shoes, 1, 7, 0, .@fgcard0, .@fgcard1, .@fgcard2, .@fgcard3, 0 )+"^000000");
		.@totalcost = .fgprice + (getitemslots(.@w_shoes)*.cprice);
		if (.@totalcost) {
			mes("Would you like to proceed buying this item at ^ff0000"+callfunc("F_InsertComma",.fgprice + (getitemslots(.@w_shoes)*.cprice) )+"^000000z ?");
		} else {
			mes("Would you like to proceed?");
		}
		if (select("No, thanks", "Yes, I'm sure") == 2) {
			if (.@totalcost) {
				if (Zeny < .@totalcost ) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Your bag is too heavy, isn't it?");
					mes("Come to me again");
					mes("after emptying your bag.");
					close();
				}
				else if (checkweight(.@w_shoes,1) == 0) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("- Wait !! -");
					mes("- You have too many items, so it's -");
					mes("- impossible to have more. -");
					mes("- Come to me again -");
					mes("- after emptying some of it. -");
					close();
				}
				Zeny = Zeny - .@totalcost;
			}
			specialeffect(154, AREA, playerattached());
			if(.@w_shoes== 2407) {
				rentitem2(.@w_shoes,10800,1,7,0,8149,0,0,0);
			} else {
				if (!getitemslots(.@w_shoes)) {
					rentitem2(.@w_shoes,10800,1,7,0,8149,0,0,0);
				} else {
					rentitem2(.@w_shoes,10800,1,7,0,.@fgcard0, .@fgcard1, .@fgcard2, .@fgcard3);
				}
			}
			close2();
			break;
		}
		else {
			close2();
			break;
		}
	case 6: // Shield
		.@menu$ = "";
		.@scard0 = 0; .@scard1 = 0; .@scard2 = 0; .@scard3 = 0;
		for( .@i = 0; .@i < getarraysize(.shield); .@i++ )
			.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.shield[.@i])+" [ "+getitemslots(.shield[.@i])+" ]:";
		.@select = select( .@menu$ ) - 1;
		.@w_shield = .shield[.@select];

		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You selected: "+CStr(getitemname(.@w_shield),"RED")+" ["+getitemslots(.@w_shield)+"]");

		// Get Cards
		for( .@s = 0; .@s < getitemslots(.@w_shield); ++.@s){
			dispbottom("Select Card #"+(.@s));
			.@menu$ = "";
			for( .@i = 0; .@i < getarraysize(.scard); .@i++ ) {
				.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.scard[.@i])+":";
			}
			.@select = select( .@menu$ ) - 1;
			set getd(".@scard"+.@s),.scard[.@select];
			mes("Card #"+(.@s+1)+": "+CStr(getitemname(getd(".@scard"+.@s)),"RED"));
		}
		next();
		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You have selected:");
		mes("^28bf00"+@itemname2_info$[0] +callfunc( "getitemname2", .@w_shield, 1, 7, 0, .@scard0, .@scard1, .@scard2, .@scard3, 0 )+"^000000");
		.@totalcost = .sprice + (getitemslots(.@w_shield)*.cprice);
		if (.@totalcost) {
			mes("Would you like to proceed buying this item at ^ff0000"+callfunc("F_InsertComma",.@totalcost )+"^000000z ?");
		} else {
			mes("Would you like to proceed?");
		}

		if (select("No, thanks", "Yes, I'm sure") == 2) {
			if (.@totalcost) {
				if (Zeny < .@totalcost ) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Your bag is too heavy, isn't it?");
					mes("Come to me again");
					mes("after emptying your bag.");
					close();
				}
				else if (checkweight(.@w_shield,1) == 0) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("- Wait !! -");
					mes("- You have too many items, so it's -");
					mes("- impossible to have more. -");
					mes("- Come to me again -");
					mes("- after emptying some of it. -");
					close();
				}
				Zeny = Zeny - .@totalcost;
			}
			specialeffect(154, AREA, playerattached());	
			rentitem2 .@w_shield,10800,1,7,0,.@scard0, .@scard1, .@scard2, .@scard3;
			close2();
			break;
		}
		else {
			close2();
			break;
		}
	case 7: // Accessories
		.@menu$ = "";
		.@accard0 = 0; .@accard1 = 0; .@accard2 = 0; .@accard3 = 0;
		for( .@i = 0; .@i < getarraysize(.accessories); .@i++ )
			.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.accessories[.@i])+" [ "+getitemslots(.accessories[.@i])+" ]:";
		.@select = select( .@menu$ ) - 1;
		.@w_accessories = .accessories[.@select];

		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You selected: "+CStr(getitemname(.@w_accessories),"RED")+" ["+getitemslots(.@w_accessories)+"]");

		// Get Cards
		for( .@s = 0; .@s < getitemslots(.@w_accessories); ++.@s ){
			dispbottom("Select Card #"+(.@s));
			.@menu$ = "";
			for( .@i = 0; .@i < getarraysize(.accard); .@i++ ) {
				.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.accard[.@i])+":";
			}
			.@select = select( .@menu$ ) - 1;
			set getd(".@accard"+.@s),.accard[.@select];
			mes("Card #"+(.@s+1)+": "+CStr(getitemname(getd(".@accard"+.@s)),"RED"));
		}
		next();
		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You have selected:");
		mes("^28bf00"+@itemname2_info$[0] +callfunc( "getitemname2", .@w_accessories, 1, 0, 0, .@accard0, .@accard1, .@accard2, .@accard3, 0 )+"^000000");
		.@totalcost = .acprice + (getitemslots(.@w_accessories)*.cprice);
		if (.@totalcost) {
			mes("Would you like to proceed buying this item at ^ff0000"+callfunc("F_InsertComma",.@totalcost )+"^000000z ?");
		} else {
			mes("Would you like to proceed?");
		}	
		if (select("No, thanks", "Yes, I'm sure") == 2) {
			if (.@totalcost) {
				if (Zeny < .@totalcost ) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Your bag is too heavy, isn't it?");
					mes("Come to me again");
					mes("after emptying your bag.");
					close();
				}
				else if (checkweight(.@w_accessories,1) == 0) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("- Wait !! -");
					mes("- You have too many items, so it's -");
					mes("- impossible to have more. -");
					mes("- Come to me again -");
					mes("- after emptying some of it. -");
					close();
				}
				Zeny = Zeny - .@totalcost;
			}
			specialeffect(154, AREA, playerattached());	
			rentitem2(.@w_accessories,10800,1,0,0,.@accard0, .@accard1, .@accard2, .@accard3);
			close2();
			break;
		}
		else {
			close2();
			break;
		}
	case 8: // Headgears
		.@menu$ = "";
		.@hgcard0 = 0; .@hgcard1 = 0; .@hgcard2 = 0; .@hgcard3 = 0;
		for( .@i = 0; .@i < getarraysize(.hgear); .@i++ )
			.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.hgear[.@i])+" [ "+getitemslots(.hgear[.@i])+" ]:";
		.@select = select( .@menu$ ) - 1;
		.@w_hgear = .hgear[.@select];

		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You selected: "+CStr(getitemname(.@w_hgear),"RED")+" ["+getitemslots(.@w_hgear)+"]");

		// Get Cards
		for( .@s = 0; .@s < getitemslots(.@w_hgear); ++.@s ){
			dispbottom("Select Card #"+(.@s));
			.@menu$ = "";
			for( .@i = 0; .@i < getarraysize(.hgcard); .@i++ ) {
				.@menu$ = .@menu$ + "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.hgcard[.@i])+":";
			}
			.@select = select( .@menu$ ) - 1;
			set getd(".@hgcard"+.@s),.hgcard[.@select];
			mes("Card #"+(.@s+1)+": "+CStr(getitemname(getd(".@hgcard"+.@s)),"RED"));
		}
		next();
		mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
		mes("You have selected:");
		mes("^28bf00"+@itemname2_info$[0] +callfunc( "getitemname2", .@w_hgear, 1, 0, 0, .@hgcard0, .@hgcard1, .@hgcard2, .@hgcard3, 0 )+"^000000");
		.@totalcost = .hgprice + (getitemslots(.@w_hgear)*.cprice);
		if (.@totalcost) {
			mes("Would you like to proceed buying this item at ^ff0000"+callfunc("F_InsertComma",.@totalcost )+"^000000z ?");
		} else {
			mes("Would you like to proceed?");
		}
		if (select("No, thanks", "Yes, I'm sure") == 2) {
			if (.@totalcost) {
				if (Zeny < .@totalcost ) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("Your bag is too heavy, isn't it?");
					mes("Come to me again");
					mes("after emptying your bag.");
					close();
				}
				else if (checkweight(.@w_hgear,1) == 0) {
					next();
					mes("[ "+CStr("Vanilla WoE Shop","GREEN")+" ]");
					mes("- Wait !! -");
					mes("- You have too many items, so it's -");
					mes("- impossible to have more. -");
					mes("- Come to me again -");
					mes("- after emptying some of it. -");
					close();
				}
				Zeny = Zeny - .@totalcost;
			}
			specialeffect(154, AREA, playerattached());
			if(.@w_hgear == 2218 || .@w_hgear == 2265 || .@w_hgear == 2266 || .@w_hgear == 2267 || .@w_hgear == 2268 || .@w_hgear == 2269 || .@w_hgear == 2270 || .@w_hgear == 2289 || .@w_hgear == 2291 || .@w_hgear == 2292 || .@w_hgear == 2295 || .@w_hgear == 2296 || .@w_hgear == 2281 || .@w_hgear == 5014 || .@w_hgear == 5043 ) {
				if (!getitemslots(.@w_hgear)) {
					rentitem2(.@w_hgear,10800,1,0,0,8149,0,0,0);
				} else {
					rentitem2(.@w_hgear,10800,1,0,0,.@hgcard0, .@hgcard1, .@hgcard2, .@hgcard3);
				}
			}
			else {
				if (!getitemslots(.@w_hgear)) {
					rentitem2(.@w_hgear,10800,1,7,0,8149,0,0,0);
				} else {
					rentitem2(.@w_hgear,10800,1,7,0,.@hgcard0, .@hgcard1, .@hgcard2, .@hgcard3);
				}
			}
			close2();
			break;
		}
		else {
			close2();
			break;
		}
	default:
		close();
	}
}
end;

OnClock2100:
OnClock2300:
	if (gettime(GETTIME_WEEKDAY) == THURSDAY) {
		if (!$vanilla) {
			$vanilla = 1;
			announce "Vanilla WoE Shop is now active.  Visit NPC near Prontera fountain.",bc_all,"0xffff00",FW_BOLD,12;
			end;
		} else {
			$vanilla = 0;
			announce "Vanilla WoE Shop is now close. See you next Thursday.",bc_all,"0xffff00",FW_BOLD,12;
			end;
		}
	}
	end;

/* Announce every 5 minutes */
OnMinute00:
OnMinute05:
OnMinute10:
OnMinute15:
OnMinute20:
OnMinute25:
OnMinute30:
OnMinute35:
OnMinute40:
OnMinute45:
OnMinute50:
OnMinute55:
	if ($vanilla) {
		announce "Vanilla WoE Shop is active.  Visit NPC near Prontera fountain to shop for your equipment.",bc_all,"0xffff00",FW_BOLD,12;
	}
	end;
OnInit:
	$vanilla = 0;
	.GMAccess = 99;
	.wprice = 0;	// Weapon Cost
	.aprice = 0;	// Armor Cost
	.gprice = 0;	// Garment Cost
	.sprice = 0;	// Shield Cost
	.fgprice = 0;	// FootGear Cost
	.accprice = 0;	// Accessories Cost
	.hgprice = 0;	// Headgear Cost
	.cprice = 0;		// Card Cost
	setarray .weapon, 
		/*  One-Hand Sword */	1108, 1117, 1120, 1127, 1128,
		/*  Two-Hand Sword */   1158, 1162, 1164,
		/*  Dagger         */   1202, 1208, 1220,
		/*  Katar          */   1251, 1253, 1255, 1261,
		/*  One-Hand Axe   */   1302,
		/*  Two-Hand Axe   */   1352, 1361, 1363,
		/*  One-Hand Spear */   1408,
		/*  Two-Hand Spear */   1461, 1464,
		/*  Mace           */   1505, 1517, 1520,
		/*  Book           */   1551,
		/*  Rod            */   1602, 1605, 1608, 1611, 1613, 1614, 1615,
		/*  Bow            */   1705, 1711, 1715, 1718,
		/*  Knuckle        */   1802, 1804, 1806, 1808, 1810, 1812,
		/*  Instruments    */   1902, 1904, 1906, 1908,
		/*  Whip           */   1951, 1953; 

	setarray .class, 7,8,9,10,11,12,13,15,16,17,18,19,20;	
	setarray .armor, 2310, 2311, 2315, 2317, 2320, 2322, 2324, 2326, 2331, 2333, 2336;
	setarray .garment, 2502, 2504, 2506, 2508;
	setarray .shoes, 2402, 2404, 2406, 2407;
	setarray .shield, 2102, 2104, 2106, 2108;
	setarray .accessories, 2607, 2621, 2622, 2623, 2624, 2625, 2626, 2627;
	setarray .hgear, 2209, 2214, 2217, 2218, 2221, 2225, 2227, 2229, 2230, 2233, 2234, 2235, 2236, 2244, 2246, 2249, 2251, 2252, 2254, 2255, 2256, 2258, 2265, 2266, 2267, 2268, 2269, 2270, 2274, 2277, 2280, 2283, 2285, 2287, 2289, 2291, 2292, 2295, 2296, 2299, 2281, 5014, 5043;
 	setarray .wcard, 8035, 8092, 8062, 8043, 8018, 8094, 8063, 8082, 8125, 8069, 8004, 8118, 8002, 8020, 8026, 8080, 8060, 8072, 8019, 8115, 8065, 8006, 8076, 8030, 8055, 8057, 8126, 8106, 8085, 8007, 8024, 8104, 8005, 8017, 8068, 8117, 8025, 8037, 8086, 8111, 8049, 8029, 8096;
	setarray .acard, 8105, 8003, 8078, 8114, 8023, 8119, 8061, 8098, 8141, 8031, 8008, 8011, 8001, 8021, 8014, 8101, 8042, 8089, 8016;
	setarray .gcard, 8133, 8102, 8129, 8015, 8056, 8088, 8081, 8116, 8109, 8113, 8095, 8108, 8071;
	setarray .fgcard, 8097, 8107, 8009, 8070, 8050, 8100, 8038;
	setarray .scard, 8058, 8032, 8013, 8075, 8074, 8045, 8067, 8090, 8066, 8083;
	setarray .accard, 8064, 8079, 8027, 8040, 8103, 8139, 8091, 8084, 8036, 8093, 8077, 8073, 8048, 8033, 8044, 8022, 8028, 8053, 8034, 8051; 
	setarray .hgcard, 8041, 8052, 8087, 8112, 8046, 8127, 8039, 8010;
	end;


}