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

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

  1. Offline

    Nohup

    DropBonus
    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!

    Features:
    • 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


    Changelog:

    v 2.5
    • Updated to work with Bukkit 733.


    v 2.4
    • Updated to work with new version of Bukkit. NOT backward compatible.
    v2.3
    • 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

    GameFAQsRolo

    How extensively has the cooldown feature been tested? Would a ~140 tick global cooldown be a noticeable resource jump on a server with an average of 15 players on at a time?

    I'm interested in using the cooldown option, but am concerned about the memory warning on the wiki. If I set the cooldown to 7 seconds (140 ticks, correct?), will it cache the placement of EVERY block placed for 7 seconds or just the specified blocks in the config.yml? What I'd like to accomplish is placing some nice bonuses on gold ore when using a gold pickaxe, but I am worried that players will figure out they can just place gold ore and break it over and over. Ideally, I would like to just place a cooldown on gold ore (or any specific block) if a global cooldown generates a noticeable impact on performance.
     
  3. Offline

    XxZeroxX

    Alright, I can give my input on how I have setup coins to drop working properly. You could basically copy/paste what I'm typing and see if it works for you, but if not just follow the same general guidelines and it should work out.

    Code:
    bonuses:
    
        craftzombie:
            coins: 90 1 2
            tool:
                gold_sword:
                    coins: 90 1 4
            probability: 100
    
        craftspider:
            coins: 90 2 3
            tool:
                gold_sword:
                    coins: 90 2 6
            probability: 100
    
        craftskeleton:
            coins: 90 2 4
            tool:
                gold_sword:
                    coins: 90 2 8
            probability: 100
    
        craftcreeper:
            coins: 90 3 4
            tool:
                gold_sword:
                    coins: 90 3 8
            probability: 100
    Basically everything has a 90% chance of rewarding for the kill. Using any tool at all will give the first coins: line, which is listed just under the name. Under tool: gold_sword coins: there's the bonus for killing it with the set weapon. You should be able to copy and paste those lines and adjust the amounts of coins as needed. If that doesn't work then there may be an issue with your config file and I would make a backup and have it create a new one and start from there.

    What I did to fix that issue is either don't give them the reward for it or make it so gold_ore drops gold_ingots. That'll teach them to try to farm-break those blocks ;)
     
  4. Offline

    Strebelschneck

    Edit4: Was just a permission issue. All good now.
    Edit3:

    And STILL, it doesnt work. nothing does. here is the code:

    Code:
    bonuses:
        craftchicken:
            maxcount: 3
            chances:
                    egg: 10
                    feather: 60 1 3
            probability: 99.9
            override: false
        stone:
            maxcount: 2
            tool:
                  gold_pickaxe:
                         chances:
                                 glowstone: 5 1 2
            probability: 100
            override: false
        dirt:
            maxcount: 2
            tool:
                  gold_spade:
                         chances:
                                 glowstone_dust: 7 1 4
            probability: 100
            override: false
        lapis_ore:
            maxcount: 4
            chances:
                    blue_dye: 40 1 4
            probability: 100
            override: false
        diamond_ore:
            maxcount: 1
            chances:
                    golden_apple: 10
            probability: 100
            override: false
        craftspider:
            maxcount: 3
            chances:
                    apple: 30
            probability: 100
            override: false
        sand:
            maxcount: 2
            chances:
                    stone: 100 1 2
            probability: 100
            override: false
    help me please. I don't have any errors on startup.

    Edit2: okay,....it's "spade"....sorry.
     
  5. Offline

    Daveyo

    these config files look incredibly complex.
     
    SweetCraft Girl likes this.
  6. @Nohup @dugen would there be a away of incorporating chances with damaged:?

    ie: Diamond pickaxe is damaged 75% of the time:

    Code:
    bonuses:
     probability: 75
        tool:
         chances:
            damaged: 1
          
    Or can we use a decimal with the damaged int? ie. 0.75 instead of 1 damage?
     
  7. Offline

    anon

    Help please.

    I want a group to drop stone from stone if they use a golden pickaxe. If they break with another tool, we would have a normal drop. If another group breaks normal drop too.

    This is my config file:
    Code:
    bonuses:
        stone:
            chances:
            override: true
            tool:
                gold_pickaxe:
                    chances:
                        stone: 100
                diamond_pickaxe:
                    chances:
                        cobblestone: 100
                        stone: 5
            probability: 100
    
    creature:
        requirekiller: true
    block:
        cooldown: 0
    and my permissions file:

    Code:
    groups:
      miner:
        default: false
        permissions:
        - essentials.kit.miner
        - bonuses.stone.tool.gold_pickaxe.*
        inheritance:
        - peasant
        info:
          prefix: '&2'
          build: true
          suffix: Miner
    Althou if I break a stone, I get no drop at all :(
     
  8. Offline

    XxZeroxX

    The syntax to how you do things is important. Avoid manual typing as much as possible, copy and paste will make life easier xD.

    Code:
    bonuses:
        stone:
            chances:
                cobblestone: 100 1 1
            override: true
            tool:
                gold_pickaxe:
                        stone: 100
                diamond_pickaxe:
                        cobblestone: 100
                        stone: 5
            probability: 100
    
    creature:
        requirekiller: true
    block:
        cooldown: 0
    I believe that should work. I took what you said word-for-word. So breaking Stone with anything will ALWAYS give you a cobblestone. Breaking Stone with a Gold Pickaxe will give them 1 Cobblestone + 1 Stone, and breaking Stone with a Diamond Pickaxe will give them 2 Cobblestone and have a 5% chance of giving them 1 Stone as well. Let me know if that sounds good and if it works =)
     
  9. Offline

    anon

    Yes, but, I would like so when u break a cobblestone with a goldpickaxe it would give only a stone, and not a cobblestone plus a stone. Is this possible? I mean, thats why I took off the first "cobblestone: 100 1 1".
     
  10. Offline

    mudzereli

    Do the new material level permissions work for chances as well as tools?

    For example:
    Code:
        craftzombie:
            chances:
                arrow: 100 0 6
                coal: 26.37
                iron_ingot: 12.37
                iron_block: 1.37
                diamond: 0.52
                diamond_block: 0.05
            override: true
            probability: 100
    I could do something like

    - bonuses.craftzombie.*
    - -bonuses.craftzombie.chances.diamond
    - -bonuses.craftzombie.chances.diamond_block

    Can you confirm that this is accurate?

    Also, just wanted to say thanks again for this plugin. My config file is up to 689 lines now :)
     
  11. Offline

    XxZeroxX

    Code:
    bonuses:
        stone:
            override: false
            tool:
                gold_pickaxe:
                    chances: 100
                        stone: 100
                diamond_pickaxe:
                    chances: 100
                        cobblestone: 100
                        stone: 5
            probability: 100
    
    creature:
        requirekiller: true
    block:
        cooldown: 0
    Try that and let me know if it works. I've yet to sleep since I'm a pro procrastinator for classes and had things to finish, so don't pick on me in case something obvious is messed up xD. That should make it so if they use a tool, they get the tool-based bonus.. if they use anything else they only get cobblestone. Try that out and post back in case there is anything else acting weird xD.
     
  12. Offline

    anon

    Now I get only normal drop :(
    Eve using the golden tool, I get only normal drop. I have this node on my permissions file : - bonuses.stone.tool.gold_pickaxe.*

    is this right?
     
  13. Offline

    Nohup

    Good Lord, I go to sleep for the very few hours I took last night...

    @dugen, @HamburgerHelper - I think I am going to have to play with tool damage more. Right now you can set an int value to what the tool takes, but I was under the assumption that the incoming damage differed but from what I am hearing it may be the underlying durability that is the difference. I will have to look into tools further. You would think that by giving us the ability to change the damage... but I guess that may be so you can set a higher degradation. Sorry, I will dig into it!

    @Kruemelkatze - I know there are several store-based plugins out there. for the life of me I cant think of one off the top of my head, but i've seen em!

    @GameFAQsRolo - As extensively as its been used by anyone other than me. My testing is on a local server with just me. Now, the thread itself is TINY and all it is doing is holding an object reference that is then looked up in the list and removed. The list contains Block objects. You have a good idea about only placing the cooldown on configured blocks. I like it! I will have to look to implement it ASAP as that would cut down on entries.

    @Strebelschneck - I am not certain, but I think your last edit is the first entry and all is fine now?

    @Daveyo - rally they can be as complex or as simple as you take it. The biggest part is just spacing properly and putting things on the right nodes... Once you get the entries themselves down there are only like 5 different key words and the rest is just hierarchy and material names. Some of these guys are setting up MMO-like servers though where they have roles and what not so their's are obviously going to be more complex.

    @anon - The override is basically telling it "don't drop what would normally break, I will tell you what to drop". Since this started off as a bonus tool it primarily focused on building onto what already dropped, and then I added the override to stop the default drop. Unfortunately if you want to "have it both way" you will have to turn override on and then specify wayyyyyyy too many options for it to be useful. I will have to look at configuring the override specifically at the tool level, but keep in mind the tool level will still process any default level chances. Also, you guys keep leaving off the chances nodes under your tools!!!!

    @mudzereli - correct, I check the permission right before I add it to the stack, and it works on both tool-level and default-level chances nodes.

    @XxZeroxX - You need the chances node under gold_pickaxe and diamond_pickaxe.
     
  14. Offline

    anon

    Oh thanks for the answer, I managed to make it work... Kind of.
    The chances thing really was what was keeping it to work. Now it works, but only as you said droping the normal thing plus the thing specifyed on the tools option.
    The only way to go around this would be assigning a tools option for every block/tool that exists right, and have tons of permissions nodes... So I guess ill have to wait :( Im trying to replace the superheat plugin with this one, superheat had the ability to "melt" blocks when they were mined with golden tools, but it isnt working anymore, nor have permission suport.
    Also something that I dont understand. The permission node - bonuses.stone.*
    shouldnt it contain the - bonuses.stone.tool.gold_pickaxe.* ? I mean .tool.gold_pickaxe.* would be inside the first * right?
     
  15. Offline

    XxZeroxX

    I told you lack of sleep!!. Was copy and pasting things around like a big nub xD. But yeah, I'm glad I only got poked at by 11 words, least yelled at on the list ;D.
     
  16. Offline

    Nohup

    @anon - basically if you are trying to only give that gold pickaxe to a miner you would not give that node to the others, so if you are doing bonuses.stone.* you would also have to do - bonuses.stone.tool.gold_pickaxe to take that node away from the rest, because as you said the .* permission includes it all
     
  17. Offline

    mudzereli

    I believe the best way to replace superheat would be something like this:

    Config:
    Code:
    bonuses:
    #12 - Sand
        sand:
            chances:
            override: true
            tool:
                air:
                    chances:
                        sand: 100
                wood_spade:
                    chances:
                        sand: 100
                stone_spade:
                    chances:
                        sand: 100
                iron_spade:
                    chances:
                        sand: 100
                gold_spade:
                    chances:
                        glass: 100
                diamond_spade:
                    chances:
                        sand: 100
            probability: 100
    Permissions:
    - bonuses.sand.*

    The problem you will run into though, is that if the player has, for example, a wood block in his hand instead of nothing, or a shovel, he or she would get nothing from the block.

    There may be another way to do this but I'm not sure.
     
  18. Offline

    randomnewb

    I can confirm the new 2.01 iConomy coins from mobs works! Also, thanks for the help with coding my apples from leaves. That works as well. Very awesome plugin! The players love it as well!
     
    Nohup likes this.
  19. Offline

    Nohup

    LOL I understand, I don't know how many times copy/paste has bitten me over the years...
     
  20. Offline

    anon

    Nohup, maybe if you dont want to create a override inside tool level, you could add a tool node, with an alltools, and maybe a exception node.

    Its just something that I saw on groupmanager that has exception nodes, maybe you could put something like:

    Code:
    tool:
                allbutgold_shovel:
                    chances:
                        sand: 100
    
    I know its strange the way I wrote, but its just to get the idea, so we could select all blocks except one.
     
  21. Offline

    dugen


    I've done some more testing and it would appear that whatever "damaged" value you specify is in addition to whatever damage is applied by Minecraft by default. Now.. there's also an interesting thing that I found where you can set the damage to a negative value and it works.. kindof. If I set it to -1, the item appears to lose durability normally according to the little bar graph but if you move the item and the graph refreshes, you can see it actually didn't lose. Setting it to -2 seems to make the graph refresh on the fly but, if you do it too often you will push the durability higher than max and it seems to keep track of it. I expect that would eventually overflow and do bad things so it sounds like a terrible idea. One thing that seems to work well is setting damaged to -2 with a percent less than 50. For example.. I changed stone so that wooden pickaxes have a 40% chance of adding -2 durability (on average you'd be removing 1 and adding back .8 every time for an overall loss average of .2) and my wooden pickaxe lasted much longer (should have been about 5x and that sounds about right.) I'm thinking in production, I may do stone with a 25-35% chance to add -2 to diamond picaxes which should add up to 2x to about 3x increase in diamond pickaxe durability cutting through stone. Combine that with changing diamond to drop more when broken and time spent farming mats for tools should be cut down dramatically.

    This is a bit limiting since you have to set percent below 50% on whatever you want to use with this so you couldn't, for example, set stone to always drop something, and set the durability loss lower. Also, there's a bit of math involved in getting the loss you want. A nicer interface might be worthwhile but this is quite useful as it is. I'm excited to implement this on my production server.

    Also, since nobody else seems to have mentioned it "damaged" is indeed the keyword under tools where you set this value. I suggest adding it to the wiki, unless it's there and I just missed it.

    Another thought.. is it possible to set a "damaged" value outside the tools section so that you could, for example, easily set it so that leaves don't damage anything.
     
  22. Offline

    GameFAQsRolo

    Excellent idea. I will definitely be using this on gold and iron, thanks.

    Cool, that will be great.
     
  23. Offline

    Nohup

    Okay I made the changes for cooldown and added the override to the tool level. as far as the damage goes I am going to have to think further. @dugen there is no percentage that applies to damage right now other than the overall percentage. I am thinking it would be more useful to have its own, but then I am thinking there are more things that would be affected. I will think on it some more, I just want to make sure I put the best option in place.

    Version 2.1 is now out there with the above changes.
     
  24. Awesome! Thanks NoHup!
     
  25. Offline

    NEO

    is it possible to have multiple drop bonus configurations for the same block? For example 3 configurations for diamond ore that drop 1 diamond 100% 1 diamond 10%, 1 diamond 100% 1 diamond 15%, 1 diamond 100% 1 diamond 20?
     
  26. Offline

    Nohup

    There isn't really a need for three diamond_ore nodes for that. Your configuration as you stated it would drop 3 diamonds 100% of the time and then have the possibility for an additional three at 20, 15 and 10% chances respectively. So it would be:

    Code:
    bonuses:
        diamond_ore:
            chances:
                diamond:
                    - 100 3 3
                    - 20 1 1
                    - 15 1 1
                    - 10 1 1
     
  27. Offline

    NEO

    no i want separate drops for diamond ore. So some people would get a 15% drop rate plus the normal drop rate of diamond ore. and i could give some 20%.

    sorry for the confusion. I need an underscore for diamond ore? do i need the underscore in my permission node to or just diamondore?
     
  28. Offline

    Nohup

    the permission node has to match the block node so would need it both places. The list of block types to use is here
     
  29. Offline

    NEO

    So support for the same block having separate drop rates is not possible then.
     
  30. Offline

    Nohup

    and as far as what you are looking for, that wouldn't work right now. what would be the determining factor, just permissions? I am trying to keep it all as generic as possible, so I don't want to add permission group names or anything like that into the search path. Would you be able to limit the tool use or anything like that for the different groups?
     
  31. Offline

    Shenlong

    Just thought I'd let you know, after the update everything works fine for me. Thanks for all the help! This is quickly becoming one of my favorite plugins [​IMG]!
     

Share This Page