Jump to content
  • 0

Slot Machine Payout Odds


Jasc

Question


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  270
  • Reputation:   20
  • Joined:  12/10/11
  • Last Seen:  

Picked up a nice casino pack from Zig.


== Script Name =========================
// ---- Slot machine for CASINO pack
// == Author ==============================
// ---- Zigbigidorlu (( [GM] Dionysus ))
// == Designed For ========================
// ---- FaithRO (( http://faithro.net ))
// == Version =============================
// ---- 8.05 rv2.05
// == Release =============================
// ---- 5.5.8
// == Description =========================
// ---- Simple slot machine system with
// Advanced odds and payout system. Uses
// a global $jackpot variable for jackpot
// payout based on zeny put into the pot
// after a number of uses.
//
// == Odds and payout chart ===============
// *---------------------------------------------*
// | R | ODDS | TL | TRIP | ODDTRIPL | ODD_DB |
// |---------------------------------------------|
// | 7 | 1:64 | 1 | JKPT | 1:262144 | 1:4096 |
// | 6 | 3:64 | 4 | 256x | 1:87381 | 1:1365 |
// | 5 | 6:64 | 10 | 128x | 1:43690 | 1:682 |
// | 4 | 9:64 | 19 | 64x | 1:29127 | 1:455 |
// | 3 | 12:64 | 31 | 32x | 1:21845 | 1:341 |
// | 2 | 15:64 | 46 | 16x | 1:17476 | 1:273 |
// | 1 | 18:64 | 64 | 8x | 1:14563 | 1:227 |
// *---------------------------------------------*
function script slotreel {
set @number,rand(64);
if(@number == 0) return 7;
else if(@number >= 1 && 4 > @number) return 6;
else if(@number >= 4 && 10 > @number) return 5;
else if(@number >= 10 && 19 > @number) return 4;
else if(@number >= 19 && 31 > @number) return 3;
else if(@number >= 31 && 46 > @number) return 2;
else if(@number >= 46 && 64 > @number) return 1;
}
function script slotcheckwin {
set @val1,getarg(0);
set @val2,getarg(1);
set @val3,getarg(2);
if(@val1 == @val2 && @val2 == @val3)
{
switch(@val1)
{
case 1: set @mult,8; break;
case 2: set @mult,16; break;
case 3: set @mult,32; break;
case 4: set @mult,64; break;
case 5: set @mult,128; break;
case 6: set @mult,256; break;
case 7: goto JACKPOT; break;
}
set @winnings,(@bet*@mult);
set chips,(chips+@winnings);
mes " ";
mes "Winner! You've won ^FF0000"+@winnings+" ^000000chips!";
return;
}
else if(@val1 == @val2 || @val1 == @val3 || @val2 == @val3)
{
set @winnings,@bet;
set chips,(chips+@winnings);
mes " ";
mes "Winner! You've won your bet back!";
return;
}
else return;
JACKPOT:
next;
mes "[slot Machine]";
mes " ";
mes "^FF0000Congratulations! You've hit the Jackpot!^000000";
mes "You've won "+$jackpot+" chips!";
announce "FreestyleRO Casino Manager: Congratulations to "+strcharinfo(0)+",",0;
sleep(3000);
announce "FreestyleRO Casino Manager: Who just won the casino Jackpot of "+$jackpot+" chips!",0;
set chips,(chips+$jackpot);
set $jackpot,0;
return;
}
- script slotmachine -1,{
set @bet,1;
START:
mes "[slot Machine]";
mes "Welcome to Comodo Slots!";
menu "Play",SLOT_SPIN,"Change bet ("+@bet+" chips)",SLOT_CHIPS,"Leave",SLOT_LEAVE;
SLOT_SPIN:
next;
if(chips > 0)
{
if(@bet <= chips)
{
set chips,(chips-@bet);
set $jackpot,($jackpot+@bet);
set @reelA,callfunc("slotreel");
set @reelB,callfunc("slotreel");
set @reelC,callfunc("slotreel");
mes "[slot Machine]";
mes " ";
mes "[ "+@reelA+" ] | [ "+@reelB+" ] | [ "+@reelC+" ]";
callfunc "slotcheckwin",@reelA,@reelB,@reelC;
menu "Spin Again ("+chips+" chips left)",SLOT_SPIN,"Change bet ("+@bet+" chips)",SLOT_CHIPS,"Leave",SLOT_LEAVE;
}
else
{
mes "[slot Machine]";
mes "You do not have enough chips to place that bet!";
menu "Change bet ("+@bet+" chips)",SLOT_CHIPS,"Leave",SLOT_LEAVE;
}
}
else
{
goto SLOT_NOCHIPS;
}
SLOT_CHIPS:
next;
if(chips > 0)
{
mes "[slot Machine]";
mes "You have currently ^FF0000"+chips+" ^000000chips.";
mes "How many would you like to bet?";
input @newbet;
next;
if(@newbet > chips)
{
mes "[slot Machine]";
mes "You do not have enough chips to place that bet!";
goto SLOT_CHIPS;
}
else if(@newbet < 1)
{
mes "[slot Machine]";
mes "Invalid bet! Please input a valid bet!";
goto SLOT_CHIPS;
}
else
{
mes "[slot Machine]";
mes "Success! Your bet has been set to: ^FF0000"+@newbet+"^000000 chips.";
set @bet,@newbet;
}
menu "Play",SLOT_SPIN,"Change bet ("+@bet+" chips)",SLOT_CHIPS,"Leave",SLOT_LEAVE;
}
else
{
goto SLOT_NOCHIPS;
}
SLOT_NOCHIPS:
mes "[slot Machine]";
mes "You do not have any chips! Please visit the Chips exchanger for more!";
close;
SLOT_LEAVE:
close;
}
//Row 1
cmd_in02,168,107,1 duplicate(slotmachine) Slot Machine#slot1-2 111
cmd_in02,169,107,1 duplicate(slotmachine) Slot Machine#slot1-3 111
cmd_in02,170,107,1 duplicate(slotmachine) Slot Machine#slot1-4 111
cmd_in02,171,107,1 duplicate(slotmachine) Slot Machine#slot1-5 111
cmd_in02,172,107,1 duplicate(slotmachine) Slot Machine#slot1-6 111
cmd_in02,173,107,1 duplicate(slotmachine) Slot Machine#slot1-7 111
cmd_in02,174,107,1 duplicate(slotmachine) Slot Machine#slot1-8 111
cmd_in02,175,107,1 duplicate(slotmachine) Slot Machine#slot1-9 111
//Row 2
cmd_in02,182,107,1 duplicate(slotmachine) Slot Machine#slot2-2 111
cmd_in02,183,107,1 duplicate(slotmachine) Slot Machine#slot2-3 111
cmd_in02,184,107,1 duplicate(slotmachine) Slot Machine#slot2-4 111
cmd_in02,185,107,1 duplicate(slotmachine) Slot Machine#slot2-5 111
cmd_in02,186,107,1 duplicate(slotmachine) Slot Machine#slot2-6 111
cmd_in02,187,107,1 duplicate(slotmachine) Slot Machine#slot2-7 111
cmd_in02,188,107,1 duplicate(slotmachine) Slot Machine#slot2-8 111
//Row 3
cmd_in02,166,101,1 duplicate(slotmachine) Slot Machine#slot3-3 111
cmd_in02,167,101,1 duplicate(slotmachine) Slot Machine#slot3-4 111
cmd_in02,168,101,1 duplicate(slotmachine) Slot Machine#slot3-5 111
cmd_in02,169,101,1 duplicate(slotmachine) Slot Machine#slot3-6 111
cmd_in02,170,101,1 duplicate(slotmachine) Slot Machine#slot3-7 111
cmd_in02,171,101,1 duplicate(slotmachine) Slot Machine#slot3-8 111
cmd_in02,172,101,1 duplicate(slotmachine) Slot Machine#slot3-9 111
//Row 4
cmd_in02,184,101,1 duplicate(slotmachine) Slot Machine#slot4-2 111
cmd_in02,185,101,1 duplicate(slotmachine) Slot Machine#slot4-3 111
cmd_in02,186,101,1 duplicate(slotmachine) Slot Machine#slot4-4 111
cmd_in02,187,101,1 duplicate(slotmachine) Slot Machine#slot4-5 111
cmd_in02,188,101,1 duplicate(slotmachine) Slot Machine#slot4-6 111
cmd_in02,189,101,1 duplicate(slotmachine) Slot Machine#slot4-7 111
cmd_in02,190,101,1 duplicate(slotmachine) Slot Machine#slot4-8 111
[/codeBOX]

Theres an odds table at the beginning of the script.

I want to decrease the winning rate, but have not experienced an odds script such as this before.

Any suggestions and ideas on what I would change to alter the rate of winning?

All help is appreciated, thank you.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  130
  • Reputation:   43
  • Joined:  12/11/11
  • Last Seen:  

The 'slotreel' function decides the odds of a number to appear. If you want to decrease the probability of winning, you could equalize the difference between the numbers to give a greater variety but then they will also have a higher chance of hitting the high numbers. You could also add more numbers to give them less chance of getting a combination of three equal numbers.

There's currently 18 numbers the random number generated between 0 and 63 could hit to give a 1, that's what the 18:64 means. I guess you could figure out how to alter the table to your liking. If you want to play with the chances, alter this function:

function script slotreel {
set @number,rand(64);
if(@number == 0) return 7;
else if(@number >= 1  &&  4 > @number) return 6;
else if(@number >= 4  && 10 > @number) return 5;
else if(@number >= 10 && 19 > @number) return 4;
else if(@number >= 19 && 31 > @number) return 3;
else if(@number >= 31 && 46 > @number) return 2;
else if(@number >= 46 && 64 > @number) return 1;
}

If you instead want to decrease the winning multiplier, that will say the amount of zeny they win. Then alter this part:

   case 1: set @mult,8;  break;
   case 2: set @mult,16;  break;
   case 3: set @mult,32;  break;
   case 4: set @mult,64;  break;
   case 5: set @mult,128;  break;
   case 6: set @mult,256; break;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  270
  • Reputation:   20
  • Joined:  12/10/11
  • Last Seen:  

Ty for the quick reply Plank, that was extremely helpful.

So if I did this for example:

function script slotreel {
set @number,rand(74);
if(@number == 0) return 7;
else if(@number >= 1  &&  4 > @number) return 6;
else if(@number >= 4  && 10 > @number) return 5;
else if(@number >= 10 && 19 > @number) return 4;
else if(@number >= 19 && 31 > @number) return 3;
else if(@number >= 31 && 46 > @number) return 2;
else if(@number >= 46 && 74 > @number) return 1;
}

I altered it from 64 to 74 and changed the if(@number) from 46-74, which means I added 10 numbers to decrease chance of it hitting 0 (jackpot). So any numbers from now between 46-74 will return go to return1;

Is this what you meant by editing it?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  130
  • Reputation:   43
  • Joined:  12/11/11
  • Last Seen:  

That would make the chance of getting the numbers:

7 | 1:74

6 | 3:74

5 | 6:74

4 | 9:74

3 | 12:74

2 | 15:74

1 | 28:74

Therefore increasing the chance to get the number 1 for the user but decreasing the probability to get other numbers. The amount of winnings with 1 would therefore increase but the amount of high winnings decrease.

Since only one number got it's probability increased, that will also increase the over-all winning chance.

I hope I'm making sense :D

Edited by plankt
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  270
  • Reputation:   20
  • Joined:  12/10/11
  • Last Seen:  

I understand it now, just took me a few minutes to see it properly. Thank you so much for pointing me in right direction.

Edited by Jasc
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

can i use your slot merchine?

about this

case 1: set @mult,8; break;

case 2: set @mult,16; break;

case 3: set @mult,32; break;

case 4: set @mult,64; break;

case 5: set @mult,128; break;

case 6: set @mult,256; break;

dun wan put hight for player win then need increase that 8 or decrease that 8?

if reduce for decrease chance?

case 1: set @mult,6; break;

case 2: set @mult,12; break;

case 3: set @mult,24; break;

case 4: set @mult,48; break;

case 5: set @mult,96; break;

case 6: set @mult,192; break;

like this?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  130
  • Reputation:   43
  • Joined:  12/11/11
  • Last Seen:  

The number '@mult' is set to, is how much they will recieve:

How much you win = Your bet * @mult

So your edit will make them win less Zeny each time they win

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

icic. if i set 6 they win 6 zeny? maximumt 192zeny?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  130
  • Reputation:   43
  • Joined:  12/11/11
  • Last Seen:  

If you set 6, they win (6 * the amount they bet).

They play with chips which another NPC seems to handle for them.

So if I bet 20 chips, you had it on x6, then I would receive 120 chips.

Edited by plankt
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

icic. erm do the another chip that handle chip is official or custom one? >.< I dun have chip npc. do you have?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  130
  • Reputation:   43
  • Joined:  12/11/11
  • Last Seen:  

Jasc, the one who made this topic, should have it if he wants to share with you. Try asking him or do a search on the forums and you might find it.

If you want to make it yourself, the chips are stored in the permanent char variable 'chips'. You can also try requesting it in the script request forum.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

icic. i should listening to you. =) i go request.

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