Jump to content
  • 0

H>Modified Costume Enchanter


GM Winter

Question


  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

hello everyone i would like to ask how to remove the selection in available costume to be enchant instead it will just show all the costumes available in your inventory

heres the script:

 

Quote

//===== rAthena Script ======================================= 
//= costume Enchanter
//===== By: ================================================== 
//= L0ne_W0lf
//===== Current Version: ===================================== 
//= 1.3a
//===== Compatible With: ===================================== 
//= rAthena Project
//===== Description: ========================================= 
//= [Official Conversion]
//= Add a +1, +2, or +3 random stat to a specified costume.
//===== Additional Comments: ================================= 
//= 1.0 First version.
//= 1.1 Corrected typo (Sit -> Suit) (bugreport:4586)
//= 1.2 Optimized. [Euphy]
//= 1.3 Fixed some typos and optimized a little more. [Daegaladh]
//= 1.3a Added 'disable_items' command. [Euphy]
//============================================================ 

//payon,161,163,2    script    Costume Enchanter    4_M_FARIYKING,{ 
payon,160,126,5    script    Costume Enchanter    4_f_jp_dark_adelaide,{  //646
    disable_items;
    mes "[Costume Enchanter]";
    if (Zeny >= 5000000) {
        mes "I've been studying ways to enhance an costume to maximize its capability.";
        next;
        mes "[Costume Enchanter]";
        mes "Enchanting is an awesome skill that infuses a mysterious status powers into the costume's hidden socket.";
        next;
        mes "[Costume Enchanter]";
        mes "However, you have to keep in mind that if there are two costumes of the same kind in your possession, the Enchantment will be applied in the order they are placed in your inventory.";
        next;
        mes "[Costume Enchanter]";
        mes "In that case, the Enchantment may be applied to an item which you didn't mean to Enchant. So just bring ^5555ffONE costume^000000 you want enchanted to be safe...";
        next;
        mes "[Costume Enchanter]";
        mes "I'm not responsible for what would happen if you have more than one of the same kind in your inventory.";
        next;
        switch(select("Premium Costumes.:Quest Gacha Costumes.:Premium Gacha Costumes.:WOE Costumes.:KOE Costumes.:PVP Costumes.:Battlepass Costumes.:Maybe next time.")) {
        case 1:
            setarray .@Items[0],61293,61294,61295,61296,61297,61298,61299,61300,61301,61302,61303,61304;
            set .@j,50;
            break;
        case 2:
            setarray .@Items[0],20727,20526,20500,20764,20525,20548;
            set .@j,55;
            break;
        case 3:
            setarray .@Items[0],20516,20530,20579,20509,61209,61206,61207,61208,61316,20514;
            set .@j,55;
            break;    
        case 4:
            setarray .@Items[0],40000,60093,40002,40003,40004,40005,40006,40007,40008,40018,60091,60089,60100,60090,60092;
            set .@j,55;
            break;    
        case 5:
            setarray .@Items[0],61310,61311,61312,61313,61314;
            set .@j,55;
            break;        
        case 6:
            setarray .@Items[0],31885,31803,20448,31719,61495;
            set .@j,55;
            break;        
        case 7:
            setarray .@Items[0],61115,61116,61117,61118,61119,61120;
            set .@j,55;
            break;            
        case 8:
            mes "[Costume Enchanter]";
            mes "Please come back when you have any interest in enchanting your costume.";
            close;
        }
        set .@menu$,"";
        for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+1)
            set .@menu$, .@menu$+getitemname(.@Items[.@i])+((.@k)?" [1]":"")+":";
        callsub S_Enchantcostume, .@Items[select(.@menu$)-1], .@j;
        end;
    }
    mes "I am in charge of Enchanting costumes. Simply put, I've been studying ways to power-up costume.";
    next;
    mes "[Costume Enchanter]";
    mes "If by any chance, you would want to enchant your costume, bring me ^ff00005,000,000^000000 zeny and the costume you want to enchant and you are all set to go.";
    close;

S_Enchantcostume:
    set .@itemid,getarg(0);
    set .@failrate,16;
    mes "[Costume Enchanter]";
    if (countitem(.@itemid) == 1) {
        mes "enchant will cost you 5,000,000 zeny. And there will be a random option enchanted.";
        next;
        mes "[Costume Enchanter]";
        mes "Do you still want to try an Enchant?";
        next;
        if(select("Let me think it over.:Go ahead.") == 1) {
            mes "[Costume Enchanter]";
            mes "Well, I can't blame you. Safety first, eh?";
            mes "Now you have a nice day.";
            close;
        }
        mes "[Costume Enchanter]";
        mes "Quite of an adventurer huh? Well, shall we?";
        close2;
        specialeffect2 EF_MAPPILLAR;
        if (Zeny < 5000000) {
            mes "[Costume Enchanter]";
            mes "Sorry, but you don't have enough zeny.";
            close;
        }
        progressbar "ffff00",7;
        set Zeny, Zeny-5000000;
        delitem .@itemid,1;
        switch (rand(1,.@failrate)) {
            case 1: set .@addpart,4700;break;
            case 2:
            case 3:
            case 4: set .@addpart,4710;break;
            case 5:
            case 6:
            case 7: set .@addpart,4720;break;
            case 8:
            case 9:
            case 10: set .@addpart,4730;break;
            case 11:
            case 12:
            case 13: set .@addpart,4740;break;
            case 14:
            case 15:
            case 16: set .@addpart,4750;break; //1
            default:
                specialeffect2 EF_PHARMACY_FAIL;
                mes "[Costume Enchanter]";
                mes "Well that's too bad.";
                mes "The requested equipment has failed to enchant.";
                close;
        }
        getitem2 .@itemid, 1, 1, 0, 0, 0, 0, 0, .@addpart;
    }
    else {
        mes "Hmm? There's nothing to be enchanted!";
        mes "Please come back with just ONE equipment to be enchanted.";
        close;
    }
}
prontera,165,76,4    duplicate(Costume Enchanter)    Costume Enchanter#prt    4_f_jp_dark_adelaide
prontera,146,149,5    duplicate(Costume Enchanter)    Costume Enchanter#prt1    4_f_jp_dark_adelaide
 

 

1.png

2.png

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

Add an if-statement in the for-loop. Maybe like this:

Enchanter.txt

 

Rynbef~

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

find

for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+1)
	if(countitem(.@Items[.@i]))set .@menu$, .@menu$+getitemname(.@Items[.@i])+((.@k)?" [1]":"")+":";

and replace with

for (.@i = 0; .@i < getarraysize(.@Items); .@i++) {
	if (countitem(.@Items[.@i]))
		.@menu$ = .@menu$ + getitemname(.@Items[.@i]) + ((.@k)?" [1]":"");
	.@menu$ = .@menu$ + ":";
}
Edited by Emistry
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

14 minutes ago, Emistry said:
for (.@i = 0; .@i < getarraysize(.@Items); .@i++) {
	if (countitem(.@Items[.@i]))
		.@menu$ = .@menu$ + getitemname(.@Items[.@i]) + ((.@k)?" [1]":"");
	.@menu$ = .@menu$ + ":";
}

 

hello sir where will i put this i try to insert it but i always got error

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

The version I previously uploaded is already modified.

 

Rynbef~

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

1 hour ago, GM Winter said:

hello sir where will i put this i try to insert it but i always got error

I have updated the provided code, and the script only have one part that used to display the menu, should at least try amend it instead of keep asking for spoonfeed and saying error without provide any details.

 

8 minutes ago, Rynbef said:

The version I previously uploaded is already modified.

this version isn't recommended because there is a small bug where it skip items when attempt to generate the menu, causing wrong item index.

  • Like 1
Link to comment
Share on other sites

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.

×
×
  • Create New...