Yugosh Posted March 17, 2013 Posted March 17, 2013 Same the Request script http://rathena.org/board/topic/79595-costumeheadgear-gacha-npc/ but i have a diffrent like him. i want 671 Gold Coin have a 50% drop chance and 7227 TCG have 20% drop chance the drop is like YGG,bubble gum , token and else.... the script can work also to eathena thanks master, Quote
1 Capuche Posted April 3, 2013 Posted April 3, 2013 prontera,155,180,5 script Random 98,{ mes .npc_name$; mes "Hello, do you want to play ?"; next; if( select( "Play !", "More Informations", "Leave" ) == 3 ) { mes .npc_name$; mes "Bye!~"; close; } else if( @menu == 2 ) { while( getd(".p"+ .@j ) ) { mes .npc_name$; mes "Item required: ^FFCC00"+ getitemname( getd(".p"+ .@j ) ) +"^000000"; mes "Chance to gain something: ^CC0000"+ getd(".p"+ .@j +"[1]" ) +"%^000000"; mes "Possible gains:"; for( .@i = 3; .@i < getarraysize( getd(".p"+ .@j ) ); .@i += 3 ) mes "^0000FFx"+ getd(".p"+ .@j +"["+ .@i +"]" ) +"^000000 "+ getitemname( getd(".p"+ .@j +"["+ (.@i -1) +"]" ) ) +" (^CC0000"+ getd(".p"+ .@j +"["+ (.@i +1) +"]" ) +"%^000000)"; .@j++; next; } } mes .npc_name$; mes "Which item do you want to use ?"; next; for( .@j = 0; getd(".p"+ .@j ); .@j++ ) if( countitem( getd(".p"+ .@j ) ) ) { .@size = getarraysize( .@menu$ ); .@menu$[ .@size ] = getitemname( getd(".p"+ .@j ) ); .@sel[ .@size ] = .@j; } .@s = .@sel[ select( implode( .@menu$, ":" ) ) -1 ]; mes .npc_name$; while (1) { mes "Here we go..."; delitem getd(".p"+ .@s ), 1; if( rand(100) > getd(".p"+ .@s +"[1]" ) )// lose mes "You got nothing"; else { .@rand = rand( getd(".totalchance"+ .@s ) ); .@r = 1; while ( ( .@rand = .@rand - getd( ".p"+ .@s +"["+ (1+ 3 * .@r) +"]" ) ) >= 0 ) .@r++; getitem getd( ".p"+ .@s +"["+ (1+ 3*.@r -2) +"]" ), getd( ".p"+ .@s +"["+( 1+3*.@r -1 )+"]" ); mes "You got ^FF00CC"+ getd( ".p"+ .@s +"["+( 1+3*.@r -1 )+"]" ) +" "+ getitemname( getd( ".p"+ .@s +"["+ (1+ 3*.@r -2) +"]" ) ) +"^000000"; } mes " "; mes "wanna try again ?"; next; if ( select( "Yes", "No" ) == 2 ) close; mes .npc_name$; if ( countitem( getd(".p"+ .@s ) ) < 1 ) { mes "it seems you have ran out of "+ getitemname( getd(".p"+ .@s ) ); close; } } close; OnInit: // (item ID need) (chance), (reward 1) (number of reward 1) (chance to gain), (reward 2) (number of reward 2) (chance to gain)... setarray .p0, 671,50, 2462,1,20, 1161,1,30, 5394,1,50; // gold coin setarray .p1, 7227,20, 2462,1,10, 2541,1,10, 1161,1,10, 13517,1,70; while ( getd(".p"+ .@j ) ) { for( .@i = 4; .@i < getarraysize( getd(".p"+ .@j ) ); .@i += 3 ) setd ".totalchance"+ .@j, getd(".totalchance"+ .@j ) + getd(".p"+ .@j +"["+ .@i +"]" ); .@j++; } .npc_name$ = "[ "+ strnpcinfo(1) +"]"; end; } gold coin(50% to gain an item) Possible rewards: Sleipnir(20%), Balmung(30%),bubblegum(50%) tcg(20%to gain an item) Possible rewards: Sleipnir(10%), Asprika(10%), Balmung(10%),yggbox(70%) This option is set here // (item ID need) (chance), (reward 1) (number of reward 1) (chance to gain), (reward 2) (number of reward 2) (chance to gain)... setarray .p0, 671,50, 2462,1,20, 1161,1,30, 5394,1,50; // gold coin setarray .p1, 7227,20, 2462,1,10, 2541,1,10, 1161,1,10, 13517,1,70; You can add more reward or add an other list following the typo I wrote 1 1 Quote
0 LearningRO Posted March 25, 2020 Posted March 25, 2020 hi, @Capuche if player doesnt have the ticket in inventory when talk to npc get null menu how to change null > into required item and tell to player you dont have the item to play this gacha Quote
0 LewL Posted April 5, 2021 Posted April 5, 2021 On 4/4/2013 at 7:33 AM, Capuche said: prontera,155,180,5 script Random 98,{ mes .npc_name$; mes "Hello, do you want to play ?"; next; if( select( "Play !", "More Informations", "Leave" ) == 3 ) { mes .npc_name$; mes "Bye!~"; close; } else if( @menu == 2 ) { while( getd(".p"+ .@j ) ) { mes .npc_name$; mes "Item required: ^FFCC00"+ getitemname( getd(".p"+ .@j ) ) +"^000000"; mes "Chance to gain something: ^CC0000"+ getd(".p"+ .@j +"[1]" ) +"%^000000"; mes "Possible gains:"; for( .@i = 3; .@i < getarraysize( getd(".p"+ .@j ) ); .@i += 3 ) mes "^0000FFx"+ getd(".p"+ .@j +"["+ .@i +"]" ) +"^000000 "+ getitemname( getd(".p"+ .@j +"["+ (.@i -1) +"]" ) ) +" (^CC0000"+ getd(".p"+ .@j +"["+ (.@i +1) +"]" ) +"%^000000)"; .@j++; next; } } mes .npc_name$; mes "Which item do you want to use ?"; next; for( .@j = 0; getd(".p"+ .@j ); .@j++ ) if( countitem( getd(".p"+ .@j ) ) ) { .@size = getarraysize( .@menu$ ); .@menu$[ .@size ] = getitemname( getd(".p"+ .@j ) ); .@sel[ .@size ] = .@j; } .@s = .@sel[ select( implode( .@menu$, ":" ) ) -1 ]; mes .npc_name$; while (1) { mes "Here we go..."; delitem getd(".p"+ .@s ), 1; if( rand(100) > getd(".p"+ .@s +"[1]" ) )// lose mes "You got nothing"; else { .@rand = rand( getd(".totalchance"+ .@s ) ); .@r = 1; while ( ( .@rand = .@rand - getd( ".p"+ .@s +"["+ (1+ 3 * .@r) +"]" ) ) >= 0 ) .@r++; getitem getd( ".p"+ .@s +"["+ (1+ 3*.@r -2) +"]" ), getd( ".p"+ .@s +"["+( 1+3*.@r -1 )+"]" ); mes "You got ^FF00CC"+ getd( ".p"+ .@s +"["+( 1+3*.@r -1 )+"]" ) +" "+ getitemname( getd( ".p"+ .@s +"["+ (1+ 3*.@r -2) +"]" ) ) +"^000000"; } mes " "; mes "wanna try again ?"; next; if ( select( "Yes", "No" ) == 2 ) close; mes .npc_name$; if ( countitem( getd(".p"+ .@s ) ) < 1 ) { mes "it seems you have ran out of "+ getitemname( getd(".p"+ .@s ) ); close; } } close; OnInit: // (item ID need) (chance), (reward 1) (number of reward 1) (chance to gain), (reward 2) (number of reward 2) (chance to gain)... setarray .p0, 671,50, 2462,1,20, 1161,1,30, 5394,1,50; // gold coin setarray .p1, 7227,20, 2462,1,10, 2541,1,10, 1161,1,10, 13517,1,70; while ( getd(".p"+ .@j ) ) { for( .@i = 4; .@i < getarraysize( getd(".p"+ .@j ) ); .@i += 3 ) setd ".totalchance"+ .@j, getd(".totalchance"+ .@j ) + getd(".p"+ .@j +"["+ .@i +"]" ); .@j++; } .npc_name$ = "[ "+ strnpcinfo(1) +"]"; end; } This option is set here // (item ID need) (chance), (reward 1) (number of reward 1) (chance to gain), (reward 2) (number of reward 2) (chance to gain)... setarray .p0, 671,50, 2462,1,20, 1161,1,30, 5394,1,50; // gold coin setarray .p1, 7227,20, 2462,1,10, 2541,1,10, 1161,1,10, 13517,1,70; You can add more reward or add an other list following the typo I wrote @Capuche got error with this script hope you can help Quote
0 abdol Posted April 13, 2022 Posted April 13, 2022 On 3/20/2013 at 11:05 AM, Capuche said: prontera,150,184,5 script blop 56,{ mes "hello ! a little gamble ?"; mes "you will need "+ .item_num +" "+ getitemname( .item_req ) +" or "+ .item_num[1] +" "+ getitemname( .item_req[1] ) +" to play"; next; set .@req_1, countitem( .item_req ) - .item_num; set .@req_2, countitem( .item_req[1] ) - .item_num[1]; set .@s, select( ( .@req_1 >= 0 ? "Play with "+ getitemname( .item_req ) +"!" : "" ), ( .@req_2 >= 0 ? "Play with "+ getitemname( .item_req[1] ) +"!" : "" ),"Leave" ) -1; if( .@s == 2 ) { mes "good bye !"; close; } mes "let's see..."; sleep2 1000; mes "."; sleep2 1000; mes ".."; sleep2 1000; mes "..."; if( .percent_gain[.@s] < rand( 1,100 ) ) { mes "Sorry you lose !"; close; } set .@r, rand( .size_gain ); getitem .item_gainID[.@r], 1; delitem .item_req[.@s], .item_num[.@s]; mes "you got a "+ getitemname( .item_gainID[.@r] ) +" !"; close; OnInit: setarray .item_req, 671, 7227; setarray .item_num, 1, 1; // number of items req for each column setarray .percent_gain, 50,20; // % (independent) to gain something for each column // equiprobable gains setarray .item_gainID, 501,502,503; // Put ID YGG,bubble gum , token and else. set .size_gain, getarraysize( .item_gainID ); end; } try this it seems if you lose you don't lose the items also? so unlimited try until they win? Quote
0 Capuche Posted April 13, 2022 Posted April 13, 2022 https://github.com/Atemo/scripts_customs/blob/master/olds_scripts/gatcha.txt Quote
Yugosh Posted March 18, 2013 Author Posted March 18, 2013 help please yup you right but i want gold coin can change cash item like bloody branch or Tokenn... Quote
Capuche Posted March 18, 2013 Posted March 18, 2013 (edited) Same the Request script http://rathena.org/board/topic/79595-costumeheadgear-gacha-npc/ but i have a diffrent like him. i want 671 Gold Coin have a 50% drop chance and 7227 TCG have 20% drop chance the drop is like YGG,bubble gum , token and else.... the script can work also to eathena thanks master, This request was about giving a normal/rare costume in exchange for a ticket, it was not about drop. Maybe you mean to give a gold coin (50% chance) or tgc (20% chance) etc.. in exchange to something ? Edited March 18, 2013 by Capuche 1 Quote
Capuche Posted March 20, 2013 Posted March 20, 2013 prontera,150,184,5 script blop 56,{ mes "hello ! a little gamble ?"; mes "you will need "+ .item_num +" "+ getitemname( .item_req ) +" or "+ .item_num[1] +" "+ getitemname( .item_req[1] ) +" to play"; next; set .@req_1, countitem( .item_req ) - .item_num; set .@req_2, countitem( .item_req[1] ) - .item_num[1]; set .@s, select( ( .@req_1 >= 0 ? "Play with "+ getitemname( .item_req ) +"!" : "" ), ( .@req_2 >= 0 ? "Play with "+ getitemname( .item_req[1] ) +"!" : "" ),"Leave" ) -1; if( .@s == 2 ) { mes "good bye !"; close; } mes "let's see..."; sleep2 1000; mes "."; sleep2 1000; mes ".."; sleep2 1000; mes "..."; if( .percent_gain[.@s] < rand( 1,100 ) ) { mes "Sorry you lose !"; close; } set .@r, rand( .size_gain ); getitem .item_gainID[.@r], 1; delitem .item_req[.@s], .item_num[.@s]; mes "you got a "+ getitemname( .item_gainID[.@r] ) +" !"; close; OnInit: setarray .item_req, 671, 7227; setarray .item_num, 1, 1; // number of items req for each column setarray .percent_gain, 50,20; // % (independent) to gain something for each column // equiprobable gains setarray .item_gainID, 501,502,503; // Put ID YGG,bubble gum , token and else. set .size_gain, getarraysize( .item_gainID ); end; } try this 1 Quote
hyuna Posted April 3, 2013 Posted April 3, 2013 @Capuche nyc script but I wanna ask for something a bit different I want Gold Coin and TCG to have different sets of items with different percentages ex. gold coin(50% to gain an item) Possible rewards: Sleipnir(20%), Balmung(30%),bubblegum(50%) tcg(20%to gain an item) Possible rewards: Sleipnir(10%), Asprika(10%), Balmung(10%),yggbox(70%) something like that pls.... Quote
hyuna Posted April 5, 2013 Posted April 5, 2013 I was about to ask for an addition of quantity(but you read my mind) wew THX for this!!!!!!!!!! +1 Quote
Question
Yugosh
Same the Request script http://rathena.org/board/topic/79595-costumeheadgear-gacha-npc/
but i have a diffrent like him.
i want 671 Gold Coin have a 50% drop chance
and 7227 TCG have 20% drop chance
the drop is like YGG,bubble gum , token and else....
the script can work also to eathena
thanks master,
11 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.