Jump to content

Gold coin exchange


Notorius

Recommended Posts


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

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;
}

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

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 by Notorius
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...