Jump to content
  • 0

Help > Instant Refine+ORB Armor NPC


yodaGG

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   0
  • Joined:  02/14/22
  • Last Seen:  

hi guys. i just learn how to scripting for npc.
i try to make Instant buy ORB + Refine +10 NPC, but the npc cant click
someone help me please ?
thankoyouu <3.

 

Quote

new_1-4,12,187,6    script    Donaion Instant Armor    794,{
    mes "[Donation Instant Armor By Friday]";
    if (countitem(7615) > 0) {
        mes "Select Your Armor";
        next;
        switch(select("Non Slotted Armor.:Slotted Armor.:High Grade Armor.: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;;
            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;
            break;
        case 3:
            setarray .@Items[0],2364,2365,2391,2374,2375,2357,2376,2377,2378,2379,2380,2381,2382,2387,2388,2389,2390,2367;
            break;
        case 4:
            mes "[Donation Instant Armor]";
            mes "Please come back when you have any interest.";
            close;
        }
        mes "Select Your ORB";
        next;
        switch(select("Select Orb.:Maybe next time.")) {
        case 1:
            setarray .@orb[0],4702,4732,4742,4712,4722,4752;
            break;
        case 2:
            mes "[Donation Instant Armor]";
            mes "Please come back when you have any interest.";
            close;
        }
        mes "U Need to Refine?. +1,+2,+3,+4,+5,+6,+7,+8,+9,+10 ?";
        mes "If you don't want any, please enter the number, '0.'";
        next;
        while(1) {
        input .@darmorrefine;
        if (.@darmorrefine == 0) {
            mes "The deal has";
            mes "been cancelled.";
            close;
        }
        else if (.@darmorrefine < 0 || .@darmorrefine > 10) {
            mes "Maximum Refine +10";
            mes "got it? Good.";
            next;
        }
        else {
            break;
        }
        progressbar "ffff00",1;
        delitem 7615,1;
        specialeffect 154;
        getitem2 .@item, 1, 1, .@darmorrefine, 0, 0, 0, 0, .@orb;

    else {
        mes "Hmm? There's nothing to be enchanted!";
        mes "Please come back with just ONE equipment to be enchanted.";
        close;
    }

    }

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.01
  • Content Count:  39
  • Reputation:   30
  • Joined:  06/08/23
  • Last Seen:  

Your script has missing bracket that is why its give an error in console and then can't be clicked

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   0
  • Joined:  02/14/22
  • Last Seen:  

Quote
new_1-4,12,187,6    script  Donaion Instant Armor   794,{
    mes "[Donation Instant Armor By Friday]";
    if (countitem(7615) > 0) {
        mes "Select Your Armor";
        next;
        switch(select("Non Slotted Armor.:Slotted Armor.:High Grade Armor.: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;;
            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;
            break;
        case 3:
            setarray .@Items[0],2364,2365,2391,2374,2375,2357,2376,2377,2378,2379,2380,2381,2382,2387,2388,2389,2390,2367;
            break;
        case 4:
            mes "[Donation Instant Armor]";
            mes "Please come back when you have any interest.";
            close;
        }
        mes "Select Your ORB";
        next;
        switch(select("Select Orb.:Maybe next time.")) {
        case 1:
            setarray .@orb[0],4702,4732,4742,4712,4722,4752;
            break;
        case 2:
            mes "[Donation Instant Armor]";
            mes "Please come back when you have any interest.";
            close;
        }
        mes "U Need to Refine?. +1,+2,+3,+4,+5,+6,+7,+8,+9,+10 ?";
        mes "If you don't want any, please enter the number, '0.'";
        next;
        while(1) {
        input .@darmorrefine;
        if (.@darmorrefine == 0) {
            mes "The deal has";
            mes "been cancelled.";
            close;
        }
        else if (.@darmorrefine < 0 || .@darmorrefine > 10) {
            mes "Maximum Refine +10";
            mes "got it? Good.";
            next;
        }
        else {
            break;
        }}
        progressbar "ffff00",1;
        delitem 7615,1;
        specialeffect 154;
        getitem2 .@item, 1, 1, .@darmorrefine, 0, 0, 0, 0, .@orb;
 
    else {
        mes "Hmm? There's nothing to be enchanted!";
        mes "Please come back with just ONE equipment to be enchanted.";
        close;
        }
 
    }}

i put aldy but still error :
 

Quote


[Error]:  Loading NPC file: npc/custom/donation/donationarmor.txt
script error on npc/custom/donation/donationarmor.txt line 55

 

 

Edited by yodaGG
forgot put error code
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   36
  • Joined:  05/15/20
  • Last Seen:  

5 hours ago, yodaGG said:

i put aldy but still error :
 

 

Try this.
 

new_1-4,12,187,6    script    Donaion Instant Armor    794,{
    mes "[Donation Instant Armor By Friday]";
    if (countitem(7615) > 0) {
        mes "Select Your Armor";
        next;
        switch(select("Non Slotted Armor.:Slotted Armor.:High Grade Armor.: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;;
            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;
            break;
        case 3:
            setarray .@Items[0],2364,2365,2391,2374,2375,2357,2376,2377,2378,2379,2380,2381,2382,2387,2388,2389,2390,2367;
            break;
        case 4:
            mes "[Donation Instant Armor]";
            mes "Please come back when you have any interest.";
            close;
        }
        mes "Select Your ORB";
        next;
        switch(select("Select Orb.:Maybe next time.")) {
        case 1:
            setarray .@orb[0],4702,4732,4742,4712,4722,4752;
            break;
        case 2:
            mes "[Donation Instant Armor]";
            mes "Please come back when you have any interest.";
            close;
        }
        mes "U Need to Refine?. +1,+2,+3,+4,+5,+6,+7,+8,+9,+10 ?";
        mes "If you don't want any, please enter the number, '0.'";
        next;
        while(1) {
            input .@darmorrefine;
            if (.@darmorrefine == 0) {
                mes "The deal has";
                mes "been cancelled.";
                close;
            }
            else if (.@darmorrefine < 0 || .@darmorrefine > 10) {
                mes "Maximum Refine +10";
                mes "got it? Good.";
                next;
            }
            else {
                break;
            }
            progressbar "ffff00",1;
            delitem 7615,1;
            specialeffect 154;
            getitem2 .@item, 1, 1, .@darmorrefine, 0, 0, 0, 0, .@orb;
        }
    }
    else {
        mes "Hmm? There's nothing to be enchanted!";
        mes "Please come back with just ONE equipment to be enchanted.";
        close;
    }
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   0
  • Joined:  02/14/22
  • Last Seen:  

SOLVED. Thankyou guys

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