Jump to content
  • 0

extending this script


Sunset

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  89
  • Reputation:   3
  • Joined:  05/05/13
  • Last Seen:  

Hello! I've been trying to figure out, how could i make my script to enchant the item with addparts not only once, but IF the player has a green potion in inventory, then 3 times, and its deleting the green potion, and the enchantment costs shall not be only zeny, but like 10 piece apple too.

Could you guys help me out? thanks in advice!

Spoiler

geffenia_in,354,239,5    script    Costume Enchanter    504,{
    disable_items;
    mes "[Costume Enchanter]";
    if (Zeny >= 400000) {
        mes "Did you brought my noodles??";
            if(select("What noodles? Are you drunken?")&2)close;
        mes "Oh, excuse me. ";
        mes "Im waiting for my food since 2 hours, and im very hungry...";
        next;
        mes "But i suppose, you are here, to enchant your costumes, right?";
        next;
            if(select("Yes:You are scary, im out.")&2)close;
        mes "You can enchant costume headgears, and garments. The enchantment has NO chance to fail";
        next;
        mes "My eyes are already old, so for your safety bring only ^5555ffone item^000000 you want to be enchanted...";
        next;
        mes "I'm not responsible for what would happen if you have more than one of the same kind in your inventory.";
        mes "I might could create a new monster?!";
            emotion e_bzz;
        next;
        switch(select("^660099Costume Hats .:^009900Costume Wings .:^000000Maybe next time.")) {
        case 1:
            setarray .@Items[0],5381;
            set .@j,50;
            break;
        case 2:
            setarray .@Items[0],20509,20764;
            set .@j,55;
            set .@k,1;
            break;
        case 3:
            mes "Please come back when you have any interest in enchanting your costumes.";
            close;
        }
        set .@menu$,"";
        for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+1)
            set .@menu$, .@menu$+getitemname(.@Items[.@i])+((.@k)?" ":"")+":";
        callsub S_EnchantArmor, .@Items[select(.@menu$)-1], .@j;
        end;
    }
    mes "I am in charge of Enchanting Costumes. Simply put, I've been studying ways to power-up armor.";
    next;
    mes "[Costume Enchanter]";
    mes "If by any chance, you would want to enchant your armor, bring me 400,000 zeny and the armor you want to enchant and you are all set to go.";
    close;

S_EnchantArmor:
    set .@itemid,getarg(0);
    set .@failrate,getarg(0);
    mes "[Costume Enchanter]";
    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 armor.";
        next;
        mes "[Costume Enchanter]";
        mes "First and most importantly.";
        mes "^ff5555Existing Refine Level of the Armor";
        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 "[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 < 400000) {
            mes "[Costume Enchanter]";
            mes "Sorry, but you don't have enough zeny.";
            close;
        }
        progressbar "ffff00",1;
        set Zeny, Zeny-400000;
        delitem .@itemid,1;
        switch (rand(1,18)) {
            case 1: set .@addpart,4709;break;
            case 2: set .@addpart,4719;break;
            case 3: set .@addpart,4729;break;
            case 4: set .@addpart,4739;break;
            case 5: set .@addpart,4749;break;
            case 6: set .@addpart,4759;break;
            case 7: set .@addpart,4907;break;
            case 8: set .@addpart,4905;break;
            case 9: set .@addpart,4900;break;
            case 10: set .@addpart,4807;break;
            case 11: set .@addpart,4828;break;
            case 12: set .@addpart,4822;break;
            case 13: set .@addpart,4844;break;
            case 14: set .@addpart,4842;break;
            case 15: set .@addpart,4838;break;
            case 16: set .@addpart,4866;break;
            case 17: set .@addpart,4950;break;
            case 18: set .@addpart,4852;break;
        }
        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;
    }
}

 

Edited by Sunset
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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