[INACTIVE][MECH] DropBonus v2.5 - Loot table configuration tool - [740]

Discussion in 'Inactive/Unsupported Plugins' started by Nohup, Feb 25, 2011.

  1. Offline


    Version 2.5

    Tags - Loot, Drops, Permissions, iConomy, Multi-world

    The DropBonus plugin will allow you to configure the loot tables on your server in such a way that you can a) set the probability that breaking a block or killing an entity will generate a bonus, b) set the probability of EACH TYPE of bonus that can be generated, c) set a range for the number of items dropped and MORE. Even better still, the plugin was coded in a completely generic fashion so you aren't limited to the combinations that I thought were correct or needed. You can configure this plugin so that ANY block that is broken has the chance (.1% - 100%) of generating ANY other material (Material.X). The same goes for any creature that is killed.

    This tool can be used to override the default game drops as well. If you wanted to turn all drops from blocks off and control all the materials on your server, this tool makes it possible. It provides total control over what drops when blocks break and when creatures are killed!

    • Allows for bonus blocks to be dropped when a configured block is broken OR when a configured mob is killed.
    • Bonus chances are cumulative, so you could receive multiple bonuses for one block/mob based on the laws of probability.
    • Single "roll" performed to determine if bonuses should be granted on this event or not. Once you have qualified for a bonus, all bonuses defined for that block will be attempted.
    • Individual "rolls" performed for each bonus type, ensuring that qualifying for one bonus at a given level doesn't automatically qualify you for all bonuses at that level.
    • Configurability is the key. You can configure any block type and under that block type you can configure the chance of a bonus entity being dropped when the given block type is broken. The same goes for mob type.
    • Along those lines, you can also set individual blocks OR bonuses to be turned off. You don't have to have a specific set of entries or drops. Only set up what you want to occur.
    • Percentage configuration is now from 0-100 and anywhere in between in double format (so 0.000001 will now be accepted)
    • Ability to override standard drops from entities and blocks, assumed to be false if not specified
    • Ability to set drops based on tool used when breaking the block/killing the mob
    • Ability to specify 0-n bonus items of a type to be delivered in one "bonus"
    • Ability to specify 0-n bonus evaluations for a given bonus (i.e. you have 100% of one bonus stone, and then 20% chance of a second bonus stone)
    • Ability to specify the maximum number of dropped items per bonus per material
    • Configurable permissions supported by the Permissions plugin
    • Ability to specify the amount of damage done to a tool when breaking a block of a given type or killing a given mob
    • Newly added - MULTI-WORLD support, configurability for each world or all worlds at once.
    • iConomy support for specifying currency to drop from mobs and blocks
    Usage: Install the plugin and configure the config.yml for it (after it is generated). No commands currently specified. Bonus node permissions can be setup in the Permissions config.yml as exemplified below.

    Configuration Examples: Wiki

    Permissions Example: Wiki

    Multi-world Support: Wiki

    iConomy Support: Wiki

    Download DropBonus: DropBonus v 2.5
    Download Source: GitHub
    Wiki Site: Wiki

    Latest CraftBukkit version tested against: 733


    v 2.5
    • Updated to work with Bukkit 733.

    v 2.4
    • Updated to work with new version of Bukkit. NOT backward compatible.
    • Added list support for coins entries
    • Added permissions check before applying override
    v 2.2
    • Bug fixes for Permissions plugin name and 0 data field entry.
    v 2.1
    • Changed cooldown to only affect configured blocks
    • Added override support at tool level
    v 2.0.1
    • Bug fix for creature coin drop issue for iConomy integration.
    v 2.0
    • Added permissions configurability at the Material level (items dropped)
    • Major code refactor, thus new major version
    • Adjusted priority to Monitor where dealing with cancellable events, this will prevent conflicts with WorldGuard and iZone
    • Tested against new Recommended Build, w00t!
    v 1.10

    • Added support for boats and carts
    v 1.9

    • Added configuration to specify whether a killed entity only drops bonuses when killed by a player or not. This has a top-level default AND creature-specific configurations.
    • Added configuration to specify a placed-block cooldown timer (in ticks).
    • Added clean up routine to tracking to make sure entries aren't orphaned.
    • Adjusted block listener priority for onBlockBreak event and accounted for if the event is cancelled.
    v 1.8

    • iConomy beta successfully complete
    • Refactored some of my packages for those that look at my code
    • Created wiki for documentation so this post wasn't so large!
    v 1.7

    • Multi-world support added
    v 1.6

    • Added additional data specification within drop entries (used for color, texture, etc)
    • Added ability to specify how much damage a tool takes when breaking a block or killing a creature
    • Added BETA release of iConomy support (thanks to @Coelho for his help!)
    • Limited error spam to the console when configuration files are not correct
    v 1.5

    • Added Permission support
    v 1.4

    • Added tool-specific drop specification
    • Added support for 0-n bonus items to be dropped from a single configuration
    • Added support for o-n bonuses per material type per bonus
    • Added specification for maximum number of bonuses dropped per event
    v 1.3

    • Added override support to disable standard drops from blocks and entities.
    • Override flag assumed to be false if not specified
    v 1.2

    • added check to only drop bonus when death is caused by entity attack, not by external triggers such as skeletons burning to death or entities drowning
    v 1.1

    • Overhaul to percentage definitions
    • Added support for mob deaths
    • Changed name to DropBonus to span new functionality
    v 1.0

    • Initial release.
    Noppoly, Stormbow, Phaedrus and 2 others like this.
  2. Offline


    Hm, I think you're right, this is pretty much what I was looking for! =o
    Close to it anyways. I was sorta thinking, like what Bukkit of Blocks proposed, having only gold tools dropping the block that was mined, and configuring it to only work with a few things (Ice, Redstone, Coal maybe) just to have a more legit way to get those blocks for building with.
    This does seem very cool though, and I could definitely use this instead. Until Bukkit of Blocks gets updated to have a config, I will definitely look into and use this. :) Might even stick with this plugin anyways.
    Thanks for making this!

    Edit: Quick question... If I want redstone ore blocks to sometimes drop redstone ore blocks, not the ore/dust, would I put redstone_ore or just redstone in the config? Or do item IDs work instead?
  3. Offline


    REDSTONE_ORE would be the equivalent of item 73. You can see all of the Material enumeration constants here

    You can definitely configure this to drop anything you want, and as much and as little as you want. The only thing I don't have is a specification of what tool has to be in the players hand. I could do that if it is truly pertinent though.
  4. Offline


    Ah alright. Thank you very much!
  5. Offline


    Two remarks:
    1. Instead of using 1000-1 you should probably use 100-.1 or 1-.001. People are much more familiar working with percentages this way. 1000 = 100% is very unintuitive!
    2. Is it possible to allow this to hook into mob deaths also? This way we can alter mob loot with your nice gradated drop tables.
    SweetCraft Girl likes this.
  6. Offline


    Updated to be called DropBonus and took your two remarks to heart :) Mob-drop support is now available and configurations are now 0-100 with decimals supported.
  7. Offline


    I read the thread, but it's still a little unclear to me if it's possible to overwrite the original drop a block would have dropped or not.

    If not, is it possible to make it so? Would be the last feature this plugin needs that I could think of!
  8. Offline


    Cancelling what could be dropped by a creature on death would be easy enough since there is a method to access their item stack. However, a block appears to be a different story. The drop generation for a block is NOT currently covered in Bukkit code from what I can see. I updated to 423 of Bukkit in case I was missing something, but looking at the CraftBukkit source that occurs outside the block of their code and appears (reading obfuscated stuff here) to be based on the relative type and not tied directly to the block as an attribute.
  9. Offline


    is it possible to to stop a mob from dropping custom drops if not killed by a player. cause people afk mob grinder to much.

    i want them to kill the mob.. not have a trap do it
  10. Offline


    BlockDrops supported this functionality. I do believe it has a source you can look at.
  11. Offline


    Very good point, and there is a new version (1.2) out there now to account for this. Items will only drop when the damage cause is "ENTITY_ATTACK". No point in popping bonuses every time a skeleton burns up in the morning :)
  12. Offline


    Thanks so much. needed this for my item based economy
  13. Offline


    Oh god, please please please include the ability to disable the normal mob drops now! I want to get rid of mob farmers entirely.

    And the ability to disable normal block drops like the BlockDrops plugin does would also be very appreciated, this functionality is desperately needed atm because David Diaz had to go on hiatus.
  14. Offline


    Is there a possible way to add EssentialEco to this? :] That would be AMAZING. Please tho, look into it please? XD
  15. Offline


    And version 1.3 just for QQ... Thanks for the reference to BlockDrops, helped some although the way they did it is no longer available in Bukkit. But it did show me how to get around there not being a specific property for what you wanted on blocks :)
    --- merged: Mar 1, 2011 5:49 AM ---
    1) Isn't Essentials being updated?
    2) What does this one do? Sounds like economy stuff so not sure that it fits into this plugin.
  16. Offline


    Alright, I'm not shooting you down for what you have so far since I do find it interesting the way you made your original post. It is very descriptive. I myself have moved from BlockDrops to OtherBlocks and see that this one is another good one to go off of. There is a few things I want to clear up and a request of my own to make ^^;.

    First is, probability is the initial chance that it will be special, so if that isn't rolled true, then all of the bonus blocks don't even get rolled (right?). I assume that means if the probability was 1 and the special blocks were all 100, the time it rolls the probability true, all the special blocks drop.

    Next, I know in OtherBlocks that formatting in the file was important (at least it did that for me ><). I do understand that the order the text is layed out is important and that there are colons in the right spot, but is there a specific reason for the amount of spaces used to indent them or is that for our visual pleasure ;0?

    Lastly! Is there any chance that you can implement some type of multiplier here, and/or maybe a range system to work off of. The best example I can give makes logically no sense, but should make it clear xD. Say you wanted a dirt block to drop 1-5 sand, 2-6 gravel, 2-4 leaves, 0-3 gold ingots. It would be nice if you could allow a feature where the range is there but the percentage change it drops affects each individual roll.

    /Breaks example Dirt block
    //Sand Chance: 70%
    -- Sand Roll 1 (Failed)
    -- Sand Roll 2 (Success)
    -- Sand Roll 3 (Success)
    -- Sand Roll 4 (Failed)
    -- Sand Roll 5 (Failed)
    //Gravel Chance: 25%
    -- Gravel Roll 1 (Success)
    -- Gravel Roll 2 (Success)
    -- Gravel Roll 3 (Failed)
    -- Gravel Roll 4 (Success)
    -- Gravel Roll 5 (Success)
    -- Gravel Roll 6 (Success)
    //Leaves Chance: 50%
    -- Leaves Roll 1 (Failed)
    -- Leaves Roll 2 (Failed)
    -- Leaves Roll 3 (Failed)
    -- Leaves Roll 4 (Failed)
    //Gold Chance: 5%
    -- Gold Roll 1 (Failed)
    -- Gold Roll 2 (Failed)
    -- Gold 3 Roll (Failed)
    The reward would be 2 Sand, 5 Gravel, 2 Leaves, 0 Gold Ingots. Since Leaves had a minimum range of 2, even though it failed it stated that leaves would be 2-4, meaning it will give at least 2, but gold didn't have the minimum beyond 0, so it rewarded nothing.
    I assume the layout would look something like this:

                1 5 sand: 70
                2 6 gravel: 25
                2 4 leaves: 50
                0 3 gold_ingot: 5
            probability: 100
            override: false
  17. Offline


    Thank you. For the record though, I think someone posted up an updated version of BlockDrops that actually works with recent builds (though it has some issues). It's attached to crazy2be's post here: http://forums.bukkit.org/threads/me...s-vehicles-blocks-185.2177/page-10#post-96678
  18. Offline


    @QQCucumber - I was just going off of the source code you linked that used onBlockDamage with a DamageLevel of Broken. As of now the only DamageLevels used are apparently started and stopped.

    @XxZeroxX - Lots of questions, so I guess I have to give lots of answers...

    1) Correct on all accounts
    2) This is a YAML file and the original is built via Bukkit's Configuration object. I believe you can get away with 2 leading spaces instead of 4 but the way it comes out programatically with a Configuration.save call is what you are seeing. You can NOT get rid of the space between the : and the value, and you can not preface the keys of the file as you did in your example.
    3) As with any programming, everything is technically possible lol. I was trying to keep it pretty straight forward and simple, but i can add on what you are asking about (though I would implement it differently to reduce the number of rolls). The catch-22 is balance. If you put in 20 configurations, all with a chance of 1-5 that is 100 extra rolls you are asking the server to do each time that particular block is broken. You then add in 10 players mining lets say and then you are asking for 1000x per second or two if they are all actively going to town hitting that block. I guess what I am getting at is the more you add in then the more you are going to see it affect the server. I could spawn a separate thread for the item creation (which is what I do in Philosopher's Box) but then if for some reason the server was busy and the thread wasn't consumed immediately it would make the effect look chunky. Again, not saying I couldn't put it in, just saying it could have impacts on server performance down the road.
  19. Offline


    Is this possible to make different drop depends on what tool does the player use?
    SweetCraft Girl likes this.
  20. Offline


    I greatly appreciate the responses. Just gathering information here and there to see what is possible and inquire on what features are potential in the future ^^. As mentioned the example isn't really a good one since it is a very common block to destroy. On my server the only reason I ask that is because I'm trying to discourage people to farm monster spawners for arrows and things of that sort, so what I did was pretty much packed monster spawners with an extreme amount of items, and so my config ended up spanning probably could to 150 lines ;0.

    Ultimately giving someone a 1-time big drop is more encouraged than getting infinite arrows out of skeleton drowning xD. Definitely not arguing with your logic since you definitely were fair and backed up what you had to say. I obviously have no experience in plugin creation (Only experienced Java-side) so I'm not sure how much stress can be placed on a server. I assume the amount of stress it adds depend on the block and quantity that someone is looking to put into a block. Regardless, keep up the good work and thanks again for the quick response =).
  21. Offline


    Any chance of a complete item list?
  22. Offline

    SweetCraft Girl

    Yes, for example, i would like to have a golden pick axe, be able to mine "fire" from nether rack, a drop only achievable with a mod so that they can make their own chain mail and look EPIC.
  23. Offline


    This seems excellent, but my only question is, is there a way to add permissions? So that maybe only a certain group gets these benefits?
  24. Offline



  25. Offline


    Just got a chance to test out the override. It works great, thanks!
    --- merged: Mar 1, 2011 3:12 PM ---
    Uh, hm. I can't seem to figure out how to make it roll for two of the same item. I did a test and two of something never drops.
  26. Offline


    Thank, since iMonster is not updated this will do to make monsters drop the "shiz" again ;)

    Essentials is updated ALOT, they just dont update the thread,
    but they only show updates on their wiki page, which sucks..
    and yeah i agree sounds like Economy, not sure cause its not obvious.
    so never installed it either.
  27. Offline


    First, thanks everyone for the interest. I am happy to see that my work on the plugins isn't just for my own curiosity/satisfaction :) Now, more questions, more answers:

    @QQCucumber - yah, I did the same test last night after XxZeroxX's post since he was asking about things dropping 0-n items (well I guess technically x-n since he wants both sides variable and configurable). Since the loops was pulling by the keys list, I had assumed it would make two hits. But, I am thinking YAML is optimizing the list somehow so it is dropping dups. I was going to look into Xx's request today anyway so will see what I can do.

    @Grungeud, @DJ_Idol - I haven't looked into Permissions as of yet. I know the plugin exists and can be tied in. Let me look into it and see what hooks I have to add. I know others having tied it in have been able to make it an either/or scenario so their plugin didn't break if the Permissions plugin wasn't on the server, so that is awesome.

    @SweetCraft Girl, @enkryptor - again, anything is possible. I would want to make it to where it could be either way and I think I have an idea how to do it.

    @Shadow771 - List can be found here

    With all of this I ponder at what point does it become too taxing on the server. Of course that question is totally unanswerable since every server is different. Heck, some of my servers at work just serving up this thread would be taxing ;) Best bet is I can add all this in such a way that you can build your configuration as complex or as simple as you like and tweak it based on how your server is handling.
    --- merged: Mar 1, 2011 6:07 PM ---
    updated with list for Shadow
    TatteredKing likes this.
  28. Offline

    SweetCraft Girl

    Servers suffer from 2 things the most when it comes to plugins, i have noticed:

    - Poor resource management that leads to abusing the CPU with 100% or 0% lockup with resource flooding
    - TOO MUCH REPORTING - Log writing, notifications. Log writing = disk access; and when your plugin is writing every time someone performs action X, then it starts competing with the 3-10 other plugins writing to logs as well, and now your disk use graph is near peaking with just 15 people online. Ram Disk grossly reduces this abuse however, plug-in developers need to start considering that many admins "dont care to have their server log 90% of the crap they have decided to log for us:, this impacts our servers read/write/access time and ability to send the map at high speed to those traveling due to unnecessary logging of things i never knew were being logged.

    I turn off logging whenever possible at all times and we run on a beefy i7 in a ram disk - logging should be more optional/configurable than automatic considering it is a hit on the server that quickly adds up as more plug ins use logging methods without any real reason or need.
  29. Offline


    very good points, and usually aside from loading if you see logs in my plugins then that means I forgot to take something out. The way I see it a good majority of server admins don't want to see when xyz (like in this case a successful bonus roll) occurs. They just want to know it works. The one lag I have seen get bad is stack traces on errors, which as plugin developers we should catch and handle gracefully, but we never think our stuff will break ;)

    As I said I am open to putting these changes in and then you guys can measure the impacts as more and more complex configurations are implemented. They probably won't happen until later tonight or tomorrow though as the Mrs is taking me out to dinner tonight for getting older on her.
  30. Offline


    Would there be any way to get this to drop iConomy coins?

    This looks great!

Share This Page