viewing paste [ Request ] Item Giver | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
// =============================
/* Item Giver: http://herc.ws/board/topic/13915-npc-item-giver-with-requirement/
    ----------------------------
    by: Legend
    compatible w/: Hercules
    ----------------------------
    Description:
    * Can only get items once per account.
    * Requires specific items to be worn before obtaining the items.
    * Can choose ONLY 3 items to be obtained on the menu.
*/
// =============================
 
prontera,150,158,4  script  Request#5   4_M_FAIRYSOLDIER,{
    if (#received) {
        mes .npc$;
        mes "You can only receive once per account.";
        close;
    }
    for (.@x = 0; .@x < .b; ++.@x){
        if (!isequipped(.a[.@x])){
            mes .npc$;
            mes "You should wear all of the items listed here:";
            for (.@z = 0; .@z < .b; ++.@z){
                mes (.@z+1)+". ^FF0000"+getitemname(.a[.@z])+"^000000";
            }
            close;
        }
    }
    mes .npc$;
    mes "Select any reward items you would like to receive.";
    next;
    for ( .@y = 0; .@y < .d; .@y += 2 ){
        menu getitemname(.c[.@y]),i_1,
        getitemname(.c[.@y+2]),i_2,
        getitemname(.c[.@y+4]),i_3;
    }
        i_1:
            for ( .@y = 0; .@y < .d; .@y += 2 ){
                getitem .c[.@y],.c[.@y+1];
                #received = 1;
                close;
            }
            end;
        i_2:
            for ( .@y = 0; .@y < .d; .@y += 2 ){
                getitem .c[.@y+2],.c[.@y+3];
                #received = 1;
                close;
            }
            end;
        i_3:
            for ( .@y = 0; .@y < .d; .@y += 2 ){
                getitem .c[.@y+4],.c[.@y+5];
                #received = 1;
                close;
            }
            end;
OnInit:
// -- CONFIG --
    .npc$ = "[ Fairy ]"; // NPC Name
    setarray .a[0],1203,2302; // Required items to be worn (you can set this as many as you want).
    setarray .c[0],4005,1,4006,2,4007,3; // (SYNTAX: <item id>,<item amount>,...;)
        // NOTE: For array ".c[0]" Just replace values, DO NOT ADD MORE THAN 3 ITEMS, if more than 3 = the rest can't be read.
    
// -- DO NOT TOUCH THIS --
    .d = getarraysize(.c);
    .b = getarraysize(.a);
    end;
}
Viewed 1062 times, submitted by Legend.