Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - script donate2coin 112,{
- mes .@npc_name$ = "[Donate2Coin]";
- getinventorylist;
- for(.@i = 0; .@i < @inventorylist_count; .@i++) {
- if ((.@k = inarray(.list, @inventorylist_id[.@i])) > -1) {
- if (@inventorylist_equip[.@i] == 0) {
- .@avail = 1;
- .@data[getarraysize(.@data)] = @inventorylist_id[.@i];
- .@menu$ = .@menu$ + "- "+getitemname(@inventorylist_id[.@i])+":";
- }
- }
- }
- if (!.@avail) {
- mes "Hey what are you doing here?";
- close;
- }
- mes "Select item in your inventory to convert";
- .@idx = select(.@menu$)-1;
- clear;
- copyarray .@q, getd(".d_"+.@data[.@idx]+"[0]"), getarraysize(getd(".d_"+.@data[.@idx]+"[0]"));
- mes .@npc_name$;
- mes "You chose ^0000FF"+getitemname(.@data[.@idx])+"^000000 will be converted into";
- mes "--------------------------------";
- for (.@i = 2; .@i < getarraysize(.@q); .@i+=2)
- mes "- "+.@q[.@i+1]+"x "+getitemname(.@q[.@i]);
- select("- Convert ?");
- clear;
- if (countitem(.@q[0]) < .@q[1]) {
- mes "Huh where is your "+getitemname(.@q[0]);
- close;
- }
- delitem .@q[0], .@q[1];
- for (.@i = 2; .@i < getarraysize(.@q); .@i+=2)
- getitem .@q[.@i], .@q[.@i+1];
- mes .@npc_name$;
- mes "Done! Have good day!";
- close;
- OnInit:
- function AddData;
- AddData(1201, 1, 501, 1);
- AddData(1202, 1, 501, 2);
- AddData(1203, 1, 501, 3);
- AddData(1204, 1, 501, 4);
- end;
- function AddData {
- .@itemid = getarg(0);
- if (getitemname(.@itemid) == "null") {
- debugmes "invalid item #"+.@itemid+" in "+strnpcinfo(0);
- return;
- }
- setarray .@j[0], getarg(0), getarg(1, 1);
- for(.@i = 2; .@i < getargcount(); .@i += 2) {
- if (getitemname(getarg(.@i)) == "null") {
- debugmes "invalid item #"+getarg(.@i)+" in requirement for "+.@itemid+" in npc : "+strnpcinfo(0);
- return;
- } else
- setarray .@j[.@i], getarg(.@i), getarg(.@i+1);
- }
- .list[getarraysize(.list)] = .@itemid;
- copyarray getd(".d_"+getarg(0)+"[0]"), .@j[0], getarraysize(.@j);
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement