Jump to content

Slot Machine System


Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
  ( Internal )
This is the hidden content, please
 
( MEGA )
This is the hidden content, please
 
( GitHub )

Hello again M2Dev,

 

It’s been quite I wile since I haven’t released anything for the community so today I decided to release one of my systems I created some days ago, it’s very simple and it consists on gambling to say the least…

 

Spoiler


283517SlotMachineSystem.jpg

 

 

The point is to bet your money (yang/gold) on a higher amount of gold and the higher you bet the higher the payout is, similar as how a casino slot machine works without being too complex.

The rules are simple, you have three (3) possible jackpots in which each one has a payout amount.
Hit the same icon three (3) times and you will win the jackpot.

If you get any other combination that contain jackpot reel icons, you will win half your bet back with a short bet multiplier.

So, the jackpot reels work as so,

A, A, A = Jackpot 1
B, B, B = Jackpot 2
C, C, C = Jackpot 3

All other possible combinations to have a winning: A, A, B; A, A, C; B, B, A; B, B, C; C, C, A; C, C, B; A, B, C; C, A, B; B, A, C; C, B, A; A, C, B;

If you happen to win a jackpot while having close to maximum gold, you will receive an item in your inventory if you have space for it otherwise you will receive it in your storage room. The item will contain the jackpot value.

 

250914GreyInfo.pngHow to configure?

 

game/constants.cpp you can edit all the betting values you want.
game/contants.cpp you can edit as well the jackpot values.
@ root/uiSlotMachineSystem.py you can edit the reel icons and bet values.

In-game, you can also use the commands,
/e slot_machine_reels < x > where < x > is the number of reels you want to randomize.
The more reel icons you have, the harder it is to win a jackpot!

/e slot_machine_multiplier < x > where < x > is the value of the multiplied you want.
The higher this value, the higher the payout is.

 

250914GreyInfo.pngAdditional information

 

For those who are using older versions of C++ some data type identifiers need to be changed as shown below.

  • uint64_t = unsigned long long
  • uint32_t = UINT
  • int32_t = INT
  • uint16_t = WORD
  • uint8_t = BYTE

 

Sincerly,

Owsap

Edited by Owsap
Additional information, reviewed code & updated files.
  • Metin2 Dev 62
  • kekw 1
  • Eyes 1
  • Dislove 1
  • Angry 2
  • Smile Tear 1
  • Confused 1
  • Scream 3
  • Good 13
  • Love 8
  • Love 50
Link to comment
Share on other sites

  • Premium
46 minutes ago, memett4545 said:

First of all, thanks for your sharing, I am getting an error. How can I solve it?

spacer.png

 

First of all, I bet you will have more problems that this one, so you should create a topic in Q&A section, but for now, change "g_MaxGold" to "GOLD_MAX"

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Good 1
Link to comment
Share on other sites

  • Honorable Member
On 3/26/2021 at 1:07 PM, memett4545 said:

First of all, thanks for your sharing, I am getting an error. How can I solve it?

spacer.png

 

I have forgot to change that to GOLD_MAX.

 

On 3/26/2021 at 1:57 PM, filipw1 said:

First of all, I bet you will have more problems that this one, so you should create a topic in Q&A section, but for now, change "g_MaxGold" to "GOLD_MAX"

In fact there were some mistakes that I forgot to remove and to included.
I have reviewed the system on a clean server revision 40250.

Topic updated,
Additional information, reviewed code & updated files.

If any one encounters any problem regarding the system please let me know.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Good 1
Link to comment
Share on other sites

  • Management
  • 2 weeks later...
  • 1 month later...
  • Contributor

Thanks for this system but seems that there are some problem, or at least on my file. I link you the screenshot.


spacer.png
 

char.h:2395: error: 'ESlotMachine' is not a class or a namespace

 

On char.h, line 2395: 
 

BYTE m_bSlotMachineReel[ESlotMachine::MAX_SLOT_MACHINE_SLOTS];


Update: I solved by edit ESlotMachine on lenght.h in this way:

 

namespace ESlotMachine
{
    enum ESlotMachine
    {
        MAX_SLOT_MACHINE_SLOTS = 3,
        MAX_SLOT_MACHINE_REELS = 8,
    };
}


But now I've another problem

spacer.png
 

packet.h:2547: error: ISO C++ forbids initialization of member 'bHeader'
packet.h:2547: error: making 'bHeader' static
packet.h:2547: error: ISO C++ forbids in-class initialization of non-const static member 'bHeader'
packet.h:2549: error: ISO C++ forbids initialization of member 'bWin'
packet.h:2549: error: making 'bWin' static
packet.h:2549: error: ISO C++ forbids in-class initialization of non-const static member 'bWin'
packet.h:2550: error: ISO C++ forbids initialization of member 'bJackpot'
packet.h:2550: error: making 'bJackpot' static
packet.h:2550: error: ISO C++ forbids in-class initialization of non-const static member 'bJackpot'

 

On packet.h line 2547:

    BYTE bHeader = HEADER_GC_SLOT_MACHINE;
    BYTE bSlotReel[ESlotMachine::MAX_SLOT_MACHINE_SLOTS];
    bool bWin = false;
    bool bJackpot = false;
} TPacketGCSlotMachine;
#endif


Update part2: Thanks to @Mali61 I solve this error. Now there's the last(I hope) one:
 

char.cpp:9002:18: error: random: No such file or directory
char.cpp: In member function 'bool CHARACTER::StartSlotMachine(BYTE)':
char.cpp:9042: error: 'random_device' is not a member of 'std'
char.cpp:9042: error: expected `;' before 'rd'
char.cpp:9043: error: 'mt19937' is not a member of 'std'
char.cpp:9043: error: expected `;' before 'mt'
char.cpp:9044: error: 'uniform_real_distribution' is not a member of 'std'
char.cpp:9044: error: expected primary-expression before '>' token
char.cpp:9044: error: 'dist' was not declared in this scope
char.cpp:9045: error: 'mt' was not declared in this scope
char.cpp: In function 'long int SlotMachineEventFunc(LPEVENT, long int)':
char.cpp:9174: error: 'unique_ptr' is not a member of 'std'
char.cpp:9174: error: expected primary-expression before '>' token
char.cpp:9174: error: 'pMsg' was not declared in this scope

Any Advice?

 

Edited by TokiSan
  • Metin2 Dev 1
Link to comment
Share on other sites

  • 2 years later...

The system works great! Also the code is soo clean and so easy to understand what is going on even if you don't actually know a programming language. Also, I didn't have any problems in implementation, this system being my first system that I implemented without any errors in server / sources / syserr. 

Gif Owsap <<<<<

Also, I recomment to look on Owsap site. He has some great systems there! 

Edited by Metin2 Dev International
Core X - External 2 Internal
  • kekw 1
  • Love 1
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.