// =============================
/* 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;
}