[INACTIVE][FUN] Jackpot v0.2.3 - Dice/Coins/Cards! [670]

Discussion in 'Inactive/Unsupported Plugins' started by Hunt800, Apr 10, 2011.

  1. Offline


    Jackpot - Gambling Commands:
    Version: v0.2.2

    This is my first shot at a plugin. While it's incredibly simple at the moment, I aim to have it include many different commands to aid with gambling on SMP server. From simple coin tosses, to complex Poker games, hopefully this plugin will someday handle it all!

    • /roll command for rolling dice (locally and globally)
    • /cointoss command for flipping coins
    • /card command for playing with decks
    • Permissions support!
    • A simple config file for setting some defaults
    Download Jar

    Source Code

    Commands (BASIC)
    • /roll <# of dice> <sides on dice> <OPTIONAL> - If left blank, # of dice will default to 1 and sides of dice will default to whatever it is in the config. <OPTIONAL> can be left blank to broadcast locally, or changed to g to broadcast results globally.
    • /cointoss <# of coins> <OPTIONAL> - # of coins will ALWAYS default to 1 if left blank, <OPTIONAL> is the same as above.
    Commands (CARDS)

    The current /card system can be confusing, which is why it deserves its own section! Before I begin with commands, let me explain the basics of the system:
    Each player (upon logging in) is given a unique 'set' of cards. This set contains a lot of information - such as all the cards not yet dealt, the cards drawn (not dealt to a specific player), and a list of players with the cards that have been dealt to them. Because of this setup, in the commands, players sometimes need to refer to the player's 'set' that they are trying to access. For example, if I am playing with Nooby1 and Nooby2, and they have both dealt me cards, I would use '/card mine Nooby1' to see the cards that Nooby1 dealt and '/card mine Nooby2' to see the cards that belong to Nooby2'
    • /card shuffle - This will 'reset' your entire personal deck, making it seem like you just logged in
    • /card draw - This will take a card from YOUR deck (broadcasting the card locally) and place it into the center (see /card see <NAME>)
    • /card deal <NAME> - This will deal a card from YOUR deck to a player. No one but the player you dealt to will see the card
    • /card see <NAME> - This will show you all the cards currently in the center of <NAME>'s "set"
    • /card mine <NAME> - This will show you all the cards that <NAME> has dealt to you since <NAME>'s last shuffle
    • /card show <NAME> - This will LOCALLY BROADCAST all the cards that <NAME> has dealt to you. This command will let nearby players know what cards you are holding, so until the end of a hand, only use /card mine <NAME>
    • /card left <NAME> - This is more of an admin command and was really only used for testing (by me). Basically, it shows (very dirtily) all the cards that have yet to be dealt in <NAME>'s deck. You probably shouldn't give this one out, since it makes cheating possible
    Permissions Nodes

    • 'jackpot.roll.local' - Allows user to roll dice with /roll <# of dice> <sides on dice>
    • 'jackpot.roll.global' - Allows user to add 'g' to the end of a roll command to broadcast the result globally. Player MUST have jackpot.roll.local for this to work
    • 'jackpot.flip.local' - Allows user to use /cointoss <# of coins>
    • 'jackpot.flip.global' - If the player has jackpot.flip.local then they can add 'g' to a /cointoss command to broadcast globally
    • 'jackpot.card.shuffle' - /card shuffle
    • 'jackpot.card.draw' - /card draw
    • 'jackpot.card.deal' - /card deal <NAME>
    • 'jackpot.card.see' - /card see <NAME>
    • 'jackpot.card.mine' - /card mine <NAME>
    • 'jackpot.card.show' - /card show <NAME>
    • 'jackpot.card.left' - /card left <NAME>

    At the moment, the config is simple:
    • broadcast-distance - distance a result will be broadcast if the user does not make it global.
    • default-dice-size - if the user simply types /roll this is the number of sides that the dice will use.
    • play-with-cards - if false, the plugin will run without any /card features
    To Do:

    • Figure out a simpler /card system? Help me with this one!
    • Sign based gambling support? (ie, players can create a sign that lets other players gamble with iConomy money, even when the owner is offline)
    • More? You tell me what you want to see next!

    Version 0.2.3
    • Added a play-with-cards config field for disabling all card features
    • Fixed code that generates config file so it will add any missing fields
    • Added ability to use "/roll #" to roll without specifying sides. It will roll # dice with the default number of sides
    • Added ability to use "/cointoss g" instead of needing to include a number of coins before "g"

    Version 0.2.2
    • Added card support (complicated at the moment)

    Version 0.1.7
    • Released the plugin
    • Support for dice and coins
    • Permissions nodes
    • Ability to add "g" to the end of commands to globally broadcast results
    NEO and renxwar like this.
  2. Offline


    Nice Thanks :)
  3. Offline


    THANK YOU! I've been looking for a looong time for a gambling plugin. Props to you bro.
  4. Offline


    I wrote an entire deck, card, and hand class in C++ for my programming courses a while back. They work pretty efficiently but i don't know what language you used. If you're interested in using the classes that I made, let me know and I can provide you with the data source. Oh, and I also have a "Quick Sort" class that can sort a large amount of numbers very quickly in case you need something like that for some strange reason.
  5. Offline


    Thanks Boof, but I'm fine. I think I pretty much have my deck stuff worked out (though it's a little complicated, since each player has a unique 'deck'). I'm going to update this soon, I just need to write out a how-to.

    UPDATE: I added the new version with cards. Tell me what you think.
  6. Offline


    One of my players built an enormous rendition of the Bellagio, so I'll be watching this
  7. Offline


    It seems that plugin is funny, i think i give it a try!

  8. Offline


    Nice job :)
  9. Offline


    Thanks for the attention, I wasn't sure how useful people would find a simple plugin like this. Anyway, unless anyone has found any bugs, or has a suggestion for what they ABSOLUTELY need out of a gambling plugin, I think my next edition will include [Gamble] signs. They'll be simple signs enabled if the server has iConomy that allows for a basic slots sort of game. But, I probably won't get much time until the weekend anyway, so I'm open to ideas until then :)
  10. Offline


    sounds cool I have seen other slots plugins maybe look there for ideas :)
  11. Offline


    I was thinking of a setup that's really easy for players to customize. Something like this:
    Line 1: [Gamble]
    Line 2: $100
    Line 3: 76-99:2
    Line 4: 100:3

    Where, Line 1 turns the sign into a gambling sign. Line 2 specifies the amount per bet and the rest of the lines define the win condition. In this case, every time the player right clicks the sign, 100 iConomy money will be transfered to the signs owner and a number will be generated between 1 and 100. Because of line 3, if the number is between 76 and 99, 2x of the players bet (100) will be returned. In this case, the player will make 100 iConomy money. If the number is 100, they will get 3 times their bet and since 100*3=300, they'll make 200 (minus 100 since that was their original bet). Get it?
  12. Offline


    Nice plugin, i was looking for something just like this.

    Only thing i noticed when testing, you cant roll more than 1 die. It comes up with an internal server error and the console shows
    [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'roll' in plugin Jackpot v0.2.2
    	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:254)
    	at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:608)
    	at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:571)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:565)
    	at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    	at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
    	at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
    	at com.Hunt800.Jackpot.Jackpot.onCommand(Jackpot.java:74)
    	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    	... 12 more
    i'm using V0.2.2 of your plugin and CB674.
    Other than that great stuff!
  13. Offline


    What command were you typing? Remember, to roll 2 6 sided dice it's /roll 2 6
  14. Offline


    oh ok that may be it, i think i forgot the 6, ill try and report back.

    EDIT: Works, Thanks! Although maybe change that so that if /roll is only used with number of dice, it defaults to the specified face value in the config? It would be nice, but not really needed :p
  15. Offline


    Yeah, I'll add that default to thing in the next update. I think I'm also going to make all card events default to the last command (ie, if you type /card see Hunt800, then typing /card mine will show you /card mine Hunt800) But, I haven't had much time lately.
  16. Offline


    Bump, this is what I missed and wanted. Thank you very much.
  17. Offline


    Request: a way to disable cards.

    I just really wanted the dice and coins, i dont really need the cards, atm. If possible could you add it to the config to disable cards? Thanks!
  18. Offline


    I'll look into it, but why can't you simply not hand out the permissions? Everything, after all, has a permission node.
  19. Offline


    Very nice, I'm going to keep an eye on this.
  20. Offline


    Oh i have, but i mean just disabling it completely. just so nobody can have it, and decks dont generate for new people :p
  21. Offline


    Oh, sure. I can probably work some quick fix out. I'll probably do that and allow easier commands tomorrow, and maybe throw in another feature while I do it.

    But for now, don't worry. Other than the annoying console message (which was really just for debugging, I should probably disable it anyway) the decks shouldn't take up much space.
  22. Offline


    sweet! :D
  23. Offline


    Released Version 0.2.3 to include your suggestions, I'll probably start the [Gamble] signs soon. More info on 0.2.3:

    Version 0.2.3
    • Added a play-with-cards config field for disabling all card features
    • Fixed code that generates config file so it will add any missing fields
    • Added ability to use "/roll #" to roll without specifying sides. It will roll # dice with the default number of sides
    • Added ability to use "/cointoss g" instead of needing to include a number of coins before "g"
  24. Offline

    Anthony Walker

    Does this support iConomy?
  25. Offline


    Can this get BOSEcon support as well!! would be epic!
  26. Offline


    No Economy support whatsoever at the moment. However, once I implement things that need money, I'll probably support iConomy first and BOSE in an update.
  27. Offline


    Can one play children's cardgames on boats with the /card command?
  28. Offline



    And, sorry for the delay, but I figured I'd give you the heads up that any updates will be delayed for a week. My computer suddenly crashed the other day and after a lot of time spent trying to fix it, it's been declared that I must send it back to the manufacturers. Be happy that I used github, or else everything would be lost.
  29. Offline


    Any updates on this? I am interested in using it.
  30. Offline


    I've sent back my broken computer, and I can't work on any plugins until I get it back. Unfortunately, my temporary laptop is to slow to even run MineCraft, there's no way I could get a test server running.

Share This Page