Jump to content
  • 0
DrakeSky

3 cards of your choice = 1 random card

Question

I really need help. Npc Script. 3 cards of your choice = 1 random card.

Share this post


Link to post
Share on other sites

16 answers to this question

Recommended Posts

  • 0

Your question is too simple until I cant understand the whole idea. But.. if you want to give your players random from 3 item, then :

getitem F_Rand( 1,2,3),1;

Share this post


Link to post
Share on other sites
  • 0
On 5/31/2020 at 11:47 PM, Chaos92 said:

Your question is too simple until I cant understand the whole idea. But.. if you want to give your players random from 3 item, then :

getitem F_Rand( 1,2,3),1;

What I mean is, an NPC Script that you can exchange your 3 trash cards that you will select and then the NPC will give you a random card.

ex:

I will sacrifice 1 pecopeco, 1 hydra, 1 poring card and then the Npc will give me 1 random card.

Need Help Please

Share this post


Link to post
Share on other sites
  • 0
prontera,150,150,6	script	Sample	100,{
	getinventorylist;
	for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) {
		if (getiteminfo(@inventorylist_id[[email protected]], 2) == 6) {
			[email protected]$ = [email protected]$ + "- " + getitemname(@inventorylist_id[[email protected]]) + ":";
			[email protected][getarraysize([email protected])] = @inventorylist_id[[email protected]];
		}
	}
	
	[email protected] = 0;
	
	mes "Please select 3 cards...";
	while ([email protected] < 3) {
		if (getarraysize([email protected])) {
			mes "> 1x " + getitemname([email protected][[email protected]]);
			[email protected]++;
		}
		[email protected] = select([email protected]$) - 1;
		[email protected][getarraysize([email protected])] = [email protected][[email protected]];
		[email protected]++;
	}
	mes "> 1x " + getitemname([email protected][[email protected]]);
	next;
	mes "Are you sure you want to trade these cards?";
	if (select("~ Yes:~ No") & 2) end;
	
	for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++)
		delitem [email protected][[email protected]], 1;
	
	getitem rand(4001,4699), 1;
	
	close;
}

Try something like this

  • Love 1

Share this post


Link to post
Share on other sites
  • 0
On 6/20/2020 at 4:01 AM, Patskie said:
prontera,150,150,6	script	Sample	100,{
	getinventorylist;
	for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) {
		if (getiteminfo(@inventorylist_id[[email protected]], 2) == 6) {
			[email protected]$ = [email protected]$ + "- " + getitemname(@inventorylist_id[[email protected]]) + ":";
			[email protected][getarraysize([email protected])] = @inventorylist_id[[email protected]];
		}
	}
	
	[email protected] = 0;
	
	mes "Please select 3 cards...";
	while ([email protected] < 3) {
		if (getarraysize([email protected])) {
			mes "> 1x " + getitemname([email protected][[email protected]]);
			[email protected]++;
		}
		[email protected] = select([email protected]$) - 1;
		[email protected][getarraysize([email protected])] = [email protected][[email protected]];
		[email protected]++;
	}
	mes "> 1x " + getitemname([email protected][[email protected]]);
	next;
	mes "Are you sure you want to trade these cards?";
	if (select("~ Yes:~ No") & 2) end;
	
	for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++)
		delitem [email protected][[email protected]], 1;
	
	getitem rand(4001,4699), 1;
	
	close;
}

Try something like this

I have 23 poring cards but it is not showing how many poring cards I have, also when I trade 3 poring cards I got 1 Mummy Card then I try trading the mummy card, I can input 3 Mummy Card then after trading no card will release.

Share this post


Link to post
Share on other sites
  • 0

I replied based on what you have described in this topic. Its too vague for me

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
50 minutes ago, Patskie said:

I replied based on what you have described in this topic. Its too vague for me

I'll use your script to get my needs Sir. Thank you so much!

Edited by DrakeSky

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
prontera,150,150,6   script	 Sample	100,{
	getinventorylist;
	for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) {
		if (getiteminfo(@inventorylist_id[[email protected]], 2) == 6) {
			[email protected]$ = [email protected]$ + "- " + getitemname(@inventorylist_id[[email protected]]) + " x"[email protected]_amount[[email protected]]+":";
			[email protected][getarraysize([email protected])] = @inventorylist_id[[email protected]];
		}
	}
	
	[email protected] = 0;
	
	mes "Please select 3 cards...";
	while ([email protected] < 3) {
		if (getarraysize([email protected])) {
			mes "> 1x " + getitemname([email protected][[email protected]]);
			[email protected]++;
		}
		[email protected] = select([email protected]$) - 1;
		[email protected][getarraysize([email protected])] = [email protected][[email protected]];
		[email protected]++;
	}
	mes "> 1x " + getitemname([email protected][[email protected]]);
	next;
	mes "Are you sure you want to trade these cards?";
	if (select("~ Yes:~ No") & 2) end;
	
	for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++)
		delitem [email protected][[email protected]], 1;
	
	set @Rand,rand(4001,4699);
        next;
        getitem @Rand,1;
        mes"Congratulations!!.... you received";
        mes "^CC99CC"+getitemname(@Rand)+"^000000";
	close;
}

 I have a little bit of customization, you try this. 

thx @Patskie

Edited by noteeee

Share this post


Link to post
Share on other sites
  • 0
5 hours ago, noteeee said:
prontera,150,150,6   script	 Sample	100,{
	getinventorylist;
	for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) {
		if (getiteminfo(@inventorylist_id[[email protected]], 2) == 6) {
			[email protected]$ = [email protected]$ + "- " + getitemname(@inventorylist_id[[email protected]]) + " x"[email protected]_amount[[email protected]]+":";
			[email protected][getarraysize([email protected])] = @inventorylist_id[[email protected]];
		}
	}
	
	[email protected] = 0;
	
	mes "Please select 3 cards...";
	while ([email protected] < 3) {
		if (getarraysize([email protected])) {
			mes "> 1x " + getitemname([email protected][[email protected]]);
			[email protected]++;
		}
		[email protected] = select([email protected]$) - 1;
		[email protected][getarraysize([email protected])] = [email protected][[email protected]];
		[email protected]++;
	}
	mes "> 1x " + getitemname([email protected][[email protected]]);
	next;
	mes "Are you sure you want to trade these cards?";
	if (select("~ Yes:~ No") & 2) end;
	
	for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++)
		delitem [email protected][[email protected]], 1;
	
	set @Rand,rand(4001,4699);
        next;
        getitem @Rand,1;
        mes"Congratulations!!.... you received";
        mes "^CC99CC"+getitemname(@Rand)+"^000000";
	close;
}

 I have a little bit of customization, you try this. 

thx @Patskie

Hi! I tried this but there is an error. I have 1x Willow Card, 2x Drops Card, 1x Poring Card when I try trading my cards I can select 3x Drops Card even though I only have 2x Drops Card then when I traded it 2x Drops Card are gone.

Share this post


Link to post
Share on other sites
  • 0

Any Update on this post?.,

i modified this script..

       to 1 specific card only  and count the item inventory

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Try below 

// if you want to use card trader where you can put multiple cards if u have them in inventory then use below
prontera,150,150,6	script	Sample	100,{
	getinventorylist;
	for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) {
		if (getiteminfo(@inventorylist_id[[email protected]], 2) == 6) {
			[email protected]$ = [email protected]$ + getitemname(@inventorylist_id[[email protected]]) + ":";
			[email protected][getarraysize([email protected])] = @inventorylist_id[[email protected]];
			[email protected][getarraysize([email protected])] = @inventorylist_amount[[email protected]];
		}
	}
	
	[email protected] = 0;
	
	mes "Please select 3 cards...";
	while ([email protected] < 3) {
		if (getarraysize([email protected])) {
			mes "> 1x " + getitemname([email protected][[email protected]]);
			[email protected]++;
		}
		[email protected] = select([email protected]$) - 1;
		[email protected][getarraysize([email protected])] = [email protected][[email protected]];
		cleararray [email protected][[email protected]], ([email protected][[email protected]] < 1 ? 0 : ([email protected][[email protected]]-1)), 1;
		if ([email protected][[email protected]])
			[email protected]$ = replacestr([email protected]$, getitemname([email protected][[email protected]]), "");
		[email protected]++;
	}
	
	[email protected] = getarraysize([email protected]);
	mes "> 1x " + getitemname([email protected][[email protected]]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	if (select("~ Yes:~ No") & 2) end;
	
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
		delitem [email protected][[email protected]], 1;
	
	getitem rand(4001,4699), 1;
	
	close;
}
// if you want to use distinct card trader, means even if u have 2x poring card you can only trade 1 of them use below
prontera,153,153,6	script	Sample1	100,{
	getinventorylist;
	for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) {
		if (getiteminfo(@inventorylist_id[[email protected]], 2) == 6) {
			[email protected][getarraysize([email protected])] = @inventorylist_id[[email protected]];
			[email protected]$ = [email protected]$ + getitemname(@inventorylist_id[[email protected]]) + ":";
		}
	}
	
	[email protected] = 0;
	
	mes "Please select 3 cards...";
	while ([email protected] < 3) {
		if (getarraysize([email protected])) {
			mes "> 1x " + getitemname([email protected][[email protected]]);
			[email protected]++;
		}
		[email protected] = select([email protected]$) - 1;
		[email protected][getarraysize([email protected])] = [email protected][[email protected]];
		[email protected]$ = replacestr([email protected]$, getitemname([email protected][[email protected]]), "");
		[email protected]++;
	}
	
	[email protected] = getarraysize([email protected]);
	mes "> 1x " + getitemname([email protected][[email protected]]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
		mes "> " + getitemname([email protected][[email protected]]);
	
	if (select("~ Yes:~ No") & 2) end;
	
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
		delitem [email protected][[email protected]], 1;
	
	getitem rand(4001,4699), 1;
	
	close;
}

 

Edited by Patskie
  • MVP 1

Share this post


Link to post
Share on other sites
  • 0
On 7/16/2020 at 8:24 PM, Patskie said:

Try below 

// if you want to use card trader where you can put multiple cards if u have them in inventory then use below
prontera,150,150,6	script	Sample	100,{
	getinventorylist;
	for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) {
		if (getiteminfo(@inventorylist_id[[email protected]], 2) == 6) {
			[email protected]$ = [email protected]$ + getitemname(@inventorylist_id[[email protected]]) + ":";
			[email protected][getarraysize([email protected])] = @inventorylist_id[[email protected]];
			[email protected][getarraysize([email protected])] = @inventorylist_amount[[email protected]];
		}
	}
	
	[email protected] = 0;
	
	mes "Please select 3 cards...";
	while ([email protected] < 3) {
		if (getarraysize([email protected])) {
			mes "> 1x " + getitemname([email protected][[email protected]]);
			[email protected]++;
		}
		[email protected] = select([email protected]$) - 1;
		[email protected][getarraysize([email protected])] = [email protected][[email protected]];
		cleararray [email protected][[email protected]], ([email protected][[email protected]] < 1 ? 0 : ([email protected][[email protected]]-1)), 1;
		if ([email protected][[email protected]])
			[email protected]$ = replacestr([email protected]$, getitemname([email protected][[email protected]]), "");
		[email protected]++;
	}
	
	[email protected] = getarraysize([email protected]);
	mes "> 1x " + getitemname([email protected][[email protected]]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	if (select("~ Yes:~ No") & 2) end;
	
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
		delitem [email protected][[email protected]], 1;
	
	getitem rand(4001,4699), 1;
	
	close;
}
// if you want to use distinct card trader, means even if u have 2x poring card you can only trade 1 of them use below
prontera,153,153,6	script	Sample1	100,{
	getinventorylist;
	for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) {
		if (getiteminfo(@inventorylist_id[[email protected]], 2) == 6) {
			[email protected][getarraysize([email protected])] = @inventorylist_id[[email protected]];
			[email protected]$ = [email protected]$ + getitemname(@inventorylist_id[[email protected]]) + ":";
		}
	}
	
	[email protected] = 0;
	
	mes "Please select 3 cards...";
	while ([email protected] < 3) {
		if (getarraysize([email protected])) {
			mes "> 1x " + getitemname([email protected][[email protected]]);
			[email protected]++;
		}
		[email protected] = select([email protected]$) - 1;
		[email protected][getarraysize([email protected])] = [email protected][[email protected]];
		[email protected]$ = replacestr([email protected]$, getitemname([email protected][[email protected]]), "");
		[email protected]++;
	}
	
	[email protected] = getarraysize([email protected]);
	mes "> 1x " + getitemname([email protected][[email protected]]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
		mes "> " + getitemname([email protected][[email protected]]);
	
	if (select("~ Yes:~ No") & 2) end;
	
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
		delitem [email protected][[email protected]], 1;
	
	getitem rand(4001,4699), 1;
	
	close;
}

 

Sometimes when I trade the card it doesn't give me a card. Where can I fix that?

Share this post


Link to post
Share on other sites
  • 0
On 7/28/2020 at 11:28 AM, DrakeSky said:

Sometimes when I trade the card it doesn't give me a card. Where can I fix that?

getitem rand(4001,4699), 1;

Share this post


Link to post
Share on other sites
  • 0

I can use this npc but for other types of items that are not cards? like equipment for example or usable items?

I don't know much code, if anyone can make this change I would appreciate it.

Share this post


Link to post
Share on other sites
  • 0
On 7/16/2020 at 8:24 PM, Patskie said:

Try below 

// if you want to use card trader where you can put multiple cards if u have them in inventory then use below
prontera,150,150,6	script	Sample	100,{
	getinventorylist;
	for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) {
		if (getiteminfo(@inventorylist_id[[email protected]], 2) == 6) {
			[email protected]$ = [email protected]$ + getitemname(@inventorylist_id[[email protected]]) + ":";
			[email protected][getarraysize([email protected])] = @inventorylist_id[[email protected]];
			[email protected][getarraysize([email protected])] = @inventorylist_amount[[email protected]];
		}
	}
	
	[email protected] = 0;
	
	mes "Please select 3 cards...";
	while ([email protected] < 3) {
		if (getarraysize([email protected])) {
			mes "> 1x " + getitemname([email protected][[email protected]]);
			[email protected]++;
		}
		[email protected] = select([email protected]$) - 1;
		[email protected][getarraysize([email protected])] = [email protected][[email protected]];
		cleararray [email protected][[email protected]], ([email protected][[email protected]] < 1 ? 0 : ([email protected][[email protected]]-1)), 1;
		if ([email protected][[email protected]])
			[email protected]$ = replacestr([email protected]$, getitemname([email protected][[email protected]]), "");
		[email protected]++;
	}
	
	[email protected] = getarraysize([email protected]);
	mes "> 1x " + getitemname([email protected][[email protected]]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	if (select("~ Yes:~ No") & 2) end;
	
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
		delitem [email protected][[email protected]], 1;
	
	getitem rand(4001,4699), 1;
	
	close;
}
// if you want to use distinct card trader, means even if u have 2x poring card you can only trade 1 of them use below
prontera,153,153,6	script	Sample1	100,{
	getinventorylist;
	for ([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++) {
		if (getiteminfo(@inventorylist_id[[email protected]], 2) == 6) {
			[email protected][getarraysize([email protected])] = @inventorylist_id[[email protected]];
			[email protected]$ = [email protected]$ + getitemname(@inventorylist_id[[email protected]]) + ":";
		}
	}
	
	[email protected] = 0;
	
	mes "Please select 3 cards...";
	while ([email protected] < 3) {
		if (getarraysize([email protected])) {
			mes "> 1x " + getitemname([email protected][[email protected]]);
			[email protected]++;
		}
		[email protected] = select([email protected]$) - 1;
		[email protected][getarraysize([email protected])] = [email protected][[email protected]];
		[email protected]$ = replacestr([email protected]$, getitemname([email protected][[email protected]]), "");
		[email protected]++;
	}
	
	[email protected] = getarraysize([email protected]);
	mes "> 1x " + getitemname([email protected][[email protected]]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
		mes "> " + getitemname([email protected][[email protected]]);
	
	if (select("~ Yes:~ No") & 2) end;
	
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
		delitem [email protected][[email protected]], 1;
	
	getitem rand(4001,4699), 1;
	
	close;
}

 

How to put blacklist array on this sir patskie? if i want to blacklist a certain card on the draw.

Share this post


Link to post
Share on other sites
  • 0

Sometimes when I trade the card it doesn't give me a card. Where can I fix that?

** I have same problem 5% of the time when i use the npc.  Can someone help?

Share this post


Link to post
Share on other sites
  • 0
On 5/31/2020 at 7:59 PM, DrakeSky said:

I really need help. Npc Script. 3 cards of your choice = 1 random card.

payment script

contact emistry

 

 

Share this post


Link to post
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.