can someone add a blacklist array on this script or make a new one
// -------------------------------------------------------------------------------
// Script Name : Headgear to Costume converter >> Costume to Headgear converter
// -------------------------------------------------------------------------------
// Description :
// - Allows a user to convert the equipped headgear (on Top, Mid or Low) into a
// costume item. It will remove any card and refine of the Item.
// - Allows a user to restore the equipped costume headgear (on Top, Mid or Low)
// into its original form. It will not return any card or refine of the item.
// -------------------------------------------------------------------------------
function script costume {
[email protected]_name$ = getarg(0);
// ======================================================================
[email protected] = 7399; // Item ID Requirement
// ======================================================================
disable_items;
mes "["+ [email protected]_name$ +"]";
mes "Here you can convert your headgears into a Costume Headgear or restore to its Original form.";
next;
switch(select("I want to convert.:I want to restore.:No thanks.")) {
case 1:
setarray [email protected][1], EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW;
for ([email protected] = 1; [email protected]<=3; [email protected]) {
if (getequipisequiped([email protected][[email protected]])) {
[email protected]$ = [email protected]$ + F_getpositionname([email protected][[email protected]]) + "-[" + getequipname([email protected][[email protected]]) + "]";
[email protected] = 1;
}
[email protected]$ = [email protected]$ + ":";
}
getinventorylist;
while( [email protected] < @inventorylist_count ){
if( @inventorylist_bound[[email protected]] && @inventorylist_equip[[email protected]] ){
mes "This item "+getitemname( @inventorylist_id[[email protected]] )+" is Bounded.";
}
if (@inventorylist_expire[[email protected]] && @inventorylist_equip[[email protected]] ) {
mes "This item "+getitemname( @inventorylist_id[[email protected]] )+" is Rental.";
close;
}
set [email protected],[email protected] + 1;
}
if ([email protected] == 0) {
mes "["+ [email protected]_name$ +"]";
mes "You need to wear headgears that I can costume...";
close;
}
mes "["+ [email protected]_name$ +"]";
mes "Please select what to convert.";
mes "Remember, cards and refine will be removed.";
next;
[email protected] = [email protected][ select([email protected]$) ];
if (!getequipisequiped([email protected])) {
mes "["+ [email protected]_name$ +"]";
mes "You're not wearing anything there...";
close;
}
mes "["+ [email protected]_name$ +"]";
mes "You want to Costume your " + getitemname(getequipid([email protected])) + "?";
next;
if (select("Yes, proceed:No, sorry.") == 2) {
mes "["+ [email protected]_name$ + "]";
mes "Need some time to think about it, huh?";
mes "Alright, I can understand.";
close;
}
if ( countitem([email protected]) < 1 ) {
mes "["+ [email protected]_name$ + "]";
mes "You need "+getitemname([email protected]);
end;
}
delitem [email protected],1;
costume [email protected]; // Convert the Headgear
mes "["+ [email protected]_name$ +"]";
mes "Done, enjoy your costume headgear.";
close;
case 2:
setarray [email protected][1], EQI_COSTUME_HEAD_TOP, EQI_COSTUME_HEAD_MID, EQI_COSTUME_HEAD_LOW;
for ([email protected] = 1; [email protected]<=3; [email protected]) {
if (getequipisequiped([email protected][[email protected]])) {
[email protected]$ = [email protected]$ + F_getpositionname([email protected][[email protected]]) + "-[" + getequipname([email protected][[email protected]]) + "]";
[email protected] = 1;
}
[email protected]$ = [email protected]$ + ":";
}
if ([email protected] == 0) {
mes "["+ [email protected]_name$ +"]";
mes "You need to wear costumed headgears that I can restore...";
close;
}
mes "["+ [email protected]_name$ +"]";
mes "Please select what to restore.";
mes "Remember, I will only restore it back without refine and cards.";
next;
[email protected] = [email protected][ select([email protected]$) ];
if (!getequipisequiped([email protected])) {
mes "["+ [email protected]_name$ +"]";
mes "You're not wearing anything there...";
close;
}
if (isequippedcnt(getequipid([email protected])) > 1) {
mes "["+ [email protected]_name$ +"]";
mes "You're wearing too many of the same headgear!";
mes "How am I supposed to know which one to restore?";
mes "See me when you have one equipped.";
close;
}
if (countitem(getequipid([email protected])) > 1) {
mes "["+ [email protected]_name$ +"]";
mes "You have another " + getitemname(getequipid([email protected])) + " with you.";
mes "Put it away before restoring.";
close;
}
mes "[" + [email protected]_name$ + "]";
mes "You want to restore your " + getitemname(getequipid([email protected])) + "?";
next;
if (select("Yes, proceed:No, sorry.") == 2) {
mes "["+ [email protected]_name$ +"]";
mes "Need some time to think about it, huh?";
mes "Alright, I can understand.";
close;
}
if (Zeny < 50000000) {
mes "["+ [email protected]_name$ + "]";
mes "I need atleast 50m to restore your costume headgear";
close;
}
Zeny = Zeny - 50000000;
// Restore headgear by recreating
a = getequipid([email protected]);
delitem a,1;
getitem a,1;
mes "["+ [email protected]_name$ +"]";
mes "Done, enjoy your restored headgear.";
close;
case 3:
mes "["+ [email protected]_name$ +"]";
mes "Very well. Return at once if you seek my services.";
close;
}
}
// ---------------------------------------------------------------------------
// Add more lines to put your npc on different cities (adjust name if desired)
// ---------------------------------------------------------------------------
prontera,143,143,6 script Costume Clown#1 715,{ callfunc "costume","Costume Clown",0; end; }
can someone add a blacklist array on this script or make a new one
// ------------------------------------------------------------------------------- // Script Name : Headgear to Costume converter >> Costume to Headgear converter // ------------------------------------------------------------------------------- // Description : // - Allows a user to convert the equipped headgear (on Top, Mid or Low) into a // costume item. It will remove any card and refine of the Item. // - Allows a user to restore the equipped costume headgear (on Top, Mid or Low) // into its original form. It will not return any card or refine of the item. // ------------------------------------------------------------------------------- function script costume { [email protected]_name$ = getarg(0); // ====================================================================== [email protected] = 7399; // Item ID Requirement // ====================================================================== disable_items; mes "["+ [email protected]_name$ +"]"; mes "Here you can convert your headgears into a Costume Headgear or restore to its Original form."; next; switch(select("I want to convert.:I want to restore.:No thanks.")) { case 1: setarray [email protected][1], EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW; for ([email protected] = 1; [email protected]<=3; [email protected]) { if (getequipisequiped([email protected][[email protected]])) { [email protected]$ = [email protected]$ + F_getpositionname([email protected][[email protected]]) + "-[" + getequipname([email protected][[email protected]]) + "]"; [email protected] = 1; } [email protected]$ = [email protected]$ + ":"; } getinventorylist; while( [email protected] < @inventorylist_count ){ if( @inventorylist_bound[[email protected]] && @inventorylist_equip[[email protected]] ){ mes "This item "+getitemname( @inventorylist_id[[email protected]] )+" is Bounded."; } if (@inventorylist_expire[[email protected]] && @inventorylist_equip[[email protected]] ) { mes "This item "+getitemname( @inventorylist_id[[email protected]] )+" is Rental."; close; } set [email protected],[email protected] + 1; } if ([email protected] == 0) { mes "["+ [email protected]_name$ +"]"; mes "You need to wear headgears that I can costume..."; close; } mes "["+ [email protected]_name$ +"]"; mes "Please select what to convert."; mes "Remember, cards and refine will be removed."; next; [email protected] = [email protected][ select([email protected]$) ]; if (!getequipisequiped([email protected])) { mes "["+ [email protected]_name$ +"]"; mes "You're not wearing anything there..."; close; } mes "["+ [email protected]_name$ +"]"; mes "You want to Costume your " + getitemname(getequipid([email protected])) + "?"; next; if (select("Yes, proceed:No, sorry.") == 2) { mes "["+ [email protected]_name$ + "]"; mes "Need some time to think about it, huh?"; mes "Alright, I can understand."; close; } if ( countitem([email protected]) < 1 ) { mes "["+ [email protected]_name$ + "]"; mes "You need "+getitemname([email protected]); end; } delitem [email protected],1; costume [email protected]; // Convert the Headgear mes "["+ [email protected]_name$ +"]"; mes "Done, enjoy your costume headgear."; close; case 2: setarray [email protected][1], EQI_COSTUME_HEAD_TOP, EQI_COSTUME_HEAD_MID, EQI_COSTUME_HEAD_LOW; for ([email protected] = 1; [email protected]<=3; [email protected]) { if (getequipisequiped([email protected][[email protected]])) { [email protected]$ = [email protected]$ + F_getpositionname([email protected][[email protected]]) + "-[" + getequipname([email protected][[email protected]]) + "]"; [email protected] = 1; } [email protected]$ = [email protected]$ + ":"; } if ([email protected] == 0) { mes "["+ [email protected]_name$ +"]"; mes "You need to wear costumed headgears that I can restore..."; close; } mes "["+ [email protected]_name$ +"]"; mes "Please select what to restore."; mes "Remember, I will only restore it back without refine and cards."; next; [email protected] = [email protected][ select([email protected]$) ]; if (!getequipisequiped([email protected])) { mes "["+ [email protected]_name$ +"]"; mes "You're not wearing anything there..."; close; } if (isequippedcnt(getequipid([email protected])) > 1) { mes "["+ [email protected]_name$ +"]"; mes "You're wearing too many of the same headgear!"; mes "How am I supposed to know which one to restore?"; mes "See me when you have one equipped."; close; } if (countitem(getequipid([email protected])) > 1) { mes "["+ [email protected]_name$ +"]"; mes "You have another " + getitemname(getequipid([email protected])) + " with you."; mes "Put it away before restoring."; close; } mes "[" + [email protected]_name$ + "]"; mes "You want to restore your " + getitemname(getequipid([email protected])) + "?"; next; if (select("Yes, proceed:No, sorry.") == 2) { mes "["+ [email protected]_name$ +"]"; mes "Need some time to think about it, huh?"; mes "Alright, I can understand."; close; } if (Zeny < 50000000) { mes "["+ [email protected]_name$ + "]"; mes "I need atleast 50m to restore your costume headgear"; close; } Zeny = Zeny - 50000000; // Restore headgear by recreating a = getequipid([email protected]); delitem a,1; getitem a,1; mes "["+ [email protected]_name$ +"]"; mes "Done, enjoy your restored headgear."; close; case 3: mes "["+ [email protected]_name$ +"]"; mes "Very well. Return at once if you seek my services."; close; } } // --------------------------------------------------------------------------- // Add more lines to put your npc on different cities (adjust name if desired) // --------------------------------------------------------------------------- prontera,143,143,6 script Costume Clown#1 715,{ callfunc "costume","Costume Clown",0; end; }i've been trying to insert this script
setarray [email protected][0],1166,2527; for(set @i,0;@i < getarraysize([email protected]);set @i,@i+1){ if(countitem([email protected][@i]) >= 1){close;}
From here
https://rathena.org/board/topic/125062-headgear-to-costume-converter-costume-to-headgear-converter/#comment-382628
i failed and i guess it's not to easy for me. thats why i am asking for your little time.
Link to comment
Share on other sites