prontera,158,173,4 script Quest NPC 88,{
mes .npc$;
mes "Want to make a trade?";
next;
switch(select("What are the require items?","What do you have?")) {
case 1: // Required Items
mes .npc$;
mes "300 Poring Coins";
mes "500 Mithril Coins";
mes "1 Ghostring Card";
close;
case 2: // What do you have
// Build Menu
for (set .@a, 0; .@a < getarraysize(.items); set .@a, .@a + 1) {
set .@menu$, (.@menu$ == "" ? getitemname(.items[.@a]) + " Quest" : .@menu$ + ":" + getitemname(.items[.@a]) + " Quest");
}
set .@my_item, select(.@menu$) - 1;
// Check for Required Items
if(countitem(7539) < 300 || countitem(674) < 500 || countitem(4047) < 1) {
mes .npc$;
mes "Not enough coins";
close;
}
// Pass Complete (Check Weight)
else if (!checkweight(.items[.@my_item], 1)) {
mes "You cannot handle this items load...";
close;
}
// Complete Quest
else {
mes .npc$;
mes "Awesome! Here is your item!";
delitem 7539, 300;
delitem 674, 500;
delitem 5057, 1;
getitem .items[.@my_item], 1;
mes "Have a nice day!";
close;
}
OnInit:
set .npc$, "[" + strnpcinfo(1) + "]";
setarray .items[0],19000,19001,19002,19003,19004,19005,19006,19007,19008,19009,19010,19011,19012,19013,19014,19015,19016,19017,19018,
19019,19020,19021,19022,19023,19024,19025,19026,19027,19028,19029,19030,19031,19032,19033,19034,19035,19036;
end;
}
Tiny Bit Shorter, and MUCH easier to add / remove items from, simply modify the array below the OnInit, to include or exclude item id's... (Keep in mind this limits to 128)