Jump to content
  • 0

Need Help > Card Exhanger NPC


Question

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...