DrakeSky Posted May 31, 2020 Posted May 31, 2020 I really need help. Npc Script. 3 cards of your choice = 1 random card. Quote
0 Chaos92 Posted May 31, 2020 Posted May 31, 2020 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; Quote
0 DrakeSky Posted June 2, 2020 Author Posted June 2, 2020 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 Quote
0 Patskie Posted June 19, 2020 Posted June 19, 2020 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 1 Quote
0 DrakeSky Posted June 24, 2020 Author Posted June 24, 2020 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. Quote
0 Patskie Posted June 24, 2020 Posted June 24, 2020 I replied based on what you have described in this topic. Its too vague for me Quote
0 DrakeSky Posted June 24, 2020 Author Posted June 24, 2020 (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 June 24, 2020 by DrakeSky Quote
0 noteeee Posted July 4, 2020 Posted July 4, 2020 (edited) 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 July 4, 2020 by noteeee Quote
0 DrakeSky Posted July 5, 2020 Author Posted July 5, 2020 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. Quote
0 gelo221 Posted July 16, 2020 Posted July 16, 2020 Any Update on this post?., i modified this script.. to 1 specific card only and count the item inventory Quote
0 Patskie Posted July 16, 2020 Posted July 16, 2020 (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 (.@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 July 16, 2020 by Patskie 1 Quote
0 DrakeSky Posted July 28, 2020 Author Posted July 28, 2020 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? Quote
0 PsyOps Posted August 31, 2020 Posted August 31, 2020 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; Quote
0 kronobr Posted September 25, 2020 Posted September 25, 2020 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. Quote
0 DrakeSky Posted October 17, 2020 Author Posted October 17, 2020 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. Quote
0 kronobr Posted October 30, 2020 Posted October 30, 2020 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? Quote
0 mR L Posted October 31, 2020 Posted October 31, 2020 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 Quote
0 Sallycantdance Posted March 15, 2022 Posted March 15, 2022 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 Quote
Question
DrakeSky
I really need help. Npc Script. 3 cards of your choice = 1 random card.
17 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.