DailyBonus
DailyBonus- Daily Login Bonuses
Want to help update DailyBonus? Contact gomeow
This plugin give a bonus once a day to players who log in. The amount is configurable.
There is an option in the config file for a delayed time until they get the bonus. If the player logs out before getting the bonus, then it will remember that they didn't get the bonus yet for that day, and attempt to make them wait the time again.
You can also give items based off a list in the config file.
The plugin uses SuperPerms (all permissions plugins will work, is what this means) for Permissions and Vault for economy, so all plugins that support those will work with DailyBonus!
Watch the video!
The Tier system:
The tier system allows you to have as many tiers as you want, as long as you change the "Number of Tiers" option in your config.
How tiers work:
- Tier number, 1 being the lowest tier
- So the highest admins/ops/VIPs will be given the highest Tiers, while defaults/noobs get the lowly Tier 1.
Economy Bonus
- The economy amount will be given as long as Vault is enabled. If you don't use an Economy, then set the values to 0.
- Again, you NEED Vault to give an economy amount with DailyBonus.
- To have a random amount of economy, put the "base-values;random-amount" down. So "20;5" would give a random amount between 5 more or 5 less than 20, aka 15-25 currency.
Message:
- This message will be sent to the player when they get their DailyBonus. Color codes such as &6 and &4 work.
- (Full list here!).
- !amount will be replaced with the economy amount given.
- !type will be replaced with your currency, if available.
Items:
- This is a list of items the player will be given. "x;y" -> x being the item ID and y being the amount to give. So "266:5" would give 5 Gold Ingots!
- If you don't want to give any items, set one ID of 0 or just leave it empty.
- To give random items, set the line to "x;y;z", with x and y the same as above, and z being the max or min that will be added/subtracted from the y.
- To give items with a data value add a "-d" to the end of the item line, with the d being a data value.
- Example - "5;10;5-1" - This would give 5 to 15 wood planks (ID 5) with a data value of 1 (Darkwood).'
- Item Give Delay (In Seconds): This is how many seconds the plugin will wait to give the bonus. So if you set it to 5 minutes (300 seconds), the player must login and stay online for 5 minutes before getting the bonus. If they log out early, the timer will stop and they must wait another 5 minutes to get it for that day.
Permissions:
- dailybonus.tier.#
- # being the tier number. So 'dailybonus.tier.1', 'dailybonus.tier.2', 'dailybonus.tier.3', and so on.
- You can have an unlimited amount of tiers, just change the "number of tiers" option in the config accordingly.
- Players will not inherit the other tiers. For example - even if admin's with tier.2 were set to inherit the default groups tier.1 they would not get items from both sections.
Features:
- Daily amount given (configurable) when a player logs in each day.
- Permissions based on tier systems
- Custom message for each tier
- !amount is replaced by the actual amount in the message
- Item giving
- If the player's inventory is full, items will drop at their feet!
Commands
- '/DailyBonus reload' - Reloads the plugin - Permission 'dailybonus.reload'
Get Vault here if you are using an Economy plugin!
Roadmap:
- Suggest Stuff!
@fjutte
I finished the delay timer, I just need to add the lists if they logout, which I shall do tonight or tomorrow :D The delay time just uses a new thread, so an infinite amount of players can be 'waiting' for the bonus after the delay.
Also added the global message, which can list the !amount a player gets and the !playername in the message.
@itsatacoshop247
Ahh, that sounds really good actually :)
@fjutte
I'm going to add a check to see if the player logs out before they get their bonus, and even if they log back in it will force a restart of the countdown.
@itsatacoshop247
Hmm I guess you have to set the player's time of login in a file and then start a timer for that user, to check that they are online for x minutes. On my server, players automatically go AFK after 15 minutes of inactivity. And after another 15 minutes they get kicked, so the timer should stop if they logout or get kicked (or banned). Hmmm dunno how to do this really, I'm out of ideas right now, it's late :)
For me, it's not necessary with a message in advance, it would only make players logout and then login again when they know exactly when they will receive the bonus. But that's MY opinion.
@fjutte
I've got an issue with the delay thing right now. If the player goes offline before getting the update, then they can't get it at all for that day, because when they come online again those playername.dat shows that they still logged in for the day. Either it will be stuck like that, or I guess I could save the names of players who didn't receive the bonus and then if they log in again I can try giving the items again.
Also, should I add an option to send the player a message saying "You will get a bonus in x minutes/seconds whatever". (Will be configurable of course.)
@itsatacoshop247
Great!! Can't wait for update!! :)
@fjutte
Everyone likes tacos :D
@fjutte
Yes! I forgot to put this in the planned changes list. I know exactly how to set this up, with a configurable time, I just wanted to get the initial release done first.
Global broadcast will be easy too!
Great plugin! But.. (there's always a but hehe) can you add a timer, so players have to be online for a specified amount of time (like 30 minutes) before they get the daily bonus? Players seem to log in, get their bonus, and then logout :(
And, can you add a broadcast to encourage other players to login every day? just like the message to the player, but global like so:
btw I love tacos! :)
Update! Version 2.2
Download 2.2 here!
@xizvyrious
You don't seem to have Vault loaded :D Please download and install Vault and try again. I should add a null check to ensure Vault is loaded, and return error warnings if it isn't.
This plugin seems not to work on 1.2.4, I have added the permissions node 'dailybonus.tier.1' to my default group and all group are inherited from the default but none of my groups are being rewarded with 1000 iConomy money as set in the 'config.yml' for DailyBonus. When someone joins I get this error:
2012-03-25 13:55:58 [SEVERE] Could not pass event PlayerJoinEvent to DailyBonus org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:303) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459) at net.minecraft.server.ServerConfigurationManager.c(ServerConfigurationManager.java:132) at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:129) at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:41) at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:61) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:554) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452) at net.minecraft.server.ThreadServerApplication.run(SourceFile:490) Caused by: java.lang.NoClassDefFoundError: net/milkbowl/vault/economy/Economy at me.itsatacoshop247.DailyBonus.DailyBonusPlayerListener.onPlayerJoin(DailyBonusPlayerListener.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ... 9 more Caused by: java.lang.ClassNotFoundException: net.milkbowl.vault.economy.Economy at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 15 more
Updated to 2.1!
Download.
@gwinans
Any error messages? Do you have vault set up (if giving money), and do you have the items setup right? 'dailybonus.tier.1' should work fine.
This plugin doesn't appear to work.
Tested it with a single group with the following perms:
- dailybonus.get
- dailybonus.tier.1
I deleted the player.dat file to ensure there was no lastLogin info. The plugin is definitely loading, but that appears to be all it does at this point.
@apoisonedgift
Its possiblse to add, I'll play with the idea more when I get the chance.
Okay. Would it be possibly to make an option where once someone has received the reward for logging in x amount of times, they advance a tier?
Sorry :P Love the plugin as is... just would love to encourage more logins lol XD
@apoisonedgift
DRUNK! The tier system is so that different groups get different rewards. So tier one would be the defaults, the regular players. Then tier 2 might be the donators/high ranked players - maybe you want to give them more money or items as a reward. And tier 3 could be mods/admins. You can make it work however best fits your server.
lol okay, cool and cool. That's fair enough.
One final question (I think :P)... is each tier a day? So... on the first day its tier 1, the second day, tier 2, or am I drunk? :P
@apoisonedgift
Yup, they will get it tomorrow.
If I was to have the plugin replace the item names, it would look like Material.ITEM_NAME in the message - ew :D Since you can have custom messages for each tier, just enter it yourself into the message. I'll add an option for new lines in the message since they could get long.