ahloi007 Posted September 6, 2019 Share Posted September 6, 2019 Hi, can I know how to edit this Cash Converter Npc at below? I want to make it like 6 TCG card to 1 cash point.. But I have tried several times to edit it but the Cash Point amount give out doesn't get what I want. Can please point out where should I need to edit in details? Because I'm still new to here. *lol prt_in,44,100,3 script CP Converter 532,{ [email protected]$ = strcharinfo(0); // Char Name [email protected] = 7227; // Item ID [email protected] = 1; // Amount [email protected] = countitem( [email protected]* ); // Countitem if( [email protected] < 1 ) { mes "[ Cash Converter ]"; mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points."; mes "Please come back to me if you have it already."; close; } mes "[ Cash Converter ]"; mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." : ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points."; mes " "; mes "What would you like to do?"; next; mes "[ Cash Converter ]"; mes "^FF0000Information:^000000"; mes "^777777 -------------------- ^000000"; mes "Exchange Rate: "+ [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +""; next; if( select("- Convert","- Cancel") == 1 ) { progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP; delitem [email protected],[email protected]; #CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] ); message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +""; mes "[ Cash Converter ]"; mes "You have successfully exchanged."; } close; } 1 Quote Link to comment Share on other sites More sharing options...
1 Radian Posted September 7, 2019 Share Posted September 7, 2019 2 hours ago, ahloi007 said: Sir, this npc function well but can you make it like auto detect the amount of TCG card and straight away convert it into cash point instead of key in the amount? Because just now I have tried it, even I got 1 TCG it still can convert into cash point and obtain 0 cash point but if I key in the amount of 6 TCG card it function well. Or can please change it into cash amount that need to be exchange? I scare later those people got confuse when using this npc xD change this part input .@tcg_amount,0,30000; into this input [email protected]_amount,6,30000; Quote Link to comment Share on other sites More sharing options...
1 nomade Posted September 7, 2019 Share Posted September 7, 2019 16 hours ago, ahloi007 said: Thanks sir, but the npc function still remain the same 1 TCG =1 cash point not 6 TCG =1 cash point. But I still like this npc as well because easy for player use. Sorry for the delay in answering, I was at work ^^ Try this one now: prt_in,44,100,3 script CP Converter 532,{ [email protected]$ = strcharinfo(0); // Char Name [email protected] = 7227; // Item ID [email protected] = 6; // Item Quantity Required to Receive Cash [email protected] = 1; // Cash amount to be paid [email protected] = countitem( [email protected] )/ [email protected]; // Countitem if( [email protected] < 1) { mes "[ Cash Converter ]"; mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points."; mes "Please come back to me if you have it already."; close; } mes "[ Cash Converter ]"; mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." : ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points."; mes " "; mes "What would you like to do?"; next; mes "[ Cash Converter ]"; mes "^FF0000Information:^000000"; mes "^777777 -------------------- ^000000"; mes "Exchange Rate: "+ [email protected] * [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +""; next; if( select("- Convert","- Cancel") == 1 ) { progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP; delitem [email protected],[email protected] * [email protected]; #CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] ); message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +""; mes "[ Cash Converter ]"; mes "You have successfully exchanged."; } close; } https://prnt.sc/p34xca https://prnt.sc/p34xhj https://prnt.sc/p34xjo https://prnt.sc/p34xoe Quote Link to comment Share on other sites More sharing options...
0 Radian Posted September 6, 2019 Share Posted September 6, 2019 (edited) Try this one if you like, I made it. prt_in,44,100,3 script CP Converter 532,{ [email protected]$ = "[ CP Converter ]"; // Char Name [email protected] = 7227; // Item ID [email protected] = 6; // Amount [email protected]_points = 1; // cash points amount mes [email protected]$; mes "Would you like to convert your " + getitemname( [email protected] ) + " into cash points?"; next; if( select("Yes Convert","No I dont want to.") == 2 ) close; input [email protected]_amount,0,30000; if( [email protected]_amount ) end; if( countitem([email protected]) < [email protected]_amount ) { mes [email protected]$; mes "Im sorry but you dont have enough " + getitemname( [email protected] ) + " to exchange."; close; } mes [email protected]$; mes "To confirm this deal you wanted to exchanged (" + [email protected] + ") " + getitemname( [email protected] ) + " into a total of " + ( [email protected]_amount / [email protected] ) + " cash points."; next; if( select("Yes!","No") == 2 ) close; mes [email protected]$; mes "The convertion was successful!"; delitem [email protected], [email protected]_amount; [email protected]_value = [email protected]_amount / [email protected]; #CASHPOINTS += [email protected]_value; dispbottom "You gained a total " + ( [email protected]_value ) + " cash points."; end; } Edited September 6, 2019 by Radian Quote Link to comment Share on other sites More sharing options...
0 nomade Posted September 6, 2019 Share Posted September 6, 2019 The colleague above already answered, but here is the same npc, with the modification that requested. prt_in,44,100,3 script CP Converter 532,{ [email protected]$ = strcharinfo(0); // Char Name [email protected] = 7227; // Item ID [email protected] = 6; // Item Quantity Required to Receive Cash [email protected] = 1; // Cash amount to be paid [email protected] = countitem( [email protected] )/ [email protected]; // Countitem if( [email protected] < [email protected]) { mes "[ Cash Converter ]"; mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points."; mes "Please come back to me if you have it already."; close; } mes "[ Cash Converter ]"; mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." : ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points."; mes " "; mes "What would you like to do?"; next; mes "[ Cash Converter ]"; mes "^FF0000Information:^000000"; mes "^777777 -------------------- ^000000"; mes "Exchange Rate: "+ [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +""; next; if( select("- Convert","- Cancel") == 1 ) { progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP; delitem [email protected],[email protected] * [email protected]; #CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] ); message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +""; mes "[ Cash Converter ]"; mes "You have successfully exchanged."; } close; } Quote Link to comment Share on other sites More sharing options...
0 ahloi007 Posted September 7, 2019 Author Share Posted September 7, 2019 (edited) On 9/7/2019 at 5:46 AM, nomade said: The colleague above already answered, but here is the same npc, with the modification that requested. prt_in,44,100,3 script CP Converter 532,{ [email protected]$ = strcharinfo(0); // Char Name [email protected] = 7227; // Item ID [email protected] = 6; // Item Quantity Required to Receive Cash [email protected] = 1; // Cash amount to be paid [email protected] = countitem( [email protected] )/ [email protected]; // Countitem if( [email protected] < [email protected]) { mes "[ Cash Converter ]"; mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points."; mes "Please come back to me if you have it already."; close; } mes "[ Cash Converter ]"; mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." : ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points."; mes " "; mes "What would you like to do?"; next; mes "[ Cash Converter ]"; mes "^FF0000Information:^000000"; mes "^777777 -------------------- ^000000"; mes "Exchange Rate: "+ [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +""; next; if( select("- Convert","- Cancel") == 1 ) { progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP; delitem [email protected],[email protected] * [email protected]; #CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] ); message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +""; mes "[ Cash Converter ]"; mes "You have successfully exchanged."; } close; } Thanks sir, but the npc function still remain the same 1 TCG =1 cash point not 6 TCG =1 cash point. But I still like this npc as well because easy for player use. On 9/7/2019 at 5:12 AM, Radian said: Try this one if you like, I made it. prt_in,44,100,3 script CP Converter 532,{ [email protected]$ = "[ CP Converter ]"; // Char Name [email protected] = 7227; // Item ID [email protected] = 6; // Amount [email protected]_points = 1; // cash points amount mes [email protected]$; mes "Would you like to convert your " + getitemname( [email protected] ) + " into cash points?"; next; if( select("Yes Convert","No I dont want to.") == 2 ) close; input [email protected]_amount,0,30000; if( [email protected]_amount ) end; if( countitem([email protected]) < [email protected]_amount ) { mes [email protected]$; mes "Im sorry but you dont have enough " + getitemname( [email protected] ) + " to exchange."; close; } mes [email protected]$; mes "To confirm this deal you wanted to exchanged (" + [email protected] + ") " + getitemname( [email protected] ) + " into a total of " + ( [email protected]_amount / [email protected] ) + " cash points."; next; if( select("Yes!","No") == 2 ) close; mes [email protected]$; mes "The convertion was successful!"; delitem [email protected], [email protected]_amount; [email protected]_value = [email protected]_amount / [email protected]; #CASHPOINTS += [email protected]_value; dispbottom "You gained a total " + ( [email protected]_value ) + " cash points."; end; } Sir, this npc function well but can you make it like auto detect the amount of TCG card and straight away convert it into cash point instead of key in the amount? Because just now I have tried it, even I got 1 TCG it still can convert into cash point and obtain 0 cash point but if I key in the amount of 6 TCG card it function well. Or can please change it into cash amount that need to be exchange? I scare later those people got confuse when using this npc xD Please let me know if you can't understand what I'm saying, sorry for my bad english Edited September 7, 2019 by ahloi007 Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted September 7, 2019 Share Posted September 7, 2019 your calculation parts are wrong. prt_in,44,100,3 script CP Converter 532,{ [email protected] = 7227; // Item ID [email protected] = 6; // Amount [email protected] = (countitem([email protected]) / [email protected]); // Countitem if( [email protected] < 1 ) { mes "[ Cash Converter ]"; mes "You required at least "[email protected]+" ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points."; mes "Please come back to me if you have it already."; close; } mes "[ Cash Converter ]"; mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." : ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points."; mes " "; mes "What would you like to do?"; next; mes "[ Cash Converter ]"; mes "^FF0000Information:^000000"; mes "^777777 -------------------- ^000000"; mes "Exchange Rate: "+ [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +""; next; if( select("- Convert","- Cancel") == 1 ) { progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP; delitem [email protected],([email protected] * [email protected]); #CASHPOINTS = #CASHPOINTS + [email protected]; message strcharinfo(0),"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +""; mes "[ Cash Converter ]"; mes "You have successfully exchanged."; } close; } Quote Link to comment Share on other sites More sharing options...
0 ahloi007 Posted September 8, 2019 Author Share Posted September 8, 2019 On 9/7/2019 at 12:42 PM, Radian said: change this part input .@tcg_amount,0,30000; into this input [email protected]_amount,6,30000; Yes it's work! xD thanks ya! 20 hours ago, nomade said: Sorry for the delay in answering, I was at work ^^ Try this one now: prt_in,44,100,3 script CP Converter 532,{ [email protected]$ = strcharinfo(0); // Char Name [email protected] = 7227; // Item ID [email protected] = 6; // Item Quantity Required to Receive Cash [email protected] = 1; // Cash amount to be paid [email protected] = countitem( [email protected] )/ [email protected]; // Countitem if( [email protected] < 1) { mes "[ Cash Converter ]"; mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points."; mes "Please come back to me if you have it already."; close; } mes "[ Cash Converter ]"; mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." : ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points."; mes " "; mes "What would you like to do?"; next; mes "[ Cash Converter ]"; mes "^FF0000Information:^000000"; mes "^777777 -------------------- ^000000"; mes "Exchange Rate: "+ [email protected] * [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +""; next; if( select("- Convert","- Cancel") == 1 ) { progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP; delitem [email protected],[email protected] * [email protected]; #CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] ); message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +""; mes "[ Cash Converter ]"; mes "You have successfully exchanged."; } close; } https://prnt.sc/p34xca https://prnt.sc/p34xhj https://prnt.sc/p34xjo https://prnt.sc/p34xoe Wow! Finally it's work! Thanks ya! Quote Link to comment Share on other sites More sharing options...
Hi, can I know how to edit this Cash Converter Npc at below?
I want to make it like 6 TCG card to 1 cash point..
But I have tried several times to edit it but the Cash Point amount give out doesn't get what I want.
Can please point out where should I need to edit in details? Because I'm still new to here.
*lol
prt_in,44,100,3 script CP Converter 532,{ [email protected]$ = strcharinfo(0); // Char Name [email protected] = 7227; // Item ID [email protected] = 1; // Amount [email protected] = countitem( [email protected]* ); // Countitem if( [email protected] < 1 ) { mes "[ Cash Converter ]"; mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points."; mes "Please come back to me if you have it already."; close; } mes "[ Cash Converter ]"; mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." : ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points."; mes " "; mes "What would you like to do?"; next; mes "[ Cash Converter ]"; mes "^FF0000Information:^000000"; mes "^777777 -------------------- ^000000"; mes "Exchange Rate: "+ [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +""; next; if( select("- Convert","- Cancel") == 1 ) { progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP; delitem [email protected],[email protected]; #CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] ); message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +""; mes "[ Cash Converter ]"; mes "You have successfully exchanged."; } close; }Link to comment
Share on other sites