Jump to content
  • 0

R> Color Game Machine


Question

Posted

Hi, I would like to request an Color Game Machine using the illust image provided inside the data.grf and rdata.grf. Here's the mechanics of the Machine when the player talk to the machine, The Machine asked to input TCG(any amount) and select color he/she wants then after the transaction the machine will rolled off a random color with animation using "cutin" so players can see which colors will be the machine to be chosen then .


when the color matches the player's chosen color, He/She will win double prize let say he input 5pcs of TCG then he got 10TCG .

Images here.
http://i42.tinypic.com/14t28tk.png
http://i41.tinypic.com/25z5izs.jpg
http://i44.tinypic.com/rviop1.png
http://i43.tinypic.com/a1u3xw.jpg
http://i40.tinypic.com/29c6p78.png


Thanks & More Power to rAthena

14 answers to this question

Recommended Posts

  • 1
Posted

prontera,150,188,5	script	Color Machine	100,{
	cutin "color_machine_0", 2;
	if ( countitem(7227) < 5 ) {
		mes "you must have at least 5 TCG to play";
		close2;
		cutin "", 255;
		end;
	}
	mes "how many TCG you want to play ?";
	mes "minimum to bet = 5";
	next;
	input .@input, 5, countitem(7227);
	mes "betting = "+ .@input;
	mes "choose a color";
	next;
	.@s = select( "Red", "Green", "Blue", "Yellow" ) -1;
	.@r = rand(4);
	.@loop = .@r + 4*5 +1; // 4 choices * 10 loops
	for ( .@i = 0; .@i < .@loop; .@i++ ) {
		cutin "color_machine_"+( .@i%4 +1 ), 2;
		sleep2 250;
	}
	if ( .@s == .@r ) {
		mes "Correct !";
		getitem 7227, .@input;
	}
	else {
		mes "Wrong";
		delitem 7227, .@input;
	}
	close2;
	cutin "", 255;
	end;
}
I got a pm regarding this topic, so I want to say something

in this script request section we supporters only write the system

if you want this npc looks more interesting, you have to learn how to edit the dialog

like add mes,next,progressbar ... these stuff you have to do it yourself

if you edited this script and its not working, feel free to post your edited script in script support section

  • Upvote 1
Posted

mathematics ..

there are 4 choices, and if choose 1 correct, your prize get double

means the probability of earning back is money is x*2/4 = 1/2x ...

... the more you play ... your money gradually gets lessen by 1/2 ...

just kidding

 color_machine.rar

prontera,150,188,5	script	kjhdfkjsdhf	100,{
	cutin "color_machine_0", 2;
	if ( countitem(7227) < 5 ) {
		mes "you must have at least 5 TCG to play";
		close2;
		cutin "", 255;
		end;
	}
	mes "choose a color";
	select "Red", "Green", "Blue", "Yellow";
	.@r = rand(1,4);
	cutin "color_machine_"+ .@r, 2;
	if ( @menu == .@r ) {
		mes "Correct !";
		getitem 7227, 5;
	}
	else {
		mes "Wrong";
		delitem 7227, 5;
	}
	close2;
	cutin "", 255;
	end;
}
btw I'm just writing for fun, since I haven't write any script using cutin for about ... 5 years ? lol ...
Posted

	if ( @menu == .@r ) {
		mes "Correct !";
		getitem 7227, 5;
	}
	else {
		mes "Wrong";
		delitem 7227, 5;
	}
	close2;
	cutin "", 255;
	end;

impossible, I've tested in-game before I post on the board

... I think no need a screenshot to prove <.<

maybe you edited something ... try show it

Posted (edited)

mathematics ..

there are 4 choices, and if choose 1 correct, your prize get double

means the probability of earning back is money is x*2/4 = 1/2x ...

... the more you play ... your money gradually gets lessen by 1/2 ...

just kidding

 attachicon.gifcolor_machine.rar

prontera,150,188,5	script	kjhdfkjsdhf	100,{
	cutin "color_machine_0", 2;
	if ( countitem(7227) < 5 ) {
		mes "you must have at least 5 TCG to play";
		close2;
		cutin "", 255;
		end;
	}
	mes "choose a color";
	select "Red", "Green", "Blue", "Yellow";
	.@r = rand(1,4);
	cutin "color_machine_"+ .@r, 2;
	if ( @menu == .@r ) {
		mes "Correct !";
		getitem 7227, 5;
	}
	else {
		mes "Wrong";
		delitem 7227, 5;
	}
	close2;
	cutin "", 255;
	end;
}
btw I'm just writing for fun, since I haven't write any script using cutin for about ... 5 years ? lol ..

hi i tested your script and it works fine it is possible to have timer so that there's an animation like this? after inputing 5 tcg then the animation will go for 10 seconds then it will stop on the winning random color

http://imgflip.com/i/5ln48

Edited by Xii
Posted

hi madam im amze this script for rathena can you convert to eathena

 

change

	.@s = select( "Red", "Green", "Blue", "Yellow" ) -1;
	.@r = rand(4);
	.@loop = .@r + 4*5 +1; // 4 choices * 10 loops
	for ( .@i = 0; .@i < .@loop; .@i++ ) {

to

	set .@s,select( "Red", "Green", "Blue", "Yellow" ) -1;
	set .@r,rand(4);
	set .@loop,( .@r + 4*5 +1 ); // 4 choices * 10 loops
	for ( set .@i,0; .@i < .@loop; set .@i,.@i + 1 ) {

 

Sorry to ask but where to upload the images under color_machine.rar?

illust folder

Posted (edited)

Hello I tried putting the Images in illust folder, but when I talk to the npc the image doesnt show :( any help ?

put the image at illust folder inside texture folder, make sure the images are bmp not jpg, or png

Edited by Yonko
Posted

 

Hello I tried putting the Images in illust folder, but when I talk to the npc the image doesnt show :( any help ?

put the image at illust folder inside texture folder, make sure the images are bmp not jpg, or png

 

Yea Im pretty surs its inside that folder and is bmp. But when I talk to the color game machine the image doesnt show

Posted
prontera,150,188,5	script	Color Machine	100,{
	cutin "color_machine_0", 2;
	if ( countitem(7227) < 5 ) {
		mes "you must have at least 5 TCG to play";
		close2;
		cutin "", 255;
		end;
	}
	mes "how many TCG you want to play ?";
	mes "minimum to bet = 5";
	next;
	input .@input, 5, countitem(7227);
	mes "betting = "+ .@input;
	mes "choose a color";
	next;
	.@s = select( "Red", "Green", "Blue", "Yellow" ) -1;
	.@r = rand(4);
	.@loop = .@r + 4*5 +1; // 4 choices * 10 loops
	for ( .@i = 0; .@i < .@loop; .@i++ ) {
		cutin "color_machine_"+( .@i%4 +1 ), 2;
		sleep2 250;
	}
	if ( .@s == .@r ) {
		mes "Correct !";
		getitem 7227, .@input;
	}
	else {
		mes "Wrong";
		delitem 7227, .@input;
	}
	close2;
	cutin "", 255;
	end;
}
I got a pm regarding this topic, so I want to say something

in this script request section we supporters only write the system

if you want this npc looks more interesting, you have to learn how to edit the dialog

like add mes,next,progressbar ... these stuff you have to do it yourself

if you edited this script and its not working, feel free to post your edited script in script support section

 

Hi Annie I'm digging up this script and it works fine on my server but actually i need something to modify since the pattern of cutins are Red Green Blue Yellow and when it rolls it starts from R-G-B-Y (like consecutives) how will i make this starts at random color let say G-Y-B-R / B-Y-R-G and so forth different combinations thank you :)

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...