Jump to content

Quests, Games: Slot Machine


Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

File Name: Slot Machine

File Submitter: GmOcean

File Submitted: 13 Sep 2014

File Category: Games, Events, Quests

Content Author: GmOcean


This script will allow users to spend zeny &/or an item 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.

To add the cutins, just place them in: data/texture/À¯ÀúÀÎÅÍÆäÀ̽º/illust

/* =============================================================
/* NOTE - If using soundeffects you must add the ".wav" files
/* provided in the ".rar" file to your: data/wav folder located
/* in either your: ( Ragnarok folder ) OR ( .grf file )
/* =============================================================



Click here to download this file

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

Nice script but it is possible to re-shuffle again in three times? specifically like this  

(success,success,success) = win
(success,success,lose) = lose
(success,lose,success) = lose
...
and so forth

Players will notice the machine works as a 50-50 chances of winning and losing due to it only once decide if success/lose

Thank you sorry for the bad english =)
 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

The fail / success rate is determined by you. It only shows a 50% but it can be anywhere from 0% success -> 100% success.

But what you mean is you want it to roll the slot machine 3x and determine the outcome then? I'll take a look at it and probably add it as an extra feature that can be enabled/disabled.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

The fail / success rate is determined by you. It only shows a 50% but it can be anywhere from 0% success -> 100% success.

But what you mean is you want it to roll the slot machine 3x and determine the outcome then? I'll take a look at it and probably add it as an extra feature that can be enabled/disabled.

it would be nice if three animations will rolled out in 1 round =)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Updated to v0.2 - Added the Triple slot machine with animations.

Edited by GmOcean
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

Updated to v0.2

what's new in v0.2?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

O.o I updated the description, it would allow you to use either a single slit machine version or a triple slot machine version. I even made a semi-custom animation for it.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

O.o I updated the description, it would allow you to use either a single slit machine version or a triple slot machine version. I even made a semi-custom animation for it.

ohh thank you =)

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Suggestion :

  • Enable multiple prizes
  • Different chances of winning
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Sorry, I forgot to update to version 0.7 on rAthena @.@; I've submitted an upload just waiting for approval by an admin.


    v0.1 - Original Script Created.
    v0.2 - Added Option for Triple Slot Machine with animations.
    v0.3 - Added support for item pricing &/or zeny pricing.
    v0.4 - Cleaned up script variables for easy editing.
    v0.5 - Tested out some new scripting methods with IF(THEN).
    v0.6 - Added option to change slot machine modes ingame.
    v0.7 - Added optional sound effects to slot machines. - NOTE

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

report this missing file wav (v 0.7)

if( .soundeffects ){ soundeffect "rog_steal coin.wav",1; }

change

if( .soundeffects ){ soundeffect "rog_steal_coin.wav",1; }

and when success rate with soundeffect client crash

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  10/22/14
  • Last Seen:  

report this missing file wav (v 0.7)

if( .soundeffects ){ soundeffect "rog_steal coin.wav",1; }

change

if( .soundeffects ){ soundeffect "rog_steal_coin.wav",1; }

and when success rate with soundeffect client crash

same happends to me, if win client crash

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  10/14/12
  • Last Seen:  

Looks like you guys were missing a wav file under wav folder from data folder.

To create your own file, simply look at the client error and determine what file is missing. Make any wav file(just to test) and rename it to the "missing error file".

Put the renamed file inside wav folder in data folder.

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

My apologies, my attention was else where @.@; I provided the wav file, but I neglected to re-name it to the one the script uses. I'll update this shortly. Sorry again.

Link to comment
Share on other sites

  • 9 months later...

  • Group:  Members
  • Topic Count:  250
  • Topics Per Day:  0.06
  • Content Count:  697
  • Reputation:   15
  • Joined:  01/07/12
  • Last Seen:  

hello i was testing ur slot mech, but it dint not show those cutin, does it becoz my data folder are in korean?

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

Can anyone provide a quick edit to make the "Another Round" and "I'm done" randomly switch location every after round?

 

For example:

Switch 1 = Another Round & I'm Done.

Switch 2 = I'm Done & Another Round.

Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   0
  • Joined:  11/21/13
  • Last Seen:  

is it possible to have multiple item prize instead of 1 item prize??

Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  89
  • Reputation:   3
  • Joined:  05/05/13
  • Last Seen:  

How could i edit this script to basically hide the npc, but at every 2nd hour it shows up and players can play with it?

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  04/22/17
  • Last Seen:  

Im having this error , and i dont know to fix this , can someone help me ?

error1.png

error2.png

Link to comment
Share on other sites

  • 1 month later...

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

how to make 2 item requirment to play game?

Link to comment
Share on other sites


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

how to add the cutins in thor patcher??? to enable also on players already downloaded the full installer

rog_steel_coin.wav missing

Link to comment
Share on other sites

  • 2 years later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  248
  • Reputation:   34
  • Joined:  11/19/11
  • Last Seen:  

rog_steal_coin.wav - missing. 

Link to comment
Share on other sites

  • 5 months later...

  • Group:  Members
  • Topic Count:  103
  • Topics Per Day:  0.03
  • Content Count:  323
  • Reputation:   4
  • Joined:  12/09/13
  • Last Seen:  

How can I lower success rate of this? It seem I won 8/10. tnx

On 4/1/2020 at 9:04 PM, kitty14 said:

How can I lower success rate of this? It seem I won 8/10. tnx

up please.

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  02/11/19
  • Last Seen:  

Thanks for the script !!

 

Would it be possible to have several prizes to be won (always winning 1 only but not always the same)

I tried
setarray .ssm_prize [0], 125,501,10,7773.50;

But its always gives that the first item ...




Thanks

Edited by legtoleg
Link to comment
Share on other sites

  • 3 years later...

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   1
  • Joined:  02/10/12
  • Last Seen:  

I am loving this script, but is it possible to change it?

ex. (in triple slot machine)
Slot 1 (Success) |  Slot 2 (Success) | Slot 3 (Failure) = Specific Item Reward
even if it has 1 Failure, it can give an Specific Item Reward ( Box )

PS: I don't know what version of your script I downloaded but here it is
 

Quote

prontera,152,176,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( !.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(15)) {
                case 0:
                    getitem 603,5; // OBB
                    break;
                case 1:
                    getitem 617,5; // OPB
                    break;
                case 2:
                    getitem 644,5;    // Gift Box
                    break;
                case 3:
                    getitem 616,1; // OCA
                    break;
                case 4:
                    getitem 31053,1; // Drooping Eddga Costume
                    break;
                case 5:
                    getitem 18571,1; // no item
                    break;
                case 6:
                    getitem 7720,1000; // Gold Coin
                    break;
                case 7:
                    getitem 17271,1; // no item
                    break;
                case 8:
                    getitem 17272,1; // 
                    break;
                case 9:
                    getitem 17273,1;
                    break;
                case 10:
                    getitem 17274,1;
                    break;
                case 11:
                    getitem 17275,1;
                    break;
                case 12:
                    getitem 12208,5; // Battle Manual
                    break;
                case 13:
                    getitem 12103,2; // Bloody Branch
                    break;
                case 14:
                    getitem 12259,1; // Miracle Tonic for Level Up
                    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( !.payment || .payment == 2 ) { Zeny -= .tsm_payment[0]; }
            if( .payment ) { delitem( .tsm_payment[1], .tsm_payment[2] ); }
            if( .soundeffects ) { soundeffect "slot_pay_coin.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(15)) {
                case 0:
                    getitem 603,5;
                    break;
                case 1:
                    getitem 617,5;    
                    break;
                case 2:
                    getitem 644,5;    
                    break;
                case 3:
                    getitem 616,1;
                    break;
                case 4:
                    getitem 31053,1;
                    break;
                case 5:
                    getitem 18571,1;
                    break;
                case 6:
                    getitem 7720,100;
                    break;
                case 7:
                    getitem 17271,1;
                    break;
                case 8:
                    getitem 17272,1;
                    break;
                case 9:
                    getitem 17273,1;
                    break;
                case 10:
                    getitem 17274,1;
                    break;
                case 11:
                    getitem 17275,1;
                    break;
                case 12:
                    getitem 12208,5;
                    break;
                case 13:
                    getitem 12103,2;
                    break;
                case 14:
                    getitem 12259,1;
                    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;
        }
OnClock0400:
OnClock0800:
OnClock1200:
OnClock1600:
OnClock2000:
OnClock0000:
    announce "Slot Machine will begin in 1 minute.", bc_all;
    sleep 60000;
    announce "Come and Play slot machine at prontera", bc_all;
    hideoffnpc strnpcinfo(3);
    sleep 300000;
    announce "Slot Machine already finished", bc_all;
    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],"70","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],"70","70","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],0,7528,1; // Single Slot Machine Payment Price
setarray .tsm_payment[0],0,7528,1; // 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;
}

 

Edited by blakbord
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
Reply to this topic...

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