Jump to content
  • 0
Sign in to follow this  
AyenPanda

R> Zeny Roulette NPC using Cutin.

Question

Posted (edited)

i Got my Cutins but the zeny roulette script is all need.  here is the sample cutin 1s_1.bmp

the thing is i am requesting for the roulette paying zeny. if you talk to the npc it will display the default cutin (zeny_rolet.bmp) showing the prize of roulette each level , asking you if you want to play the roulette paying 100k, this roulette has a 7 level. as you can see on the BMP cutin sample. zeny_rolet.bmp
so at the first level, there is a 1s_1 to 1s_9 cutins , if i pay 100k for example it will run the roulette and it will stop on certain cutin that will correspond a prize you can get according what on the cutins (1s_2 to 1s_8 ) and get you to level 2 going to 2s_1 to 2s_8 cutins , after getting to level 2 , you need to pay another 100k to be able to run the roulette at that level after winning a prize will get you on level 3, which if you won a prize it will get you higher until level 7  which is the last level .and if it is at the (/) which is the 1s_1 and 1s_9 which is like a try again button as well as the level 2 where 2s_1 and 2s_8 is the try again (/) , you need to pay 100k again if you want to continue play on that level and get you to higher level.

P.S. : if you win a prize there is a SC effect like Mammonite, and if you won the Jackpot prize at level 7, it announce "Emistry won the jackpot prize (the jackpot prize name) at Zeny Roulette, get yours now!" and if there is possible to put a mp3 while playing the roulette.

 

 

 

Edited by AyenPanda

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Try below

prontera,150,150,6	script	Zeny Roulette	4_F_KAFRA1,{
	function Roll;
	cutin "1s_1", 3;
	mes .npc$;
	mes "Hi " + strcharinfo(0) + ", So do you want to play zeny roulette?";
	next;
	
	if (select("~ Yes:~ No") & 2) {
		mes .npc$;
		mes "Alright!";
		close2;
		cutin "", 255;
		end;
	}
	
	mes .npc$;
	mes "Let's go!";
	next;
	
	@level = 1;
	
	while(1) {
		switch(select("~ Play:~ Exit")) {
			case 1: 
				[email protected]$ = Roll(@level);
				if ([email protected]$ == "NZ") {
					mes .npc$;
					mes "You need " + callfunc("F_InsertComma", .zeny_amt_need) + " in order to participate in the roulette.";
					[email protected] = 1;
					break;
				}
				if ([email protected]$ == "NA") {
					mes .npc$;
					mes "Seems not your lucky day " + strcharinfo(0);
					if (@level > 1)
						@level--;
					next;
					break;
				}
				[email protected] = inarray(.item_cutin$, [email protected]$);
				mes .npc$;
				mes "Congratulations! You won ^FF8000" + getitemname(.item_reward[[email protected]]) + "^000000!";
				getitem .item_reward[[email protected]], 1;
				specialeffect 10;
				// Jackpot
				if ([email protected]$ == "7s_2") {
					announce strcharinfo(0) + " just won the jackpot prize " + getitemname(.item_reward[[email protected]]) + " at Zeny Roulette, get yours now!", 0;
					@level = 1;
					[email protected] = 1;
					break;
				}
				@level++;
				next;
				break;
			case 2:
			default:
				[email protected] = 1;
				break;
		}
		
		if ([email protected]) { [email protected] = 0; break; }
	}
	
	close2;
	cutin "", 255;
	end;
	
	function Roll {
		if (.zeny_required && .zeny_amt_need > Zeny)
			return "NZ";
		Zeny -= .zeny_amt_need;
		[email protected] = getarg(0, 1);
		while(1) {
			[email protected] = 0;
			for ([email protected] = 1; [email protected] <= (10 - [email protected]); [email protected]++) {
				cutin [email protected] + "s_" + [email protected], 3;
				if (5 > rand(100)) {
					[email protected] = 1;
					[email protected]_cutin$ = [email protected] + "s_" + [email protected];
					if ([email protected] == 1 || [email protected] == (10 - [email protected]))
						[email protected]_cutin$ = "NA";
					break;
				}
				sleep2 100;
			}
			
			if ([email protected])
				break;
		}
		return [email protected]_cutin$;
	}
	
	OnInit:
		.npc$ = "[^808080 " + strnpcinfo(1) + " ^000000]";
		.zeny_required = 1; // 1 = yes / 0 = no
		.zeny_amt_need = 100000; // zeny amount needed
		setarray .item_cutin$[0], "1s_2", "1s_3", "1s_4", "1s_5", "1s_6", "1s_7", "1s_8", "2s_2", "2s_3", "2s_4", "2s_5", "2s_6", "2s_7", "3s_2", "3s_3", "3s_4", "3s_5", "3s_6", "4s_2", "4s_3", "4s_4", "4s_5", "5s_2", "5s_3", "5s_4", "6s_2", "6s_3", "7s_2";	
		setarray .item_reward[0], 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507;
		end;
}

You have to set the rewards properly

setarray .item_cutin$[0], "1s_2", "1s_3", "1s_4", "1s_5", "1s_6", "1s_7", "1s_8", "2s_2", "2s_3", "2s_4", "2s_5", "2s_6", "2s_7", "3s_2", "3s_3", "3s_4", "3s_5", "3s_6", "4s_2", "4s_3", "4s_4", "4s_5", "5s_2", "5s_3", "5s_4", "6s_2", "6s_3", "7s_2";	
setarray .item_reward[0], 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507, 501, 502, 503, 504, 505, 506, 507;

 

Edited by Patskie
add specialeffect
  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	cutin "1s_1", 3;
	for ([email protected] = 1; [email protected] <= 7; [email protected]++)
		for ([email protected] = 0; [email protected] < (10 - [email protected]); [email protected]++) {
			cutin [email protected]+"s_"[email protected], 3;
			sleep2 ([email protected] * 100) + ([email protected] * 100);
		}
	close2;
	cutin "", 255;
	end;
}

 

Share this post


Link to post
Share on other sites
  • 0
On 4/18/2020 at 11:39 PM, Emistry said:
prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	cutin "1s_1", 3;
	for ([email protected] = 1; [email protected] <= 7; [email protected]++)
		for ([email protected] = 0; [email protected] < (10 - [email protected]); [email protected]++) {
			cutin [email protected]+"s_"[email protected], 3;
			sleep2 ([email protected] * 100) + ([email protected] * 100);
		}
	close2;
	cutin "", 255;
	end;
}

 

boss can you apply it with roullette paying for zeny ? for example 100k.

up!

Share this post


Link to post
Share on other sites
  • 0
prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	mes "Pay "+.zeny+" Zeny to play?";
	cutin "1s_1", 3;
	if (select("Pay", "Cancel") == 1) {
		if (Zeny < .zeny) {
			mes "Not enough zeny.";
		}
		else {
			for ([email protected] = 1; [email protected] <= 7; [email protected]++)
				for ([email protected] = 0; [email protected] < (10 - [email protected]); [email protected]++) {
					cutin [email protected]+"s_"[email protected], 3;
					sleep2 ([email protected] * 100) + ([email protected] * 100);
				}
		}
	}
	close2;
	cutin "", 255;
	end;
	
	OnInit:
		.zeny = 100000;
		end;
}

in future, please write everything in your first post rather than keep asking for changes.

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
On 4/26/2020 at 12:51 AM, Emistry said:
prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	mes "Pay "+.zeny+" Zeny to play?";
	cutin "1s_1", 3;
	if (select("Pay", "Cancel") == 1) {
		if (Zeny < .zeny) {
			mes "Not enough zeny.";
		}
		else {
			for ([email protected] = 1; [email protected] <= 7; [email protected]++)
				for ([email protected] = 0; [email protected] < (10 - [email protected]); [email protected]++) {
					cutin [email protected]+"s_"[email protected], 3;
					sleep2 ([email protected] * 100) + ([email protected] * 100);
				}
		}
	}
	close2;
	cutin "", 255;
	end;
	
	OnInit:
		.zeny = 100000;
		end;
}

in future, please write everything in your first post rather than keep asking for changes.

i am so sorry boss @Emistry. i thought that i explain it well on the first post. it is indeed my fault. forgive me. the thing is i am requesting for the roulette paying zeny. if you talk to the npc it will display the default cutin (zeny_rolet.bmp) showing the prize of roulette each level , asking you if you want to play the roulette paying 100k, this roulette has a 7 level. as you can see on the BMP cutin sample. zeny_rolet.bmp
so at the first level, there is a 1s_1 to 1s_9 cutins , if i pay 100k for example it will run the roulette and it will stop on certain cutin that will correspond a prize you can get according what on the cutins (1s_2 to 1s_8 ) and get you to level 2 going to 2s_1 to 2s_8 cutins , after getting to level 2 , you need to pay another 100k to be able to run the roulette at that level after winning a prize will get you on level 3, which if you won a prize it will get you higher until level 7  which is the last level .and if it is at the (/) which is the 1s_1 and 1s_9 which is like a try again button as well as the level 2 where 2s_1 and 2s_8 is the try again (/) , you need to pay 100k again if you want to continue play on that level and get you to higher level.

P.S. : if you win a prize there is a SC effect like Mammonite, and if you won the Jackpot prize at level 7, it announce "Emistry won the jackpot prize (the jackpot prize name) at Zeny Roulette, get yours now!" and if there is possible to put a mp3 while playing the roulette.

Thank you so much boss in advance.

Thank you

up! 

Edited by AyenPanda

Share this post


Link to post
Share on other sites
  • 0

Good evening everyone, i just want to up this topic, it's been two weeks now. 😄 hopefully some kind heart might help me. Thank you!

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.