//ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ\\
// /ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ\ \\
// | Card Removal NPC                                                           | \\
// | Version: 0.2                                                               | \\
// |----------------------------------------------------------------------------| \\
// | Written By: Izkuru                                                         | \\
// | Email:      teh_face_x_o@yahoo.com                                         | \\
// | Tested With: OmniAthena 1033                                               | \\
// |----------------------------------------------------------------------------| \\
// | This is an NPC that will remove all cards compounded into an item that the | \\
// | player has equiped. Uses some global variables for specifying what the     | \\
// | player will have to pay the NPC for this service.                          | \\
// |----------------------------------------------------------------------------| \\
// | To install: Place this TXT file anywhere in your Athena scripts folder,    | \\
// | and include it in scripts.conf. Then, using a GM account, talk to the NPC  | \\
// | and set the price, items, and ammounts that you want it to charge. Then,   | \\
// | make sure to enable the NPC from its GM Menu :P                            | \\
// | Started on: Jun 22 2004                                                    | \\
// | Last Modified: Jun 27 2004                                                 | \\
// |----------------------------------------------------------------------------| \\
// | Changelog:                                                                 | \\
// | Version 0.1 - Jun 22 2004                                                  | \\
// |               Initial release                                              | \\
// | Version 0.2 - Jun 27 2004                                                  | \\
// |               Can now be customized on the fly by a GM. Now uses Global    | \\
// |           variables for not only the cost in zeny, but the items to charge | \\
// |           as well. :D                                                      | \\
// \____________________________________________________________________________/ \\
//________________________________________________________________________________\\

prontera.gat,158,193,4	script	Card Removal	78,{
	if(getgmlevel(readparam(75)) > 0) goto L_GM;
L_Top:
	if($cardRemStatus == 0) goto L_NPCDis;
		mes "[Wise Old Woman]";
		mes "I have the power to remove cards compounded into your equipment.";
	next;
		mes "[Wise Old Woman]";
		mes "However, this service comes at a cost. To work my magic, I need:";
	
	set @lcv,0;
L_CostLoopStart:
	if(@lcv == $cardRemNumItems) goto L_CostLoopEnd;
		mes $cardRemItemAmm[@lcv] + " ^ff9999" + $cardRemItemName$[@lcv] + "^000000";
	set @lcv,@lcv + 1;
	goto L_CostLoopStart;
L_CostLoopEnd:

	next;
		mes "[Wise Old Woman]";
		mes "That, and I charge " + $cardRemCost + "z per card.";
		mes "What do you say?";
	next;
	menu "Sure",L_Item_Chk,"No way!",-;
	
L_No:
		mes "[Wise Old Woman]";
		mes "Fine, come back if you want your cards removed. I'm the only one here who can.";
	close;
	
L_Item_Chk:

	set @lcv,0;
L_ChkLoopStart:
	if(@lcv == $cardRemNumItems) goto L_ChkLoopEnd;
		if(countitem($cardRemItemId[@lcv]) < $cardRemItemAmm[@lcv]) goto L_Item_Err;
	set @lcv,@lcv + 1;
	goto L_ChkLoopStart;
L_ChkLoopEnd:
	
		mes "[Wise Old Woman]";
		mes "Alright, you have your items. Now what do you want me to remove cards from?";
	next;
	menu getequipname(1),L_Slot1,
	     getequipname(2),L_Slot2,
	     getequipname(3),L_Slot3,
	     getequipname(4),L_Slot4,
	     getequipname(5),L_Slot5,
	     getequipname(6),L_Slot6,
	     getequipname(7),L_Slot7,
	     getequipname(8),L_Slot8,
	     getequipname(9),L_Slot9,
	     getequipname(10),L_Slot10,
	     "Cancel",L_No;
L_Slot1:
	set @part,1;
	goto L_CNum_Chk;
L_Slot2:
	set @part,2;
	goto L_CNum_Chk;
L_Slot3:
	set @part,3;
	goto L_CNum_Chk;
L_Slot4:
	set @part,4;
	goto L_CNum_Chk;
L_Slot5:
	set @part,5;
	goto L_CNum_Chk;
L_Slot6:
	set @part,6;
	goto L_CNum_Chk;
L_Slot7:
	set @part,7;
	goto L_CNum_Chk;
L_Slot8:
	set @part,8;
	goto L_CNum_Chk;
L_Slot9:
	set @part,9;
	goto L_CNum_Chk;
L_Slot10:
	set @part,10;
	goto L_CNum_Chk;

L_CNum_Chk:
	set @CNum, getequipcardcnt(@part);
	if(@CNum == 0) goto L_No_Card;
	if(@CNum == 1) set @card$,"card";
	if(@CNum > 1) set @card$,"cards";
		mes "[Wise Old Woman]";
		mes "This item has " + @CNum + " " + @card$ + " in it. That brings the cost to " + ($cardRemCost * @CNum) + "z.";
	next;
		mes "[Wise Old Woman]";
		mes "Do you still want to remove your " + @card$ + " from this item?";
	next;
	menu "Yes",-,"No",L_No;
		mes "[Wise Old Woman]";
		mes "Ok, let me just make sure you have enough Zeny.";
	next;
	if(Zeny < ($cardRemCost * @CNum)) goto L_Z_Err;
		mes "[Wise Old Woman]";
		mes "Ok, you have your Zeny. Now I will take your payment and work my magic.";
	next;
	successremovecards @part;
	set Zeny,zeny - $cardRemCost * @CNum;
	
	set @lcv,0;
L_DelLoopStart:
	if(@lcv == $cardRemNumItems) goto L_DelLoopEnd;
		Delitem $cardRemItemId[@lcv],$cardRemItemAmm[@lcv];
	set @lcv,@lcv + 1;
	goto L_DelLoopStart;
L_DelLoopEnd:	
		mes "[Wise Old Woman]";
		mes "There you go. Now come back when you need more cards removed.";
	close;

L_Item_Err:
	mes "[Wise Old Woman]";
	mes "Sorry, but unless you have the items, I can't work my magic.";
close;
L_Z_Err:
	mes "[Wise Old Woman]";
	mes "Look, I'm not doing this for free. Come back when you have the remaining " + (250000 * @CNum) - zeny + "z.";
close;
L_No_Card:
	mes "[Wise Old Woman]";
	mes "I can't remove your cards if there aren't any there.";
close;

L_NPCDis:
		mes "[Wise Old Woman]";
		mes "I'm sorry, but I have closed up shop for a little while.";
	next;
		mes "[Wise Old Woman]";
		mes "Come back in a little while.";
	close;

L_GM:
		mes "[Card Removal - GM CP]";
		mes "Welcome, GM " + strcharinfo(0) + ". Would you like to configure the Card Removal NPC?";
	next;
	menu "Yes",-,"No",L_Top;

L_GMMenu:
		mes "[Card Removal - GM CP]";
		mes "What would you like to change?";
	next;
	menu "Set Zeny cost",L_GMSetZ,"Set items",L_GMSetI,"Enable/Disable NPC",L_GMToggleNPC,"Nevermind",-;
		mes "[Card Removal - GM CP]";
		mes "Would you like to continue with the NPC like normal?";
	next;
	menu "Yes",L_Top,"No",-;
		mes "[Card Removal - GM CP]";
		mes "Have a nice day, GM " + strcharinfo(0) + ".";
	close;

L_GMSetZ:
		mes "[Card Removal - GM CP]";
		mes "Current Zeny cost is " + $cardRemCost + "z per card.";
		mes "What would you like to change this value to?";
	next;
	input @cost;
	if(@cost < 0) goto L_GMInv;
	set $cardRemCost,@cost;
		mes "[Card Removal - GM CP]";
		mes "Zeny cost has been changed to " + $cardRemCost + "z per card.";
	next;
	goto L_GMMenu;

L_GMSetI:
		mes "[Card Removal - GM CP]";
		mes "What do you want to do?";
	next;
	menu "Change number of items",L_GMSetNumItems,"Set item Ids/names",L_GMSetItemIds,"Set item ammounts",L_GMSetItemAmm,"Nevermind",L_GMMenu;

L_GMSetNumItems:
		mes "[Card Removal - GM CP]";
		mes "The current number of items is " + $cardRemNumItems + ".";
		mes "What would you like to change this to?";
		mes "[Enter a number between 0 and 10]";
	next;
	input @num;
	if(@num < 0 || @num > 10) goto L_GMInv;
	set $cardRemNumItems, @num;
		mes "[Card Removal - GM CP]";
		mes "Number of items has been changed to " + $cardRemNumItems + ".";
	next;
	goto L_GMMenu;

L_GMSetItemIds:
		mes "[Card Removal - GM CP]";
		mes "Which item would you like to modify?";
		mes "[Enter a number between 1 and " + $cardRemNumItems + "]";
	next;
	input @number;
	if(@number < 1 || @number > $cardRemNumItems) goto L_GMInvIndex;
		mes "[Card Removal - GM CP]";
		mes "The current item in spot number " + @number + " is " + $cardRemItemName$[@number - 1] + " [ ID: " + $cardRemItemId[@number - 1] + " ]";
	next;
		mes "[Card Removal - GM CP]";
		mes "What would you like to change this to?";
		mes "[Enter the item id]";
	next;
	input @itemId;
	set @itemName$,getitemname(@itemId);
		mes "[Card Removal - GM CP]";
		mes "Server name for item id " + @itemId + " is " + @itemName$ + ".";
		mes "Would you like to modify this name?";
	next;
	menu "Yes",-,"No",L_GMSetItemIdsDo;
		mes "[Card Removal - GM CP]";
		mes "What would you like the name for this item to be?";
	next;
	input @itemName$;
L_GMSetItemIdsDo:
	set $cardRemItemName$[@number - 1],@itemName$;
	set $cardRemItemId[@number - 1],@itemId;
		mes "[Card Removal - GM CP]";
		mes "Changed item in spot number " + @number + " to " + $cardRemItemName$[@number - 1] + " [ ID: " + $cardRemItemId[@number - 1] + " ]";
	next;
	goto L_GMMenu;

L_GMSetItemAmm:
		mes "[Card Removal - GM CP]";
		mes "Which item ammount would you like to modify?";
		mes "[Enter a number between 1 and " + $cardRemNumItems + "]";
	next;
	input @number;
	if(@number < 1 || @number > $cardRemNumItems) goto L_GMInvIndexAmm;
		mes "[Card Removal - GM CP]";
		mes "The current item ammount for spot number " + @number + " is " + $cardRemItemAmm[@number - 1] + ".";
	next;
L_GMSetItemAmmInp:
		mes "[Card Removal - GM CP]";
		mes "What would you like to change this to?";
	next;
	input @ammount;
	if(@ammount < 0 || @ammount > 30000) goto L_GMInvNumberAmm;
	set $cardRemItemAmm[@number - 1],@ammount;
		mes "[Card Removal - GM CP]";
		mes "The item ammount for spot number " + @number + " has been changed to " + $cardRemItemAmm[@number - 1] + ".";
	next;
	goto L_GMMenu;

L_GMToggleNPC:
	if($cardRemStatus == 1) goto L_GMNPCOn;
		mes "[Card Removal - GM CP]";
		mes "The NPC is currently disabled.";
		mes "Now enableing the NPC.";
	next;
	set $cardRemStatus,1;
	goto L_GMMenu;
	L_GMNPCOn:
		mes "[Card Removal - GM CP]";
		mes "The NPC is currently enabled.";
		mes "Now disableing the NPC.";
	next;
	set $cardRemStatus,0;
	goto L_GMMenu;
	
L_GMInvIndex:
		mes "[Card Removal - GM CP]";
		mes "Invalid item number.";
	next;
	goto L_GMSetItemIds;
	
L_GMInvIndexAmm:
		mes "[Card Removal - GM CP]";
		mes "Invalid item number.";
	next;
	goto L_GMSetItemAmm;
	
L_GMInvNumberAmm:
		mes "[Card Remocal - GM CP]";
		mes "Invalid item ammount.";
	next;
	goto L_GMSetItemAmmInp;

}

    Source: geocities.com/teh_face_x_o