office,136,28,4	script	Item Mall	4_MAL_KAFRA,{

	mes "[Item Mall]";
	mes "You currently have:";
	mes "Cash Points: ^FF0000"+#CASHPOINTS+"^000000";
	next;
	switch(select("^FF0000Shop Now^000000","Premium Services")) {
	case 1:
		callfunc "ishop";
		close(); 
	case 2:
	
		mes "[Item Mall]";
		mes "So, Which ^FF0000Premium Services^000000 you would like to look at it";
			switch(select(
			 "- Change Guild Leader:"+
			 ((!#mobile)?"- Change Name:":":")+
			 //"- Change Gender:"+
	 		 "- ^777777Close^000000"
			)) {
			next;	
			case 1:	// Change GM 24USD = 20000
				if (getcharid(0) != getguildmasterid(getcharid(2))) {
					mes "[Item Mall]";
					mes "You are not a guild master.";
					close();
				}
				set .@gldid,getcharid(2);
				mes "[Item Mall]";
				query_sql("SELECT `name` , `master` , `guild_lv` FROM `guild` WHERE `guild_id` = '"+.@gldid+"'",.@gname$,.@char$,.@glvl);
				mes "^FF0000Change Guild Master^000000";
				//mes "This service is FREE until 6/26";
				mes "This service will cost you";
				mes "^FF0000 20,000^000000 Cash Points";

				mes "Information:";
				mes "Guild Name: ^ff0000"+.@gname$+"^000000";
				mes "Guild Level: ^ff0000"+.@glvl+"^000000";
				mes "Guild Master: ^ff0000"+.@char$+"^000000";
				mes "Do you wish to continue changing guild master?";
				next;
				if( select("No", "Yes") == 1 )
					close();
				
				if(#CASHPOINTS < 20000 ) {
					mes "[Item Mall]";
					mes "Im sorry, but you don't have enough ^FF0000Cash Points^000000 to process this request.";
					close();
				}
				
				mes "[Item Mall]";
				mes "^FF0000NOTE^000000:";
				mes "^FF0000-^000000 Double check the spelling.";
				mes "^FF0000-^000000 The character name you";
				mes "  will be providing should";
				mes "  be the NEW guild leader.";
				mes "^FF0000-^000000 New Guild leader should be online.";
				mes "Enter the ^FF0000new^000000 guild leader's name.";
				input .@cgl$;
				next;
				mes .npc$;
				mes "Please ^FF0000re-enter^000000 the name again for confirmation.";
				input .@cgl2$;
				next;

				if (.@cgl$ != .@cgl2$) {
					mes .npc$;
					mes "The names you entered doesn't match.";
					close();
				}
				.@check = query_sql("SELECT `account_id` FROM `char` WHERE `name`='"+escape_sql(.@cgl$)+"'",.@acid);
				if (!.@check){
					mes .npc$;
					mes "Character [ ^FF0000"+.@cgl$+"^000000 ] doesn't exist!";
					close();
				}
				if (.@cgl$ == .@char$) {
					mes .npc$;
					mes "Character [ ^FF0000"+.@cgl$+"^000000 ] is already the leader of [ ^FF0000"+.@gname$+"^000000 ] Guild.";
					close();
				}
				if (!isloggedin(getcharid(3,.@cgl$), getcharid(0,.@cgl$))){
					mes .npc$;
					mes "Character [ ^FF0000"+.@cgl$+"^000000 ] must be online to proceed!";
					close();
				}
				if (getcharid(2,.@cgl$) != .@gldid){
					mes .npc$;
					mes "Character [ ^FF0000"+.@cgl$+"^000000 ] is not a member of [ ^FF0000"+.@gname$+"^000000 ] Guild.";
					close();
				}

				mes .npc$;
				mes "Please confirm the following details before we proceed,";
				mes "Current Leader: ^FF0000"+strcharinfo(PC_NAME)+"^000000";
				mes "New Leader: ^FF0000"+.@cgl$+"^000000";
				mes "Would you like to proceed?";
				next;
				if (select("Close","^FF0000Confirmed^000000!") != 1) {
					close2;
					if (.gcdone == .@gldid){
						if ( .delay > gettimetick(2) ){
							message strcharinfo(0), "Transfer failed!";
							mes .npc$;
							mes "You must wait [^FF0000"+(.delay - gettimetick(2))+"^000000] seconds,";
							mes .@char$+"'s guild has been currently";
							mes "modified and changed their";
							mes "guild leader authority.";
							close();
						}
					}

					#CASHPOINTS -= 20000;
					callfunc("F_CashLog",#CASHPOINTS,20000,"Change Guild Leader");
					
					message strcharinfo(0), "You have succesfully transferred the guild!";
					announce strcharinfo(0)+" : The [ "+.@gname$+" ] Guild previously owned by "+.@char$+" succesfully transferred its ownership to "+.@cgl$+"!",bc_all,0xe57c00;
					guildchangegm(.@gldid,.@cgl$);
					.gcdone = .@gldid;
					if (.d)
					.delay = gettimetick(2) + .d;
					sleep2 1000;
					if (isloggedin(getcharid(3,.@cgl$), getcharid(0,.@cgl$))){
						atcommand "@kick "+.@cgl$;
					}
					if (isloggedin(getcharid(3,.@char$), getcharid(0,.@char$))){
						atcommand "@kick "+.@char$;
					}
					end;
				}

				close();

			case 2:
				mes "[Item Mall]";
				mes "^FF0000Change Name^000000";
				mes "This service will cost you";
				mes "^FF0000 10,000^000000 Credit Points";
				mes "Do you wish to continue?";
				next;
				if( select("No", "Yes") == 1 )
					close();

				if(#CASHPOINTS < 10000 ) {
					mes "[Item Mall]";
					mes "Im sorry, but you don't have enough ^FF0000Credit Points^000000 to process this request.";
					close();
				}

				#CASHPOINTS -= 10000;
				callfunc("F_CashLog",#CASHPOINTS,10000,"Change Name");		

				CharRename += 1;
				mes "[Item Mall]";
				mes "Done";
				mes "You will need to character select and click ^FF0000Rename^000000 button.";
				mes "Thank you for using this service.";
				close();
			case 4:
				close();

			default:

				mes "Invalid Menu Selection for Menu. Inform this Message to ^0000FFGame Staffs^000000 immediately !";
				close();	
		}
	default:
		close();
	}
}

// Script Core
//============================================================
-	script	i_shop	FAKE_NPC,{
function Add; function Chk; function Slot; function A_An;
OnInit:
	
	freeloop(1);

// -----------------------------------------------------------
//  Basic shop settings.
// -----------------------------------------------------------

	set .Announce,0;	// Announce quest completion? (1: yes / 0: no)
	set .ShowSlot,1;	// Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
	set .ShowID,1;  	// Show item IDs? (1: yes / 0: no)
	set .ShowZeny,1;	// Show Zeny cost, if any? (1: yes / 0: no)
	set .MaxStack,1;	// Max number of quest items purchased at one time.

// -----------------------------------------------------------
//  Points variable -- optional quest requirement.
//	setarray .points$[0],"<variable name>","<display name>";
// -----------------------------------------------------------

	setarray .points$[0],"#CASHPOINTS","Cash Points";

// -----------------------------------------------------------
//  Shop IDs -- to add shops, copy dummy data at bottom of file.
//	setarray .iShops$[1],"<Shop 1>","<Shop 2>"{,...};
// -----------------------------------------------------------

	setarray .iShops$[1],"What's New","Usables","Top Headgears","Mid Headgear","Lower Headgear","Weapon","Garment","Armor","Shield","Shoes","Accessories";

// -----------------------------------------------------------
//  Quest items -- do NOT use a reward item more than once!
//	Add(<shop ID>,<reward ID>,<reward amount>,
//	    <Zeny cost>,<point cost>,
//	    <required item ID>,<required item amount>{,...});
// -----------------------------------------------------------

Add(3,2285,1,0,2000); //Apple of Archer
Add(3,2216,1,0,400); //Biretta
Add(3,5017,1,0,4000); //Bone Helm
Add(3,2227,1,0,600); //Cap
Add(3,2233,1,0,400); //Circlet
Add(3,2231,1,0,800); //Gemmed Sallet
Add(3,5128,1,0,10000); //Goibne's Helm
Add(3,2229,1,0,800); //Helm
Add(3,5137,1,0,20000); //Alice Doll
Add(3,5215,1,0,3000); //Evolved Angel Wing
Add(3,5132,1,0,12000); //Angeling Hat
Add(3,5312,1,0,4000); //Ayothaya King's Hat
Add(3,5382,1,0,10000); //Bell Ribbon
Add(3,5129,1,0,4000); //Bird Nest
Add(3,5236,1,0,1000); //Blue Beanie
Add(3,5241,1,0,1000); //Blue Mage Hat
Add(3,5310,1,0,2000); //Shining Electric Bulb Hairband
Add(3,5140,1,0,1000); //Charming Ribbon
Add(3,5283,1,0,10000); //Chick Hat
Add(3,5254,1,0,7000); //Deviling Hat
Add(3,5292,1,0,3000); //Dragon Skull
Add(3,5211,1,0,4000); //Dress Hat
Add(3,5296,1,0,4000); //Drooping Nine Tail
Add(3,5380,1,0,4000); //Fish Head Hat
Add(3,5269,1,0,20000); //Flapping Angel Wing
Add(3,5144,1,0,4000); //Gambler Hat
Add(3,5186,1,0,5000); //Geographer Band
Add(3,5262,1,0,4000); //Golden Tiara
Add(3,5235,1,0,1000); //Brown Beanie
Add(3,5240,1,0,1000); //Brown Mage Hat
Add(3,5291,1,0,7000); //Kettle Hat
Add(3,5311,1,0,7000); //Large Hisbiscus
Add(3,5185,1,0,2000); //Laurel Wreath
Add(3,5253,1,0,10000); //Lif Doll Hat
Add(3,5324,1,0,6000); //Little Angel Doll
Add(3,5217,1,0,4000); //Evolved Majestic Goat
Add(3,5138,1,0,18000); //Magic Eyes
Add(3,18597,1,0,15000); //Mercury Riser
Add(3,5226,1,0,10000); //Mini Propeller
Add(3,5188,1,0,4000); //Wandering Minstrel Hat
Add(3,5387,1,0,7000); //Neko Mimi Kafra
Add(3,5237,1,0,1000); //Pink Beanie
Add(3,5352,1,0,1000); //Poporing Cap
Add(3,5495,1,0,8000); //Power Of Thor
Add(3,5182,1,0,4000); //Puppy Hat
Add(3,5238,1,0,1000); //Red Mage Hat
Add(3,5208,1,0,4000); //Rideword Hat
Add(3,5381,1,0,7000); //Santa Poring Hat
Add(3,5216,1,0,3000); //Evolved Evil Wing
Add(3,18539,1,0,15000); //Skull Cap
Add(3,5388,1,0,20000); //Snake Head Hat
Add(3,5187,1,0,7000); //Twin Ribbon
Add(3,5289,1,0,7000); //Vanilmirth Hat
Add(3,5239,1,0,1000); //Gray Mage Hat
Add(3,5278,1,0,18000); //Yellow Ribbon
Add(3,5242,1,0,1000); //Yellow Mage Hat
Add(3,5376,1,0,8000); //Flying Evil Wing
Add(3,5311,1,0,6000); //Large Hisbiscus
Add(3,5372,1,0,4000); //Koneko Hat
Add(3,5211,1,0,6000); //Dress Hat
Add(3,5230,1,0,4000); //Gray Drooping Cat
Add(3,5770,1,0,6000); //Splash Hat
Add(3,18612,1,0,6000); //White Musang Hat
Add(3,18613,1,0,6000); //Black Musang Hat
Add(3,5518,1,0,12000); //Gigantic Majestic Goat
Add(3,5137,1,0,12000); //Alice Doll
Add(3,5379,1,0,8000); //Tam
Add(3,5766,1,0,8000); //Amistr Cap
Add(3,5293,1,0,6000); //Ramen Hat
Add(3,5464,1,0,12000); //Zaha Doll Hat
Add(3,5508,1,0,6000); //Shark Hat
Add(3,5227,1,0,6000); //Red Deviruchi Hat
Add(3,5388,1,0,4000); //Snake Head Hat
Add(3,5254,1,0,6000); //Deviling Hat
Add(3,5393,1,0,8000); //Love Valentine's Hat
Add(3,5533,1,0,6000); //Emperor Wreath
Add(3,5396,1,0,6000); //Jasper Crest
Add(3,5342,1,0,12000); //Sorin Doll Hat
Add(3,5815,1,0,6000); //Purple Cowboy Hat
Add(4,2295,1,0,2000); //Blinker
Add(4,2286,1,0,7000); //Elven Ears
Add(4,5014,1,0,400); //Fin Helm
Add(4,5401,1,0,10000); //Black Frame Glasses
Add(4,5800,1,0,19000); //Blush of Groom
Add(4,5402,1,0,10000); //Mischievous Fairy
Add(4,5315,1,0,2000); //Observer
Add(4,5288,1,0,7000); //Red Glasses
Add(4,5397,1,0,1000); //Scuba Gear
Add(4,5135,1,0,4000); //Cyclop's Eye
Add(4,5315,1,0,6000); //Observer
Add(4,5389,1,0,6000); //Angel Spirit
Add(4,5325,1,0,8000); //Robo Eye
Add(4,5800,1,0,12000); //Blush of Groom
Add(4,5104,1,0,6000); //Dark Blinder
Add(4,5401,1,0,4000); //Black Frame Glasses
Add(4,5288,1,0,4000); //Red Glasses
Add(5,2266,1,0,400); //Iron Cain
Add(5,2269,1,0,1000); //Romantic Flower
Add(5,2270,1,0,1000); //Romantic Leaf
Add(5,5362,1,0,7000); //Ninja Scroll
Add(5,5220,1,0,4000); //Evolved Pipe
Add(5,5594,1,0,4000); //Donut In Mouth
Add(5,5462,1,0,6000); //Spiked Scarf
Add(5,5463,1,0,6000); //Rainbow Scarf
Add(5,5377,1,0,12000); //Gentleman's Pipe
Add(5,5362,1,0,6000); //Ninja Scroll
Add(6,13007,1,0,1000); //Jitte
Add(6,1208,1,0,200); //Main Gauche
Add(6,13009,1,0,1000); //Kamaitachi
Add(6,13011,1,0,1000); //Asura
Add(6,1226,1,0,600); //Damascus
Add(6,13015,1,0,1000); //Hakujin
Add(6,1220,1,0,600); //Gladius
Add(6,1244,1,0,4000); //Holy Dagger
Add(6,1108,1,0,200); //Blade
Add(6,1140,1,0,2000); //Byeollungum
Add(6,1149,1,0,1000); //Flamberge
Add(6,1128,1,0,600); //Haedonggum
Add(6,1127,1,0,800); //Saber
Add(6,1120,1,0,600); //Tsurugi
Add(6,1117,1,0,1000); //Katana
Add(6,1164,1,0,200); //Muramasa
Add(6,1158,1,0,1000); //Two-Handed Sword
Add(6,1155,1,0,100); //Bastard Sword
Add(6,1172,1,0,1000); //Claymore
Add(6,1408,1,0,200); //Pike
Add(6,1461,1,0,1000); //Trident
Add(6,1302,1,0,200); //Axe
Add(6,1364,1,0,1000); //Great Axe
Add(6,1367,1,0,1000); //Slaughter
Add(6,1365,1,0,600); //Sabbath
Add(6,1361,1,0,400); //Two-Handed Axe
Add(6,1528,1,0,4000); //Grand Cross
Add(6,1520,1,0,400); //Chain
Add(6,1538,1,0,1000); //Spike
Add(6,1505,1,0,200); //Mace
Add(6,1526,1,0,4000); //Slash
Add(6,1514,1,0,600); //Morning Star
Add(6,1527,1,0,4000); //Quadrille
Add(6,1532,1,0,10000); //Stunner
Add(6,1517,1,0,600); //Sword Mace
Add(6,1473,1,0,2000); //Wizardry Staff
Add(6,1608,1,0,400); //Staff
Add(6,1611,1,0,600); //Arc Wand
Add(6,1625,1,0,4000); //Healing Staff
Add(6,1624,1,0,7000); //Lich's Bone Wand
Add(6,1472,1,0,2000); //Soul Staff
Add(6,1602,1,0,200); //Rod
Add(6,1719,1,0,4000); //Roguemaster's Bow
Add(6,1715,1,0,1000); //Arbalest
Add(6,1711,1,0,2000); //Crossbow
Add(6,1705,1,0,600); //Composite Bow
Add(6,1732,1,0,2000); //Earth Bow
Add(6,1720,1,0,600); //Rudra Bow
Add(6,1731,1,0,200); //Frozen Bow
Add(6,1716,1,0,3000); //Gakkung Bow
Add(6,1733,1,0,1000); //Gust Bow
Add(6,1813,1,0,10000); //Kaiser Knuckle
Add(6,1808,1,0,600); //Fist
Add(6,1810,1,0,600); //Claw
Add(6,1819,1,0,1000); //Icicle Fist
Add(6,1822,1,0,2000); //Combo Battle Glove
Add(6,1818,1,0,1000); //Magma Fist
Add(6,1820,1,0,1000); //Electric Fist
Add(6,1812,1,0,600); //Finger
Add(6,1821,1,0,1000); //Seismic Fist
Add(6,1802,1,0,200); //Waghnak
Add(6,1916,1,0,1000); //Green Acre Guitar
Add(6,1910,1,0,600); //Harp
Add(6,1919,1,0,3000); //Bass Guitar
Add(6,1906,1,0,400); //Lute
Add(6,1917,1,0,1000); //Gentle Breeze Guitar
Add(6,1915,1,0,1000); //Loner's Guitar
Add(6,1914,1,0,1000); //Burning Passion Guitar
Add(6,1908,1,0,600); //Guitar
Add(6,1902,1,0,200); //Violin
Add(6,1951,1,0,1000); //Rope
Add(6,1973,1,0,1000); //Sea Witch's Foot
Add(6,1966,1,0,1000); //Icicle Whip
Add(6,1965,1,0,1000); //Red Flame Whip
Add(6,1955,1,0,400); //Wire Whip
Add(6,1967,1,0,1000); //Gaia Whip
Add(6,1957,1,0,600); //Rante Whip
Add(6,1971,1,0,1000); //Electric Wire
Add(6,1551,1,0,400); //Bible
Add(6,1550,1,0,200); //Book
Add(6,1552,1,0,600); //Tablet
Add(6,1270,1,0,1500); //Drill Katar
Add(6,1261,1,0,2000); //Infiltrator
Add(6,1251,1,0,1000); //Jur
Add(6,1269,1,0,7000); //Inverse Scale
Add(6,1256,1,0,600); //Katar of Frozen Icicle
Add(6,1257,1,0,400); //Katar of Quaking
Add(6,1259,1,0,200); //Katar of Piercing Wind
Add(6,1253,1,0,1000); //Katar
Add(6,1264,1,0,4000); //Specialty Jur
Add(6,1268,1,0,2000); //Wild Beast Claw
Add(6,1258,1,0,400); //Katar of Raging Blaze
Add(6,13103,1,0,2000); //Crimson Bolt
Add(6,13105,1,0,10000); //Garrison
Add(6,13106,1,0,1000); //Gold Lux
Add(6,13101,1,0,600); //Six Shooter
Add(6,13165,1,0,1000); //Jungle Carbine
Add(6,13163,1,0,400); //Long Barrel
Add(6,13150,1,0,600); //Branch
Add(6,13152,1,0,4000); //Cyclone
Add(6,13153,1,0,2000); //Dusk
Add(6,13159,1,0,2000); //Butcher
Add(6,13157,1,0,200); //Drifter
Add(6,13169,1,0,1000); //Thunder P
Add(6,13155,1,0,1000); //Black Rose
Add(6,13156,1,0,1000); //Gate Keeper
Add(6,13154,1,0,400); //Rolling Stone
Add(6,13161,1,0,7000); //Destroyer
Add(6,13162,1,0,800); //Inferno
Add(6,13301,1,0,800); //Huuma Giant Wheel Shuriken
Add(6,13300,1,0,1000); //Huuma Wing Shuriken
Add(6,13303,1,0,1000); //Huuma Blaze Shuriken
Add(7,2507,1,0,1000); //Ancient Cape
Add(7,2502,1,0,1000); //Hood
Add(7,2506,1,0,1000); //Manteau
Add(7,2504,1,0,1000); //Muffler
Add(7,2514,1,0,7000); //Pauldron
Add(7,2529,1,0,400); //Rider Insignia
Add(7,2530,1,0,2000); //Rider Insignia
Add(8,2315,1,0,1000); //Chain Mail
Add(8,2366,1,0,2500); //Divine Cloth
Add(8,2320,1,0,2500); //Formal Suit
Add(8,2317,1,0,2500); //Full Plate
Add(8,2318,1,0,2500); //Lord's Clothes
Add(8,2308,1,0,200); //Mantle
Add(8,2311,1,0,600); //Mink Coat
Add(8,2359,1,0,1000); //Ninja Suit
Add(8,2365,1,0,2000); //Orleans's Gown
Add(8,2326,1,0,200); //Saint's Robe
Add(8,2324,1,0,4000); //Scapulare
Add(8,2322,1,0,4000); //Silk Robe
Add(8,2336,1,0,200); //Thief Clothes
Add(8,2331,1,0,2000); //Tights
Add(9,2118,1,0,1500); //Arm Guard
Add(9,2104,1,0,2000); //Buckler
Add(9,2102,1,0,600); //Guard
Add(9,2119,1,0,600); //Advanced Arm Guard
Add(9,2109,1,0,1000); //Memory Book
Add(9,2107,1,0,600); //Mirror Shield
Add(9,2123,1,0,4000); //Orleans's Server
Add(9,2106,1,0,2000); //Shield
Add(10,2425,1,0,4000); //Black Leather Boots
Add(10,2406,1,0,600); //Boots
Add(10,2412,1,0,800); //Greaves
Add(10,2402,1,0,100); //Sandals
Add(10,2404,1,0,400); //Shoes
Add(10,2426,1,0,2000); //Shadow Walk
Add(11,2627,1,0,100); //Belt
Add(11,2605,1,0,1000); //Brooch
Add(11,2652,1,0,2000); //Goddess of Fortune's Cursed Brooch
Add(11,2602,1,0,1000); //Earring
Add(11,2665,1,0,400); //Exorcising Ring
Add(11,2604,1,0,1000); //Glove
Add(11,2645,1,0,4000); //Moonlight Ring
Add(11,2603,1,0,1000); //Necklace
Add(11,2700,1,0,1000); //Red Silk Seal
Add(11,2601,1,0,1000); //Ring
Add(11,2608,1,0,1000); //Rosary
Add(11,2619,1,0,4000); //Bow Thimble
Add(11,2666,1,0,1000); //Lantern of Hope
Add(11,2765,1,0,2000); //Novice Figure
Add(11,2766,1,0,2000); //Swordman Figure
Add(11,2767,1,0,2000); //Acolyte Figure
Add(11,2768,1,0,2000); //Mage Figure
Add(11,2769,1,0,2000); //Archer Figure
Add(11,2770,1,0,2000); //Thief Figure
Add(11,2771,1,0,2000); //Merchant Figure




// -----------------------------------------------------------

	freeloop(0);
	set .menu$,"";
	for(set .@i,1; .@i<=getarraysize(.iShops$); set .@i,.@i+1) {
		set .menu$, .menu$+.iShops$[.@i]+":";
		npcshopdelitem "ishop"+.@i,909;
	}
	end;

OnMenu:
	set .@size, getarraysize(@i);
	if (!.@size) set .@i, select(.menu$);
	else if (.@size == 1) set .@i, @i[0];
	else {
		for(set .@j,0; .@j<.@size; set .@j,.@j+1)
			set .@menu$, .@menu$+.iShops$[@i[.@j]]+":";
		set .@i, @i[select(.@menu$)-1];
	}
	deletearray @i[0],getarraysize(@i);
	if (.iShops$[.@i] == "") {
		message strcharinfo(PC_NAME),"An error has occurred.";
		end;
	}
	dispbottom "Select one item at a time.";
	callshop "ishop"+.@i,1;
	npcshopattach "ishop"+.@i;
	end;

OnBuyItem:
	disable_items();
	// .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... }
	setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]);
	copyarray .@q[3],getd(".q_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+.@q[0]));
	set .@q[2],.@q[1]*.@q[3];
	if (!.@q[2] || .@q[2] > 30000) {
		message strcharinfo(PC_NAME),"You can't purchase that many "+getitemname(.@q[0])+".";
		end;
	}
	mes "[Item Mall]";
	mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000";
	mes "Requirements:";
	if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000";
	//if (.@q[5]) mes " > "+Chk(getd(.points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.points$[1]+" ("+getd(.points$[0])+"/"+(.@q[5]*.@q[1])+")^000000";
	if (.@q[5]) mes " > "+Chk(#CASHPOINTS,.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.points$[1]+" ("+#CASHPOINTS+"/"+(.@q[5]*.@q[1])+")^000000";
	if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
		mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000";
	next;
	setarray @qe[1], getiteminfo(.@q[0], ITEMINFO_LOC), getiteminfo(.@q[0], ITEMINFO_VIEWSPRITE);
	if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT)))
		set .@preview,1;
	addtimer 1000, strnpcinfo(NPC_NAME)+"::OnEnd";

	while(1) {
		switch(select(" ~ Purchase ^0055FF"+ getitemname(.@q[0]) +"^000000", ((.@preview && !@qe[7])?" ~ Preview...": ""), " ~ ^777777Cancel^000000")) {
		case 1:
			if (@qe[0]) {
				mes "[Item Mall]";
				mes "You're Credit Points is not suffecient to purchase the item.";
				close();
			}
			if (!checkweight(.@q[0],.@q[2])) {
				mes "[Item Mall]";
				mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
				close();
			}
			if (.@q[4]) Zeny -= (.@q[4]*.@q[1]);
			if (.@q[5]) {
				#CASHPOINTS -= (.@q[5]*.@q[1]);
				callfunc("F_CashLog",#CASHPOINTS,-(.@q[5]*.@q[1]),.@q[0]+" x "+.@q[2]);	
			}
			if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
				delitem .@q[.@i],.@q[.@i+1]*.@q[1];
			getitem .@q[0],.@q[2];
			if (.Announce) chanmsg("system",""+strcharinfo(PC_NAME)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):A_An(getitemname(.@q[0])))+"!");
			close();
		case 2:
			setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1;
			if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2];
			else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2];
			else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2];
			else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2];
			break;
		case 3:
			close();
		}
	}

OnEnd:
	if (@qe[7]) {
		changelook LOOK_HEAD_BOTTOM, @qe[3];
		changelook LOOK_HEAD_TOP, @qe[4];
		changelook LOOK_HEAD_MID, @qe[5];
		changelook LOOK_ROBE, @qe[6];
	}
	deletearray @qe[0],8;
	end;

function Add {
	if (getitemname(getarg(1)) == "null") {
		//debugmes "Quest reward #"+getarg(1)+" invalid (skipped).";
		return;
	}
	setarray .@j[0],getarg(2),getarg(3),getarg(4);
	for(set .@i,5; .@i<getargcount(); set .@i,.@i+2) {
		if (getitemname(getarg(.@i)) == "null") {
			//debugmes "Quest requirement #"+getarg(.@i)+" invalid (skipped).";
			return;
		} else
			setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1);
	}
	copyarray getd(".q_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j);
	npcshopadditem "ishop"+getarg(0),getarg(1),((.ShowZeny)?getarg(4):0);
	return;
}

function Chk {
	if (getarg(0) < getarg(1)) {
		set @qe[0],1;
		return "^FF0000";
	} else
		return "^00FF00";
}

function Slot {
	set .@s$,getitemname(getarg(0));
	switch(.ShowSlot) {
		case 1: if (!getitemslots(getarg(0))) return .@s$;
		case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return .@s$+" ["+getitemslots(getarg(0))+"]";
		default: return .@s$;
	}
}

function A_An {
	setarray .@A$[0],"a","e","i","o","u";
	set .@B$, "_"+getarg(0);
	for(set .@i,0; .@i<5; set .@i,.@i+1)
		if (compare(.@B$,"_"+.@A$[.@i])) return "an "+getarg(0);
	return "a "+getarg(0);
}
}

function	script	ishop	{

	deletearray @i[0],getarraysize(@i);
	for(set .@i,0; .@i<getargcount(); set .@i,.@i+1)
		set @i[.@i],getarg(.@i);
	doevent "i_shop::OnMenu";
	end;
	
}


// Dummy shop data -- copy as needed.
//============================================================
-	shop	ishop1	FAKE_NPC,909:-1
-	shop	ishop2	FAKE_NPC,909:-1
-	shop	ishop3	FAKE_NPC,909:-1
-	shop	ishop4	FAKE_NPC,909:-1
-	shop	ishop5	FAKE_NPC,909:-1
-	shop	ishop6	FAKE_NPC,909:-1
-	shop	ishop7	FAKE_NPC,909:-1
-	shop	ishop8	FAKE_NPC,909:-1
-	shop	ishop9	FAKE_NPC,909:-1
-	shop	ishop10	FAKE_NPC,909:-1
-	shop	ishop11	FAKE_NPC,909:-1