KarmicLotto
KarmicLotto
About
This plugin is a lottery plugin based off the idea from an old h_Mod plugin. The old plugin, you would pay a certain amount of items and it would randomly generate a prize. While there are some good lottery plugins, I haven't seen anything as simple or one that isn't competition-based (fighting other players for the prize). And so, this plugin was requested by FrontierCraft to be made.
Features
- Command-less, sign-based interface and usage on the user-end
- Multiple lottery lists
- Configurable items, amounts, and percentages
- Supports any percentage total, no need to be exactly 100%
- Potion support
This plugin depends on Vault in order to interface with your economy.
Lotto Sign Creation Guide
This guide can be found using /lotto help.
Line 1: Anything you want
Line 2: [KarmicLotto]
Line 3: name of the lottery
Line 4: price to pay to use
To interact with the lottery sign, just left click it. Right click is disabled currently because the player inventory doesn't seem to want to update.
Commands & Permissions
<param> - necessary parameter
[param] - optional paramter
Command | Permission Node | Description |
---|---|---|
- | KarmicLotto.use | Allows user to use KarmicLotto signs |
- | KarmicLotto.create | Allows user to create KarmicLotto signs |
- | KarmicLotto.admin | Allows user to administrate the plugin |
/lotto reload | KarmicLotto.admin | Reloads config |
/lotto help | - | Shows help. Describes how to make a sign |
/lotto version | - | Shows plugin version info, the current config options, and a list of known and enabled lotteries. |
Supernode: KarmicLotto.*
Gives all possible nodes for the plugin
Configuration
The config.yml file needs to be configured in order for the plugin to work.
defaultAmount- global amount of items to give. This applies to all lotteries. (Default: 1)
defaultPercentage - global default percentage for items, if a percentage is not specified. Applies to all lotteries (Default: 1)
effects - whether or not to use effects on usage. (Default: true)
list - the list of lotteries. Note, even if you have made a lottery, if it is not in this list it will not be seen by the plugin.
lotteries are made following the format:
name:
- itemid : percentage
- itemid&datavalue: percentage
- itemid:
- amount: amount
- percent: percentage
- itemid&datavalue:
- amount: amount
- percent: percentage
Example config:
(Note, bullets are only there to help with spacing. They should not be replicated in a real config file)
defaultAmount: 1
defaultPercent: 1
list:
- lotto
- random
lotto:
- '35&0':
- amount: 5
- percent: 5
- '35&1' : 6
- '35&2':
- amount: 4
- '35&3':
- percent: 4
- '20': 20
- '89': 5
- '19': 1
- '45': 15
- '47': 23
random:
- 4: 10
TODO:
- Implement in-game commands for creation/modification of lotteries.
- Support enchanted items
- Ability to take items as payment? (Low priority. Will do on request.)
- Have default/generated lottos in the config file
- More Spout integration
Trello Dev board
Visit the Trello board to see the current todo list for all projects.
You can comment and vote on any of the topics there.
All changes on the Trello board are in real-time.
If you've found this plugin useful, please consider donating.
@anonymous000
Ack, sorry, no... I've been working on other projects that I forgot about it. I'll try and get around to it when I can.
@Mitsugaru
No progress yet? :/
@Mitsugaru
That's awesome! Thank you very much :)
@anonymous000
Alright, I'll consider working on it at some point. Right now, in the middle of finishing an important update for one of my other plugins.
This looks like a promising plugin, almost EXACTLY what i want!
The two things I would like the most is the In-game commands for the running of the lottery, and the ability to take items as a payment..
On my server I have three guilds, one of the guilds (the merchants), will have access to this lottery, so members of other guilds can come to the merchants and ask them to run a lottery for them.
Ideally I would have people pay a few stacks of some different items, such as cobble and coal to the merchants, who will run the lottery, and then they can pass the items back to the other person.
Additionally, announcements for the lottery would be useful for this system, to ensure the merchants do not scam the other players, it could be like: <Player> just drew 2 x diamond, 4 x coal, 2 x lava in the lotto!
Thank you for this so far :)
@Taeila_Fae
Awesome, glad you got it working. :D
Yay it works now! Thanks so much! Now to play with the config. <3
@Taeila_Fae
What is your config?
Version 0.14 has a null pointer check for the possible case where a lotto exists in the list, but the configuration section isn't found.
However, this doesn't auto-fix the config file. It just warns that something wrong happened and couldn't find what it was expecting to find.
[SEVERE] Could not pass event PLAYER_INTERACT to KarmicLotto java.lang.NullPointerException at com.mitsugaru.KarmicLotto.Config.getLotto(Config.java:90) at com.mitsugaru.KarmicLotto.Lotto.generateItem(Lotto.java:135) at com.mitsugaru.KarmicLotto.Lotto.execute(Lotto.java:92) at com.mitsugaru.KarmicLotto.KLPlayerListener.onPlayerInteract(KLPlayerListener.java:31) at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:338) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:340) at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:177) at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:92) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:503) at net.minecraft.server.Packet14BlockDig.a(SourceFile:43) at net.minecraft.server.NetworkManager.b(NetworkManager.java:226) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:96) at net.minecraft.server.NetworkListenThread.a(SourceFile:108) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:535) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:433) at net.minecraft.server.ThreadServerApplication.run(SourceFile:465) 2012-01-17 14:53:20
The error I get when someone left clicks the sign. At least it isn't spamming with not economy found.
@Taeila_Fae
I see that 0.13 has been approved, so, let me know how it goes.
Thanks so much for the quick response. Can't wait to get it!
@Taeila_Fae
I've submitted version 0.13 for approval. I've tested with latest version of BOSEconomy and it appeared to work.
If you have any other problems or any suggestions, please let me know.
version 0.7.3
@Taeila_Fae
Hey, which version of BOSEconomy are you using?
Its interesting as it seems as its using the right methods from Vault. But in order for me to test to your needs, I'd like to make sure I get the right version for testing.
@Taeila_Fae
I've seen this before, in a different plugin that I work on. I probably know what is wrong and I will go fix it now. I will reply again when I have submitted a compatible version.
Thanks for letting me know and sorry for the inconvenience.
I have Vault installed, but is there no support for BOSEconomy? The [KarmicLotto] sign can be placed and it says it was created, but when I go to left click it to try it out I get the error; You do not appear to have an economy account. Any help? I really want this plugin since it is like the old Tombola one.
Thanks, Taeila
@spydercanopus
Yeah, sure I'll look into more Spout integration.
Got a couple requests from players for this plugin. Seems pretty cool.
Can I request Spout support for sound effects and pop-ups?
nice plugin!