Emistry Posted April 28, 2019 Share Posted April 28, 2019 View File iRO - Ben Recycle NPC Ben Recycle in Prontera allows players to turn certain equipment into Rough Elunium and Rough Oridecon. How to use: func_AddItem(<equipment_id>, <item1>, <amount1>, <item2>, <amount2>); // WEAPONS func_AddItem(1421, 757, 4, 756, 4); func_AddItem(1822, 757, 2, 756, 2); func_AddItem(1625, 757, 5, 756, 5); func_AddItem(1819, 757, 3, 756, 3); func_AddItem(1269, 757, 4, 756, 4); func_AddItem(1142, 757, 3, 756, 3); func_AddItem(1624, 757, 5, 756, 5); func_AddItem(1626, 757, 5, 756, 5); func_AddItem(13404, 757, 5, 756, 5); func_AddItem(13027, 757, 6, 756, 6); func_AddItem(1821, 757, 1, 756, 1); func_AddItem(1268, 757, 5, 756, 5); // ARMORS func_AddItem(2422, 757, 3, 756, 3); func_AddItem(2104, 757, 1, 756, 1); func_AddItem(5124, 757, 2, 756, 1); func_AddItem(2406, 757, 3, 756, 3); func_AddItem(5122, 757, 2, 756, 1); func_AddItem(5126, 757, 2, 756, 1); func_AddItem(2504, 757, 2, 756, 1); func_AddItem(2353, 757, 15, 756, 15); func_AddItem(2514, 757, 6, 756, 6); func_AddItem(2404, 757, 2, 756, 1); func_AddItem(2315, 757, 2, 756, 1); func_AddItem(2102, 757, 2, 756, 1); func_AddItem(2114, 757, 2, 756, 2); Additional: // if enable shop UI (only work if items can sell to npc shop) .shop_npc$ = "ben_recycle_shop#iro"; Mirror Link: https://pastebin.com/cCBdevB5 Submitter Emistry Submitted 04/28/2019 Category Utilities Video Content Author Emistry 1 Quote Link to comment Share on other sites More sharing options...
Quesooo Posted July 19, 2019 Share Posted July 19, 2019 Hi @Emistry im using your script and i modify it above to exchange for other items. can you help me how to solve this? i got an error saying when selling 10 or more different items. // https://irowiki.org/wiki/Ben_Recycle - shop ben_recycle_shop -1,909:-1 prt_mall,164,53,0 script Ben Recycle 4_M_CRU_KNT,{ function func_GetItemName; function func_AddItem; mes "Hi, I can convert certain equipment into ores."; mes "Would you give it a try?"; next; if (select("Convert", "Information") == 2) { for ([email protected] = 0; [email protected] < .size; [email protected]++) { mes func_GetItemName(.nameid[[email protected]]); if (.amount1[[email protected]] > 0 && .nameid1[[email protected]] > 0) mes " ~ "+F_InsertComma(.amount1[[email protected]])+"x "+func_GetItemName(.nameid1[[email protected]]); if (.amount2[[email protected]] > 0 && .nameid2[[email protected]] > 0) mes " ~ "+F_InsertComma(.amount2[[email protected]])+"x "+func_GetItemName(.nameid2[[email protected]]); mes " "; } next; } if (.shop_npc$ != "") { mes "Place all the equipments you wish to convert into ores."; close2; npcshopattach .shop_npc$, 1; callshop .shop_npc$, 2; end; } else { for ([email protected] = 0; [email protected] < .size; [email protected]++) [email protected]$ = [email protected]$ + func_GetItemName(.nameid[[email protected]]) + ":"; [email protected] = select([email protected]$) - 1; if (countitem(.nameid[[email protected]])) { delitem .nameid[[email protected]], 1; mes "Exchanged "+func_GetItemName(.nameid[[email protected]])+":"; if (.nameid1[[email protected]] > 0 && .amount1[[email protected]] > 0) { mes " ~ "+F_InsertComma(.amount1[[email protected]])+"x "+func_GetItemName(.nameid1[[email protected]]); getitem .nameid1[[email protected]], .amount1[[email protected]]; } if (.nameid2[[email protected]] > 0 && .amount2[[email protected]] > 0) { mes " ~ "+F_InsertComma(.amount2[[email protected]])+"x "+func_GetItemName(.nameid2[[email protected]]); getitem .nameid2[[email protected]], .amount2[[email protected]]; } } else { mes "you dont have "+func_GetItemName(.nameid[[email protected]]); } } close; OnSellItem: [email protected]_nameid_size = getarraysize(@sold_nameid); for ([email protected] = 0; [email protected] < [email protected]_nameid_size && [email protected]; [email protected]++) { for ([email protected] = 0; [email protected] < .size && [email protected]; [email protected]++) { if (.nameid[[email protected]] == @sold_nameid[[email protected]]) { if (!checkweight(.nameid1[[email protected]], .amount1[[email protected]])) { mes "Exchange stopped, you're overweight."; [email protected]++; } else { [email protected]++; delitem2(@sold_nameid[[email protected]], @sold_quantity[[email protected]], @sold_identify[[email protected]], @sold_refine[[email protected]], @sold_attribute[[email protected]], @sold_card1[[email protected]], @sold_card2[[email protected]], @sold_card3[[email protected]], @sold_card4[[email protected]]); mes "Exchanged "+func_GetItemName(.nameid[[email protected]])+":"; if (.nameid1[[email protected]] > 0 && .amount1[[email protected]] > 0) { mes " ~ "+F_InsertComma(.amount1[[email protected]])+"x "+func_GetItemName(.nameid1[[email protected]]); getitem .nameid1[[email protected]], .amount1[[email protected]]; } if (.nameid2[[email protected]] > 0 && .amount2[[email protected]] > 0) { mes " ~ "+F_InsertComma(.amount2[[email protected]])+"x "+func_GetItemName(.nameid2[[email protected]]); getitem .nameid2[[email protected]], .amount2[[email protected]]; } mes " "; } } } } mes "Exchanged "[email protected]+" item(s)."; close2; npcshopattach .shop_npc$, 0; end; function func_GetItemName { [email protected] = getarg(0, 0); [email protected] = getitemslots([email protected]); [email protected]_name$ = getitemname([email protected]); [email protected] = getiteminfo([email protected], 2); if ([email protected] || [email protected] == IT_WEAPON || [email protected] == IT_ARMOR) [email protected]_name$ = [email protected]_name$ + " ["[email protected]+"]"; return [email protected]_name$; } function func_AddItem { [email protected] = getarg(0, 0); [email protected] = getarg(1, 0); [email protected] = getarg(2, 0); [email protected] = getarg(3, 0); [email protected] = getarg(4, 0); if ([email protected] > 0 && [email protected] > 0 && [email protected] > 0 && [email protected] > 0 && [email protected] > 0 ) { .nameid[.size] = [email protected]; .nameid1[.size] = [email protected]; .amount1[.size] = [email protected]; .nameid2[.size] = [email protected]; .amount2[.size] = [email protected]; .size++; } } OnInit: // if enable shop UI (only work if items can sell to npc shop) .shop_npc$ = "ben_recycle_shop"; // func_AddItem(<equipment_id>, <item1>, <amount1>, <item2>, <amount2>); // WEAPONS func_AddItem(1421, 757, 4, 756, 4); func_AddItem(1822, 757, 2, 756, 2); func_AddItem(1625, 757, 5, 756, 5); func_AddItem(1819, 757, 3, 756, 3); func_AddItem(1269, 757, 4, 756, 4); func_AddItem(1142, 757, 3, 756, 3); func_AddItem(1624, 757, 5, 756, 5); func_AddItem(1626, 757, 5, 756, 5); func_AddItem(13404, 757, 5, 756, 5); func_AddItem(13027, 757, 6, 756, 6); func_AddItem(1821, 757, 1, 756, 1); func_AddItem(1268, 757, 5, 756, 5); // ARMORS func_AddItem(2422, 757, 3, 756, 3); func_AddItem(2104, 757, 1, 756, 1); func_AddItem(5124, 757, 2, 756, 1); func_AddItem(2406, 757, 3, 756, 3); func_AddItem(5122, 757, 2, 756, 1); func_AddItem(5126, 757, 2, 756, 1); func_AddItem(2504, 757, 2, 756, 1); func_AddItem(2353, 757, 15, 756, 15); func_AddItem(2514, 757, 6, 756, 6); func_AddItem(2404, 757, 2, 756, 1); func_AddItem(2315, 757, 2, 756, 1); func_AddItem(2102, 757, 2, 756, 1); func_AddItem(2114, 757, 2, 756, 2); // COSTUMES func_AddItem(19835, 7915, 1, 7539, 1); func_AddItem(31123, 7915, 1, 7539, 1); func_AddItem(20247, 7915, 1, 7539, 1); func_AddItem(31062, 7915, 1, 7539, 1); func_AddItem(19934, 7915, 1, 7539, 1); waitingroom "Item Recycle",0; end; } Quote Link to comment Share on other sites More sharing options...
Emistry Posted August 24, 2019 Author Share Posted August 24, 2019 fixed. Quote Link to comment Share on other sites More sharing options...
oxob Posted April 13, 2020 Share Posted April 13, 2020 (edited) How I change the convert item into cash? for example i trade my corsair and i get some cash. And I already try injecting the npc but it say missing shop npc or not in shop type Edited April 13, 2020 by oxob Quote Link to comment Share on other sites More sharing options...