/* =============================================================/* Slot Machine - Triple Slot Machine/* =============================================================/* Version: v0.2a/* v0.1 - Original Script Created./* v0.2 - Added Option for Triple Slot Machine with animations./* v0.2a - Added option for item price instead of zeny.Untested./* =============================================================/* Description/* =============================================================/* This script will allow users to spend zeny for a chance to/* win a prize from the slot machine. Currently there are 2/* versions. First is a Single Slot Machine, where only 1 slot/* is rolled. Second is the Triple Slot machine, where 3 slots/* are rolled. For either version, SUCCESS must be the only/* thing displayed in order to win./* =============================================================/* Created By: GmOcean/* ===========================================================*/prontera,152,176,4 script SlotMachine 563,{switch( .mode ){ case 0: // Single Slot machine mode. mes "Do you want to play a game?","It costs: "+ .price[1] +" "+ (.price[2]?"zeny":""+getitemname(.price[0])+"") +" to play."; if( select("YES:NO") == 2 || Zeny < .price[0] && !.price[2] || ( countitem( .price[0] ) < .price[1] ) && .price[2] ){ close; } while( @menu == 1 ){ if( !.price[2] ){ Zeny -= .price[0]; } else { delitem .price[0],.price[1]; } .@a = rand(1,100); if( .@a < atoi(.1animate$[0]) ){ .@a = 1; } else { .@a = 2; } .@b = 1; while( .@b < atoi(.1animate$[.@a]) ) { cutin .1animate$[3] + .@b,4; sleep2 ( ( atoi(.1animate$[4]) * 1000 ) / atoi(.1animate$[.@a]) ); .@b++; } if( .@a == 1 ){ cutin .1animate$[3] + atoi(.1animate$[.@a]),4; dispbottom "Failed"; } else { cutin .1animate$[3] + atoi(.1animate$[.@a]),4; getitem .1prize[0], .1prize[1]; } if( select("Another Round:I'm done") == 2 || Zeny < .price[0] && !.price[2] || ( countitem( .price[0] ) < .price[1] ) && .price[2] ){ cutin "",255; close; } } end; case 1: // Triple Slot machine mode. mes "Do you want to play a game?","It costs: "+ .price[1] +" "+ (.price[2]?"zeny":""+getitemname(.price[0])+"") +" to play."; if( select("YES:NO") == 2 || Zeny < .price[0] && !.price[2] || countitem( .price[0] ) < .price[1] && .price[2] ){ close; } while( @menu == 1 ){ if( !.price[2] ){ Zeny -= .price[0]; } else { delitem .price[0],.price[1]; } // 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(.3animate$[0]) && .@3 <= atoi(.3animate$[1]) ){ .@a = 8; } else if( .@2 <= atoi(.3animate$[0]) && .@3 > atoi(.3animate$[1]) ){ .@a = 6; } else if( .@2 > atoi(.3animate$[0]) && .@3 <= atoi(.3animate$[1]) ){ .@a = 4; } else { .@a = 2; } .@b = 1; while( .@b < atoi(.3animate$[.@a+1]) ) { cutin .3animate$[.@a] + .@b,4; sleep2 ( ( atoi(.3animate$[10]) * 1000 ) / atoi(.3animate$[.@a+1]) ); .@b++; } cutin .3animate$[.@a] + atoi(.3animate$[.@a+1]),4; if( .@a == 2 ){ getitem .3prize[0], .3prize[1]; } else { dispbottom "Failed"; } if( select("Another Round:I'm done") == 2 || Zeny < .price[1] ){ cutin "",255; close; } } end; }OnInit://[ 0 = Single Slot Machine Mode ]_[ 1 = Triple Slot Machine Mode ].mode = 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 )setarray .1animate$[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 )setarray .3animate$[0],"30","30","SSS_","41","SSF_","37","SFS_","41","SFF_","45","3";setarray .1prize[0],501,10;setarray .3prize[0],501,30;// [ 0 = SSM Zeny / Item Req ] | [ 1 = TSM Zeny / Item Amt ] | [ 2 = Enable/Disable Item Requirements ( 0 = Disable, 1 = Enable ).// e.g of zeny mode: setarray .price[0], 100, 300, 0; <--- SSM costs 100z, TSM costs 300z to play.// e.g of item mode: setarray .price[0], 501, 10, 1; <---- SSM & TSM costs 10 RedPotions to play.setarray .price[0],100,300,0;end;}