Notorius Posted March 8, 2023 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 109 Reputation: 1 Joined: 09/24/19 Last Seen: March 11 Share Posted March 8, 2023 buenas quiero un npc que intercambie gold coin por cash hasta ahora e buscado en el furo y el que mas me a funcionado es este lo que quiero pedirles es su ayuda para poder editar la cantidad de monedas por la cantidad de cash es decir quiero que el itercambio se de 10 gold coin por 1 cash estoy usando este guion // Scripted by : Royr // Description : Simple Cash Converter // Topic: https://rathena.org/board/topic/127558-facing-problem-with-the-coin-to-cash-exchanger-npc/ prontera.gat, 154, 180, 4 script Cash Converter 4_M_01,{ mes .@name$ = "[ ^FF0000Cash Point Converter^000000 ]"; mes "Greetings! Player "+strcharinfo(0)+"."; mes " "; mes "Total Balance: ^FF0000"+F_InsertComma(#CASHPOINTS)+"^000000 Cash Points"; dispbottom "You have Total Balance of: ^FF0000"+F_InsertComma(#CASHPOINTS)+"^000000 Cash Points"; next; switch( select( implode(.menu_options$, ":") ) ) { case 1: mes .@name$; mes "^0000FF"+.ItemName$+"^000000 will ^ff0000NOT TO BE REFUND^000000 after converted to ^FF0000Cash Points^000000."; mes "How many Gold Coin do you want to exchange?"; mes " "; mes "^ff0000Note^000000: "+.qty+" x ^0000FF"+.ItemName$+"^000000 equivalent to 200 ^FF0000Cash Points^000000."; next; input .@amount; if( .@amount < .qty || .@amount > countitem(.itemID) ) { mes .@name$; mes "That's an Invalid amount."; mes "Please try again."; close; } mes .@name$; mes "Are you sure you want to exchange "+.@amount+" x ^0000FF"+.ItemName$+"^000000 to "+ .@amount * 5 +" ^FF0000Cash Points^000000?"; next; if( select(" - Yes: - No") == 2 ) close; #CASHPOINTS = #CASHPOINTS + .@amount * 5 ); mes .@name$; mes "You have successfully exchanged "+ .ItemName$ +" to Cash Points."; mes " "; mes "You have added your new balance "+ F_InsertComma(#CASHPOINTS) +" ^FF0000Cash Points^000000."; delitem .itemID, .@amount; dispbottom "Your new balance is now : "+ F_InsertComma(#CASHPOINTS) +" Cash Points"; close; case 2: mes .@name$; mes "Alrighth then! You can come back anytime."; close; } OnInit: .itemID = 7517; .qty = 40; .ItemName$ = getitemname(.itemID) +""; setarray .menu_options$[0], "- Exchange ^0000FF"+.ItemName$+"^000000 to ^FF0000Cash Points^000000", "- Cancel"; end; } Quote Link to comment Share on other sites More sharing options...
Notorius Posted March 8, 2023 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 109 Reputation: 1 Joined: 09/24/19 Last Seen: March 11 Author Share Posted March 8, 2023 (edited) 42 minutes ago, Notorius said: buenas quiero un npc que intercambie gold coin por cash hasta ahora e buscado en el furo y el que mas me a funcionado es este lo que quiero pedirles es su ayuda para poder editar la cantidad de monedas por la cantidad de cash es decir quiero que el itercambio se de 10 gold coin por 1 cash estoy usando este guion // Scripted by : Royr // Description : Simple Cash Converter // Topic: https://rathena.org/board/topic/127558-facing-problem-with-the-coin-to-cash-exchanger-npc/ prontera.gat, 154, 180, 4 script Cash Converter 4_M_01,{ mes .@name$ = "[ ^FF0000Cash Point Converter^000000 ]"; mes "Greetings! Player "+strcharinfo(0)+"."; mes " "; mes "Total Balance: ^FF0000"+F_InsertComma(#CASHPOINTS)+"^000000 Cash Points"; dispbottom "You have Total Balance of: ^FF0000"+F_InsertComma(#CASHPOINTS)+"^000000 Cash Points"; next; switch( select( implode(.menu_options$, ":") ) ) { case 1: mes .@name$; mes "^0000FF"+.ItemName$+"^000000 will ^ff0000NOT TO BE REFUND^000000 after converted to ^FF0000Cash Points^000000."; mes "How many Gold Coin do you want to exchange?"; mes " "; mes "^ff0000Note^000000: "+.qty+" x ^0000FF"+.ItemName$+"^000000 equivalent to 200 ^FF0000Cash Points^000000."; next; input .@amount; if( .@amount < .qty || .@amount > countitem(.itemID) ) { mes .@name$; mes "That's an Invalid amount."; mes "Please try again."; close; } mes .@name$; mes "Are you sure you want to exchange "+.@amount+" x ^0000FF"+.ItemName$+"^000000 to "+ .@amount * 5 +" ^FF0000Cash Points^000000?"; next; if( select(" - Yes: - No") == 2 ) close; #CASHPOINTS = #CASHPOINTS + .@amount * 5 ); mes .@name$; mes "You have successfully exchanged "+ .ItemName$ +" to Cash Points."; mes " "; mes "You have added your new balance "+ F_InsertComma(#CASHPOINTS) +" ^FF0000Cash Points^000000."; delitem .itemID, .@amount; dispbottom "Your new balance is now : "+ F_InsertComma(#CASHPOINTS) +" Cash Points"; close; case 2: mes .@name$; mes "Alrighth then! You can come back anytime."; close; } OnInit: .itemID = 7517; .qty = 40; .ItemName$ = getitemname(.itemID) +""; setarray .menu_options$[0], "- Exchange ^0000FF"+.ItemName$+"^000000 to ^FF0000Cash Points^000000", "- Cancel"; end; } mes .@name$; mes "Are you sure you want to exchange "+.@amount+" x ^0000FF"+.ItemName$+"^000000 to "+ .@amount /10 +" ^FF0000Cash Points^000000?"; next; if( select(" - Yes: - No") == 2 ) close; #CASHPOINTS = #CASHPOINTS + .@amount /10 ); mes .@name$; mes "You have successfully exchanged "+ .ItemName$ +" to Cash Points."; mes " "; mes "You have added your new balance "+ F_InsertComma(#CASHPOINTS) +" ^FF0000Cash Points^000000."; delitem .itemID, .@amount; dispbottom "Your new balance is now : "+ F_InsertComma(#CASHPOINTS) +" Cash Points"; close; solucionado Edited March 8, 2023 by Notorius Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.