Jump to content
  • 0

Question

Posted (edited)

Well hi guys, my first post hope im doing everything correct.

I managed to make the @costumeitem command work for my rAthena but when i enable this costume npc it wont find any headgears that im using, in exchange it can find my weapons... anybody can point out where is the error??


prontera,149,214,4 script Costumer#cs_0 421,{
mes "[Clown]";
mes "Here you can convert your headgears into a Costume Headgear or restore to its Original form.";
switch(select("I want to convert.:I want to restore.:No thanks.")) {
case 1:
next;
mes "[Clown]";
mes "Please, select what to convert.";
mes "Remember, cards and refine will be removed.";
next;
setarray .@Position$[1],"Top","Mid","Low";
setarray .@Position[1],     1,    9,   10;
set .@Menu$,"";
for( set .@i, 1; .@i < 5; set .@i, .@i + 1 )
{
if( getequipisequiped(.@Position[.@i]) )
set .@Menu$, .@Menu$ + .@Position$[.@i] + "-" + "[" + getequipname(.@Position[.@i]) + "]";
set .@Menu$, .@Menu$ + ":";
}
set .@Part, .@Position[ select(.@Menu$) ];
set .@id, getequipid(.@Part);
set .@ref, getequiprefinerycnt(.@Part);
if( !getequipisequiped(.@Part) )
{
mes "[Clown]";
mes "Your not wearing anything there...";
close;
}
mes "[Clown]";
mes "You want to Costume your " + getitemname(getequipid(.@Part)) + "?";
next;
if( select("Yes, proceed:No, I am sorry.") == 2 )
{
mes "[Clown]";
mes "Need some time to think about it, huh?";
mes "Alright, I can understand.";
close;
}
for(set .@i,0; .@i<4; set .@i,.@i+1)
set .@slot[.@i], getequipcardid(.@Part,.@i);
if (.@slot[0]>4000 && .@slot[0]<5000) { // If it has card don't convert
mes "[Clown]";
mes "A card? Here?!";
mes "As I said before, I don't convert headgear with cards.";
emotion e_hmm;
close;
}
getinventorylist;
for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1)
if (@inventorylist_expire[.@i] != 0 && @inventorylist_equip[.@i] != 0) { // If rental don't convert
mes "[Clown]";
mes "Sorry, I don't convert a rental headgear!";
emotion e_hmm;
close;
}
if (.@ref > 0) { // If refine don't convert
mes "[Clown]";
mes "Sorry please keep in mind.";
mes "I don't convert headgear with refine.";
emotion e_hmm;
close;
}
if (!countitem(.@id)) { 
mes "[Clown]";
mes "Where is "+getitemname(@id)+"...?";
npctalk "You're a snoozy cheater!";
logmes "CHEATER: Tried to sign an item not having it: "+getitemname(@id);
emotion e_wah;
close;
}
costume .@Part; // Convert the Headgear
mes "[Clown]";
mes "Done, enjoy your costume headgear.";
close;
case 2:
next;
mes "Please, select what to restore.";
mes "Remember, I will only restore it back without refine and cards.";
next;
setarray .@Position$[1],"Top","Mid","Low";
setarray .@Position[1],     13,    12,   11;
set .@Menu$,"";
for( set .@i, 1; .@i < 5; set .@i, .@i + 1 )
{
if( getequipisequiped(.@Position[.@i]) )
set .@Menu$, .@Menu$ + .@Position$[.@i] + "-" + "[" + getequipname(.@Position[.@i]) + "]";
set .@Menu$, .@Menu$ + ":";
}
set .@Part, .@Position[ select(.@Menu$) ];
if( !getequipisequiped(.@Part) )
{
mes "[Clown]";
mes "Your not wearing anything there...";
close;
}
mes "[Clown]";
mes "You want to restore your " + getitemname(getequipid(.@Part)) + "?";
next;
if( select("Yes, proceed:No, I am sorry.") == 2 )
{
mes "[Clown]";
mes "Need some time to think about it, huh?";
mes "Alright, I can understand.";
close;
}
a = getequipid(.@Part);
delitem a,1;
getitem a,1;

mes "[Clown]";
mes "Done, enjoy your restored headgear.";
close;
case 3:
mes "[Clown]";
mes "Very well. Return at once if you seek my services.";
close;
}
}
Edited by alternate

10 answers to this question

Recommended Posts

  • 0
Posted (edited)

Try

 

change

setarray .@Position[1],     1,    9,   10;

to

setarray .@Position[1],     6,    5,   4;

change

setarray .@Position[1],     13,    12,   11;

to

setarray .@Position[1],     10,    11,   12;
Edited by Technoken
  • Upvote 1
  • 0
Posted
// -------------------------------------------------------------------------------
// 	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.
// -------------------------------------------------------------------------------
-	script	Costume Clown	-1,{
	mes "[Clown]";
	mes "Here you can convert your headgears into a Costume Headgear or restore to its Original form.";
	switch(select("I want to convert.:I want to restore.:No thanks.")) {
	case 1:
			next;
			mes "Please, select what to convert.";
			mes "Remember, cards and refine will be removed.";
			next;
				setarray .@Position$[1],"Top","Mid","Low","Garment";
				setarray .@Position[1],     EQI_HEAD_TOP,    EQI_HEAD_MID,   EQI_HEAD_LOW, EQI_GARMENT;
				set .@Menu$,"";
			for( set .@i, 1; .@i < 6; set .@i, .@i + 1 )
			{
				if( getequipisequiped(.@Position[.@i]) )
				set .@Menu$, .@Menu$ + .@Position$[.@i] + "-" + "[" + getequipname(.@Position[.@i]) + "]";
				set .@Menu$, .@Menu$ + ":";
			}
			set .@Part, .@Position[ select(.@Menu$) ];
			if( !getequipisequiped(.@Part) )
			{
				mes "[Clown]";
				mes "You are not wearing anything there."; 
				close;
			}
			mes "[Clown]";
			mes "You want to Costume your " + getitemname(getequipid(.@Part)) + "?";
			next;
			if( select("Yes, proceed:No, I am sorry.") == 2 )
			{
				mes "[Clown]";
				mes "Need some time to think about it, huh?";
				mes "Alright, I can understand.";
				close;
			}
			costume .@Part; // Convert the Headgear
			mes "[Clown]";
			mes "Done, enjoy your costume headgear.";
			close;
	case 2:
			next;
			mes "Please, select what to restore.";
			mes "Remember, I will only restore it back without refine and cards.";
			next;
				setarray .@Position$[1],"Top","Mid","Low", "Garment";
				setarray .@Position[1], EQI_COSTUME_HEAD_TOP, EQI_COSTUME_HEAD_MID, EQI_COSTUME_HEAD_LOW, EQI_COSTUME_GARMENT;
				set .@Menu$,"";
			for( set .@i, 1; .@i < 6; set .@i, .@i + 1 )
			{
				if( getequipisequiped(.@Position[.@i]) )
				set .@Menu$, .@Menu$ + .@Position$[.@i] + "-" + "[" + getequipname(.@Position[.@i]) + "]";
				set .@Menu$, .@Menu$ + ":";
			}
			set .@Part, .@Position[ select(.@Menu$) ];
			if( !getequipisequiped(.@Part) )
			{
				mes "[Clown]";
				mes "You are not wearing anything there.";
				close;
			}
			mes "[Clown]";
			mes "You want to restore your " + getitemname(getequipid(.@Part)) + "?";
			next;
			if( select("Yes, proceed:No, I am sorry.") == 2 )
			{
				mes "[Clown]";
				mes "Need some time to think about it, huh?";
				mes "Alright, I can understand.";
				close;
			}
			.@a = getequipid(.@Part);			
			delitem .@a,1;
			getitem .@a,1;
			
			mes "[Clown]";
			mes "Done, enjoy your restored headgear.";
			close;
	case 3:
		mes "[Clown]";
		mes "Very well. Return at once if you seek my services.";
		close;
	}
}
// --------------------------------------------------------------------------
// Use duplicates to put your npc on different cities
// --------------------------------------------------------------------------
prontera,155,181,4	duplicate(Costume Clown)	Costume Clown#1	715

We having a change on our constant. Please use script above.

  • Upvote 1
  • 0
Posted (edited)

Thanks for the answer guys! 

@Technoken & @Elsa Mist

Tried your suggested changes and it worked for that problem. what i found out now is that it recognizes the item correctly but it wont change the item into costume, the command @costumeitem is working, ill try to find out whats wrong.

i appreciate the attention and any more suggestions

@edit

i managed it to make the npc restore an costume item to normal item but i cant make it change a normal item to costume, also if i have the same costume and item equipped it will duplicate the item without deleting the costume item

any ideas?

On 6/30/2016 at 3:07 AM, Elsa Mist said:

// -------------------------------------------------------------------------------
// 	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.
// -------------------------------------------------------------------------------
-	script	Costume Clown	-1,{
	mes "[Clown]";
	mes "Here you can convert your headgears into a Costume Headgear or restore to its Original form.";
	switch(select("I want to convert.:I want to restore.:No thanks.")) {
	case 1:
			next;
			mes "Please, select what to convert.";
			mes "Remember, cards and refine will be removed.";
			next;
				setarray .@Position$[1],"Top","Mid","Low","Garment";
				setarray .@Position[1],     EQI_HEAD_TOP,    EQI_HEAD_MID,   EQI_HEAD_LOW, EQI_GARMENT;
				set .@Menu$,"";
			for( set .@i, 1; .@i < 6; set .@i, .@i + 1 )
			{
				if( getequipisequiped(.@Position[.@i]) )
				set .@Menu$, .@Menu$ + .@Position$[.@i] + "-" + "[" + getequipname(.@Position[.@i]) + "]";
				set .@Menu$, .@Menu$ + ":";
			}
			set .@Part, .@Position[ select(.@Menu$) ];
			if( !getequipisequiped(.@Part) )
			{
				mes "[Clown]";
				mes "You are not wearing anything there."; 
				close;
			}
			mes "[Clown]";
			mes "You want to Costume your " + getitemname(getequipid(.@Part)) + "?";
			next;
			if( select("Yes, proceed:No, I am sorry.") == 2 )
			{
				mes "[Clown]";
				mes "Need some time to think about it, huh?";
				mes "Alright, I can understand.";
				close;
			}
			costume .@Part; // Convert the Headgear
			mes "[Clown]";
			mes "Done, enjoy your costume headgear.";
			close;
	case 2:
			next;
			mes "Please, select what to restore.";
			mes "Remember, I will only restore it back without refine and cards.";
			next;
				setarray .@Position$[1],"Top","Mid","Low", "Garment";
				setarray .@Position[1], EQI_COSTUME_HEAD_TOP, EQI_COSTUME_HEAD_MID, EQI_COSTUME_HEAD_LOW, EQI_COSTUME_GARMENT;
				set .@Menu$,"";
			for( set .@i, 1; .@i < 6; set .@i, .@i + 1 )
			{
				if( getequipisequiped(.@Position[.@i]) )
				set .@Menu$, .@Menu$ + .@Position$[.@i] + "-" + "[" + getequipname(.@Position[.@i]) + "]";
				set .@Menu$, .@Menu$ + ":";
			}
			set .@Part, .@Position[ select(.@Menu$) ];
			if( !getequipisequiped(.@Part) )
			{
				mes "[Clown]";
				mes "You are not wearing anything there.";
				close;
			}
			mes "[Clown]";
			mes "You want to restore your " + getitemname(getequipid(.@Part)) + "?";
			next;
			if( select("Yes, proceed:No, I am sorry.") == 2 )
			{
				mes "[Clown]";
				mes "Need some time to think about it, huh?";
				mes "Alright, I can understand.";
				close;
			}
			.@a = getequipid(.@Part);			
			delitem .@a,1;
			getitem .@a,1;
			
			mes "[Clown]";
			mes "Done, enjoy your restored headgear.";
			close;
	case 3:
		mes "[Clown]";
		mes "Very well. Return at once if you seek my services.";
		close;
	}
}
// --------------------------------------------------------------------------
// Use duplicates to put your npc on different cities
// --------------------------------------------------------------------------
prontera,155,181,4	duplicate(Costume Clown)	Costume Clown#1	715

We having a change on our constant. Please use script above.

 

Hi Elsa, i have tested your script, i removed the garment part from the script and i found out that it wont change the normal item to costume, and when i try to convert a costume to regular it gives me the normal item without removing the costume from my alt q... i think its pretty much the same think happening at the other script... any thoughts?

Edited by alternate
  • 0
Posted (edited)

Edit:

Fixed it


Hi,

I also have issues with that npc but the link for the topic doesn't work anymore.

I made it so it can see the headgear in my char's equipment, but it only converts it to the same hat named nameless's cap for exemple. @alternate would it be possible to share your solution if you're still around?

Edited by Sirique
  • 0
Posted
On 8/16/2019 at 1:44 AM, Sirique said:

Edit:

Fixed it


Hi,

I also have issues with that npc but the link for the topic doesn't work anymore.

I made it so it can see the headgear in my char's equipment, but it only converts it to the same hat named nameless's cap for exemple. @alternate would it be possible to share your solution if you're still around?

Hi Sirique, is it possible for you to share the script? thanks!

  • 0
Posted

// -------------------------------------------------------------------------------
//     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    {
    .@npc_name$ = getarg(0);
    disable_items;
    mes "[ ^FF7700Costume Clown^000000 ]";
    mes "Here you can convert your headgears into a Costume Headgear or restore to its Original form.";
    next;
    mes "[ ^FF7700Costume Clown^000000 ]";
    mes "I cannot convert Rental or bounded items into costume.";
    next;
    mes "[ ^FF7700Costume Clown^000000 ]";
    mes "I will require 1 Costume Ticket to transform an ordinary headgear into a costume.";
    mes "";
    mes "Restoring a costume back to it's original form will cost ^9900002,000,000^000000 Zeny.";
    next;
    switch(select("I want to convert.:I want to restore.:No thanks.")) {
    case 1:
        setarray .@indices[1], EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW;
        for (.@i = 1; .@i<=3; ++.@i) {
            if (getequipisequiped(.@indices[.@i])) {
                .@menu$ = .@menu$ + F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]";
                .@equipped = 1;
            }
            .@menu$ = .@menu$ + ":";
        }
        if (.@equipped == 0) {
            mes "[ ^FF7700Costume Clown^000000 ]";
            mes "You need to wear headgears that I can costume...";
            close;
        }
        if (countitem(60000) < 1){
        mes "You do not have the Costume Ticket from your inventory.";
        close;
        }
        mes "[ ^FF7700Costume Clown^000000 ]";
        mes "Please select what to convert.";
        mes "^FF0000 Take note: ^0000FF";
        mes "^0B27F3 I cannot convert items that has a refine OR a card inserted. ^0000FF";
        next;
        .@part = .@indices[ select(.@menu$) ];
        if (!getequipisequiped(.@part)) {
            mes "[ ^FF7700Costume Clown^000000 ]";
            mes "You're not wearing anything there...";
            close;
        }
        getinventorylist;
            for (.@i = 0; .@i < @inventorylist_count; .@i++) {
            //    mes "test " + getequipid(EQI_HEAD_TOP) + " test";
 //     if (@inventorylist_bound[.@i]) {
 //          mes "you are wearing "+ @inventorylist_equip[.@i];
//        mes "you are wearin1g "+   @inventorylist_id[.@i] ;
//        mes "wew" + getequipid(.@part);
//close;
//          
 //      }
    
                if (@inventorylist_expire[.@i]) {
                    if (@inventorylist_equip[.@i] > 0 && @inventorylist_id[.@i] == getequipid(.@part)){
                        mes "Your item ( ^FF0000"+ getitemname(getequipid(.@part)) + "^0000FF ) is rental. I cannot convert this item.";
                        mes "";
                    close;
                    }
                }
                if (@inventorylist_bound[.@i] ) {
                    if (@inventorylist_equip[.@i] > 0 && @inventorylist_id[.@i] == getequipid(.@part)){
                        mes "Your item ( ^FF0000"+ getitemname(getequipid(.@part)) + "^0000FF ) is bounded. I cannot convert this item";
                        mes"";
                    close;
                    }                
                }
            
            }
        if ( getequiprefinerycnt(.@part) >= 1 ) {
            mes "[ ^FF7700Costume Clown^000000 ]";
            mes "Your item (" + getitemname(getequipid(.@part)) + ") that you want to convert has a refine. I cannot convert this to costume.";
            close;
        }
        set .@cardcount,getequipcardcnt(.@part);
        if(.@cardcount > 0) {
            mes "[ ^FF7700Costume Clown^000000 ]";
            mes "Young one... There are card/s compounded on this item (" + getitemname(getequipid(.@part)) + "). I can do nothing with it, I'm afraid.";
            close;
        }
        mes "[ ^FF7700Costume Clown^000000 ]";
        mes "You want to Costume your " + getitemname(getequipid(.@part)) + "?";
        next;

        if (select("Yes, proceed:No, sorry.") == 2) {
            mes "["+ .@npc_name$ + "]";
            mes "Need some time to think about it, huh?";
            mes "Alright, I can understand.";
            close;
        }

        costume .@part; // Convert the Headgear
        delitem 60000,1;
        mes "[ ^FF7700Costume Clown^000000 ]";
        mes "Done, enjoy your costume headgear.";
        close;
    case 2:
        setarray .@indices[1], EQI_COSTUME_HEAD_TOP, EQI_COSTUME_HEAD_MID, EQI_COSTUME_HEAD_LOW;
        for (.@i = 1; .@i<=3; ++.@i) {
            if (getequipisequiped(.@indices[.@i])) {
                .@menu$ = .@menu$ + F_getpositionname(.@indices$[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]";
                .@equipped = 1;
            }
            .@menu$ = .@menu$ + ":";
        }

        if (.@equipped == 0) {
            mes "[ ^FF7700Costume Clown^000000 ]";
            mes "You need to wear costumed headgears that I can restore...";
            close;
        }

        mes "[ ^FF7700Costume Clown^000000 ]";
        mes "Please select what to restore.";
        mes "Remember, I will only restore it back without refine and cards.";
        mes "I also need 2,000,000 Zeny to restore.";
        next;

        .@part = .@indices[ select(.@menu$) ];
        if (!getequipisequiped(.@part)) {
            mes "[ ^FF7700Costume Clown^000000 ]";
            mes "You're not wearing anything there...";
            close;
        }
        if (Zeny < 2000000) {
        mes " You do not have enough Zeny. I require 2,000,000 Zeny to use my service.";
        close;
        }
        if (isequippedcnt(getequipid(.@part)) > 1) {
            mes "[ ^FF7700Costume Clown^000000 ]";
            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(.@part)) > 1) {
            mes "[ ^FF7700Costume Clown^000000 ]";
            mes "You have another " + getitemname(getequipid(.@part)) + " with you.";
            mes "Put it away before restoring.";
            close;
        }

        mes "[" + .@npc_name$ + "]";
        mes "You want to restore your " + getitemname(getequipid(.@part)) + "?";
        next;

        if (select("Yes, proceed:No, sorry.") == 2) {
            mes "[ ^FF7700Costume Clown^000000 ]";
            mes "Need some time to think about it, huh?";
            mes "Alright, I can understand.";
            close;
        }

        // Restore headgear by recreating
        a = getequipid(.@part);
        delitem a,1;
        getitem a,1;
        set Zeny, Zeny-2000000;
        mes "[ ^FF7700Costume Clown^000000 ]";
        mes "Done, enjoy your restored headgear.";
        close;
    case 3:
        mes "[ ^FF7700Costume Clown^000000 ]";
        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,155,177,5    script    Costume Clown#1    715,{ 
callfunc "costume","Costume Clown",0; 
end; 
}

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...