//@loadnpc npc/amatsu/functions.txt

function	script	F_FreeHG	{
	setarray .@freehg[0],19561,19587,19883,19903,19970,19979,20071,20202,20278,20393,20399,20514,30200,30201,30202,30203,30205,30206,30207,30210,30212,30213,30214,30215,30220,30221,30223,30226,30227,30229,30230,30231,30232,30233,30234,30236,30237,30239,30241,30243,31160,31261,19973,20450,31123,31195,31204,31389;
	if(getarg(0) == 4){
		getitembound .@freehg[rand(1,getarraysize(.@freehg))], 1,4;
	} else if(getarg(0) == 2){
		getitembound .@freehg[rand(1,getarraysize(.@freehg))], 1,2;
	} else if(getarg(0) == 1){
		getitem .@freehg[rand(1,getarraysize(.@freehg))], 1;	
	}	
	end;
}

function	script	F_GrowthPack	{
	if (getarg(0) == 1){
		.@ret = checkweight(
			Growth_Pack_10,1,
			Online_Coin,1,
			Preschool_Hat_F,1,
			Light_White_Pot_F,300,
			Light_Blue_Pot_F,100,
			Wing_Of_Fly_F,10,
			Wing_Of_Butterfly_F,5,
			Thick_Manual50,3,
			Battle_Manual_X3,1
		);
		if(.@ret){
			delitem Growth_Pack_1,1;
			getitembound Growth_Pack_10,1,4;
			getitembound Online_Coin,1,4;
			getitembound Preschool_Hat_F,1,4;
			getitembound Light_White_Pot_F,300,4;
			getitembound Light_Blue_Pot_F,100,4;
			getitembound Wing_Of_Fly_F,10,4;
			getitembound Wing_Of_Butterfly_F,5,4;
			getitembound Thick_Manual50,3,4;
			getitembound Battle_Manual_X3,1,4;
			Zeny += 500;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else if (getarg(0) == 10){
		.@ret = checkweight(
			Growth_Pack_20,1,
			Wing_Of_Fly_F,10,	
			Wing_Of_Butterfly_F,5,
			Thick_Manual50,3
		);
		if(.@ret){
			delitem Growth_Pack_10,1;
			getitembound Growth_Pack_20,1,4;
			getitembound Wing_Of_Fly_F,10,4;
			getitembound Wing_Of_Butterfly_F,5,4;
			getitembound Thick_Manual50,3,4;
			Zeny += 2000;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else if (getarg(0) == 20){
		.@ret = checkweight(
			Growth_Pack_30,1,
			Wing_Of_Fly_F,10,
			Wing_Of_Butterfly_F,5,
			Bubble_Gum,1,
			Light_White_Pot_F,300,
			Light_Blue_Pot_F,100,
			Dish_Pack_A,1,
			Thick_Manual50,3
		);
		if(.@ret){
			delitem Growth_Pack_20,1;
			getitembound Growth_Pack_30,1,4;
			getitembound Wing_Of_Fly_F,10,4;
			getitembound Wing_Of_Butterfly_F,5,4;
			getitembound Bubble_Gum,1,4;
			getitembound Light_White_Pot_F,300,4;
			getitembound Light_Blue_Pot_F,100,4;
			getitembound Dish_Pack_A,1,4;
			getitembound Thick_Manual50,3,4;
			Zeny += 5000;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else if (getarg(0) == 30){
		.@ret = checkweight(
			Growth_Pack_40,1,
			Bubble_Gum,1,
			Light_White_Pot_F,300,
			Light_Blue_Pot_F,100,
			Thick_Manual50,3,
			Premium_Reset_Stone,1
		);
		if(.@ret){
			delitem Growth_Pack_30,1;
			getitembound Growth_Pack_40,1,4; 
			getitembound Bubble_Gum,1,4;
			getitembound Light_White_Pot_F,300,4;
			getitembound Light_Blue_Pot_F,100,4;
			getitembound Thick_Manual50,3,4;
			getitembound Premium_Reset_Stone,1,4;
			callfunc "F_FreeHG",1;
			Zeny += 10000;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else if (getarg(0) == 40){
		.@ret = checkweight(
			Growth_Pack_50,1,
			Neuralizer,1,
			Branch_Of_Dead_Tree,5,
			Old_Blue_Box,1,
			Dish_Pack_A,2,
			Elunium,2,
			Bubble_Gum,2,
			Light_White_Pot_F,300,
			Light_Blue_Pot_F,100,
			Thick_Manual50,3
		);
		if(.@ret){
			delitem Growth_Pack_40,1;
			getitembound Growth_Pack_50,1,4; 
			getitembound Neuralizer,1,4;
			getitembound Branch_Of_Dead_Tree,5,4;
			getitembound Old_Blue_Box,1,4;
			getitembound Dish_Pack_A,2,4;
			getitembound Elunium,2,4;
			getitembound Bubble_Gum,2,4;
			getitembound Light_White_Pot_F,300,4;
			getitembound Light_Blue_Pot_F,100,4;
			getitembound Thick_Manual50,3,4;
			Zeny += 20000;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else if (getarg(0) == 50){
		.@ret = checkweight(
			Growth_Pack_60,1,
			Inspector_Certificate,10,
			Bubble_Gum,2,
			Light_White_Pot_F,300,
			Light_Blue_Pot_F,100,
			Thick_Manual50,3
		);
		if(.@ret){
			delitem Growth_Pack_50,1;
			getitembound Growth_Pack_60,1,4; 
			getitembound Inspector_Certificate,10,4;
			getitembound Bubble_Gum,2,4;
			getitembound Light_White_Pot_F,300,4;
			getitembound Light_Blue_Pot_F,100,4;
			getitembound Thick_Manual50,3,4;
			Zeny += 30000;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else if (getarg(0) == 60){
		.@ret = checkweight(
			Growth_Pack_70,1,
			Bubble_Gum,2,
			Branch_Of_Dead_Tree,10,
			Old_Violet_Box,1,
			Dish_Pack_B,1,
			Elunium,2,
			Light_White_Pot_F,300,
			Light_Blue_Pot_F,100,
			Thick_Manual50,3
		);
		if(.@ret){
			delitem Growth_Pack_60,1;
			getitembound Growth_Pack_70,1,4; 
			getitembound Bubble_Gum,2,4;
			getitembound Branch_Of_Dead_Tree,10,4;
			getitembound Old_Violet_Box,1,4;
			getitembound Dish_Pack_B,1,4;
			getitembound Elunium,2,4;
			getitembound Light_White_Pot_F,300,4;
			getitembound Light_Blue_Pot_F,100,4;
			getitembound Thick_Manual50,3,4;
			Zeny += 40000;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else if (getarg(0) == 70){
		.@ret = checkweight(
			Growth_Pack_80,1,
			Bubble_Gum,2,
			Branch_Of_Dead_Tree,10,
			Old_Violet_Box,1,
			Dish_Pack_B,1,
			Elunium,2,
			Light_White_Pot_F,300,
			Light_Blue_Pot_F,100,
			Thick_Manual50,3
		);
		if(.@ret){
			delitem Growth_Pack_70,1;
			getitembound Growth_Pack_80,1,4; 
			getitembound Bubble_Gum,2,4;
			getitembound Branch_Of_Dead_Tree,10,4;
			getitembound Old_Violet_Box,1,4;
			getitembound Dish_Pack_B,1,4;
			getitembound Elunium,2,4;
			getitembound Light_White_Pot_F,300,4;
			getitembound Light_Blue_Pot_F,100,4;
			getitembound Thick_Manual50,3,4;
			Zeny += 50000;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else if (getarg(0) == 80){
		.@ret = checkweight(
			Growth_Pack_90,1, 
			Bubble_Gum,2,
			Branch_Of_Dead_Tree,10,
			Old_Violet_Box,1,
			Dish_Pack_B,1,
			Elunium,2,
			Light_White_Pot_F,300,
			Light_Blue_Pot_F,100,
			Thick_Manual50,3
		);
		if(.@ret){
			delitem Growth_Pack_80,1;
			getitembound Growth_Pack_90,1,4; 
			getitembound Bubble_Gum,2,4;
			getitembound Branch_Of_Dead_Tree,10,4;
			getitembound Old_Violet_Box,1,4;
			getitembound Dish_Pack_B,1,4;
			getitembound Elunium,2,4;
			getitembound Light_White_Pot_F,300,4;
			getitembound Light_Blue_Pot_F,100,4;
			getitembound Thick_Manual50,3,4;
			Zeny += 60000;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else if (getarg(0) == 90){
		.@ret = checkweight(
			Growth_Pack_99,1, 
			Dish_Pack_B,10,
			Bubble_Gum,2,
			Light_White_Pot_F,300,
			Light_Blue_Pot_F,100,
			Thick_Manual50,3
		);
		if(.@ret){
			delitem Growth_Pack_90,1;
			getitembound Growth_Pack_99,1,4; 
			getitembound Dish_Pack_B,10,4;
			getitembound Bubble_Gum,2,4;
			getitembound Light_White_Pot_F,300,4;
			getitembound Light_Blue_Pot_F,100,4;
			getitembound Thick_Manual50,3,4;
			Zeny += 70000;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else if (getarg(0) == 99){
		.@ret = checkweight(
			Yggdrasilberry,20,
			Bloody_Dead_Branch,5,
			Bubble_Gum,10,
			Dish_Pack_B,10,
			Light_White_Pot_F,300,
			Light_Blue_Pot_F,100
		);
		if(.@ret){
			delitem Growth_Pack_99,1;
			getitembound Yggdrasilberry,20,4;
			getitembound Bloody_Dead_Branch,5,4;
			getitembound Bubble_Gum,10,4;
			getitembound Dish_Pack_B,10,4;
			getitembound Light_White_Pot_F,300,4;
			getitembound Light_Blue_Pot_F,100,4;
			callfunc "F_FreeHG",1;
			Zeny += 100000;
		} else {
			dispbottom "You might get overweight. Please store some items and try again.";
		}
	} else {
		dispbottom "Invalid";
	}
	return;
}


function	script	F_Blueprint	{
	disable_items();
	function Chk;
	@chk = 0;
	mes "[ Headgear Crafting ]";
	mes "You will need:";
	if(getarg(4))  mes Chk(Zeny,getarg(4))+" Zeny: ^0000FF"+getarg(4)+"^000000";
	if(getarg(5))  mes Chk(#CASHPOINTS,getarg(5))+" Cash Points: ^0000FF"+getarg(5)+"^000000";
	for(.@i = 6; .@i < getargcount(); .@i = .@i+2)
		mes Chk(countitem(getarg(.@i,0)),getarg(.@i+1))+" "+getitemname(getarg(.@i))+( getitemslots(getarg(.@i)) >= 1 ? " ["+getitemslots(getarg(.@i))+"]" : "")+": ^0000FF"+getarg(.@i+1)+"^000000";
	next;
	switch(select(
	  ((@chk)? "^FF0000Incomplete^000000":"Craft ^0000FF"+getitemname(getarg(2))+"^000000:")
	)) {
	case 1:
		if(@chk) close;
		delitem getarg(0),getarg(1);  			// delete the trigger item
		if(getarg(4)) Zeny -= getarg(4);		// deduct zeny if required
		if(getarg(5)) #CASHPOINTS -= getarg(5);		// deduct cashpoints if required
		for(.@i = 6; .@i < getargcount(); .@i = .@i+2)
			delitem getarg(.@i),getarg(.@i+1);	
		getitem getarg(2),getarg(3);			// get the crafted item
		chanmsg("#system","Congratulation! Player [ "+strcharinfo(PC_NAME)+" ] has crafted "+getitemname(getarg(2)));
		specialeffect(EF_PRIMECHARGE4, AREA, playerattached());
	default:
		close;	
	}
	close;

	function	Chk	{
		if (getarg(0) < getarg(1)) {
			@chk = 1;
			return "[^FF0000 x ^000000]";
		} else
			return "[^0000FF + ^000000]";
	}
}

function	script	F_MVPTime	{
	mes "^FF0000MvP Status^000000";
	for( .@i = 0; .@i < getarraysize(getvariableofnpc(.mvpid,"mvpcontroller")); .@i++ ) {
		.@time =  getd("$T" +getvariableofnpc(.mvpva[.@i],"mvpcontroller") + getvariableofnpc(.mvpid[.@i],"mvpcontroller"));
		.@alive = getd("$S" +getvariableofnpc(.mvpva[.@i],"mvpcontroller") + getvariableofnpc(.mvpid[.@i],"mvpcontroller"));

		set .@hours, (.@time - gettimetick(2)) / 3600;
		set .@mins,  (.@time - gettimetick(2))%3600/60;
		set .@secs,  (.@time - gettimetick(2))%60;

		set .@mobname$,getmonsterinfo( getvariableofnpc(.mvpid[.@i], "mvpcontroller"),0 );
		set .@map$,getvariableofnpc(.mvpmaps$[.@i], "mvpcontroller");
		set .@player$,getd("$P"+getvariableofnpc(.mvpva[.@i], "mvpcontroller") + getvariableofnpc(.mvpid[.@i], "mvpcontroller") +"$");
		
		mes ((.@alive == 1) ? "[ ^01DF01+^000000 ]" : "[ ^FF0000x^000000 ]")+((getstrlen( .@mobname$ ) > 10 ) ? " ^0055FF"+substr(.@mobname$,0, 10)+"^000000" : " ^0055FF"+.@mobname$+"^000000")+" ^777777"+.@map$+"^000000 ";
		if( .@alive == 2 ) {
			mes "^FF0000"+((.@hours) ? .@hours +"h" : "")+" "+((.@mins)  ? .@mins  +"m" : "")+" "+((.@secs)  ? .@secs  +"s" : "")+"^000000 "+"^777777 kiiled by "+.@player$+"^000000";
		}
	}
	close;
}

function	script	F_WhichChar	{
	__OnInput:
		while( input( .@player_name$,3,24 ) );
		query_sql( "SELECT `name`,`class` FROM `char` WHERE `name` LIKE '%"+escape_sql( .@player_name$ )+"%' ORDER BY `name` LIMIT 50",.@temp_name$,.@class );
		.@temp_name_size = getarraysize( .@temp_name$ );
		
		if ( .@temp_name_size <= 0 ) {
			dispbottom "[ System ] '"+.@player_name$+"' doesnt exist.";
			// next;
			if( select( "Search another Name","Cancel" ) == 1 ) goto __OnInput;
			return "";
		}
		else if ( .@temp_name_size > 1 ) {
			dispbottom "[ System ] Pick a player.";
			for ( .@i = 0; .@i < .@temp_name_size; .@i++ )
				.@menu$ = .@menu$ + "^FF0000["+jobname( .@class[.@i] )+"] ^000000" + .@temp_name$[.@i] +":";
			.@i = select( .@menu$ ) - 1;
		}
	return .@temp_name$[.@i];
}

function	script	F_CashLog	{
		query_sql ("CREATE TABLE IF NOT EXISTS `cashlog` ("+
		 "`id` int(11) NOT NULL AUTO_INCREMENT,"+
		 "`time` datetime DEFAULT NULL,"+
		 "`account_id` int(11) NOT NULL DEFAULT '0',"+
		 "`char_id` int(11) UNSIGNED NOT NULL DEFAULT '0',"+
		 "`points` int(11) UNSIGNED NOT NULL DEFAULT '0',"+
		 "`amount` int(11) NOT NULL DEFAULT '0',"+
		 "`npc` varchar(20) DEFAULT NULL,"+
		 "`map` varchar(11) NOT NULL DEFAULT '',"+
		 "PRIMARY KEY (`id`)"+
		 ") ENGINE=MyISAM;"
		);
		query_sql( "INSERT INTO `cashlog` ( `time`,`account_id`,`char_id`,`points`,`amount`,`npc`,`map` ) VALUES ( NOW(),"+getcharid(CHAR_ID_ACCOUNT)+","+getcharid(CHAR_ID_CHAR)+","+getarg(0)+","+getarg(1)+",'"+getarg(2)+"','"+strcharinfo(PC_MAP)+"' )" );	
		return;
}

function	script	F_LiveCast	{
	mes "[ ProGames TV ]";
	mes "Please select your desired Freebies";
	next;
	switch(select(
		("1000x Light White Potion:")+
		("500x Light Blue Potion:")+
		("2x Bubble Gum:")+
		"^777777Close^000000"
	)) {	
	case 1:
		chanmsg("#system","Congratulation! Player [ "+strcharinfo(PC_NAME)+" ] has claimed 1000x Light White Potion from ProGames TV Streaming Event.");
		delitem 30033,1;
		getitem 30011,1000;
		close;
	case 2:
		chanmsg("#system","Congratulation! Player [ "+strcharinfo(PC_NAME)+" ] has claimed 500x Light Blue Potion from ProGames TV Streaming Event.");
		delitem 30033,1;
		getitem 30012,500;
		close;
	case 3:
		chanmsg("#system","Congratulation! Player [ "+strcharinfo(PC_NAME)+" ] has claimed 2x Blubble Gum from ProGames TV Streaming Event.");
		delitem 30033,1;
		getitem 12210,2;
		close;
	default:
		close;
	}
	end;
}


function	script	F_CardRemover	{
	mes "[ Card Remover ]";
	mes "Please select item to extract card.";
	next;
	setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
	set .@menu$,"";
	for( set .@i,1; .@i <= 10; set .@i,.@i+1 )
	{
		if( getequipisequiped(.@i) )
		set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
			set .@menu$, .@menu$ + ":";
	}
	set .@part,select(.@menu$);
	close2;

	set .@cardcount,getequipcardcnt(.@part);

	if(!getequipisequiped(.@part)) {
		dispbottom "You are not wearing anything there that I can remove cards from.";
		return;
	} else if(getequipcardcnt(.@part) == 0) {
		dispbottom "There are no cards compounded on this item.";
		return;
	} else if (!checkweight(Knife_,(.@cardcount+1))) {
		dispbottom "You are carrying too much stuff. Put your extra items in Kafra Storage and try again.";
		return;
	} else if( .@cardcount > countitem(Card_Remover) ) {
		dispbottom "You do not have enough "+getitemname(Card_Remover);
		return;
	} else {
		delitem Card_Remover,.@cardcount;
		specialeffect(EF_REFINEOK, AREA, playerattached());	
		successremovecards .@part;
	}
	return;
}

function	script	F_GetBuff	{
	if (getarg(0) == 1){
		if (#VIP) {
			set .@days,((#VIP - gettimetick(2))/60/60)/24;
			set .@hours,((#VIP - gettimetick(2))/60/60)%24;
			set .@mins,((#VIP - gettimetick(2))/60)%60;
			dispbottom("You still have buff service active."+ ((.@days) ? .@days +":Days " : "") +""+ ((.@hours) ? .@hours +":Hours " : "") +""+ ((.@mins) ? .@mins +":Minutes " : "") +" ");
			end;
		}
		#VIP = gettimetick(2)+604800;
		// move the player to the VIP group until logout
		sc_end SC_BLESSING;
		skilleffect AL_BLESSING,0;
		sc_start SC_BLESSING,1800000,10;

		if(Hp>15) {
			sc_end SC_INC_AGI;
			skilleffect AL_INCAGI,0;
			sc_start SC_INC_AGI,1800000,10;
			heal -15,0;
		}

		if (countitem(Buff_Scroll_A)) delitem Buff_Scroll_A,1;
		getitem Buff_Scroll,1;

		addtimer((#VIP - gettimetick(2)),"VIP::OnExpire");
			set .@days,((#VIP - gettimetick(2))/60/60)/24;
			set .@hours,((#VIP - gettimetick(2))/60/60)%24;
			set .@mins,((#VIP - gettimetick(2))/60)%60;
		// notify the player
		dispbottom("Your buff status is active until"+ ((.@days) ? .@days +":Days " : "") +""+ ((.@hours) ? .@hours +":Hours " : "") +""+ ((.@mins) ? .@mins +":Minutes " : "") +" ");

		end;
	} 
	if (getarg(0) == 2) {
		if (#VIP) {
			if ( getstatus(SC_BLESSING) && getstatus(SC_INC_AGI) ){
				 dispbottom "You still have active buff.";
				 end;
			}
			if ( !getstatus(SC_BLESSING) ) {
				sc_end SC_BLESSING;
				skilleffect AL_BLESSING,0;
				sc_start SC_BLESSING,1800000,10;
			}
			
			if ( !getstatus(SC_INC_AGI) ) {
				if(Hp>15) {
					sc_end SC_INC_AGI;
					skilleffect AL_INCAGI,0;
					sc_start SC_INC_AGI,1800000,10;
					heal -15,0;
				}
			}
		
		} else {
			delitem Buff_Scroll,countitem(Buff_Scroll);
			dispbottom "You buff status has ended.";
		}
		end;
	}
}

function	script	card_illust	{
	if(getarg(0)==4001) { .@ca$ ="ī";
	} else if( getarg(0) == 4002 ) { .@ca$ = "ĺ긣ī";
	} else if( getarg(0) == 4003 ) { .@ca$ = "Ǫī";
	} else if( getarg(0) == 4004 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4005 ) { .@ca$ = "Ÿī";
	} else if( getarg(0) == 4006 ) { .@ca$ = "糪ƽī";
	} else if( getarg(0) == 4007 ) { .@ca$ = "ھī";
	} else if( getarg(0) == 4008 ) { .@ca$ = "Űī";
	} else if( getarg(0) == 4009 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4010 ) { .@ca$ = "οī";
	} else if( getarg(0) == 4011 ) { .@ca$ = "Űī";
	} else if( getarg(0) == 4012 ) { .@ca$ = "Ϲī";
	} else if( getarg(0) == 4013 ) { .@ca$ = "ӵ巹ī";
	} else if( getarg(0) == 4014 ) { .@ca$ = "δαī";
	} else if( getarg(0) == 4015 ) { .@ca$ = "ܵī";
	} else if( getarg(0) == 4016 ) { .@ca$ = "Ϲī";
	} else if( getarg(0) == 4017 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4018 ) { .@ca$ = "ӵ巹ī";
	} else if( getarg(0) == 4019 ) { .@ca$ = "ȣī";
	} else if( getarg(0) == 4020 ) { .@ca$ = "۹иī";
	} else if( getarg(0) == 4021 ) { .@ca$ = "Ŀī";
	} else if( getarg(0) == 4022 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4023 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4024 ) { .@ca$ = "öũī";
	} else if( getarg(0) == 4025 ) { .@ca$ = "̷ī";
	} else if( getarg(0) == 4026 ) { .@ca$ = "ϵϹī";
	} else if( getarg(0) == 4027 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4028 ) { .@ca$ = "Ÿοī";
	} else if( getarg(0) == 4029 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4030 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4031 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4032 ) { .@ca$ = "ڹƮī";
	} else if( getarg(0) == 4033 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4034 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4035 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4036 ) { .@ca$ = "īī";
	} else if( getarg(0) == 4037 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4038 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4039 ) { .@ca$ = "Ÿ̳ī";
	} else if( getarg(0) == 4040 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4041 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4042 ) { .@ca$ = "ƿī";
	} else if( getarg(0) == 4043 ) { .@ca$ = "ӵ巹ī";
	} else if( getarg(0) == 4044 ) { .@ca$ = "Űī";
	} else if( getarg(0) == 4045 ) { .@ca$ = "ȣī";
	} else if( getarg(0) == 4046 ) { .@ca$ = "ƾī";
	} else if( getarg(0) == 4047 ) { .@ca$ = "Ʈī";
	} else if( getarg(0) == 4048 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4049 ) { .@ca$ = "ٵī";
	} else if( getarg(0) == 4050 ) { .@ca$ = "Ϲī";
	} else if( getarg(0) == 4051 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4052 ) { .@ca$ = "οī";
	} else if( getarg(0) == 4053 ) { .@ca$ = "ŸŸī";
	} else if( getarg(0) == 4054 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4055 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4056 ) { .@ca$ = "Ƽ׽ī";
	} else if( getarg(0) == 4057 ) { .@ca$ = "Ʋī";
	} else if( getarg(0) == 4058 ) { .@ca$ = "Ÿαī";
	} else if( getarg(0) == 4059 ) { .@ca$ = "ӵ巹ī";
	} else if( getarg(0) == 4060 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4061 ) { .@ca$ = "Ŀī";
	} else if( getarg(0) == 4062 ) { .@ca$ = "Ƴܴũī";
	} else if( getarg(0) == 4063 ) { .@ca$ = "īī";
	} else if( getarg(0) == 4064 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4065 ) { .@ca$ = "īȣī";
	} else if( getarg(0) == 4066 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4067 ) { .@ca$ = "ްεī";
	} else if( getarg(0) == 4068 ) { .@ca$ = "ǿī";
	} else if( getarg(0) == 4069 ) { .@ca$ = "巹θī";
	} else if( getarg(0) == 4070 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4071 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4072 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4073 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4074 ) { .@ca$ = "ǲī";
	} else if( getarg(0) == 4075 ) { .@ca$ = "Ƹī";
	} else if( getarg(0) == 4076 ) { .@ca$ = "ÿī";
	} else if( getarg(0) == 4077 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4078 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4079 ) { .@ca$ = "Ƽī";
	} else if( getarg(0) == 4080 ) { .@ca$ = "÷ζī";
	} else if( getarg(0) == 4081 ) { .@ca$ = "ȣī";
	} else if( getarg(0) == 4082 ) { .@ca$ = "Ʈī";
	} else if( getarg(0) == 4083 ) { .@ca$ = "÷þī";
	} else if( getarg(0) == 4084 ) { .@ca$ = "Ǿī";
	} else if( getarg(0) == 4085 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4086 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4087 ) { .@ca$ = "̾ƽī";
	} else if( getarg(0) == 4088 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4089 ) { .@ca$ = "ҵǽī";
	} else if( getarg(0) == 4090 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4091 ) { .@ca$ = "ںƮī";
	} else if( getarg(0) == 4092 ) { .@ca$ = "̿Ŀī";
	} else if( getarg(0) == 4093 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4094 ) { .@ca$ = "Ľī";
	} else if( getarg(0) == 4095 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4096 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4097 ) { .@ca$ = "Ÿī";
	} else if( getarg(0) == 4098 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4099 ) { .@ca$ = "Ļ糪ī";
	} else if( getarg(0) == 4100 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4101 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4102 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4103 ) { .@ca$ = "ȣī";
	} else if( getarg(0) == 4104 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4105 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4106 ) { .@ca$ = "̶ī";
	} else if( getarg(0) == 4107 ) { .@ca$ = "Ʈī";
	} else if( getarg(0) == 4108 ) { .@ca$ = "̽Ʈī";
	} else if( getarg(0) == 4109 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4110 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4111 ) { .@ca$ = "Ʈī";
	} else if( getarg(0) == 4112 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4113 ) { .@ca$ = "Ʈī";
	} else if( getarg(0) == 4114 ) { .@ca$ = "Ƹī";
	} else if( getarg(0) == 4115 ) { .@ca$ = "öī";
	} else if( getarg(0) == 4116 ) { .@ca$ = "̽ýī";
	} else if( getarg(0) == 4117 ) { .@ca$ = "ֵιī";
	} else if( getarg(0) == 4118 ) { .@ca$ = "ڶī";
	} else if( getarg(0) == 4119 ) { .@ca$ = "ټҸī";
	} else if( getarg(0) == 4120 ) { .@ca$ = "߻ڶī";
	} else if( getarg(0) == 4121 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4122 ) { .@ca$ = "ġī";
	} else if( getarg(0) == 4123 ) { .@ca$ = "尡ī";
	} else if( getarg(0) == 4124 ) { .@ca$ = "޵λī";
	} else if( getarg(0) == 4125 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4126 ) { .@ca$ = "Ȳī";
	} else if( getarg(0) == 4127 ) { .@ca$ = "Ʈ޾ī";
	} else if( getarg(0) == 4128 ) { .@ca$ = "ݵϹī";
	} else if( getarg(0) == 4129 ) { .@ca$ = "ִϾī";
	} else if( getarg(0) == 4130 ) { .@ca$ = "Ǿŷī";
	} else if( getarg(0) == 4131 ) { .@ca$ = "ȭī";
	} else if( getarg(0) == 4132 ) { .@ca$ = "̽Ʈī";
	} else if( getarg(0) == 4133 ) { .@ca$ = "̵帯ī";
	} else if( getarg(0) == 4134 ) { .@ca$ = "ťī";
	} else if( getarg(0) == 4135 ) { .@ca$ = "ũεī";
	} else if( getarg(0) == 4136 ) { .@ca$ = "̳Ʈī";
	} else if( getarg(0) == 4137 ) { .@ca$ = "巹ũī";
	} else if( getarg(0) == 4138 ) { .@ca$ = "ƴī";
	} else if( getarg(0) == 4139 ) { .@ca$ = "Ŀī";
	} else if( getarg(0) == 4140 ) { .@ca$ = "Įī";
	} else if( getarg(0) == 4141 ) { .@ca$ = "̵ī";
	} else if( getarg(0) == 4142 ) { .@ca$ = "ðī";
	} else if( getarg(0) == 4143 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4144 ) { .@ca$ = "øī";
	} else if( getarg(0) == 4145 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4146 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4147 ) { .@ca$ = "Ʈī";
	} else if( getarg(0) == 4148 ) { .@ca$ = "Ķī";
	} else if( getarg(0) == 4149 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4150 ) { .@ca$ = "Ʈī";
	} else if( getarg(0) == 4151 ) { .@ca$ = "Ʈī";
	} else if( getarg(0) == 4152 ) { .@ca$ = "İī";
	} else if( getarg(0) == 4153 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4154 ) { .@ca$ = "ܵī";
	} else if( getarg(0) == 4155 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4156 ) { .@ca$ = "̴ī";
	} else if( getarg(0) == 4157 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4158 ) { .@ca$ = "ߵī";
	} else if( getarg(0) == 4159 ) { .@ca$ = "ȣī";
	} else if( getarg(0) == 4160 ) { .@ca$ = "Ѻī";
	} else if( getarg(0) == 4161 ) { .@ca$ = "׷ī";
	} else if( getarg(0) == 4162 ) { .@ca$ = "׸ī";
	} else if( getarg(0) == 4163 ) { .@ca$ = "׸ī";
	} else if( getarg(0) == 4164 ) { .@ca$ = "۸θƼī";
	} else if( getarg(0) == 4165 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4166 ) { .@ca$ = "Ʈ޾׷ī";
	} else if( getarg(0) == 4167 ) { .@ca$ = "׷̵ī";
	} else if( getarg(0) == 4168 ) { .@ca$ = "ũεī";
	} else if( getarg(0) == 4169 ) { .@ca$ = "ũϷī";
	} else if( getarg(0) == 4170 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4171 ) { .@ca$ = "ũƮī";
	} else if( getarg(0) == 4172 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4173 ) { .@ca$ = "Žī";
	} else if( getarg(0) == 4174 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4175 ) { .@ca$ = "βī";
	} else if( getarg(0) == 4176 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4177 ) { .@ca$ = "̾ī";
	} else if( getarg(0) == 4178 ) { .@ca$ = "巡ī";
	} else if( getarg(0) == 4179 ) { .@ca$ = "巡öī";
	} else if( getarg(0) == 4180 ) { .@ca$ = "帱ī";
	} else if( getarg(0) == 4181 ) { .@ca$ = "𽺰ī";
	} else if( getarg(0) == 4182 ) { .@ca$ = "ƺī";
	} else if( getarg(0) == 4183 ) { .@ca$ = "̴ī";
	} else if( getarg(0) == 4184 ) { .@ca$ = "ٰī";
	} else if( getarg(0) == 4185 ) { .@ca$ = "̵ī";
	} else if( getarg(0) == 4186 ) { .@ca$ = "۷ī";
	} else if( getarg(0) == 4187 ) { .@ca$ = "̵帯ī";
	} else if( getarg(0) == 4188 ) { .@ca$ = "̺øī";
	} else if( getarg(0) == 4189 ) { .@ca$ = "̽ī";
	} else if( getarg(0) == 4190 ) { .@ca$ = "̾ī";
	} else if( getarg(0) == 4191 ) { .@ca$ = "θ縮ī";
	} else if( getarg(0) == 4192 ) { .@ca$ = "̷ī";
	} else if( getarg(0) == 4193 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4194 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4195 ) { .@ca$ = "Ĺī";
	} else if( getarg(0) == 4196 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4197 ) { .@ca$ = "͸ī";
	} else if( getarg(0) == 4198 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4199 ) { .@ca$ = "Ӹī";
	} else if( getarg(0) == 4200 ) { .@ca$ = "ްī";
	} else if( getarg(0) == 4201 ) { .@ca$ = "νī";
	} else if( getarg(0) == 4202 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4203 ) { .@ca$ = "Ʈ巡̵ī";
	} else if( getarg(0) == 4204 ) { .@ca$ = "̴ϵī";
	} else if( getarg(0) == 4205 ) { .@ca$ = "̹ī";
	} else if( getarg(0) == 4206 ) { .@ca$ = "̽Ʈ̽ī";
	} else if( getarg(0) == 4207 ) { .@ca$ = "̽ƿī";
	} else if( getarg(0) == 4208 ) { .@ca$ = "̾ߺī";
	} else if( getarg(0) == 4209 ) { .@ca$ = "̿øī";
	} else if( getarg(0) == 4210 ) { .@ca$ = "ȸϴī";
	} else if( getarg(0) == 4211 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4212 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4213 ) { .@ca$ = "긱Ʈī";
	} else if( getarg(0) == 4214 ) { .@ca$ = "Ӵī";
	} else if( getarg(0) == 4215 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4216 ) { .@ca$ = "罺ġī";
	} else if( getarg(0) == 4217 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4218 ) { .@ca$ = "ťī";
	} else if( getarg(0) == 4219 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4220 ) { .@ca$ = "ָī";
	} else if( getarg(0) == 4221 ) { .@ca$ = "̷׷ī";
	} else if( getarg(0) == 4222 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4223 ) { .@ca$ = "ͷƽī";
	} else if( getarg(0) == 4224 ) { .@ca$ = "ۿī";
	} else if( getarg(0) == 4225 ) { .@ca$ = "潴ī";
	} else if( getarg(0) == 4226 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4227 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4228 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4229 ) { .@ca$ = "ðžī";
	} else if( getarg(0) == 4230 ) { .@ca$ = "óī";
	} else if( getarg(0) == 4231 ) { .@ca$ = "ľī";
	} else if( getarg(0) == 4232 ) { .@ca$ = "żī";
	} else if( getarg(0) == 4233 ) { .@ca$ = "Ʊǥī";
	} else if( getarg(0) == 4234 ) { .@ca$ = "Ƴī";
	} else if( getarg(0) == 4235 ) { .@ca$ = "XMASŰī";
	} else if( getarg(0) == 4236 ) { .@ca$ = "Ƹī";
	} else if( getarg(0) == 4237 ) { .@ca$ = "ƿũī";
	} else if( getarg(0) == 4238 ) { .@ca$ = "ƿٷī";
	} else if( getarg(0) == 4239 ) { .@ca$ = "̾ǽƮī";
	} else if( getarg(0) == 4240 ) { .@ca$ = "ũ콺ī";
	} else if( getarg(0) == 4241 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4242 ) { .@ca$ = "Įī";
	} else if( getarg(0) == 4243 ) { .@ca$ = "Ͽī";
	} else if( getarg(0) == 4244 ) { .@ca$ = "˶ī";
	} else if( getarg(0) == 4245 ) { .@ca$ = "ϹƮī";
	} else if( getarg(0) == 4246 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4247 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4248 ) { .@ca$ = "μƮ̶ī";
	} else if( getarg(0) == 4249 ) { .@ca$ = "μƮī";
	} else if( getarg(0) == 4250 ) { .@ca$ = "ťī";
	} else if( getarg(0) == 4251 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4252 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4253 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4254 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4255 ) { .@ca$ = "ũ̵ī";
	} else if( getarg(0) == 4256 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4257 ) { .@ca$ = "ϵī";
	} else if( getarg(0) == 4258 ) { .@ca$ = "伱ī";
	} else if( getarg(0) == 4259 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4260 ) { .@ca$ = "źī";
	} else if( getarg(0) == 4261 ) { .@ca$ = "źī";
	} else if( getarg(0) == 4262 ) { .@ca$ = "Ǽī";
	} else if( getarg(0) == 4263 ) { .@ca$ = "ɹī";
	} else if( getarg(0) == 4264 ) { .@ca$ = "Ʈī";
	} else if( getarg(0) == 4265 ) { .@ca$ = "̸Ÿī";
	} else if( getarg(0) == 4266 ) { .@ca$ = "Ŭī";
	} else if( getarg(0) == 4267 ) { .@ca$ = "ͽ÷ī";
	} else if( getarg(0) == 4268 ) { .@ca$ = "Ƽī";
	} else if( getarg(0) == 4269 ) { .@ca$ = "ťī";
	} else if( getarg(0) == 4270 ) { .@ca$ = "̾Ʈ̴ī";
	} else if( getarg(0) == 4271 ) { .@ca$ = "̾Ʈȣī";
	} else if( getarg(0) == 4272 ) { .@ca$ = "ķī";
	} else if( getarg(0) == 4273 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4274 ) { .@ca$ = "񸶽ī";
	} else if( getarg(0) == 4275 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4276 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4277 ) { .@ca$ = "Ÿī";
	} else if( getarg(0) == 4278 ) { .@ca$ = "Ʈī";
	} else if( getarg(0) == 4279 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4280 ) { .@ca$ = "׷ī";
	} else if( getarg(0) == 4281 ) { .@ca$ = "ۺī";
	} else if( getarg(0) == 4282 ) { .@ca$ = "õī";
	} else if( getarg(0) == 4283 ) { .@ca$ = "õϴ屺ī";
	} else if( getarg(0) == 4284 ) { .@ca$ = "üƮī";
	} else if( getarg(0) == 4285 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4286 ) { .@ca$ = "īīī";
	} else if( getarg(0) == 4287 ) { .@ca$ = "ıī";
	} else if( getarg(0) == 4288 ) { .@ca$ = "ĳī";
	} else if( getarg(0) == 4289 ) { .@ca$ = "ĳʷī";
	} else if( getarg(0) == 4290 ) { .@ca$ = "Ĺī";
	} else if( getarg(0) == 4291 ) { .@ca$ = "ںƮī";
	} else if( getarg(0) == 4292 ) { .@ca$ = "ںƮī";
	} else if( getarg(0) == 4293 ) { .@ca$ = "Űī";
	} else if( getarg(0) == 4294 ) { .@ca$ = "ťī";
	} else if( getarg(0) == 4295 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4296 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4297 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4298 ) { .@ca$ = "ũǾī";
	} else if( getarg(0) == 4299 ) { .@ca$ = "Ŭī";
	} else if( getarg(0) == 4300 ) { .@ca$ = "Ű޶ī";
	} else if( getarg(0) == 4301 ) { .@ca$ = "ųƼī";
	} else if( getarg(0) == 4302 ) { .@ca$ = "Ÿīī";
	} else if( getarg(0) == 4303 ) { .@ca$ = "Ŵī";
	} else if( getarg(0) == 4304 ) { .@ca$ = "Žī";
	} else if( getarg(0) == 4305 ) { .@ca$ = "Ʋ׷ī";
	} else if( getarg(0) == 4306 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4307 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4308 ) { .@ca$ = "ƮƮī";
	} else if( getarg(0) == 4309 ) { .@ca$ = "зƮī";
	} else if( getarg(0) == 4310 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4311 ) { .@ca$ = "۸ī";
	} else if( getarg(0) == 4312 ) { .@ca$ = "۾ī";
	} else if( getarg(0) == 4313 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4314 ) { .@ca$ = "޳ī";
	} else if( getarg(0) == 4315 ) { .@ca$ = "佺Ʈī";
	} else if( getarg(0) == 4316 ) { .@ca$ = "ũī";
	} else if( getarg(0) == 4317 ) { .@ca$ = "¹ī";
	} else if( getarg(0) == 4318 ) { .@ca$ = "ǳǱī";
	} else if( getarg(0) == 4319 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4320 ) { .@ca$ = "ǺǱī";
	} else if( getarg(0) == 4321 ) { .@ca$ = "̷̽Ʈī";
	} else if( getarg(0) == 4322 ) { .@ca$ = "̿ũī";
	} else if( getarg(0) == 4323 ) { .@ca$ = "Ƽī";
	} else if( getarg(0) == 4324 ) { .@ca$ = "Ƽī";
	} else if( getarg(0) == 4325 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4326 ) { .@ca$ = "شī";
	} else if( getarg(0) == 4327 ) { .@ca$ = "ȣī";
	} else if( getarg(0) == 4328 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4329 ) { .@ca$ = "Ӵٸũī";
	} else if( getarg(0) == 4330 ) { .@ca$ = "ī";
	} else if( getarg(0) == 4331 ) { .@ca$ = "ī";

	
	} else {	
		.@ca$ = "sorry";
	}	
	return .@ca$;	

}

function	script	Itemlink	{
	.@id = getarg(0);
	return "<ITEM>"+getitemname(.@id)+"<INFO>"+.@id+"</INFO></ITEM>";
}

function	script	F_GetCountry	{
	.@country$ = getarg(0);
	if ( .@country$ == "AD" ) { .@countrys$ = "Andorra";
	} else if ( .@country$ == "AE" ) { .@countrys$ = "United Arab Emirates";
	} else if ( .@country$ == "AF" ) { .@countrys$ = "Afghanistan";
	} else if ( .@country$ == "AG" ) { .@countrys$ = "Antigua and Barbuda";
	} else if ( .@country$ == "AI" ) { .@countrys$ = "Anguilla";
	} else if ( .@country$ == "AL" ) { .@countrys$ = "Albania";
	} else if ( .@country$ == "AM" ) { .@countrys$ = "Armenia";
	} else if ( .@country$ == "AO" ) { .@countrys$ = "Angola";
	} else if ( .@country$ == "AQ" ) { .@countrys$ = "Antarctica";
	} else if ( .@country$ == "AR" ) { .@countrys$ = "Argentina";
	} else if ( .@country$ == "AS" ) { .@countrys$ = "American Samoa";
	} else if ( .@country$ == "AT" ) { .@countrys$ = "Austria";
	} else if ( .@country$ == "AU" ) { .@countrys$ = "Australia";
	} else if ( .@country$ == "AW" ) { .@countrys$ = "Aruba";
	} else if ( .@country$ == "AX" ) { .@countrys$ = "land Islands";
	} else if ( .@country$ == "AZ" ) { .@countrys$ = "Azerbaijan";
	} else if ( .@country$ == "BA" ) { .@countrys$ = "Bosnia and Herzegovina";
	} else if ( .@country$ == "BB" ) { .@countrys$ = "Barbados";
	} else if ( .@country$ == "BD" ) { .@countrys$ = "Bangladesh";
	} else if ( .@country$ == "BE" ) { .@countrys$ = "Belgium";
	} else if ( .@country$ == "BF" ) { .@countrys$ = "Burkina Faso";
	} else if ( .@country$ == "BG" ) { .@countrys$ = "Bulgaria";
	} else if ( .@country$ == "BH" ) { .@countrys$ = "Bahrain";
	} else if ( .@country$ == "BI" ) { .@countrys$ = "Burundi";
	} else if ( .@country$ == "BJ" ) { .@countrys$ = "Benin";
	} else if ( .@country$ == "BL" ) { .@countrys$ = "Saint Barthlemy";
	} else if ( .@country$ == "BM" ) { .@countrys$ = "Bermuda";
	} else if ( .@country$ == "BN" ) { .@countrys$ = "Brunei Darussalam";
	} else if ( .@country$ == "BO" ) { .@countrys$ = "Plurinational State of Bolivia";
	} else if ( .@country$ == "BQ" ) { .@countrys$ = "Sint Eustatius and Saba Bonaire";
	} else if ( .@country$ == "BR" ) { .@countrys$ = "Brazil";
	} else if ( .@country$ == "BS" ) { .@countrys$ = "Bahamas";
	} else if ( .@country$ == "BT" ) { .@countrys$ = "Bhutan";
	} else if ( .@country$ == "BV" ) { .@countrys$ = "Bouvet Island";
	} else if ( .@country$ == "BW" ) { .@countrys$ = "Botswana";
	} else if ( .@country$ == "BY" ) { .@countrys$ = "Belarus";
	} else if ( .@country$ == "BZ" ) { .@countrys$ = "Belize";
	} else if ( .@country$ == "CA" ) { .@countrys$ = "Canada";
	} else if ( .@country$ == "CC" ) { .@countrys$ = "Cocos (Keeling) Islands";
	} else if ( .@country$ == "CD" ) { .@countrys$ = "The Democratic Republic of the Congo";
	} else if ( .@country$ == "CF" ) { .@countrys$ = "Central African Republic";
	} else if ( .@country$ == "CG" ) { .@countrys$ = "Congo";
	} else if ( .@country$ == "CH" ) { .@countrys$ = "Switzerland";
	} else if ( .@country$ == "CI" ) { .@countrys$ = "Cte d'Ivoire";
	} else if ( .@country$ == "CK" ) { .@countrys$ = "Cook Islands";
	} else if ( .@country$ == "CL" ) { .@countrys$ = "Chile";
	} else if ( .@country$ == "CM" ) { .@countrys$ = "Cameroon";
	} else if ( .@country$ == "CN" ) { .@countrys$ = "China";
	} else if ( .@country$ == "CO" ) { .@countrys$ = "Colombia";
	} else if ( .@country$ == "CR" ) { .@countrys$ = "Costa Rica";
	} else if ( .@country$ == "CU" ) { .@countrys$ = "Cuba";
	} else if ( .@country$ == "CV" ) { .@countrys$ = "Cape Verde";
	} else if ( .@country$ == "CW" ) { .@countrys$ = "Curaao";
	} else if ( .@country$ == "CX" ) { .@countrys$ = "Christmas Island";
	} else if ( .@country$ == "CY" ) { .@countrys$ = "Cyprus";
	} else if ( .@country$ == "CZ" ) { .@countrys$ = "Czech Republic";
	} else if ( .@country$ == "DE" ) { .@countrys$ = "Germany";
	} else if ( .@country$ == "DJ" ) { .@countrys$ = "Djibouti";
	} else if ( .@country$ == "DK" ) { .@countrys$ = "Denmark";
	} else if ( .@country$ == "DM" ) { .@countrys$ = "Dominica";
	} else if ( .@country$ == "DO" ) { .@countrys$ = "Dominican Republic";
	} else if ( .@country$ == "DZ" ) { .@countrys$ = "Algeria";
	} else if ( .@country$ == "EC" ) { .@countrys$ = "Ecuador";
	} else if ( .@country$ == "EE" ) { .@countrys$ = "Estonia";
	} else if ( .@country$ == "EG" ) { .@countrys$ = "Egypt";
	} else if ( .@country$ == "EH" ) { .@countrys$ = "Western Sahara";
	} else if ( .@country$ == "ER" ) { .@countrys$ = "Eritrea";
	} else if ( .@country$ == "ES" ) { .@countrys$ = "Spain";
	} else if ( .@country$ == "ET" ) { .@countrys$ = "Ethiopia";
	} else if ( .@country$ == "FI" ) { .@countrys$ = "Finland";
	} else if ( .@country$ == "FJ" ) { .@countrys$ = "Fiji";
	} else if ( .@country$ == "FK" ) { .@countrys$ = "Falkland Islands (Malvinas)";
	} else if ( .@country$ == "FM" ) { .@countrys$ = "Federated States of Micronesia";
	} else if ( .@country$ == "FO" ) { .@countrys$ = "Faroe Islands";
	} else if ( .@country$ == "FR" ) { .@countrys$ = "France";
	} else if ( .@country$ == "GA" ) { .@countrys$ = "Gabon";
	} else if ( .@country$ == "GB" ) { .@countrys$ = "United Kingdom";
	} else if ( .@country$ == "GD" ) { .@countrys$ = "Grenada";
	} else if ( .@country$ == "GE" ) { .@countrys$ = "Georgia";
	} else if ( .@country$ == "GF" ) { .@countrys$ = "French Guiana";
	} else if ( .@country$ == "GG" ) { .@countrys$ = "Guernsey";
	} else if ( .@country$ == "GH" ) { .@countrys$ = "Ghana";
	} else if ( .@country$ == "GI" ) { .@countrys$ = "Gibraltar";
	} else if ( .@country$ == "GL" ) { .@countrys$ = "Greenland";
	} else if ( .@country$ == "GM" ) { .@countrys$ = "Gambia";
	} else if ( .@country$ == "GN" ) { .@countrys$ = "Guinea";
	} else if ( .@country$ == "GP" ) { .@countrys$ = "Guadeloupe";
	} else if ( .@country$ == "GQ" ) { .@countrys$ = "Equatorial Guinea";
	} else if ( .@country$ == "GR" ) { .@countrys$ = "Greece";
	} else if ( .@country$ == "GS" ) { .@countrys$ = "South Georgia and the South Sandwich Islands";
	} else if ( .@country$ == "GT" ) { .@countrys$ = "Guatemala";
	} else if ( .@country$ == "GU" ) { .@countrys$ = "Guam";
	} else if ( .@country$ == "GW" ) { .@countrys$ = "Guinea-Bissau";
	} else if ( .@country$ == "GY" ) { .@countrys$ = "Guyana";
	} else if ( .@country$ == "HK" ) { .@countrys$ = "Hong Kong";
	} else if ( .@country$ == "HM" ) { .@countrys$ = "Heard Island and McDonald Islands";
	} else if ( .@country$ == "HN" ) { .@countrys$ = "Honduras";
	} else if ( .@country$ == "HR" ) { .@countrys$ = "Croatia";
	} else if ( .@country$ == "HT" ) { .@countrys$ = "Haiti";
	} else if ( .@country$ == "HU" ) { .@countrys$ = "Hungary";
	} else if ( .@country$ == "ID" ) { .@countrys$ = "Indonesia";
	} else if ( .@country$ == "IE" ) { .@countrys$ = "Ireland";
	} else if ( .@country$ == "IL" ) { .@countrys$ = "Israel";
	} else if ( .@country$ == "IM" ) { .@countrys$ = "Isle of Man";
	} else if ( .@country$ == "IN" ) { .@countrys$ = "India";
	} else if ( .@country$ == "IO" ) { .@countrys$ = "British Indian Ocean Territory";
	} else if ( .@country$ == "IQ" ) { .@countrys$ = "Iraq";
	} else if ( .@country$ == "IR" ) { .@countrys$ = "Islamic Republic of Iran";
	} else if ( .@country$ == "IS" ) { .@countrys$ = "Iceland";
	} else if ( .@country$ == "IT" ) { .@countrys$ = "Italy";
	} else if ( .@country$ == "JE" ) { .@countrys$ = "Jersey";
	} else if ( .@country$ == "JM" ) { .@countrys$ = "Jamaica";
	} else if ( .@country$ == "JO" ) { .@countrys$ = "Jordan";
	} else if ( .@country$ == "JP" ) { .@countrys$ = "Japan";
	} else if ( .@country$ == "KE" ) { .@countrys$ = "Kenya";
	} else if ( .@country$ == "KG" ) { .@countrys$ = "Kyrgyzstan";
	} else if ( .@country$ == "KH" ) { .@countrys$ = "Cambodia";
	} else if ( .@country$ == "KI" ) { .@countrys$ = "Kiribati";
	} else if ( .@country$ == "KM" ) { .@countrys$ = "Comoros";
	} else if ( .@country$ == "KN" ) { .@countrys$ = "Saint Kitts and Nevis";
	} else if ( .@country$ == "KP" ) { .@countrys$ = "Democratic People's Republic of Korea";
	} else if ( .@country$ == "KR" ) { .@countrys$ = "Korea, Republic of Korea";
	} else if ( .@country$ == "KW" ) { .@countrys$ = "Kuwait";
	} else if ( .@country$ == "KY" ) { .@countrys$ = "Cayman Islands";
	} else if ( .@country$ == "KZ" ) { .@countrys$ = "Kazakhstan";
	} else if ( .@country$ == "LA" ) { .@countrys$ = "Lao People's Democratic Republic";
	} else if ( .@country$ == "LB" ) { .@countrys$ = "Lebanon";
	} else if ( .@country$ == "LC" ) { .@countrys$ = "Saint Lucia";
	} else if ( .@country$ == "LI" ) { .@countrys$ = "Liechtenstein";
	} else if ( .@country$ == "LK" ) { .@countrys$ = "Sri Lanka";
	} else if ( .@country$ == "LR" ) { .@countrys$ = "Liberia";
	} else if ( .@country$ == "LS" ) { .@countrys$ = "Lesotho";
	} else if ( .@country$ == "LT" ) { .@countrys$ = "Lithuania";
	} else if ( .@country$ == "LU" ) { .@countrys$ = "Luxembourg";
	} else if ( .@country$ == "LV" ) { .@countrys$ = "Latvia";
	} else if ( .@country$ == "LY" ) { .@countrys$ = "Libyan Arab Jamahiriya";
	} else if ( .@country$ == "MA" ) { .@countrys$ = "Morocco";
	} else if ( .@country$ == "MC" ) { .@countrys$ = "Monaco";
	} else if ( .@country$ == "MD" ) { .@countrys$ = "Republic of Moldova";
	} else if ( .@country$ == "ME" ) { .@countrys$ = "Montenegro";
	} else if ( .@country$ == "MF" ) { .@countrys$ = "Saint Martin (French part)";
	} else if ( .@country$ == "MG" ) { .@countrys$ = "Madagascar";
	} else if ( .@country$ == "MH" ) { .@countrys$ = "Marshall Islands";
	} else if ( .@country$ == "MK" ) { .@countrys$ = "The former Yugoslav Republic of Macedonia";
	} else if ( .@country$ == "ML" ) { .@countrys$ = "Mali";
	} else if ( .@country$ == "MM" ) { .@countrys$ = "Myanmar";
	} else if ( .@country$ == "MN" ) { .@countrys$ = "Mongolia";
	} else if ( .@country$ == "MO" ) { .@countrys$ = "Macao";
	} else if ( .@country$ == "MP" ) { .@countrys$ = "Northern Mariana Islands";
	} else if ( .@country$ == "MQ" ) { .@countrys$ = "Martinique";
	} else if ( .@country$ == "MR" ) { .@countrys$ = "Mauritania";
	} else if ( .@country$ == "MS" ) { .@countrys$ = "Montserrat";
	} else if ( .@country$ == "MT" ) { .@countrys$ = "Malta";
	} else if ( .@country$ == "MU" ) { .@countrys$ = "Mauritius";
	} else if ( .@country$ == "MV" ) { .@countrys$ = "Maldives";
	} else if ( .@country$ == "MW" ) { .@countrys$ = "Malawi";
	} else if ( .@country$ == "MX" ) { .@countrys$ = "Mexico";
	} else if ( .@country$ == "MY" ) { .@countrys$ = "Malaysia";
	} else if ( .@country$ == "MZ" ) { .@countrys$ = "Mozambique";
	} else if ( .@country$ == "NA" ) { .@countrys$ = "Namibia";
	} else if ( .@country$ == "NC" ) { .@countrys$ = "New Caledonia";
	} else if ( .@country$ == "NE" ) { .@countrys$ = "Niger";
	} else if ( .@country$ == "NF" ) { .@countrys$ = "Norfolk Island";
	} else if ( .@country$ == "NG" ) { .@countrys$ = "Nigeria";
	} else if ( .@country$ == "NI" ) { .@countrys$ = "Nicaragua";
	} else if ( .@country$ == "NL" ) { .@countrys$ = "Netherlands";
	} else if ( .@country$ == "NO" ) { .@countrys$ = "Norway";
	} else if ( .@country$ == "NP" ) { .@countrys$ = "Nepal";
	} else if ( .@country$ == "NR" ) { .@countrys$ = "Nauru";
	} else if ( .@country$ == "NU" ) { .@countrys$ = "Niue";
	} else if ( .@country$ == "NZ" ) { .@countrys$ = "New Zealand";
	} else if ( .@country$ == "OM" ) { .@countrys$ = "Oman";
	} else if ( .@country$ == "PA" ) { .@countrys$ = "Panama";
	} else if ( .@country$ == "PE" ) { .@countrys$ = "Peru";
	} else if ( .@country$ == "PF" ) { .@countrys$ = "French Polynesia";
	} else if ( .@country$ == "PG" ) { .@countrys$ = "Papua New Guinea";
	} else if ( .@country$ == "PH" ) { .@countrys$ = "Philippines";
	} else if ( .@country$ == "PK" ) { .@countrys$ = "Pakistan";
	} else if ( .@country$ == "PL" ) { .@countrys$ = "Poland";
	} else if ( .@country$ == "PM" ) { .@countrys$ = "Saint Pierre and Miquelon";
	} else if ( .@country$ == "PN" ) { .@countrys$ = "Pitcairn";
	} else if ( .@country$ == "PR" ) { .@countrys$ = "Puerto Rico";
	} else if ( .@country$ == "PS" ) { .@countrys$ = "Palestinian Territory, Occupied";
	} else if ( .@country$ == "PT" ) { .@countrys$ = "Portugal";
	} else if ( .@country$ == "PW" ) { .@countrys$ = "Palau";
	} else if ( .@country$ == "PY" ) { .@countrys$ = "Paraguay";
	} else if ( .@country$ == "QA" ) { .@countrys$ = "Qatar";
	} else if ( .@country$ == "RE" ) { .@countrys$ = "Runion";
	} else if ( .@country$ == "RO" ) { .@countrys$ = "Romania";
	} else if ( .@country$ == "RS" ) { .@countrys$ = "Serbia";
	} else if ( .@country$ == "RU" ) { .@countrys$ = "Russian Federation";
	} else if ( .@country$ == "RW" ) { .@countrys$ = "Rwanda";
	} else if ( .@country$ == "SA" ) { .@countrys$ = "Saudi Arabia";
	} else if ( .@country$ == "SB" ) { .@countrys$ = "Solomon Islands";
	} else if ( .@country$ == "SC" ) { .@countrys$ = "Seychelles";
	} else if ( .@country$ == "SD" ) { .@countrys$ = "Sudan";
	} else if ( .@country$ == "SE" ) { .@countrys$ = "Sweden";
	} else if ( .@country$ == "SG" ) { .@countrys$ = "Singapore";
	} else if ( .@country$ == "SH" ) { .@countrys$ = "Ascension and Tristan da Cunha Saint Helena";
	} else if ( .@country$ == "SI" ) { .@countrys$ = "Slovenia";
	} else if ( .@country$ == "SJ" ) { .@countrys$ = "Svalbard and Jan Mayen";
	} else if ( .@country$ == "SK" ) { .@countrys$ = "Slovakia";
	} else if ( .@country$ == "SL" ) { .@countrys$ = "Sierra Leone";
	} else if ( .@country$ == "SM" ) { .@countrys$ = "San Marino";
	} else if ( .@country$ == "SN" ) { .@countrys$ = "Senegal";
	} else if ( .@country$ == "SO" ) { .@countrys$ = "Somalia";
	} else if ( .@country$ == "SR" ) { .@countrys$ = "Suriname";
	} else if ( .@country$ == "ST" ) { .@countrys$ = "Sao Tome and Principe";
	} else if ( .@country$ == "SV" ) { .@countrys$ = "El Salvador";
	} else if ( .@country$ == "SX" ) { .@countrys$ = "Sint Maarten (Dutch part)";
	} else if ( .@country$ == "SY" ) { .@countrys$ = "Syrian Arab Republic";
	} else if ( .@country$ == "SZ" ) { .@countrys$ = "Swaziland";
	} else if ( .@country$ == "TC" ) { .@countrys$ = "Turks and Caicos Islands";
	} else if ( .@country$ == "TD" ) { .@countrys$ = "Chad";
	} else if ( .@country$ == "TF" ) { .@countrys$ = "French Southern Territories";
	} else if ( .@country$ == "TG" ) { .@countrys$ = "Togo";
	} else if ( .@country$ == "TH" ) { .@countrys$ = "Thailand";
	} else if ( .@country$ == "TJ" ) { .@countrys$ = "Tajikistan";
	} else if ( .@country$ == "TK" ) { .@countrys$ = "Tokelau";
	} else if ( .@country$ == "TL" ) { .@countrys$ = "Timor-Leste";
	} else if ( .@country$ == "TM" ) { .@countrys$ = "Turkmenistan";
	} else if ( .@country$ == "TN" ) { .@countrys$ = "Tunisia";
	} else if ( .@country$ == "TO" ) { .@countrys$ = "Tonga";
	} else if ( .@country$ == "TR" ) { .@countrys$ = "Turkey";
	} else if ( .@country$ == "TT" ) { .@countrys$ = "Trinidad and Tobago";
	} else if ( .@country$ == "TV" ) { .@countrys$ = "Tuvalu";
	} else if ( .@country$ == "TW" ) { .@countrys$ = "Taiwan, Province of China";
	} else if ( .@country$ == "TZ" ) { .@countrys$ = "United Republic of Tanzania";
	} else if ( .@country$ == "UA" ) { .@countrys$ = "Ukraine";
	} else if ( .@country$ == "UG" ) { .@countrys$ = "Uganda";
	} else if ( .@country$ == "UM" ) { .@countrys$ = "United States Minor Outlying Islands";
	} else if ( .@country$ == "US" ) { .@countrys$ = "United States";
	} else if ( .@country$ == "UY" ) { .@countrys$ = "Uruguay";
	} else if ( .@country$ == "UZ" ) { .@countrys$ = "Uzbekistan";
	} else if ( .@country$ == "VA" ) { .@countrys$ = "Holy See (Vatican City State)";
	} else if ( .@country$ == "VC" ) { .@countrys$ = "Saint Vincent and the Grenadines";
	} else if ( .@country$ == "VE" ) { .@countrys$ = "Venezuela, Bolivarian Republic of";
	} else if ( .@country$ == "VG" ) { .@countrys$ = "Virgin Islands, British";
	} else if ( .@country$ == "VI" ) { .@countrys$ = "Virgin Islands, U.S.";
	} else if ( .@country$ == "VN" ) { .@countrys$ = "Viet Nam";
	} else if ( .@country$ == "VU" ) { .@countrys$ = "Vanuatu";
	} else if ( .@country$ == "WF" ) { .@countrys$ = "Wallis and Futuna";
	} else if ( .@country$ == "WS" ) { .@countrys$ = "Samoa";
	} else if ( .@country$ == "YE" ) { .@countrys$ = "Yemen";
	} else if ( .@country$ == "YT" ) { .@countrys$ = "Mayotte";
	} else if ( .@country$ == "ZA" ) { .@countrys$ = "South Africa";
	} else if ( .@country$ == "ZM" ) { .@countrys$ = "Zambia";
	} else if ( .@country$ == "ZW" ) { .@countrys$ = "Zimbabwe";
	} else {
		.@countrys$ = "";
	}
	return .@countrys$;
}

function	script	getitemname2	{
	freeloop true;
	deletearray @itemname2_info$;
	.@id = getarg(0);
	.@type = getiteminfo( .@id, 2 );
	.@refine = getarg(2);
	.@card[0] = getarg(4);
	.@card[1] = getarg(5);
	.@card[2] = getarg(6);
	.@card[3] = getarg(7);
	.@bound = getarg(8,0);
	.@ref$ = ( .@refine )? "+"+ .@refine +" " : "" ; // I think no need refinement check for type 4 or 5, the source automatically convert refined etc items into no refinement
	.@slots$ = ( .@slot = getitemslots( .@id ) )? " ["+ .@slot +"]" : "" ;

	if ( .@bound ) {
		@itemname2_info$[0] = "^CCAA00"; // this condition always get overwritten ...
		if ( .@bound == 1 ) @itemname2_info$[5] = "Account";
		else if ( .@bound == 2 ) @itemname2_info$[5] = "Guild";
		else if ( .@bound == 3 ) @itemname2_info$[5] = "Party";
		else if ( .@bound == 4 ) @itemname2_info$[5] = "Character";
	}

	if ( .@type != IT_WEAPON && .@type != IT_ARMOR && .@card[0] != 254 ) { // non-equipable item that isn't signed
		.@pid = .@card[1] + ( ( .@card[1] >= 0 )? 0 : 1 << 16 ) + .@card[2] * ( 1 << 16 );
		@itemname2_info$[1] = ( .@pid )? .@pid : "";
		.@return$ = getitemname( .@id );
	}
	else if ( ( .@type == IT_WEAPON || .@type == IT_ARMOR ) && !.@card[0] && !.@card[1] && !.@card[2] && !.@card[3] ) // equipment with no card, for reduce gotocount
		.@return$ = .@ref$ + getitemname( .@id ) + .@slots$;
	else if ( ( .@type == IT_WEAPON || .@type == IT_ARMOR ) && ( .@card[0] || .@card[1] || .@card[2] || .@card[3] ) && .@card[0] != 254 && .@card[0] != 255 ) { // equipment that has cards, but not a signed item
		.@string$ = "#"+ .@card[0] +"##"+ .@card[1] +"##"+ .@card[2] +"##"+ .@card[3] +"#";
		.@i = 0;
		while ( .@i < 4 ) {
			if ( !compare( .@counted$, "#"+ .@card[.@i] +"#" ) ) {
				.@cnt[.@i] = countstr( .@string$, "#"+ .@card[.@i] +"#" );
				.@counted$ = .@counted$ +"#"+ .@card[.@i] +"#";
			}
			if ( getstrlen( $@cardprefix$[.@card[.@i]] ) && .@cnt[.@i] ) {
				if ( .@cnt[.@i] == 2 )
					.@cnt$[.@i] = "Double";
				else if ( .@cnt[.@i] == 3 )
					.@cnt$[.@i] = "Triple";
				else if ( .@cnt[.@i] == 4 )
					.@cnt$[.@i] = "Quadruple";
				if ( !compare( $@cardprefix$[.@card[.@i]], "of " ) )
					.@prefix$ = .@prefix$ + .@cnt$[.@i] +( ( getstrlen(.@cnt$[.@i]) )? " ": "" )+ $@cardprefix$[.@card[.@i]] +" ";
				else
					.@postfix$ = .@postfix$ +" "+ $@cardprefix$[.@card[.@i]] +( ( getstrlen(.@cnt$[.@i]) )? " ": "" )+ .@cnt$[.@i];
			}
			.@enchant = .@enchant + ( .@card[.@i] && .@i >= .@slot && ( .@card[.@i] /100 ) != 47 && ( .@card[.@i] /100 ) != 48 );
			.@i++;
		}
		if ( .@enchant == 1 )
			@itemname2_info$[0] = "";
		else if ( .@enchant == 2 )
			@itemname2_info$[0] = "";
		else if ( .@enchant == 3 )
			@itemname2_info$[0] = "";
		else if ( .@enchant == 4 )
			@itemname2_info$[0] = "";
		.@return$ = .@ref$ + .@prefix$ + getitemname( .@id ) + .@postfix$ + .@slots$;
	}
	else if ( .@card[0] == 254 || .@card[0] == 255 ) { // signed items
		.@cid = @itemname2_info$[1] = .@card[2] + ( ( .@card[2] >= 0 )? 0 : 1 << 16 ) + .@card[3] * ( 1 << 16 );
		if ( !query_sql("select name from `char` where char_id = "+ .@cid, .@name$) )
			.@name$ = "Unknown";
		.@sc = .@card[1] / 10;
		if ( .@sc == 128 ) {
			.@sc$ = "Very Strong ";
			@itemname2_info$[3] = "1";
		}
		else if ( .@sc == 256 ) {
			.@sc$ = "Very Very Strong ";
			@itemname2_info$[3] = "2";
		}
		else if ( .@sc == 384 ) {
			.@sc$ = "Very Very Very Strong ";
			@itemname2_info$[3] = "3";
		}
		.@ele = .@card[1] % 10;
		if ( .@ele == 1 )
			.@ele$ = @itemname2_info$[4] = "Ice ";
		else if ( .@ele == 2 )
			.@ele$ = @itemname2_info$[4] = "Earth ";
		else if ( .@ele == 3 )
			.@ele$ = @itemname2_info$[4] = "Fire ";
		else if ( .@ele == 4 )
			.@ele$ = @itemname2_info$[4] = "Wind ";
		.@return$ = .@ref$ + .@sc$ + .@name$ +"'s "+ .@ele$ + getitemname( .@id );
	}

	if ( !getarg(1) ) { // unidentified
		if ( .@type == IT_ARMOR ) {
			@itemname2_info$[0] = "";
			@itemname2_info$[2] = .@return$;
			.@loc = getiteminfo( .@id, 5 );
			.@return$ = // TODO : where to get this stuff already ??
				( .@loc & 769 )?
					// from top to bottom : Signpost, Ear Muff, Poo Poo Hat, Funeral Hat, Antenna, Egg Shell, Cap, Sheep Hat, Red Nose, Moustache, Bandana, Flower, Ribbon, Headband, Masquerade, Mask, Glasses, Hairband, Accessory, Else Hat
					( .@id == 2272 )? "Signpost" :
					( .@id == 2283 )? "Ear Muffs" :
					( .@id == 2289 )? "Poo Poo Hat" :
					( .@id == 2290 )? "Funeral Hat" :
					( .@id == 5011 )? "Antenna" :
					( .@id == 5015 )? "Egg Shell" :
					( .@id == 5370 )? "Cap" :
					( .@id == 5133 )? "Sheep Hat" :
					( .@id == 2262 || .@id == 5204 )? "Red Nose" :
					( .@id == 5373 || .@id == 5374 || .@id == 5375 )? "Helm" :
					( .@id == 2237 || .@id == 2238 || .@id == 2240 || .@id == 2241 )? "Moustache" :
					( .@id == 2211 || .@id == 2287 || .@id == 5350 || .@id == 5661 )? "Bandana" :
					( .@id == 2207 || .@id == 2253 || .@id == 712 || .@id == 10009 || .@id == 5351 || .@id == 11712 )? "Flower" :
					( .@id == 5220 || .@id == 5221 || .@id == 5315 || .@id == 2715 || .@id == 5382 || .@id == 5600 )? "Ribbon" :
					( .@id == 5210 || .@id == 5212 || .@id == 5213 || .@id == 5215 || .@id == 5216 || .@id == 5218 )? "Headband" :
					( .@id == 2278 || .@id == 2281 || .@id == 2297 || .@id == 5086 || .@id == 5087 || .@id == 5088 || .@id == 5089 || .@id == 5090 || .@id == 5121 || .@id == 5130 || .@id == 5143 || .@id == 5176 || .@id == 5309 || .@id == 5314 || .@id == 5326 || .@id == 5332 || .@id == 5397 || .@id == 5566 || .@id == 5475 )? "Masquerade" :
					( .@id == 2218 || .@id == 2219 || .@id == 2265 || .@id == 2266 || .@id == 5004 || .@id == 2288 || .@id == 2292 || .@id == 5005 || .@id == 10002 || .@id == 5054 || .@id == 5096 || .@id == 5098 || .@id == 5272 || .@id == 5294 || .@id == 5461 || .@id == 5485 || .@id == 5565 || .@id == 5482 || .@id == 5483 || .@id == 5577 )? "Mask" :
					( .@id == 2201 || .@id == 2202 || .@id == 2203 || .@id == 2204 || .@id == 2205 || .@id == 2212 || .@id == 2239 || .@id == 2242 || .@id == 2243 || .@id == 2260 || .@id == 2263 || .@id == 2271 || .@id == 2276 || .@id == 2291 || .@id == 2296 || .@id == 5006 || .@id == 10014 || .@id == 5288 || .@id == 5325 || .@id == 5401 )? "Glasses" :
					( .@id == 2210 || .@id == 2213 || .@id == 2214 || .@id == 2215 || .@id == 2250 || .@id == 2254 || .@id == 2255 || .@id == 2273 || .@id == 2274 || .@id == 2275 || .@id == 2282 || .@id == 2295 || .@id == 5010 || .@id == 5057 || .@id == 5070 || .@id == 5071 || .@id == 5082 || .@id == 5101 || .@id == 5104 || .@id == 5118 || .@id == 5125 || .@id == 5207 || .@id == 5256 || .@id == 5257 || .@id == 5269 || .@id == 5286 || .@id == 5803 || .@id == 5301 || .@id == 5310 || .@id == 5320 || .@id == 5321 || .@id == 5329 || .@id == 5357 || .@id == 5376 || .@id == 5411 || .@id == 5436 || .@id == 5438 || .@id == 5439 || .@id == 5440 || .@id == 5441 || .@id == 5442 || .@id == 5547 || .@id == 5553 || .@id == 5360 || .@id == 5585 || .@id == 5678 || .@id == 5470 )? "Hairband" :
					( .@id == 2208 || .@id == 2209 || .@id == 2267 || .@id == 2268 || .@id == 2269 || .@id == 2270 || .@id == 2279 || .@id == 2286 || .@id == 2294 || .@id == 2298 || .@id == 2601 || .@id == 2602 || .@id == 2603 || .@id == 2604 || .@id == 2605 || .@id == 2607 || .@id == 2608 || .@id == 2609 || .@id == 2610 || .@id == 2611 || .@id == 2612 || .@id == 2613 || .@id == 2614 || .@id == 2615 || .@id == 2616 || .@id == 2617 || .@id == 2618 || .@id == 2619 || .@id == 2620 || .@id == 5008 || .@id == 5013 || .@id == 2621 || .@id == 2622 || .@id == 2623 || .@id == 2624 || .@id == 2625 || .@id == 2626 || .@id == 2627 || .@id == 2628 || .@id == 10004 || .@id == 10005 || .@id == 10007 || .@id == 10011 || .@id == 10013 || .@id == 10015 || .@id == 10016 || .@id == 2629 || .@id == 2630 || .@id == 5061 || .@id == 5063 || .@id == 5064 || .@id == 5068 || .@id == 5074 || .@id == 5077 || .@id == 5079 || .@id == 5083 || .@id == 5085 || .@id == 2638 || .@id == 2639 || .@id == 2641 || .@id == 5102 || .@id == 2642 || .@id == 2643 || .@id == 2645 || .@id == 2648 || .@id == 2649 || .@id == 2650 || .@id == 2651 || .@id == 2652 || .@id == 2653 || .@id == 2654 || .@id == 2655 || .@id == 2656 || .@id == 5107 || .@id == 5110 || .@id == 5113 || .@id == 5117 || .@id == 2659 || .@id == 2660 || .@id == 2661 || .@id == 2662 || .@id == 2663 || .@id == 2664 || .@id == 2667 || .@id == 5139 || .@id == 5140 || .@id == 2668 || .@id == 5153 || .@id == 2670 || .@id == 5154 || .@id == 5155 || .@id == 5156 || .@id == 2671 || .@id == 5175 || .@id == 2672 || .@id == 2673 || .@id == 5191 || .@id == 5192 || .@id == 5193 || .@id == 5194 || .@id == 5195 || .@id == 5196 || .@id == 5197 || .@id == 2674 || .@id == 2675 || .@id == 5206 || .@id == 2676 || .@id == 5801 || .@id == 5277 || .@id == 5278 || .@id == 2701 || .@id == 2702 || .@id == 2703 || .@id == 2686 || .@id == 2687 || .@id == 2688 || .@id == 2689 || .@id == 2690 || .@id == 2691 || .@id == 2692 || .@id == 2693 || .@id == 2694 || .@id == 2695 || .@id == 2696 || .@id == 2697 || .@id == 2698 || .@id == 2699 || .@id == 2704 || .@id == 2705 || .@id == 5285 || .@id == 5305 || .@id == 5804 || .@id == 5244 || .@id == 5245 || .@id == 5248 || .@id == 5249 || .@id == 5250 || .@id == 5251 || .@id == 5311 || .@id == 5322 || .@id == 2709 || .@id == 2710 || .@id == 2712 || .@id == 2728 || .@id == 2729 || .@id == 2730 || .@id == 2731 || .@id == 2732 || .@id == 2716 || .@id == 2717 || .@id == 2718 || .@id == 2719 || .@id == 2720 || .@id == 2721 || .@id == 2722 || .@id == 2723 || .@id == 2724 || .@id == 2725 || .@id == 2726 || .@id == 2727 || .@id == 2714 || .@id == 5358 || .@id == 5361 || .@id == 5362 || .@id == 2737 || .@id == 5377 || .@id == 2742 ||				 .@id == 2751 || .@id == 2743 || .@id == 2744 || .@id == 2745 || .@id == 2746 || .@id == 2747 || .@id == 2748 || .@id == 2749 || .@id == 2765 || .@id == 2766 || .@id == 2767 || .@id == 2768 || .@id == 2769 || .@id == 2770 || .@id == 2771 || .@id == 2775 || .@id == 5462 || .@id == 5463 || .@id == 5444 || .@id == 5445 || .@id == 5446 || .@id == 2783 || .@id == 2784 || .@id == 2785 || .@id == 2786 || .@id == 10028 || .@id == 10029 || .@id == 10030 || .@id == 10031 || .@id == 10032 || .@id == 10033 || .@id == 10034 || .@id == 10035 || .@id == 10036 || .@id == 2787 || .@id == 2788 || .@id == 2789 || .@id == 2790 || .@id == 2791 || .@id == 2792 || .@id == 2793 || .@id == 5823 || .@id == 5820 || .@id == 5821 || .@id == 2794 || .@id == 2795 || .@id == 5521 || .@id == 2799 || .@id == 2800 || .@id == 2801 || .@id == 2802 || .@id == 2803 || .@id == 2804 || .@id == 2805 || .@id == 2806 || .@id == 2807 || .@id == 2798 || .@id == 5532 || .@id == 2815 || .@id == 5548 || .@id == 5574 || .@id == 5576 || .@id == 2828 || .@id == 5592 || .@id == 2830 || .@id == 2831 || .@id == 5594 || .@id == 5596 || .@id == 5597 || .@id == 5681 || .@id == 2845 || .@id == 2843 || .@id == 2844 || .@id == 2853 || .@id == 2854 || .@id == 2632 || .@id == 2633 )? "Accessory" :
					( .@id == 2206 || .@id == 2216 || .@id == 2217 || .@id == 2220 || .@id == 2221 || .@id == 2222 || .@id == 2223 || .@id == 2226 || .@id == 2227 || .@id == 2236 || .@id == 2244 || .@id == 2245 || .@id == 2247 || .@id == 2248 || .@id == 2251 || .@id == 2252 || .@id == 2277 || .@id == 2280 || .@id == 5003 || .@id == 5012 || .@id == 5016 || .@id == 5018 || .@id == 5019 || .@id == 2264 || .@id == 10006 || .@id == 10010 || .@id == 10012 || .@id == 10018 || .@id == 5058 || .@id == 5059 || .@id == 5060 || .@id == 5062 || .@id == 5065 || .@id == 5067 || .@id == 5069 || .@id == 5073 || .@id == 5075 || .@id == 5076 || .@id == 5078 || .@id == 5084 || .@id == 5092 || .@id == 5093 || .@id == 5097 || .@id == 5099 || .@id == 5103 || .@id == 5136 || .@id == 5105 || .@id == 5106 || .@id == 5108 || .@id == 5109 || .@id == 5111 || .@id == 5112 || .@id == 5114 || .@id == 5115 || .@id == 5116 || .@id == 5119 || .@id == 5120 || .@id == 5122 || .@id == 5123 || .@id == 5129 || .@id == 5132 || .@id == 5137 || .@id == 5138 || .@id == 5141 || .@id == 5144 || .@id == 5145 || .@id == 5146 || .@id == 5147 || .@id == 5150 || .@id == 5158 || .@id == 5167 || .@id == 5168 || .@id == 5170 || .@id == 5172 || .@id == 5173 || .@id == 5174 || .@id == 5188 || .@id == 5189 || .@id == 5190 || .@id == 5198 || .@id == 5200 || .@id == 5199 || .@id == 5201 || .@id == 5202 || .@id == 5208 || .@id == 5209 || .@id == 5214 || .@id == 5219 || .@id == 5222 || .@id == 5227 || .@id == 5228 || .@id == 5229 || .@id == 5230 || .@id == 5231 || .@id == 5232 || .@id == 5233 || .@id == 5234 || .@id == 5235 || .@id == 5236 || .@id == 5237 || .@id == 5252 || .@id == 5253 || .@id == 5254 || .@id == 5255 || .@id == 5258 || .@id == 5226 || .@id == 5259 || .@id == 5260 || .@id == 5263 || .@id == 5264 || .@id == 5243 || .@id == 5270 || .@id == 5273 || .@id == 5274 || .@id == 5275 || .@id == 5276 || .@id == 5802 || .@id == 5282 || .@id == 5283 || .@id == 5284 || .@id == 5287 || .@id == 5289 || .@id == 5290 || .@id == 5291 || .@id == 5293 || .@id == 5302 || .@id == 5304 || .@id == 5307 || .@id == 5308 || .@id == 5312 || .@id == 5316 || .@id == 5317 || .@id == 5318 || .@id == 5319 || .@id == 5323 || .@id == 5324 || .@id == 5330 || .@id == 5806 || .@id == 5333 || .@id == 5334 || .@id == 5335 || .@id == 5336 || .@id == 5337 || .@id == 5338 || .@id == 5339 || .@id == 5340 || .@id == 5341 || .@id == 5342 || .@id == 5343 || .@id == 5344 || .@id == 5345 || .@id == 5346 || .@id == 5353 || .@id == 5347 || .@id == 5348 || .@id == 5349 || .@id == 5352 || .@id == 5809 || .@id == 5354 || .@id == 5355 || .@id == 5356 || .@id == 5810 || .@id == 5359 || .@id == 5366 || .@id == 5368 || .@id == 5369 || .@id == 5371 || .@id == 5379 || .@id == 5380 || .@id == 5381 || .@id == 5383 || .@id == 5384 || .@id == 5372 || .@id == 5378 || .@id == 5386 || .@id == 5387 || .@id == 5388 || .@id == 5390 || .@id == 5392 || .@id == 5393 || .@id == 5812 || .@id == 5395 || .@id == 5405 || .@id == 5364 || .@id == 5365 || .@id == 5367 || .@id == 5406 || .@id == 5407 || .@id == 5408 || .@id == 5409 || .@id == 5410 || .@id == 5399 || .@id == 5413 || .@id == 5414 || .@id == 5415 || .@id == 5416 || .@id == 5417 || .@id == 5418 || .@id == 5422 || .@id == 5423 || .@id == 5424 || .@id == 5425 || .@id == 5426 || .@id == 5427 || .@id == 5428 || .@id == 5429 || .@id == 5430 || .@id == 5432 || .@id == 5433 || .@id == 5450 || .@id == 5456 || .@id == 5457 || .@id == 5458 || .@id == 5459 || .@id == 5478 || .@id == 5484 || .@id == 5813 || .@id == 5486 || .@id == 5487 || .@id == 5488 || .@id == 5437 || .@id == 5443 || .@id == 5447 || .@id == 5448 || .@id == 5449 || .@id == 5490 || .@id == 5435 || .@id == 5491 || .@id == 5494 || .@id == 5496 || .@id == 5497 || .@id == 5499 || .@id == 5500 || .@id == 5501 || .@id == 5502 || .@id == 5504 || .@id == 5505 || .@id == 5503 || .@id == 5815 || .@id == 5816 || .@id == 5818 || .@id == 5822 || .@id == 5506 || .@id == 5507 || .@id == 5508 || .@id == 5509 || .@id == 5510 || .@id == 5511 || .@id == 5519 || .@id == 5522 || .@id == 5523 || .@id == 5524 || .@id == 5525 || .@id == 5526 || .@id == 5527 || .@id == 5528 || .@id == 5824 || .@id == 5530 || .@id == 5531 || .@id == 5534 || .@id == 5535 || .@id == 5537 || .@id == 5538 || .@id == 5539 || .@id == 5544 || .@id == 5561 || .@id == 5562 || .@id == 5431 || .@id == 5826 || .@id == 5568 || .@id == 5572 || .@id == 5479 || .@id == 5480 || .@id == 5481 || .@id == 5575 || .@id == 5583 || .@id == 5586 || .@id == 5587 || .@id == 5827 || .@id == 5593 || .@id == 5601 || .@id == 5434 || .@id == 5466 || .@id == 5467 || .@id == 5468 || .@id == 5471 || .@id == 5465 || .@id == 5472 || .@id == 5473 || .@id == 5474 || .@id == 5476 || .@id == 5469 || .@id == 5563 || .@id == 5690 || .@id == 5739 || .@id == 5740 || .@id == 5744 || .@id == 5745 )? "Hat" :
					"Headgear" :
				( .@loc & 16 )?
					// Clothing, Else Armor
					( .@id == 2301 || .@id == 2302 || .@id == 2303 || .@id == 2304 || .@id == 2305 || .@id == 2306 || .@id == 2307 || .@id == 2308 || .@id == 2309 || .@id == 2310 || .@id == 2311 || .@id == 2318 || .@id == 2319 || .@id == 2320 || .@id == 2321 || .@id == 2322 || .@id == 2323 || .@id == 2324 || .@id == 2325 || .@id == 2326 || .@id == 2327 || .@id == 2330 || .@id == 2331 || .@id == 2332 || .@id == 2333 || .@id == 2334 || .@id == 2335 || .@id == 2336 || .@id == 2337 || .@id == 2338 || .@id == 2339 || .@id == 2361 || .@id == 2362 || .@id == 2363 || .@id == 2370 || .@id == 2371 || .@id == 2372 || .@id == 2373 || .@id == 2374 || .@id == 2397 || .@id == 15012 )? "Clothing" :
					"Armor" :
				( .@loc & 32 )?
					// Guard, Else Shield
					( .@id == 2110 || .@id == 2111 || .@id == 2136 )? "Guard" :
					"Shield" :
				( .@loc & 4 )? "Garment" :
				( .@loc & 64 )? "Shoes" :
				( .@loc & 136 )?
					// Ring, Else Accessory
					( .@id == 2631 || .@id == 2640 || .@id == 2677 || .@id == 2678 || .@id == 2679 || .@id == 2680 || .@id == 2681 || .@id == 2682 || .@id == 2683 || .@id == 2684 || .@id == 2685 || .@id == 2711 || .@id == 5828 )? "Ring" :
					"Accessory" :
				"Equipment - ERROR";
		}
		else if ( .@type == IT_WEAPON ) {
			@itemname2_info$[0] = "";
			@itemname2_info$[2] = .@return$;
			.@view = getiteminfo( .@id, 11 );
			if ( .@view == 1 ) .@return$ = "Dagger";
			else if ( .@view == 2 ) .@return$ = "Sword";
			else if ( .@view == 3 ) .@return$ = "Two-handed Sword";
			else if ( .@view == 4 || .@view == 5 ) .@return$ = "Spear";
			else if ( .@view == 6 || .@view == 7 ) .@return$ = "Axe";
			else if ( .@view == 8 ) .@return$ = "Mace";
			else if ( .@view == 10 ) {
				if ( .@id == 2262 || .@id == 5204 ) .@return$ = "Staff";
				else .@return$ = "Rod";
			}
			else if ( .@view == 11 ) .@return$ = "Bow";
			else if ( .@view == 12 ) .@return$ = "Claw";
			else if ( .@view == 13 ) .@return$ = "Musical Instrument";
			else if ( .@view == 14 ) .@return$ = "Whip";
			else if ( .@view == 15 ) .@return$ = "Book";
			else if ( .@view == 16 ) .@return$ = "Katar";
			else if ( .@view == 17 ) .@return$ = "Revolver";
			else if ( .@view == 18 ) .@return$ = "Rifle";
			else if ( .@view == 19 ) .@return$ = "Gatling Gun";
			else if ( .@view == 20 ) .@return$ = "Shotgun";
			else if ( .@view == 21 ) .@return$ = "Grenade Launcher";
			else if ( .@view == 22 ) .@return$ = "Huuma Shuriken";
			else .@return$ = "Weapon - ERROR";
		}
	}
//	else if ( getarg(3) ) // broken equipment ... seems no longer show red
//		@itemname2_info$[0] = "";

	if ( !getstrlen( @itemname2_info$[0] ) )
		@itemname2_info$[0] = "";

	return .@return$;
}

-	script	itemname2_prefix	FAKE_NPC,{
OnInit:
	$@cardprefix$[4001] = "Lucky";
	$@cardprefix$[4002] = "Vital";
	$@cardprefix$[4003] = "Hard";
	$@cardprefix$[4004] = "Dexterous";
	$@cardprefix$[4005] = "Hallowed";
	$@cardprefix$[4006] = "Lucky";
	$@cardprefix$[4007] = "Beholder";
	$@cardprefix$[4008] = "Extra";
	$@cardprefix$[4009] = "Light";
	$@cardprefix$[4010] = "Wise";
	$@cardprefix$[4011] = "Dynamic";
	$@cardprefix$[4012] = "Rigid";
	$@cardprefix$[4013] = "Excellent";
	$@cardprefix$[4014] = "of Champion";
	$@cardprefix$[4015] = "Quick";
	$@cardprefix$[4016] = "Speedy";
	$@cardprefix$[4017] = "Stun";
	$@cardprefix$[4018] = "Smart";
	$@cardprefix$[4019] = "Martyr";
	$@cardprefix$[4020] = "Blink";
	$@cardprefix$[4021] = "Skillful";
	$@cardprefix$[4022] = "of Spore";
	$@cardprefix$[4023] = "of Desert";
	$@cardprefix$[4024] = "Drowsy";
	$@cardprefix$[4025] = "Keen";
	$@cardprefix$[4026] = "Shrewd";
	$@cardprefix$[4027] = "Athletic";
	$@cardprefix$[4028] = "Double-forced";
	$@cardprefix$[4029] = "Wolverine";
	$@cardprefix$[4030] = "Windy";
	$@cardprefix$[4031] = "of Ares";
	$@cardprefix$[4032] = "of Athena";
	$@cardprefix$[4033] = "Detoxication";
	$@cardprefix$[4034] = "Clever";
	$@cardprefix$[4035] = "Bloody";
	$@cardprefix$[4036] = "Robust";
	$@cardprefix$[4037] = "Untouchable";
	$@cardprefix$[4038] = "of Health";
	$@cardprefix$[4039] = "of Aristotle";
	$@cardprefix$[4040] = "Teleport";
	$@cardprefix$[4041] = "of Sandman";
	$@cardprefix$[4042] = "of Heman";
	$@cardprefix$[4043] = "Hurricane";
	$@cardprefix$[4044] = "Hiding";
	$@cardprefix$[4045] = "Heavy";
	$@cardprefix$[4046] = "of Cleric";
	$@cardprefix$[4047] = "Ghost";
	$@cardprefix$[4048] = "Poison";
	$@cardprefix$[4049] = "Flammable";
	$@cardprefix$[4050] = "of Hermes";
	$@cardprefix$[4051] = "of Flash";
	$@cardprefix$[4052] = "Erudite";
	$@cardprefix$[4053] = "Healing";
	$@cardprefix$[4054] = "Holy";
	$@cardprefix$[4055] = "Ice";
	$@cardprefix$[4056] = "of Warmth";
	$@cardprefix$[4057] = "Silence";
	$@cardprefix$[4058] = "Cranial";
	$@cardprefix$[4059] = "of Cadi";
	$@cardprefix$[4060] = "Clamorous";
	$@cardprefix$[4061] = "Immortal";
	$@cardprefix$[4062] = "Envenom";
	$@cardprefix$[4063] = "Insecticide";
	$@cardprefix$[4064] = "Nimble";
	$@cardprefix$[4065] = "Underneath";
	$@cardprefix$[4066] = "Brutal";
	$@cardprefix$[4067] = "Atomic";
	$@cardprefix$[4068] = "Chemical";
	$@cardprefix$[4069] = "Saharic";
	$@cardprefix$[4070] = "of Witch";
	$@cardprefix$[4071] = "Angelic";
	$@cardprefix$[4072] = "Solid";
	$@cardprefix$[4073] = "Discount";
	$@cardprefix$[4074] = "of Gargantua";
	$@cardprefix$[4075] = "Hypnotic";
	$@cardprefix$[4076] = "Cursing";
	$@cardprefix$[4077] = "Under a Cast";
	$@cardprefix$[4078] = "of Recovery";
	$@cardprefix$[4079] = "of Muscle";
	$@cardprefix$[4080] = "Fisher";
	$@cardprefix$[4081] = "Glorious";
	$@cardprefix$[4082] = "Gigantic";
	$@cardprefix$[4083] = "Homer's";
	$@cardprefix$[4084] = "Blast";
	$@cardprefix$[4085] = "Damned";
	$@cardprefix$[4086] = "Critical";
	$@cardprefix$[4087] = "Order";
	$@cardprefix$[4088] = "Guard";
	$@cardprefix$[4089] = "Aqua";
	$@cardprefix$[4090] = "Amulet";
	$@cardprefix$[4091] = "of Counter";
	$@cardprefix$[4092] = "Boned";
	$@cardprefix$[4093] = "Cure";
	$@cardprefix$[4094] = "Kingbird";
	$@cardprefix$[4095] = "Genie's";
	$@cardprefix$[4096] = "Venomer's";
	$@cardprefix$[4097] = "Green";
	$@cardprefix$[4098] = "of Zephyrus";
	$@cardprefix$[4099] = "of Ifrit";
	$@cardprefix$[4100] = "Soul-Enchanted";
	$@cardprefix$[4101] = "of Gnome";
	$@cardprefix$[4102] = "Mocking";
	$@cardprefix$[4103] = "Clairvoyant";
	$@cardprefix$[4104] = "Chaos";
	$@cardprefix$[4105] = "Unfrozen";
	$@cardprefix$[4106] = "Ancient";
	$@cardprefix$[4107] = "Fledged";
	$@cardprefix$[4108] = "Innoxious";
	$@cardprefix$[4109] = "Flameguard";
	$@cardprefix$[4110] = "Viper's";
	$@cardprefix$[4111] = "Decussate";
	$@cardprefix$[4112] = "Peerless";
	$@cardprefix$[4113] = "of Ghost";
	$@cardprefix$[4114] = "Poisoning";
	$@cardprefix$[4115] = "Malicious";
	$@cardprefix$[4116] = "Divine";
	$@cardprefix$[4117] = "Hybrid";
	$@cardprefix$[4118] = "Dragoon";
	$@cardprefix$[4119] = "Evil";
	$@cardprefix$[4120] = "of Dragoon";
	$@cardprefix$[4121] = "Perfect";
	$@cardprefix$[4122] = "Adurate";
	$@cardprefix$[4123] = "Bearer's";
	$@cardprefix$[4124] = "Plasterer's";
	$@cardprefix$[4125] = "Aqua";
	$@cardprefix$[4126] = "Titan";
	$@cardprefix$[4127] = "Insomniac";
	$@cardprefix$[4128] = "of Deaf";
	$@cardprefix$[4129] = "of Rogue";
	$@cardprefix$[4130] = "Divine";
	$@cardprefix$[4131] = "Hasty";
	$@cardprefix$[4132] = "of Gemstone";
	$@cardprefix$[4133] = "Immune";
	$@cardprefix$[4134] = "Spiritual";
	$@cardprefix$[4135] = "Mirror";
	$@cardprefix$[4136] = "from Hell";
	$@cardprefix$[4137] = "of Infinity";
	$@cardprefix$[4138] = "Satanic";
	$@cardprefix$[4139] = "of Moonlight";
	$@cardprefix$[4140] = "Liberation";
	$@cardprefix$[4141] = "Deadly";
	$@cardprefix$[4142] = "of Berserk";
	$@cardprefix$[4143] = "Neutral";
	$@cardprefix$[4144] = "of Eternity";
	$@cardprefix$[4145] = "of Bigmouth";
	$@cardprefix$[4146] = "Reflect";
	$@cardprefix$[4147] = "Scythe-like";
	$@cardprefix$[4148] = "of Kirin";
	end;
}

function	script	F_RefineTicket	{
	disable_items;
	.@features = getarg(1);
	mes "[" + getarg(0) + "]";
	mes "I'm the Armsmith.";
	mes "I can refine all kinds of armor using a safe refine ticket, so let me";
	mes "know what you want me to refine.";
	next;
	setarray .@position$[1], "Head","Body","Left hand","Robe","Shoes";
	setarray .@position[1], 1,2,3,5,6;
	.@menu$ = "";
	setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
	.@menu$ = "";
	for(.@i = 1; .@i <= 10; ++.@i) {
		if(getequipisequiped(.@i)) {
			.@menu$ += .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";
			.@equipped = 1;
		}
		.@menu$ += ":";
	}
	if (.@equipped == 0) {
		mes "[" + getarg(0) + "]";
		mes "I don't think I can refine any items you have...";
		close;
	}
	.@part = select(.@menu$);

	if(!getequipisequiped(.@part)) { //custom check
		mes "[" + getarg(0) + "]";
		mes "You're not wearing";
		mes "anything there that";
		mes "I can refine.";
		close;
	}
	//Check if the item is refinable...
	if(!getequipisenableref(.@part)) {
		mes "[" + getarg(0) + "]";
		mes "I don't think I can";
		mes "refine this item at all...";
		close;
	}
	//Check to see if the items is already +7
	if(getequiprefinerycnt(.@part) >= 7) {
		mes "[" + getarg(0) + "]";
		mes "I can't refine this";
		mes "any more. +7 is the max";
		mes "refine that I can do with this ticket!";
		close;
	}
	.@refineitemid = getequipid(.@part); // save id of the item
	.@refinerycnt = getequiprefinerycnt(.@part); //save refinery count
	switch(getequipweaponlv(.@part)){
	case 0: 	//Refine Armor
		.@price = 0;
		.@material = 6234;
		.@safe = 7;
		break;
	case 1:	case 2: case 3:	case 4: case 5: 
		mes "[" + getarg(0) + "]";
		mes "I can't refine a";
		mes "weapon with this ticket.";
		close;
	}
	if(.@features != 1) {
		mes "[" + getarg(0) + "]";
		mes "To refine this I need";
		mes "one ^003366"+getitemname(.@material)+"^000000";
		mes "Do you really wish to continue?";
		next;
		if(select("Yes", "No") == 2){
			mes "[" + getarg(0) + "]";
			mes "Yeah...";
			mes "There's no need to";
			mes "rush. Take your time.";
			close;
		}
		if( countitem(.@material) < 1) {
			mes "[" + getarg(0) + "]";
			mes "You don't seem to have";
			mes "enough "+getitemname(.@material)+"...";
			mes "Go get some more. I'll be";
			mes "here all day if you need me.";
			close;
		}
		delitem .@material,1;
		//custom checks
		if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?)
			mes "[" + getarg(0) + "]";
			mes "Look here... you don't have any Items on...";
			close;
		}
		if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
			mes "[" + getarg(0) + "]";
	
			mes "Wait a second...";
			mes "Do you think I'm stupid?!";
			mes "You switched the item while I wasn't looking! Get out of here!";
			close;
		}

		mes "["+getarg(0)+"]";
		successrefitem .@part,7-getequiprefinerycnt(.@part);
		.@win = rand(1,3);
		if (.@win == 1) {
			mes "Perfect!";
			mes "Heh heh!";
			mes "Once again,";
			mes "flawless work";
			mes "from the master~";
		} else if(.@win == 2) {
			mes "Success...!";
			mes "Yet again, my amazing";
			mes "talent truly dazzles";
			mes "and shines today.";
		} else {
			mes "Heh heh!";
			mes "I'm all done.";
			mes "No doubt, my work is";
			mes "to your satisfaction.";
			mes "Sheer, utter perfection~";
		}
		close;
	}
}
