Jump to content
  • 0

Gatcha Item Use Gold coin and TCG !


Yugosh

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  65
  • Reputation:   0
  • Joined:  05/09/12
  • Last Seen:  

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,

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 1

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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

  • Upvote 1
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.02
  • Content Count:  84
  • Reputation:   1
  • Joined:  01/08/20
  • Last Seen:  

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 ?

1.png.2df97c3dc89f50218e7be116315bc7a6.png

 

2.png.1adc32c2961b97f876c96f8024a661ac.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.02
  • Content Count:  43
  • Reputation:   0
  • Joined:  04/06/22
  • Last Seen:  

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?

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  65
  • Reputation:   0
  • Joined:  05/09/12
  • Last Seen:  

help please

yup you right but i want gold coin can change cash item like bloody branch or Tokenn...

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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 by Capuche
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  65
  • Reputation:   0
  • Joined:  05/09/12
  • Last Seen:  

Wha Thanks you so muchhhh rep_up.png +1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  144
  • Reputation:   4
  • Joined:  10/28/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  144
  • Reputation:   4
  • Joined:  10/28/12
  • Last Seen:  

I was about to ask for an addition of quantity(but you read my mind) wew THX for this!!!!!!!!!! +1

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