Jump to content
  • 0

Slot machine nuked


Quesooo

Question


  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

hi good day where can i add nuke or kill player if she/he get a 3x slot failed?

 

also a special effect that he/she explode?

 

thank you this is the script

 

prontera,163,161,4	script	SlotMachine	563,{

	if( getgmlevel() == 99 ) {
		mes "Welcome Administrator.","What would you like to do?";
		menu "Play Game",-,"Change Slot Machine Mode",iMode;
		next;
		}
switch( getd(".mode"+strnpcinfo(3)+"") ){
	case 0: // Single Slot machine mode.
		mes "Do you want to play a game?";
		if( !.payment ) { mes "It costs: "+ .ssm_payment_message$[0] +" to play."; }
			else if ( .payment == 1 ) { mes "It costs: "+ .ssm_payment_message$[1] +" to play."; }
				else if ( .payment == 2 ) { mes "It costs: "+ .ssm_payment_message$[0] +" & "+ .payment_message$[1] +" to play."; }
		if( select("YES:NO") == 2 || Zeny < .ssm_payment[0] && ( !.payment || .payment == 2 ) || countitem(.ssm_payment[1]) < .ssm_payment[2] && .payment ){ close; }
		while( @menu == 1 ){
		if (.EventON == 0) {mes "Slot Machine already finished"; cutin "",255; end;}
			if( !.payment || .payment == 2 ) { Zeny -= .ssm_payment[0]; }
			if( .payment ) { delitem( .ssm_payment[1], .ssm_payment[2] ); }
			if( .soundeffects ) { soundeffect "slot_jackpot.wav",0; }
			.@a = rand(1,100);
			if( .@a < atoi(.ssm_animate$[0]) ){ .@a = 1; } else { .@a = 2; }
			.@b = 1;
			while( .@b < atoi(.ssm_animate$[.@a]) ) {
				cutin .ssm_animate$[3] + .@b,4; sleep2 ( ( atoi(.ssm_animate$[4]) * 1000 ) / atoi(.ssm_animate$[.@a]) ); .@b++;
				}
			if( .@a == 1 ){ 
				cutin .ssm_animate$[3] + atoi(.ssm_animate$[.@a]),4;
				dispbottom "Failed";
				} 
			else {
				cutin .ssm_animate$[3] + atoi(.ssm_animate$[.@a]),4;
				switch(rand(5)) {
				case 0:
					getitem 603,5;
					specialeffect2 10;
					break;
				case 1:
					getitem 617,5;
					specialeffect2 10;	
					break;
				case 2:
					getitem 644,5;
					specialeffect2 10;
					break;
				case 3:
					getitem 616,1;
					specialeffect2 10;
					break;
				case 4:
					getitem 7776,2;
					specialeffect2 10;
					break;
				case 5:
					getitem 18571,1;
					specialeffect2 10;
					break;
				}
				}
			if( select("Another Round:I'm done") == 2 || Zeny < .ssm_payment[0] && ( !.payment || .payment == 2 ) || countitem(.ssm_payment[1]) < .ssm_payment[2] && .payment ){ cutin "",255; close; }
			}
		end;
	
	case 1: // Triple Slot machine mode.
		mes "Do you want to play a game?";
		if( !.payment ) { mes "It costs: "+ .tsm_payment_message$[0] +" to play."; }
			else if ( .payment == 1 ) { mes "It costs: "+ .tsm_payment_message$[1] +" to play."; }
				else if ( .payment == 2 ) { mes "It costs: "+ .tsm_payment_message$[0] +" & "+ .tsm_payment_message$[1] +" to play."; }
		if( select("YES:NO") == 2 || Zeny < .tsm_payment[0] && ( !.payment || .payment == 2 ) || countitem(.tsm_payment[1]) < .tsm_payment[2] && .payment ){ close; }
		while( @menu == 1 ){
		if (.EventON == 0) {mes "Slot Machine already finished"; cutin "",255; end;}
			if( !.payment || .payment == 2 ) { Zeny -= .tsm_payment[0]; }
			if( .payment ) { delitem( .tsm_payment[1], .tsm_payment[2] ); }
			if( .soundeffects ) { soundeffect "slot_jackpot.wav",0; }
			// Slot 1 = 100% Chance for success. (Because I didn't make a fail animation for it.
			.@2 = rand(1,100); //Rolls dice for Slot 2
			.@3 = rand(1,100); //Rolls dice for Slot 3
				if( .@2 <= atoi(.tsm_animate$[0]) && .@3 <= atoi(.tsm_animate$[1]) ){ .@a = 8; }
				else if( .@2 <= atoi(.tsm_animate$[0]) && .@3 > atoi(.tsm_animate$[1]) ){ .@a = 6; }
				else if( .@2 > atoi(.tsm_animate$[0]) && .@3 <= atoi(.tsm_animate$[1]) ){ .@a = 4; }
				else { .@a = 2; }
			.@b = 1;
			while( .@b < atoi(.tsm_animate$[.@a+1]) ) {
				cutin .tsm_animate$[.@a] + .@b,4; sleep2 ( ( atoi(.tsm_animate$[10]) * 1000 ) / atoi(.tsm_animate$[.@a+1]) ); .@b++;
				}
			cutin .tsm_animate$[.@a] + atoi(.tsm_animate$[.@a+1]),4;
				if( .@a == 2 ){
					switch(rand(5)) {
				case 0:
					getitem 603,5;
					specialeffect2 10;
					break;
				case 1:
					getitem 617,5;
					specialeffect2 10;	
					break;
				case 2:
					getitem 644,5;
					specialeffect2 10;
					break;
				case 3:
					getitem 616,1;
					specialeffect2 10;
					break;
				case 4:
					getitem 7776,2;
					specialeffect2 10;
					break;
				case 5:
					getitem 18571,1;
					specialeffect2 10;
					break;
				}
				} else { dispbottom "Failed"; }
			if( select("Another Round:I'm done") == 2 || Zeny < .tsm_payment[0] && ( !.payment || .payment == 2 ) || countitem(.tsm_payment[1]) < .tsm_payment[2] && .payment ){ cutin "",255; close; }
			}
		end;
	}

OnSingleSlot:
setd ".mode"+strnpcinfo(3)+"",0;
end;
OnTripleSlot:
setd ".mode"+strnpcinfo(3)+"",1;
end;

iMode:
next;
mes "Which did you want to do?";
menu "Change THIS machine's mode:Change ALL machine's mode",-;
if( @menu == 1 ) {
	next;
	mes "What mode would you like this machine to have?";
	menu "Single Slot Machine Mode:Triple Slot Machine Mode",-;
	if( @menu == 1 ) {
		setd ".mode"+strnpcinfo(3)+"",0;
		} else {
			setd ".mode"+strnpcinfo(3)+"",1;
			}
	close;
	} else {
		next;
		mes "What mode would you like to change all slot machines to?";
		menu "Single Slot Machine Mode:Triple Slot Machine Mode",-;
		if( @menu == 1 ) {
			donpcevent "::OnSingleSlot";
			} else {
				donpcevent "::OnTripleSlot";
				}
		close;
		}
OnClock0000:
OnClock1000:
OnClock1600:
	announce "Mysterious Slot Machine will begin at prontera 163 161 in 1 minute.", bc_all;
	sleep 60000;
	announce "Slot machine event has begun at prontera 163 161", bc_all;
	set .EventON,1;
	hideoffnpc strnpcinfo(3);
	sleep 225000;
	announce "Mysterious Slot Machine event is over thank you for playing", bc_all;
	set .EventON,0;
	hideonnpc strnpcinfo(3);
	end;

OnInit:
hideonnpc strnpcinfo(3);

//[ 0 = Single Slot Machine Mode ]_[ 1 = Triple Slot Machine Mode ]
setd ".mode"+strnpcinfo(3)+"",1;

//[0] = Fail Rate
//[1] = Fail (Do not change)
//[2] = Success (Do not change)
//[3] = File Name (Do not change)
//[4] = Animation Time (Do not change, for best results :D)
setarray .ssm_animate$[0],"30","29","33","slot_","3";

//[0] = Fail Rate "Slot 2"
//[1] = Fail Rate "Slot 3"
//[2] = SSS (Do not change)
//[3] = SSS_Count (Do not change)
//[4] = SSF (Do not change)
//[5] = SSF_Count (Do not change)
//[6] = SFS (Do not change)
//[7] = SFS_Count (Do not change)
//[8] = SFF (Do not change)
//[9] = SFF_Count (Do not change)
//[10] = Animation Time (Do not change, for best results :D)
setarray .tsm_animate$[0],"30","30","SSS_","41","SSF_","37","SFS_","41","SFF_","45","3";

// Payment Settings
// Payment Type
// 0 = Zeny, 1 = Item, 2 = Zeny&Item
.payment = 1;
// [0] = Zeny, [1] = Item ID, [2] = Item Amount;
setarray .ssm_payment[0],100000,7720,3; // Single Slot Machine Payment Price
setarray .tsm_payment[0],100000,7720,3; // Triple Slot Machine Payment Price

// DO NOT CHANGE BELOW
// Payment Text Syntax
setarray .ssm_payment_message$[0],""+ .ssm_payment[0] +" zeny",""+ getitemname(.ssm_payment[1]) +" x"+ .ssm_payment[2] +"";
setarray .tsm_payment_message$[0],""+ .tsm_payment[0] +" zeny",""+ getitemname(.tsm_payment[1]) +" x"+ .tsm_payment[2] +"";
end;
}

 

credits to owner of this released @hendra814

Edited by Quesooo
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  281
  • Reputation:   14
  • Joined:  10/14/13
  • Last Seen:  

@Quesooo If failed x3 the players will get nuked using this:

For the single slot machine mode, find this part of the script:

				cutin .ssm_animate$[3] + atoi(.ssm_animate$[.@a]),4;
				dispbottom "Failed";

below that line, add the following:

				slt_fld01++;
					if (slt_fld01  >= 3){
						slt_fld01 = 0;
						atcommand "@nuke "+strcharinfo(0);
					}

 

For the Triple slot machine mode, find his part of the script:

} else { dispbottom "Failed"; }

and replace it with this:

				} else {
					dispbottom "Failed"; 
					slt_fld03++;
						if (slt_fld03  >= 3){
							slt_fld03 = 0;
							atcommand "@nuke "+strcharinfo(0);
						}
				}


 

 

Here's your script, I already added the changes I made above.

prontera,163,161,4	script	SlotMachine	563,{

	if( getgmlevel() == 99 ) {
		mes "Welcome Administrator.","What would you like to do?";
		menu "Play Game",-,"Change Slot Machine Mode",iMode;
		next;
		}
switch( getd(".mode"+strnpcinfo(3)+"") ){
	case 0: // Single Slot machine mode.
		mes "Do you want to play a game?";
		if( !.payment ) { mes "It costs: "+ .ssm_payment_message$[0] +" to play."; }
			else if ( .payment == 1 ) { mes "It costs: "+ .ssm_payment_message$[1] +" to play."; }
				else if ( .payment == 2 ) { mes "It costs: "+ .ssm_payment_message$[0] +" & "+ .payment_message$[1] +" to play."; }
		if( select("YES:NO") == 2 || Zeny < .ssm_payment[0] && ( !.payment || .payment == 2 ) || countitem(.ssm_payment[1]) < .ssm_payment[2] && .payment ){ close; }
		while( @menu == 1 ){
		if (.EventON == 0) {mes "Slot Machine already finished"; cutin "",255; end;}
			if( !.payment || .payment == 2 ) { Zeny -= .ssm_payment[0]; }
			if( .payment ) { delitem( .ssm_payment[1], .ssm_payment[2] ); }
			if( .soundeffects ) { soundeffect "slot_jackpot.wav",0; }
			.@a = rand(1,100);
			if( .@a < atoi(.ssm_animate$[0]) ){ .@a = 1; } else { .@a = 2; }
			.@b = 1;
			while( .@b < atoi(.ssm_animate$[.@a]) ) {
				cutin .ssm_animate$[3] + .@b,4; sleep2 ( ( atoi(.ssm_animate$[4]) * 1000 ) / atoi(.ssm_animate$[.@a]) ); .@b++;
				}
			if( .@a == 1 ){ 
				cutin .ssm_animate$[3] + atoi(.ssm_animate$[.@a]),4;
				dispbottom "Failed";
				slt_fld01++;
					if (slt_fld01  >= 3){
						slt_fld01 = 0;
						atcommand "@nuke "+strcharinfo(0);
					}
				}
			else {
				cutin .ssm_animate$[3] + atoi(.ssm_animate$[.@a]),4;
				switch(rand(5)) {
				case 0:
					getitem 603,5;
					specialeffect2 10;
					break;
				case 1:
					getitem 617,5;
					specialeffect2 10;	
					break;
				case 2:
					getitem 644,5;
					specialeffect2 10;
					break;
				case 3:
					getitem 616,1;
					specialeffect2 10;
					break;
				case 4:
					getitem 7776,2;
					specialeffect2 10;
					break;
				case 5:
					getitem 18571,1;
					specialeffect2 10;
					break;
				}
				}
			if( select("Another Round:I'm done") == 2 || Zeny < .ssm_payment[0] && ( !.payment || .payment == 2 ) || countitem(.ssm_payment[1]) < .ssm_payment[2] && .payment ){ cutin "",255; close; }
			}
		end;
	
	case 1: // Triple Slot machine mode.
		mes "Do you want to play a game?";
		if( !.payment ) { mes "It costs: "+ .tsm_payment_message$[0] +" to play."; }
			else if ( .payment == 1 ) { mes "It costs: "+ .tsm_payment_message$[1] +" to play."; }
				else if ( .payment == 2 ) { mes "It costs: "+ .tsm_payment_message$[0] +" & "+ .tsm_payment_message$[1] +" to play."; }
		if( select("YES:NO") == 2 || Zeny < .tsm_payment[0] && ( !.payment || .payment == 2 ) || countitem(.tsm_payment[1]) < .tsm_payment[2] && .payment ){ close; }
		while( @menu == 1 ){
		if (.EventON == 0) {mes "Slot Machine already finished"; cutin "",255; end;}
			if( !.payment || .payment == 2 ) { Zeny -= .tsm_payment[0]; }
			if( .payment ) { delitem( .tsm_payment[1], .tsm_payment[2] ); }
			if( .soundeffects ) { soundeffect "slot_jackpot.wav",0; }
			// Slot 1 = 100% Chance for success. (Because I didn't make a fail animation for it.
			.@2 = rand(1,100); //Rolls dice for Slot 2
			.@3 = rand(1,100); //Rolls dice for Slot 3
				if( .@2 <= atoi(.tsm_animate$[0]) && .@3 <= atoi(.tsm_animate$[1]) ){ .@a = 8; }
				else if( .@2 <= atoi(.tsm_animate$[0]) && .@3 > atoi(.tsm_animate$[1]) ){ .@a = 6; }
				else if( .@2 > atoi(.tsm_animate$[0]) && .@3 <= atoi(.tsm_animate$[1]) ){ .@a = 4; }
				else { .@a = 2; }
			.@b = 1;
			while( .@b < atoi(.tsm_animate$[.@a+1]) ) {
				cutin .tsm_animate$[.@a] + .@b,4; sleep2 ( ( atoi(.tsm_animate$[10]) * 1000 ) / atoi(.tsm_animate$[.@a+1]) ); .@b++;
				}
			cutin .tsm_animate$[.@a] + atoi(.tsm_animate$[.@a+1]),4;
				if( .@a == 2 ){
					switch(rand(5)) {
				case 0:
					getitem 603,5;
					specialeffect2 10;
					break;
				case 1:
					getitem 617,5;
					specialeffect2 10;	
					break;
				case 2:
					getitem 644,5;
					specialeffect2 10;
					break;
				case 3:
					getitem 616,1;
					specialeffect2 10;
					break;
				case 4:
					getitem 7776,2;
					specialeffect2 10;
					break;
				case 5:
					getitem 18571,1;
					specialeffect2 10;
					break;
				}
				} else {
					dispbottom "Failed"; 
					slt_fld03++;
						if (slt_fld03  >= 3){
							slt_fld03 = 0;
							atcommand "@nuke "+strcharinfo(0);
						}
				}
			if( select("Another Round:I'm done") == 2 || Zeny < .tsm_payment[0] && ( !.payment || .payment == 2 ) || countitem(.tsm_payment[1]) < .tsm_payment[2] && .payment ){ cutin "",255; close; }
			}
		end;
	}

OnSingleSlot:
setd ".mode"+strnpcinfo(3)+"",0;
end;
OnTripleSlot:
setd ".mode"+strnpcinfo(3)+"",1;
end;

iMode:
next;
mes "Which did you want to do?";
menu "Change THIS machine's mode:Change ALL machine's mode",-;
if( @menu == 1 ) {
	next;
	mes "What mode would you like this machine to have?";
	menu "Single Slot Machine Mode:Triple Slot Machine Mode",-;
	if( @menu == 1 ) {
		setd ".mode"+strnpcinfo(3)+"",0;
		} else {
			setd ".mode"+strnpcinfo(3)+"",1;
			}
	close;
	} else {
		next;
		mes "What mode would you like to change all slot machines to?";
		menu "Single Slot Machine Mode:Triple Slot Machine Mode",-;
		if( @menu == 1 ) {
			donpcevent "::OnSingleSlot";
			} else {
				donpcevent "::OnTripleSlot";
				}
		close;
		}
OnClock0000:
OnClock1000:
OnClock1600:
	announce "Mysterious Slot Machine will begin at prontera 163 161 in 1 minute.", bc_all;
	sleep 60000;
	announce "Slot machine event has begun at prontera 163 161", bc_all;
	set .EventON,1;
	hideoffnpc strnpcinfo(3);
	sleep 225000;
	announce "Mysterious Slot Machine event is over thank you for playing", bc_all;
	set .EventON,0;
	hideonnpc strnpcinfo(3);
	end;

OnInit:
hideonnpc strnpcinfo(3);

//[ 0 = Single Slot Machine Mode ]_[ 1 = Triple Slot Machine Mode ]
setd ".mode"+strnpcinfo(3)+"",1;

//[0] = Fail Rate
//[1] = Fail (Do not change)
//[2] = Success (Do not change)
//[3] = File Name (Do not change)
//[4] = Animation Time (Do not change, for best results :D)
setarray .ssm_animate$[0],"30","29","33","slot_","3";

//[0] = Fail Rate "Slot 2"
//[1] = Fail Rate "Slot 3"
//[2] = SSS (Do not change)
//[3] = SSS_Count (Do not change)
//[4] = SSF (Do not change)
//[5] = SSF_Count (Do not change)
//[6] = SFS (Do not change)
//[7] = SFS_Count (Do not change)
//[8] = SFF (Do not change)
//[9] = SFF_Count (Do not change)
//[10] = Animation Time (Do not change, for best results :D)
setarray .tsm_animate$[0],"30","30","SSS_","41","SSF_","37","SFS_","41","SFF_","45","3";

// Payment Settings
// Payment Type
// 0 = Zeny, 1 = Item, 2 = Zeny&Item
.payment = 1;
// [0] = Zeny, [1] = Item ID, [2] = Item Amount;
setarray .ssm_payment[0],100000,7720,3; // Single Slot Machine Payment Price
setarray .tsm_payment[0],100000,7720,3; // Triple Slot Machine Payment Price

// DO NOT CHANGE BELOW
// Payment Text Syntax
setarray .ssm_payment_message$[0],""+ .ssm_payment[0] +" zeny",""+ getitemname(.ssm_payment[1]) +" x"+ .ssm_payment[2] +"";
setarray .tsm_payment_message$[0],""+ .tsm_payment[0] +" zeny",""+ getitemname(.tsm_payment[1]) +" x"+ .tsm_payment[2] +"";
end;
}


Afaik, using @nuke command, the nuked character automatically has the explosion effect so no need to use 'specialeffect' command.
PS: I haven't tried to run it in-game.

  • Love 1
Link to comment
Share on other sites

  • 0

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

} else { dispbottom "Failed"; 
specialeffect2 X; //change x to the effect number you want I don't know the effect number for the exploding thing your asking
atcommand "@nuke " + strcharinfo(0);
}

Try this replace that line below see if it works.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

@Aureon the script working properly and do as my plan

 

but when player is died he/she can spin continuously must be not and cannot be spin 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  281
  • Reputation:   14
  • Joined:  10/14/13
  • Last Seen:  

On 10/11/2017 at 12:32 AM, Quesooo said:

@Aureon the script working properly and do as my plan

 

but when player is died he/she can spin continuously must be not and cannot be spin 


Find this part:

atcommand "@nuke "+strcharinfo(0);

Below that, add this:

cutin "",255;
close;

 

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