`Azhul 2 Posted March 1, 2021 Hello everyone, i'm using @Mabuhay item trader script as my server's Potion Converter the script is working fine. Can someone help me make it Bulk trading/converting? Because as of now it only trade 1 at a time. Would like to make it players can input how many potions they can convert on a single trade. here's the script home you can help me. thanks in advance Potion_Converter.txt Quote Share this post Link to post Share on other sites
0 Racaae 10 Posted March 1, 2021 (edited) Spoiler // Item trader // https://rathena.org/board/topic/121585-item-trader/ // by Mabuhay // v2 by Racaae - bulk option added payon,139,226,5 script Potion Converter 4_M_ALCHE_B,{ mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes("I can convert some items for you."); next; // < ITEM FOR TRADE >, < AMOUNT >, < ITEM TRADED >, < AMOUNT >, < SUCCESS RATE >.. setarray .@trade, 11503, 2, 32018, 1, 100, // 2 Siege White Potion = 1 Battle Blue Potion @ 100 % 32042, 2, 32018, 1, 100, // 2 War White Potion = 1 Battle Blue Potion @ 100 % 32017, 2, 32018, 1, 100, // 2 Battle White Potion = 1 Battle Blue Potion @ 100 % 11504, 1, 32017, 2, 100, // 2 Siege White Potion = 1 Battle Blue Potion @ 100 % 32043, 1, 32017, 2, 100, // 2 War White Potion = 1 Battle Blue Potion @ 100 % 32018, 1, 32017, 2, 100; // 2 Battle White Potion = 1 Battle Blue Potion @ 100 % .@size = getarraysize(.@trade); for ( .@i = 0; .@i < .@size; .@i += 5 ) { .@menu$ += .@trade[.@i+1] +"x "+getitemname(.@trade[.@i])+" for "+.@trade[.@i+3]+"x "+ getitemname(.@trade[.@i+2]) +":"; } .@sel = select(.@menu$)-1; .@s = .@sel * 5; mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "Your "+.@trade[.@s+1] +"x "+getitemname(.@trade[.@s])+" for "+.@trade[.@s+3]+"x "+ getitemname(.@trade[.@s+2]) +"?"; mes "This has "+ .@trade[.@s+4]+"% success rate."; mes "Note: everything you trade will be character bound."; next; switch(select("Trade one time", "Choose how much to trade", "Finish conversation")) { case 1: if ( countitem(.@trade[.@s]) < .@trade[.@s+1] ) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "You dont have enough item required."; close; } delitem .@trade[.@s], .@trade[.@s+1]; if ( .@trade[.@s+4] <= rand(100) ) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "Opps! It failed!"; mes "Try again next time."; close; } mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "Congrats! You got it!"; getitem .@trade[.@s+2], .@trade[.@s+3]; close2; end; case 2: input .@q; if (.@q < 1) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes("Trade cancelled."); close; } .@cost = .@trade[.@s+1]*.@q; if ( countitem(.@trade[.@s]) < .@cost ) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "You dont have enough item required."; close; } if ( .@trade[.@s+4] < 100) for ( .@i = 0; .@i < .@q; .@i++ ) if ( .@trade[.@s+4] <= rand(100) ) .@fail++; delitem .@trade[.@s], .@cost; getitem .@trade[.@s+2], .@trade[.@s+3]*.@q-.@fail; mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); if (.@fail == .@q) mes "I'm sorry. All failed."; else if (.@fail) mes("Congrats! You got some of it, and failed " + .@fail + " times."); else mes "Congrats! You got it all!"; close; case 3: close; } } Edited March 1, 2021 by Racaae spoiler added Quote Share this post Link to post Share on other sites
0 `Azhul 2 Posted March 4, 2021 On 3/1/2021 at 10:58 PM, Racaae said: Hide contents // Item trader // https://rathena.org/board/topic/121585-item-trader/ // by Mabuhay // v2 by Racaae - bulk option added payon,139,226,5 script Potion Converter 4_M_ALCHE_B,{ mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes("I can convert some items for you."); next; // < ITEM FOR TRADE >, < AMOUNT >, < ITEM TRADED >, < AMOUNT >, < SUCCESS RATE >.. setarray .@trade, 11503, 2, 32018, 1, 100, // 2 Siege White Potion = 1 Battle Blue Potion @ 100 % 32042, 2, 32018, 1, 100, // 2 War White Potion = 1 Battle Blue Potion @ 100 % 32017, 2, 32018, 1, 100, // 2 Battle White Potion = 1 Battle Blue Potion @ 100 % 11504, 1, 32017, 2, 100, // 2 Siege White Potion = 1 Battle Blue Potion @ 100 % 32043, 1, 32017, 2, 100, // 2 War White Potion = 1 Battle Blue Potion @ 100 % 32018, 1, 32017, 2, 100; // 2 Battle White Potion = 1 Battle Blue Potion @ 100 % .@size = getarraysize(.@trade); for ( .@i = 0; .@i < .@size; .@i += 5 ) { .@menu$ += .@trade[.@i+1] +"x "+getitemname(.@trade[.@i])+" for "+.@trade[.@i+3]+"x "+ getitemname(.@trade[.@i+2]) +":"; } .@sel = select(.@menu$)-1; .@s = .@sel * 5; mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "Your "+.@trade[.@s+1] +"x "+getitemname(.@trade[.@s])+" for "+.@trade[.@s+3]+"x "+ getitemname(.@trade[.@s+2]) +"?"; mes "This has "+ .@trade[.@s+4]+"% success rate."; mes "Note: everything you trade will be character bound."; next; switch(select("Trade one time", "Choose how much to trade", "Finish conversation")) { case 1: if ( countitem(.@trade[.@s]) < .@trade[.@s+1] ) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "You dont have enough item required."; close; } delitem .@trade[.@s], .@trade[.@s+1]; if ( .@trade[.@s+4] <= rand(100) ) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "Opps! It failed!"; mes "Try again next time."; close; } mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "Congrats! You got it!"; getitem .@trade[.@s+2], .@trade[.@s+3]; close2; end; case 2: input .@q; if (.@q < 1) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes("Trade cancelled."); close; } .@cost = .@trade[.@s+1]*.@q; if ( countitem(.@trade[.@s]) < .@cost ) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "You dont have enough item required."; close; } if ( .@trade[.@s+4] < 100) for ( .@i = 0; .@i < .@q; .@i++ ) if ( .@trade[.@s+4] <= rand(100) ) .@fail++; delitem .@trade[.@s], .@cost; getitem .@trade[.@s+2], .@trade[.@s+3]*.@q-.@fail; mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); if (.@fail == .@q) mes "I'm sorry. All failed."; else if (.@fail) mes("Congrats! You got some of it, and failed " + .@fail + " times."); else mes "Congrats! You got it all!"; close; case 3: close; } } // Item trader // https://rathena.org/board/topic/121585-item-trader/ // by Mabuhay // v2 by Racaae - bulk option added payon,139,226,5 script Potion Converter 4_M_ALCHE_B,{ mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes("I can convert some items for you."); next; // < ITEM FOR TRADE >, < AMOUNT >, < ITEM TRADED >, < AMOUNT >, < SUCCESS RATE >.. setarray .@trade, 11503, 2, 32018, 1, 100, // 2 Siege White Potion = 1 Battle Blue Potion @ 100 % 32042, 2, 32018, 1, 100, // 2 War White Potion = 1 Battle Blue Potion @ 100 % 32017, 2, 32018, 1, 100, // 2 Battle White Potion = 1 Battle Blue Potion @ 100 % 11504, 1, 32017, 2, 100, // 2 Siege White Potion = 1 Battle Blue Potion @ 100 % 32043, 1, 32017, 2, 100, // 2 War White Potion = 1 Battle Blue Potion @ 100 % 32018, 1, 32017, 2, 100; // 2 Battle White Potion = 1 Battle Blue Potion @ 100 % .@size = getarraysize(.@trade); for ( .@i = 0; .@i < .@size; .@i += 5 ) { .@menu$ += .@trade[.@i+1] +"x "+getitemname(.@trade[.@i])+" for "+.@trade[.@i+3]+"x "+ getitemname(.@trade[.@i+2]) +":"; } .@sel = select(.@menu$)-1; .@s = .@sel * 5; mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "Your "+.@trade[.@s+1] +"x "+getitemname(.@trade[.@s])+" for "+.@trade[.@s+3]+"x "+ getitemname(.@trade[.@s+2]) +"?"; mes "This has "+ .@trade[.@s+4]+"% success rate."; mes "Note: everything you trade will be character bound."; next; switch(select("Trade one time", "Choose how much to trade", "Finish conversation")) { case 1: if ( countitem(.@trade[.@s]) < .@trade[.@s+1] ) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "You dont have enough item required."; close; } delitem .@trade[.@s], .@trade[.@s+1]; if ( .@trade[.@s+4] <= rand(100) ) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "Opps! It failed!"; mes "Try again next time."; close; } mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "Congrats! You got it!"; getitem .@trade[.@s+2], .@trade[.@s+3]; close2; end; case 2: input .@q; if (.@q < 1) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes("Trade cancelled."); close; } .@cost = .@trade[.@s+1]*.@q; if ( countitem(.@trade[.@s]) < .@cost ) { mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); mes "You dont have enough item required."; close; } if ( .@trade[.@s+4] < 100) for ( .@i = 0; .@i < .@q; .@i++ ) if ( .@trade[.@s+4] <= rand(100) ) .@fail++; delitem .@trade[.@s], .@cost; getitem .@trade[.@s+2], .@trade[.@s+3]*.@q-.@fail; mesf("[%s]", strnpcinfo(NPC_NAME_VISIBLE)); if (.@fail == .@q) mes "I'm sorry. All failed."; else if (.@fail) mes("Congrats! You got some of it, and failed " + .@fail + " times."); else mes "Congrats! You got it all!"; close; case 3: close; } } Not working nothing happens when i click the npc. Quote Share this post Link to post Share on other sites
0 botka4aet 5 Posted March 4, 2021 Check map server after reloadscript or after clicking Mb some errors Quote Share this post Link to post Share on other sites
0 `Azhul 2 Posted March 27, 2021 On 3/4/2021 at 6:13 PM, botka4aet said: Check map server after reloadscript or after clicking Mb some errors fixed thanks Quote Share this post Link to post Share on other sites
Hello everyone, i'm using @Mabuhay item trader script as my server's Potion Converter the script is working fine.
Can someone help me make it Bulk trading/converting? Because as of now it only trade 1 at a time.
Would like to make it players can input how many potions they can convert on a single trade.
here's the script home you can help me. thanks in advance
Potion_Converter.txt
Share this post
Link to post
Share on other sites