Jump to content
  • 0

Need Help > Card Exhanger NPC


Quesooo

Question


  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

Hi good day. im using this NPC > https://github.com/rathena/rathena/blob/master/npc/re/merchants/card_exchange.txt

how to make it like this.?
- It reads more cards on your pocket ( Example i have 100 pupa card on my bag ).
it will generate all of that items and exchange it same value on the card coins? 100 Pupa = 100 Card Coins. etc.

- The default is, it just reading 1 by 1 card only.

 

thank you so much.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Replace:

L_Exchange:
	freeloop(1);
	.@args = getargcount();
	for (.@i = 0; .@i < .@args; .@i++) {
		if (countitem(getarg(.@i))) {
			mes "Found ^980078" + getitemname(getarg(.@i)) + "^000000,";
			mes "Do you want to exchange ONE Card into ONE Coin?";
			next;
			switch(select("No:Yes")) {
			case 1:
				mes "^980078Do you want search for other cards?^000000";
				next;
				if(select("No:Yes") == 1) {
					mes "^980078Card searching is interrupted^000000";
					close;
				}
				break;
			case 2:
				if (countitem(getarg(.@i))) {
					delitem getarg(.@i),1;
					getitem 6379,1; //Card_Coin
					mes "^980078" + getitemname(getarg(.@i)) + " has exchanged into Coin.^000000";
					next;
				} else {
					mes "^980078Your inventory does not contain the card for exchange.^000000";
					next;
				}
				break;
			}
		}
	}
	freeloop(0);
	return;

with:

L_Exchange:
	freeloop(1);
	.@args = getargcount();
	for (.@i = 0; .@i < .@args; .@i++) {
		if (countitem(getarg(.@i))) {
			mes "Found ^980078" + countitem(getarg(.@i)) + "x " + getitemname(getarg(.@i)) + "^000000,";
			mes "Do you want to exchange "+countitem(getarg(.@i))+" Cards into "+countitem(getarg(.@i))+" Coins?";
			next;
			switch(select("No:Yes")) {
			case 1:
				mes "^980078Do you want search for other cards?^000000";
				next;
				if(select("No:Yes") == 1) {
					mes "^980078Card searching is interrupted^000000";
					close;
				}
				break;
			case 2:
				if (countitem(getarg(.@i))) {
					.@ct = countitem(getarg(.@i));
					delitem getarg(.@i),.@ct;
					getitem 6379,.@ct; //Card_Coin
					mes "^980078" + .@ct + "x " + getitemname(getarg(.@i)) + " has exchanged into " + .@ct + " Coins.^000000";
					next;
				} else {
					mes "^980078Your inventory does not contain the card for exchange.^000000";
					next;
				}
				break;
			}
		}
	}
	freeloop(0);
	return;

Untested....

Or you could try my version of it:
card_coin_exchanger.txt

Edited by llchrisll
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
Answer this question...

×   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...