//===== Hercules Script ======================================
//= Card Removal NPC
//===== By: ==================================================
//= TyrNemesis^
//===== Current Version: =====================================
//= 1.2a
//===== Description: =========================================
//= Removes cards from equipped items.
//===== Additional Comments: =================================
//= 1.0 First version. [TyrNemesis^]
//= 1.2 Optimized and fixed getequipname menu. [Kisuka]
//= 1.2a Added 'disable_items' command. [Euphy]
//============================================================
//@unloadnpc npc Card Remover#evt
//@loadnpc npc/amatsu/event/cardremover.txt

office,117,29,4	script	Card Remover#evt	1_F_ORIENT_04,{

	set .zenycost,0; // Set base cost in zeny of the card remover services
	set .percardcost,0; // set cost per card of the card remover services
	set .faildestroy,0; // Should the card remover have a chance of failure that destroys items? 1 = Yes, 0 = No.
	disable_items;

	if(gettime(GETTIME_WEEKDAY) == 0 || gettime(GETTIME_WEEKDAY) == 1 || gettime(GETTIME_WEEKDAY) == 2 || gettime(GETTIME_WEEKDAY) == 3 || gettime(GETTIME_WEEKDAY) == 4 || gettime(GETTIME_WEEKDAY) == 5 ){
		mes "[Wise Old Woman]";
		mes "I'm so busy now, come back every Saturday 8PM - 9PM.";
		close;
	}
	if(gettime(GETTIME_HOUR) == 20) {
		mes "[Wise Old Woman]";

	mes "Good day, young one. I have the power to remove cards that you have compounded onto your equipment. Does this idea please you?";
	next;
	switch(select("Yes, it does.", "What do you charge?", "No thanks.")) {
	case 1:
		mes "[Wise Old Woman]";
		mes "Very well. Which item shall I examine for you?";
		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$);
		if(!getequipisequiped(.@part)) {
			mes "[Wise Old Woman]";
			mes "Young one... Your not wearing anything there that I can remove cards from.";
			close;
		}
		if(getequipcardcnt(.@part) == 0) {
			mes "[Wise Old Woman]";
			mes "Young one... There are no cards compounded on this item. I can do nothing with it, I'm afraid.";
			close;
		}
		set .@cardcount,getequipcardcnt(.@part);
		if (!checkweight(Knife_,(.@cardcount+1))) {
			mes "^3355FFJust a minute!";
			mes "I can't offer any of my";
			mes "services to you because";
			mes "you're carrying too much";
			mes "stuff. Put your extra items in";
			mes "Kafra Storage and come again~";
			close;
		}
		mes "[Wise Old Woman]";
		mes "This item has " + .@cardcount + " cards compounded on it.";
		mes "Very well. I shall begin.";
		next;
		if(select("No","Yes") == 2){		
			mes "[Wise Old Woman]";
			emotion e_heh;
			successremovecards .@part;
			mes "The process was a success. Here are your cards and your item. Farewell.";
			close;
		}
		mes "[Wise Old Woman]";
		mes "Very well. Return at once if you seek my services.";
		close;
	case 2:
		mes "[Wise Old Woman]";
		mes "My service is FREE but my time is very limited from 8PM-9PM (Sat). So what are you waiting for?";
		close;
	case 3:
		mes "[Wise Old Woman]";
		mes "Very well. Return at once if you seek my services.";
		close;
	}
	
	} else {
		mes "[Wise Old Woman]";
		mes "I'm so busy now, come back later at 8PM.";
		close;
	}
}
