// @unloadnpc migrationshop
// @loadnpc npc/thor/guildpack/shop.txt

office,171,140,4	script	migrationshop	8W_SOLDIER,{
	if (!countitem(Invitation_Letter)){
		mes("[ "+CStr("Guild Migration Assistant","GREEN")+" ]");
		mes("What are you doing here? I don't have business with you.");
		close();
	}
while(1) {
	mes("[ "+CStr("Guild Migration Shop","GREEN")+" ]");
	if (!.enabled && 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(
			((!.enabled)?"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 (!.enabled) { 
					.enabled = 1;
					dispbottom("Guild Migration Shop is now active");
				} else { 
					.enabled = 0;
					dispbottom("Guild Migration 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("Guild Migration 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("Guild Migration 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("Guild Migration Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Guild Migration 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("Guild Migration 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) {
				getitem2(.@w_weapon,1,1,10,0,.@wcard0,.@wcard1,.@wcard2,.@wcard3);
			}
			else {
				getitem2(.@w_weapon,1,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("Guild Migration 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("Guild Migration 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("Guild Migration Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Guild Migration 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("Guild Migration 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());	
			getitem2 .@w_armor,1,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("Guild Migration 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("Guild Migration 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("Guild Migration Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Guild Migration 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("Guild Migration 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) {
				getitem2(.@w_garment,1,1,7,0,0,0,0,0);
			} else {
				if (!getitemslots(.@w_garment)) {
					getitem2(.@w_garment,1,1,7,0,0,0,0,0);
				} else {
					getitem2(.@w_garment,1,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("Guild Migration 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("Guild Migration 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("Guild Migration Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Guild Migration 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("Guild Migration 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) {
				getitem2(.@w_shoes,1,1,7,0,0,0,0,0);
			} else {
				if (!getitemslots(.@w_shoes)) {
					getitem2(.@w_shoes,1,1,7,0,0,0,0,0);
				} else {
					getitem2(.@w_shoes,1,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("Guild Migration 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("Guild Migration 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("Guild Migration Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Guild Migration 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("Guild Migration 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());	
			getitem2 .@w_shield,1,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("Guild Migration 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("Guild Migration 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("Guild Migration Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Guild Migration 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("Guild Migration 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());	
			getitem2(.@w_accessories,1,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("Guild Migration 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("Guild Migration 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("Guild Migration Shop","GREEN")+" ]");
					mes("Sorry, you do not have enough Zeny.");
					close();
					break;
				}
				if ((MaxWeight-Weight) < 200) {
					mes("[ "+CStr("Guild Migration 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("Guild Migration 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)) {
					getitem2(.@w_hgear,1,1,0,0,0,0,0,0);
				} else {
					getitem2(.@w_hgear,1,1,0,0,.@hgcard0, .@hgcard1, .@hgcard2, .@hgcard3);
				}
			}
			else {
				if (!getitemslots(.@w_hgear)) {
					getitem2(.@w_hgear,1,1,7,0,0,0,0,0);
				} else {
					getitem2(.@w_hgear,1,1,7,0,.@hgcard0, .@hgcard1, .@hgcard2, .@hgcard3);
				}
			}
			close2();
			break;
		}
		else {
			close2();
			break;
		}
	default:
		close();
	}
}
end;
OnInit:
	.enabled = 1;
	.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 .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, 2217, 2218, 2221, 2225, 2227, 2229, 2233, 2251, 2265, 2266, 2267, 2269, 2270, 2274, 2277, 2280, 2285, 2287, 2289, 2291, 2295, 2296, 2299, 2281, 5014, 5043;
 	setarray .wcard, 4035, 4092, 4062, 4043, 4018, 4094, 4063, 4082, 4125, 4069, 4004, 4118, 4002, 4020, 4026, 4080, 4060, 4072, 4019, 4115, 4065, 4006, 4076, 4030, 4055, 4057, 4126, 4106, 4085, 4007, 4024, 4104, 4005, 4017, 4068, 4117, 4025, 4037, 4086, 4111, 4049, 4029, 4096;
	setarray .acard, 4105, 4003, 4078, 4114, 4023, 4119, 4061, 4098, 4141, 4031, 4008, 4011, 4001, 4021, 4014, 4101, 4042, 4089, 4016;
	setarray .gcard, 4133, 4102, 4129, 4015, 4056, 4088, 4081, 4116, 4109, 4113, 4095, 4108, 4071;
	setarray .fgcard, 4097, 4107, 4009, 4070, 4050, 4100, 4038;
	setarray .scard, 4058, 4032, 4013, 4075, 4074, 4045, 4067, 4090, 4066, 4083;
	setarray .accard, 4064, 4079, 4027, 4040, 4103, 4139, 4091, 4084, 4036, 4093, 4077, 4073, 4048, 4033, 4044, 4022, 4028, 4053, 4034, 4051; 
	setarray .hgcard, 4041, 4052, 4087, 4112, 4046, 4127, 4039, 4010;
	end;


}