Jump to content
  • 0

3 cards of your choice = 1 random card


DrakeSky

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

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

Link to comment
Share on other sites

17 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1507
  • Reputation:   227
  • Joined:  08/03/12
  • Last Seen:  

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;

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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

Try something like this

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

On 6/20/2020 at 4:01 AM, Patskie said:

prontera,150,150,6	script	Sample	100,{
	getinventorylist;
	for (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@menu$ = .@menu$ + "- " + getitemname(@inventorylist_id[.@i]) + ":";
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		.@i++;
	}
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < getarraysize(.@c); .@i++)
		delitem .@c[.@i], 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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  05/19/20
  • Last Seen:  

prontera,150,150,6   script	 Sample	100,{
	getinventorylist;
	for (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@menu$ = .@menu$ + "- " + getitemname(@inventorylist_id[.@i]) + " x"+@inventorylist_amount[.@i]+":";
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		.@i++;
	}
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < getarraysize(.@c); .@i++)
		delitem .@c[.@i], 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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

5 hours ago, noteeee said:

prontera,150,150,6   script	 Sample	100,{
	getinventorylist;
	for (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@menu$ = .@menu$ + "- " + getitemname(@inventorylist_id[.@i]) + " x"+@inventorylist_amount[.@i]+":";
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		.@i++;
	}
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < getarraysize(.@c); .@i++)
		delitem .@c[.@i], 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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  12/09/13
  • Last Seen:  

Any Update on this post?.,

i modified this script..

       to 1 specific card only  and count the item inventory

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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 (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":";
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
			.@qt[getarraysize(.@qt)] = @inventorylist_amount[.@i];
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		cleararray .@qt[.@s], (.@qt[.@s] < 1 ? 0 : (.@qt[.@s]-1)), 1;
		if (!.@qt[.@s])
			.@menu$ = replacestr(.@menu$, getitemname(.@cards[.@s]), "");
		.@i++;
	}
	
	.@size = getarraysize(.@c);
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < .@size; .@i++)
		delitem .@c[.@i], 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 (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
			.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":";
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		.@menu$ = replacestr(.@menu$, getitemname(.@cards[.@s]), "");
		.@i++;
	}
	
	.@size = getarraysize(.@c);
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	for (.@i = 0; .@i < .@size; .@i++)
		mes "> " + getitemname(.@c[.@i]);
	
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < .@size; .@i++)
		delitem .@c[.@i], 1;
	
	getitem rand(4001,4699), 1;
	
	close;
}

 

Edited by Patskie
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

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 (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":";
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
			.@qt[getarraysize(.@qt)] = @inventorylist_amount[.@i];
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		cleararray .@qt[.@s], (.@qt[.@s] < 1 ? 0 : (.@qt[.@s]-1)), 1;
		if (!.@qt[.@s])
			.@menu$ = replacestr(.@menu$, getitemname(.@cards[.@s]), "");
		.@i++;
	}
	
	.@size = getarraysize(.@c);
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < .@size; .@i++)
		delitem .@c[.@i], 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 (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
			.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":";
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		.@menu$ = replacestr(.@menu$, getitemname(.@cards[.@s]), "");
		.@i++;
	}
	
	.@size = getarraysize(.@c);
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	for (.@i = 0; .@i < .@size; .@i++)
		mes "> " + getitemname(.@c[.@i]);
	
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < .@size; .@i++)
		delitem .@c[.@i], 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?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  147
  • Reputation:   10
  • Joined:  12/03/18
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.02
  • Content Count:  71
  • Reputation:   0
  • Joined:  06/24/19
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

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 (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":";
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
			.@qt[getarraysize(.@qt)] = @inventorylist_amount[.@i];
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		cleararray .@qt[.@s], (.@qt[.@s] < 1 ? 0 : (.@qt[.@s]-1)), 1;
		if (!.@qt[.@s])
			.@menu$ = replacestr(.@menu$, getitemname(.@cards[.@s]), "");
		.@i++;
	}
	
	.@size = getarraysize(.@c);
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < .@size; .@i++)
		delitem .@c[.@i], 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 (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
			.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":";
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		.@menu$ = replacestr(.@menu$, getitemname(.@cards[.@s]), "");
		.@i++;
	}
	
	.@size = getarraysize(.@c);
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	for (.@i = 0; .@i < .@size; .@i++)
		mes "> " + getitemname(.@c[.@i]);
	
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < .@size; .@i++)
		delitem .@c[.@i], 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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.02
  • Content Count:  71
  • Reputation:   0
  • Joined:  06/24/19
  • Last Seen:  

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?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   25
  • Joined:  12/24/14
  • Last Seen:  

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

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.15
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

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 (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":";
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
			.@qt[getarraysize(.@qt)] = @inventorylist_amount[.@i];
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		cleararray .@qt[.@s], (.@qt[.@s] < 1 ? 0 : (.@qt[.@s]-1)), 1;
		if (!.@qt[.@s])
			.@menu$ = replacestr(.@menu$, getitemname(.@cards[.@s]), "");
		.@i++;
	}
	
	.@size = getarraysize(.@c);
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < .@size; .@i++)
		delitem .@c[.@i], 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 (.@i = 0; .@i < @inventorylist_count; .@i++) {
		if (getiteminfo(@inventorylist_id[.@i], 2) == 6) {
			.@cards[getarraysize(.@cards)] = @inventorylist_id[.@i];
			.@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":";
		}
	}
	
	.@i = 0;
	
	mes "Please select 3 cards...";
	while (.@i < 3) {
		if (getarraysize(.@c)) {
			mes "> 1x " + getitemname(.@c[.@j]);
			.@j++;
		}
		.@s = select(.@menu$) - 1;
		.@c[getarraysize(.@c)] = .@cards[.@s];
		.@menu$ = replacestr(.@menu$, getitemname(.@cards[.@s]), "");
		.@i++;
	}
	
	.@size = getarraysize(.@c);
	mes "> 1x " + getitemname(.@c[.@j]);
	next;
	mes "Are you sure you want to trade these cards?";
	
	for (.@i = 0; .@i < .@size; .@i++)
		mes "> " + getitemname(.@c[.@i]);
	
	if (select("~ Yes:~ No") & 2) end;
	
	for (.@i = 0; .@i < .@size; .@i++)
		delitem .@c[.@i], 1;
	
	getitem rand(4001,4699), 1;
	
	close;
}

 

hello i would like to ask if this card trader has also an mvp card with the random results? im looking for a script like this but i want to remove the mvp cards if it has 

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