Jump to content
  • 0

Change Breakable to not Break when fail on Enchantment


eirwanda

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   3
  • Joined:  11/13/16
  • Last Seen:  

i am trying to change this basic script Apprentice Blacksmith, from armor enchant to headgear enchantment 

i will edit the itemid later if this is work 

This is the script

Spoiler

//===== rAthena Script ======================================= 
//= Headgear 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 Headgear.
//===== Additional Comments ================================= 
//= 1.0 First version.
//= 1.1 Corrected typo (Sit - Suit) (bugreport4586)
//= 1.2 Optimized. [Euphy]
//= 1.3 Fixed some typos and optimized a little more. [Daegaladh]
//= 1.3a Added 'disable_items' command. [Euphy]
//============================================================ 

prontera,163,60,2    script    Dorry    73,{
    disable_items;
    mes "[Dorry]";
    if (Zeny >= 500000) {
        mes "I've been studying ways to enhance an Headgear to maximize its capability.";
        next;
        mes "[Dorry]";
        mes "Enchanting is an awesome skill that infuses a mysterious status powers into the Headgear's hidden socket.";
        next;
        mes "[Dorry]";
        mes "However, you have to keep in mind that if there are two Headgear of the same kind in your possession, the Enchantment will be applied in the order they are placed in your inventory.";
        next;
        mes "[Dorry]";
        mes "In that case, the Enchantment may be applied to an item which you didn't mean to Enchant. So just bring ^5555ffONE Headgear^000000 you want enchanted to be safe...";
        next;
        mes "[Dorry]";
        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("Upper Quest Headgear.:Middle Quest Headgear.:Lower Quest Headgear.:Maybe next time.")) {
        case 1:
            setarray .@Items[0],2307,2309,2314,2316,2321,2325,2327,2328,2330,2332,2334,2335,2341,2344,2346,2348,2350,2337,2386,2394,2395,2396;
            set .@j,50;
            break;
        case 2:
            setarray .@Items[0],2311,2318,2319,2320,2308,2310,2315,2317,2322,2324,2326,2331,2333,2336,2342,2345,2347,2349,2351;
            set .@j,55;
            set .@k,1;
            break;
        case 3:
            setarray .@Items[0],2364,2365,2391,2374,2375,2376,2377,2378,2379,2380,2381,2382,2387,2388,2389,2390;
            set .@j,60;
            break;
        case 4:
            mes "[Dorry]";
            mes "Please come back when you have any interest in enchanting your Headgear.";
            close;
        }
        set .@menu$,"";
        for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+1)
            set .@menu$, .@menu$+getitemname(.@Items[.@i])+((.@k)?" [1]":"")+":";
        callsub S_EnchantHeadgear, .@Items[select(.@menu$)-1], .@j;
        end;
    }
    mes "I am in charge of Enchanting Headgear. Simply put, I've been studying ways to power-up Headgear.";
    next;
    mes "[Dorry]";
    mes "If by any chance, you would want to enchant your Headgear, bring me 400,000 zeny and the Headgear you want to enchant and you are all set to go.";
    close;

S_EnchantHeadgear:
    set .@itemid,getarg(0);
    set .@failrate,getarg(1);
    mes "[Dorry]";
    if (countitem(.@itemid) == 1) {
        mes "Socket enchant will cost you 400,000 zeny. And there will be a random option enchanted. Of course, there is a chance of breaking your Headgear.";
        next;
        mes "[Dorry]";
        mes "First and most importantly.";
        mes "^ff5555Existing Refine Level of the Headgear";
        mes "and Cards will be GONE.^000000";
        mes "Do you still want to try an Enchant?";
        next;
        if(select("Hmm... Let me think it over.:Go ahead.") == 1) {
            mes "[Dorry]";
            mes "Well, I can't blame you. Safety first, eh?";
            mes "Now you have a nice day.";
            close;
        }
        mes "[Dorry]";
        mes "Quite of an adventurer huh? Well, shall we?";
        close2;
        specialeffect2 EF_MAPPILLAR;
        if (Zeny < 400000) {
            mes "[Dorry]";
            mes "Sorry, but you don't have enough zeny.";
            close;
        }
        progressbar "ffff00",7;
        set Zeny, Zeny-400000;
        delitem .@itemid,1;
        switch (rand(1,.@failrate)) {
            case 1: set .@addpart,4702;break;
            case 2: set .@addpart,4712;break;
            case 3: set .@addpart,4722;break;
            case 4: set .@addpart,4732;break;
            case 5: set .@addpart,4742;break;
            case 6: set .@addpart,4752;break;
            case 7:
            case 8: set .@addpart,4701;break;
            case 9:
            case 10: set .@addpart,4711;break;
            case 11:
            case 12: set .@addpart,4721;break;
            case 13:
            case 14: set .@addpart,4731;break;
            case 15:
            case 16: set .@addpart,4741;break;
            case 17:
            case 18: set .@addpart,4751;break;
            case 19:
            case 20:
            case 21: set .@addpart,4700;break;
            case 22:
            case 23:
            case 24: set .@addpart,4710;break;
            case 25:
            case 26:
            case 27: set .@addpart,4720;break;
            case 28:
            case 29:
            case 30: set .@addpart,4730;break;
            case 31:
            case 32:
            case 33: set .@addpart,4740;break;
            case 34:
            case 35:
            case 36: set .@addpart,4750;break;
            default:
                specialeffect2 EF_PHARMACY_FAIL;
                mes "[Dorry]";
                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;
    }
}
 

 

 

i am only copy,paste it and edit a little bit, and i think i can change it to Headgear Enchantment but i dont know it would be work or not /wah 

please tell me how to change it to be unbreakable after fail on enchantment

 

Thanks for advance

Edited by eirwanda
Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

Please edit your post and use codec box instead of quote, it makes thread, forums clean

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   3
  • Joined:  11/13/16
  • Last Seen:  

On 4/15/2017 at 4:43 PM, Cyro said:

Please edit your post and use codec box instead of quote, it makes thread, forums clean

sorry, thanks to remind me /ok 

 

On 4/15/2017 at 4:38 PM, eirwanda said:

i am trying to change this basic script Apprentice Blacksmith, from armor enchant to headgear enchantment 

i will edit the itemid later if this is work 

This is the script

i am only copy,paste it and edit a little bit, and i think i can change it to Headgear Enchantment but i dont know it would be work or not /wah 

please tell me how to change it to be unbreakable after fail on enchantment

 

Thanks for advance

SOLVED

 

But I want to Change Zeny from Requirement to Jellopy (Example)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  72
  • Reputation:   28
  • Joined:  12/21/16
  • Last Seen:  

 if (Zeny < 400000) {
            mes "[Dorry]";
            mes "Sorry, but you don't have enough zeny.";
            close;
        }
        progressbar "ffff00",7;
        set Zeny, Zeny-400000;

try change your line to

 if (countitem(909) < 666 ){	// if you jellopy lower than 666
            mes "[Dorry]";
            mes "Sorry, but you don't have enough jellopies.";
            close;
        }
        progressbar "ffff00",7;
        delitem 909,666;

 

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   3
  • Joined:  11/13/16
  • Last Seen:  

12 minutes ago, Valor said:

 if (Zeny < 400000) {
            mes "[Dorry]";
            mes "Sorry, but you don't have enough zeny.";
            close;
        }
        progressbar "ffff00",7;
        set Zeny, Zeny-400000;

try change your line to


 if (countitem(909) < 666 ){	// if you jellopy lower than 666
            mes "[Dorry]";
            mes "Sorry, but you don't have enough jellopies.";
            close;
        }
        progressbar "ffff00",7;
        delitem 909,666;

 

 

12 minutes ago, Valor said:

Only That part should i change it sir? how about this one 

Spoiler

prontera,163,60,2    script    Dorry    73,{
    disable_items;
    mes "[Dorry]";
    if (Zeny >= 500000) {                        <=== I think this one needs to change /sob 
        mes "I've been studying ways to enhance an Headgear to maximize its capability.";
        next;
        mes "[Dorry]";
        mes "Enchanting is an awesome skill that infuses a mysterious status powers into the Headgear's hidden socket.";
        next;
        mes "[Dorry]";
        mes "However, you have to keep in mind that if there are two Headgear of the same kind in your possession, the Enchantment will be applied in the order they are placed in your inventory.";
        next;

 

 

Edited by eirwanda
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  72
  • Reputation:   28
  • Joined:  12/21/16
  • Last Seen:  

oh, yea

if (Zeny >= 500000) { ......

thats zeny requirement for NPC open enchantment option but wont consume your zeny

else if you dont have certain zeny he ll only tell you information.

Spoiler

mes "I am in charge of Enchanting Headgear. Simply put, I've been studying ways to power-up Headgear.";
    next;
    mes "[Dorry]";
    mes "If by any chance, you would want to enchant your Headgear, bring me 400,000 zeny and the Headgear you want to enchant and you are all set to go.";
    close;

.its removeable or change to what ever you like...

Edited by Valor
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   3
  • Joined:  11/13/16
  • Last Seen:  

21 minutes ago, Valor said:

oh, yea

if (Zeny >= 500000) { ......

thats zeny requirement for NPC open enchantment option but wont consume your zeny

else if you dont have certain zeny he ll only tell you information.

  Hide contents

mes "I am in charge of Enchanting Headgear. Simply put, I've been studying ways to power-up Headgear.";
    next;
    mes "[Dorry]";
    mes "If by any chance, you would want to enchant your Headgear, bring me 400,000 zeny and the Headgear you want to enchant and you are all set to go.";
    close;

.its removeable or change to what ever you like...

Okey thank you for your help sir

 

Its working well xD /no1

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   3
  • Joined:  11/13/16
  • Last Seen:  

i Think I have Something Wrong down here....

Before : 

Spoiler

progressbar "ffff00",7;
        set Zeny, Zeny-10;
        delitem .@itemid,1;
        switch (rand(1,.@failrate)) {

After : 

Spoiler

progressbar "ffff00",7;
        set Zeny, Zeny-10;
        //delitem .@itemid,1;
        switch (rand(1,.@failrate)) {

 

when i close this line " delitem .@itemid,1; "

its succes but get a double item

Example : 

i enchanting item Life Link[1] at High Grade Category, then when its success i got a double Life Link

1 Life Link is not Enchanted, but i have 1 Life Link with Enchanted

Help me to Complete this Script

Thanks For Advance /sob 

 

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  72
  • Reputation:   28
  • Joined:  12/21/16
  • Last Seen:  

6 minutes ago, eirwanda said:

progressbar "ffff00",7;
        set Zeny, Zeny-10;
        //delitem .@itemid,1;
        switch (rand(1,.@failrate)) {

your script echant progress it 

  1. delete you current used item,
  2. then giving you new one with enchant..

by close line  //delitem @itemid,1;   means u terminate point 1

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   3
  • Joined:  11/13/16
  • Last Seen:  

2 minutes ago, Valor said:

your script echant progress it 

  1. delete you current used item,
  2. then giving you new one with enchant..

by close line  //delitem @itemid,1;   means u terminate point 1

Okay, then how to make the item to not destroyed if got a fail when enchanting ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  72
  • Reputation:   28
  • Joined:  12/21/16
  • Last Seen:  

case 1:
            setarray .@Items[0],2307,2309,2314,2316,2321,2325,2327,2328,2330,2332,2334,2335,2341,2344,2346,2348,2350,2337,2386,2394,2395,2396;
            set .@j,50;		// this .@j is you max rand for spesific item
            break;
        case 2:
            setarray .@Items[0],2311,2318,2319,2320,2308,2310,2315,2317,2322,2324,2326,2331,2333,2336,2342,2345,2347,2349,2351;
            set .@j,55;		// this .@j is you max rand for spesific item
            set .@k,1;
            break;
        case 3:
            setarray .@Items[0],2364,2365,2391,2374,2375,2376,2377,2378,2379,2380,2381,2382,2387,2388,2389,2390;
            set .@j,60;		// this .@j is you max rand for spesific item

if you are looking on your script you have case 36  success, more than 36 you will not get the item (enchant fail). idk if its work. but try change default to use break; insted of close;


            case 36: set .@addpart,4750;break;
            default: specialeffect2 EF_PHARMACY_FAIL; break;

 

Edited by Valor
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  912
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

@eirwanda Hey Buddy ^_^ 
You should not ask someone to complete your script because it will always happend to you . You should solve the problem you encounter the way how your skills do to enchance it better . This forum make's your skill improve thats why we help you . this is not your first time you will encounter all of those that why we encourage you if you can solve it on your own you should do it . because it will enchance your idea , logic , strategy how your script will work's . The resource is there gather it compare it to your existing problem and try to solve it with your own ^_^ . if you still dont know try to ask here but you should not ask for complete working script of it . 


@Valor You doing well but he did not learn . In this last part are very well for me because you did not teach him but you give him an idea how it should be work . Then starting at this point her brain already work's and gathering idea how should this script work . I remember when i was newbie back then I always post like this in this forum but one man tell me how should i do . Emistry teach me to use our resource to enchance our scripting skills . every time i ask him for help he always telling me . " Read our wiki all you need are there " . BTW im not still pro in scripting ^_^ Well done buddy ^_^ 

Very Simple answer That day HAHAHA

Untitled.png.22373986b3e794980cff003f8ff45e49.png

5 hours ago, Valor said:

if you are looking on your script you have case 36  success, more than 36 you will not get the item (enchant fail). idk if its work. but try change default to use break; insted of close;



            case 36: set .@addpart,4750;break;
            default: specialeffect2 EF_PHARMACY_FAIL; break;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  72
  • Reputation:   28
  • Joined:  12/21/16
  • Last Seen:  

:D@Poring King @eirwanda more than a half of my current knowledge comes from Emistry 

and check how its work on https://github.com/rathena/rathena/blob/master/doc/script_commands.txt

 

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:  

On 4/15/2017 at 5:39 PM, eirwanda said:

SOLVED

 

But I want to Change Zeny from Requirement to Jellopy (Example)

how did you remove the failrate?

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...