The player chooses one of the items? Or the NPC chooses one? The player receives multiple items?
geffen,151,48,5 script First Person 1_M_LIBRARYMASTER,{
//Put the IDs of the item below.
setarray .@items, 909, 910, 911, 912, 913, 914, 915;
if (isnpccloaked("Second Person") == 0) {
npctalk "You can talk to him.", strnpcinfo(0), bc_self;
end;
}
mes "[First Person]";
mes "Hi, do you have all the items with you?";
next;
for (.@i=0;.@i< getarraysize(.@items);.@i++) {
if (countitem(.@items[.@i]) < 1) {
mes "[First Person]";
mes "You don't have <ITEM>" + getitemname(.@items[.@i]) + "<INFO>" + .@items[.@i] + "</INFO></ITEM>.";
close;
}
}
mes "[First Person]";
mes "You have everything. I will call him.";
close2;
cutin "war_y1", 2;
cloakoffnpcself( "Second Person" );
npctalk "Hello.", "Second Person", bc_self;
end;
}
geffen,155,49,3 script Second Person 4_M_FAIRYKID5,{
//Put the IDs of the item below.
setarray .@items, 909, 910, 911, 912, 913, 914, 915;
//Put here the item IDs of the selection the player can choose from
setarray .@reward, 714, 607, 12103;
disable_items;
mes "[Second Person]";
mes "Hi, the first person told me you have the items.";
if (getarraysize(.@reward) > 1) {
mes "You can exchange them for one of these:";
for (.@i=0;.@i< getarraysize(.@reward);.@i++)
mes "- <ITEM>" + getitemname(.@reward[.@i]) + "<INFO>" + .@reward[.@i] + "</INFO></ITEM>";
next;
.@menu$ = "";
for (.@i=0;.@i< getarraysize(.@reward);.@i++)
.@menu$ += "- " + getitemname(.@reward[.@i]) + ":";
.@s = select(.@menu$) - 1;
mes "[Second Person]";
}
mes "Are you sure you want";
mes "<ITEM>" + getitemname(.@reward[.@s]) + "<INFO>" + .@reward[.@s] + "</INFO></ITEM>?";
next;
if (select("No", "Yes, let's do this") == 1) {
mes "[Second Person]";
mes "I see.";
close2;
cutin "", 255;
cloakonnpcself;
end;
}
for (.@i=0;.@i< getarraysize(.@items);.@i++) {
if (countitem(.@items[.@i]) < 1) {
mes "[Second Person]";
mes "You don't have <ITEM>" + getitemname(.@items[.@i]) + "<INFO>" + .@items[.@i] + "</INFO></ITEM>.";
close2;
cutin "", 255;
cloakonnpcself;
end;
}
}
if ((MaxWeight - Weight) < 1000 || checkweight("Knife",1) == 0) {
mes "^0000FF- You cannot continue due to your heavy weight. -^000000";
close2;
cutin "", 255;
cloakonnpcself;
end;
}
for (.@i=0;.@i < getarraysize(.@items);.@i++)
delitem .@items[.@i], 1;
getitem .@reward[.@s], 1;
mes "[Second Person]";
mes "Done.";
close2;
cutin "", 255;
cloakonnpcself;
end;
OnInit:
cloakonnpc;
end;
}