[FUN/MECH] CriticalHits v0.2 - Adjustable Damage Control [740]

Discussion in 'Inactive/Unsupported Plugins' started by videege, Apr 9, 2011.

  1. Offline

    videege

    CriticalHits - The Adjustable Damage plugin:
    Version: v0.2 [Now with Permissions support!]
    CriticalHits is a very simple plugin which allows you to adjust the damage dealt by items on an individual or group basis in addition to specifying "critical hit" events.

    Features:
    • Set base damage for any item or group of items.
    • Set critical damage (as well as additional random damage) and the chance to score a critical hit on a per item basis.
    • Use permissions to limit which players benefit from the entry.
    Download version 0.2
    Source Code
    Config Explanation
    The config.yml file is pretty standard fare. Put the item ID's (good reference here) as string keys under the "items" root key. You can make a group of items by specifying space-delimited item keys as well (i.e, '272 273') as well as global entries via the asterisk ('*').
    Each item can have these properties defined (note: you can leave these pretty much any of these out to utilize Minecraft defaults).
    • baseDamage: This is the base damage of the item (i.e., how much damage it deals when a critical hit is not achieved.) Range: [0,20]
    • baseCritDamage: This is the base damage for a critical hit with the item. This can be in absolute terms [0,20] or relative to the base damage ('2x').
    • critDamageModifier: This is an amount of damage that is added at random to baseCritDamage when a critical hit is scored. Any amount of damage from {0, critDamageModifier} can be added.
    • critChance: This is the percentage chance of scoring a critical hit with this item on a {0, 100} scale (integers only please).
    • permission: This is the permission required for this entry.
    It should be noted that the damage values listed above are in terms of bukkit health points (i.e, 0 = no hearts, 20 = 10 hearts).
    Finally, the one remaining global setting, "notifyOnCrit" is flag which turns critical hit notification on/off. If this is set to true players will receive a message when they score a critical hit.

    Feeling confused? Here's a sample config that shows off the options:
    Code:
    items:
        #with the exception of global entries (see below), the plugin will match the first
        #critical hit entry on this list that the player has permission for.  If no matching entry
        #is found, the plugin will then start looking at global entries.
        '*':                             #global "knights" entry
            baseDamage: 3                #knights do 3 damage with everything (1.5 hearts)
            baseCritDamage: 5            #critical hits hit for 2.5 hearts (note: this is how you specify absolute critical damage)
            critChance: 10               #10% chance of critical hit with any item
            critDamageModifer: 2         #critical hits have up to 2 bonus damage (1 heart)
            permission: somerpg.knight   #requires the permission "somerpg.knight"
    
        '267 272':                       #stone sword and iron sword, special "Knights" entry
            #no baseDamage, this tells the plugin to use the default event damage
            baseCritDamage: '2.5x'       #'2.5x' tells the plugin to multiply base damage by 2.5
            critChance: 50               #knights have a 50% chance of crit with these weapons
            critDamageModifer: 4         #critical hits have up to 4 bonus damage (2 hearts)
            permission: somerpg.knight   #requires the permission "somerpg.knight"
    
        '267 272':                       #stone sword and iron sword, general entry
            #no baseDamage, this tells the plugin to use the default event damage
            baseCritDamage: '2x'         #'2x' tells the plugin to multiply base damage by 2
            critChance: 30               #30% chance of crit
            #no critDamageModifier, this means no bonus crit damage
            #no permissions, this means anybody can get this critical hit
    
        '268':                           #wooden sword, monk entry
            baseDamage: 6                #monks do 3 hearts damage with wooden swords
            baseCritDamage: 16           #monks hit for 8 hearts damage on a critical hit
            critChance: 30               #30% chance of crit
            #no critDamageModifier, this means no bonus crit damage
            permission: somerpg.monk     #requires the permission "somerpg.monk"
    notifyOnCrit: true
    
    Features Planned
    Version 0.3:
    • Allow LivingEntities to score critical hits (i.e., monsters).
    • Allow damage reduction based on the victim entity (i.e., swords do half damage against skeletons).
    Changelog:
    Version 0.2
    • Permissions support
    • Relative crit damage specification
    • Global entries
    • Grouped entries
    Version 0.1
    • Releasing initial version.
    Version 0.1
    • Releasing initial version.
     
    kahlilnc, Phaedrus and Finer1 like this.
  2. Offline

    videege

    Yeah. The idea is that this gives you the maximum capability to tie this plugin into other plugins which work based on Permissions. If you're not running any other plugins like that, feel free to make up whatever you want.
     
    kahlilnc likes this.
  3. Offline

    videege

    Tested with new CB RBs.
     
  4. Offline

    Xyrius77

    I have a Problem with the Plugin, i am Trying to set the damage of some swords and tools to 0 and only allow players with the specified permission to do damage with them but it does not work.
    here is an example:
    items:
    '267 276 283':
    permission: somerpg.Waepons
    '292 293 294':
    permission: somerpg.Hoes
    '267 276 283':
    baseDamage: 0
    baseCritDamage: 0
    critChance: 0
    critDamageModifer: 0
    '292 293 294':
    baseDamage: 0
    baseCritDamage: 0
    critChance: 0
    critDamageModifer: 0
    notifyOnCrit: true
    This way, nobody does any damage, even players with the permissions somerpg.Waepons or somerpg.Hoes. And sometimes when you hit an Enemy and you do no damage you get the notification that you landed a critical hit, wich is confusing because the crit chance is 0.

    If i put these at the bottom instead:
    '267 276 283':
    permission: somerpg.Waepons
    '292 293 294':
    permission: somerpg.Hoes

    everyone even players without the permissions do Damage with the waepons and tools.


    is there a way to fix that ?

    I just realized, that the plugin produces an error message and won't work, as long as i use my config. But i cant find the mistake wich causes the error, anyone here who can help me out ?
     
  5. Offline

    kahlilnc

    This is what I did, does this work: (I can't test it right now cuz no one on my server at the moment and dont want to wait) Permissions:
    Code:
        Solider:
            default: false
            info:
                prefix: '&d[Soldier]&f'
                suffix: ''
                build: true
            inheritence:
            - Citizen
            permissions:
            - solider.class
    Config:
    Code:
    items:
        '*': &id001
            critDamageModifier: 2
            baseCritDamage: 6
            critChanceModifier: 10
            baseDamage: 3
            critChance: 40
            permission: solider.class
        '*': *id001
    notifyOnCrit: true
    Can someone tell me if I did this right or wrong? I can paste this in a pastie bin if you want to edit it.

    EDIT: How would I use fist to get critical besides '*'
     
  6. Offline

    kahlilnc

    This works for CB 740 and you should make weapons deal more damage on certain things like Person or Mobs. Configurable.
     
  7. Offline

    videege

    I'll look into this.
     
    kahlilnc likes this.
  8. Offline

    nemafow

    I'm still getting those errors:
    17:53:57 [SEVERE] Could not pass event ENTITY_DAMAGE to CriticalHits
    java.lang.IllegalArgumentException: n must be positive
    at java.util.Random.nextInt(Unknown Source)
    at com.barronsoftware.videege.CriticalHits.CriticalItem.getCriticalDamage(CriticalItem.java:28)
    at com.barronsoftware.videege.CriticalHits.CriticalHitsEntityListener.onEntityDamage(CriticalHitsEntityListener.java:29)
    at org.bukkit.plugin.java.JavaPluginLoader$44.execute(JavaPluginLoader.java:474)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:257)
    at net.minecraft.server.EntityHuman.d(EntityHuman.java:522)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:803)
    at net.minecraft.server.Packet7UseEntity.a(SourceFile:33)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    My config reads:
    items:
    '271':
    baseDamage: 4
    baseCritDamage: 8
    critChance: 5
    #no permissions, this means anybody can get this critical hit
    '275':
    baseDamage: 6
    baseCritDamage: 12
    critChance: 5
    #no permissions, this means anybody can get this critical hit
    '258':
    baseDamage: 8
    baseCritDamage: 16
    critChance: 5
    #no permissions, this means anybody can get this critical hit
    '279':
    baseDamage: 10
    baseCritDamage: 20
    critChance: 5
    #no permissions, this means anybody can get this critical hit
    '268':
    baseDamage: 4
    baseCritDamage: 6
    critChance: 10
    #no permissions, this means anybody can get this critical hit
    '272':
    baseDamage: 6
    baseCritDamage: 9
    critChance: 10
    #no permissions, this means anybody can get this critical hit
    '267':
    baseDamage: 8
    baseCritDamage: 12
    critChance: 10
    #no permissions, this means anybody can get this critical hit
    '276':
    baseDamage: 10
    baseCritDamage: 15
    critChance: 10
    #no permissions, this means anybody can get this critical hit
    notifyOnCrit: false
    Have I done something wrong?
     
  9. Offline

    Ranzear

    Next time you get around to an update, can you add Critical Hit Message customization? It's just a bit obtuse to have the plugin name showing up in bright green every time when I have weapons with up to 50% crit rate...
     
  10. Offline

    nemafow

    Hi Videege, any idea what is with my error?
     
  11. Offline

    nemafow

    Is this plugin dead :( ?
     
  12. Offline

    Rurikar22

    I hope not! Still works for our server and we love it!
     
  13. Offline

    nemafow

    Me too, as I dont know any other plugin that will allow me to set the axes to do the same damage as the equivalent sword. But the error messages I keep getting are giving me the craps!
     
  14. Offline

    nemafow

    I reckon this is dead
     
  15. Offline

    LOLCopter

    I have a question, if i have this:
    '*':
    critDamageModifier: '2x'
    critChance: 25
    permission: rogue
    '269 273 256 284 277':
    critDamageModifier: '2x'
    critChance: 15
    permission: rogueknife

    when a person with both these permissions attacks a player with any of those items which critChance does it calculate? the 15 or the 25 or does it add them to a 40?
     
  16. Offline

    kahlilnc

  17. Offline

    MonsieurApple

    Removed dash in thread title. (Not allowed via Plugin Release Guidelines)
     
  18. Offline

    LOLCopter

    ???? are you giving a suggestion or are you taking a jab at my permissions name?
     
  19. Offline

    kahlilnc

    No. I wasn't talking to you. I was wandering if someone would fork this but someone is. :)
     
  20. Offline

    u83rju1c3

    it seems to work with CB 803, is this being updated anymore?
     
  21. Offline

    videege

    Hey guys, I no longer have the time to develop this plugin.

    It's pretty simple though, I encourage anyone interested to fork it at their leisure. Thanks for the interest and suggestions (it's just been hard keeping up with all the updates with my new work schedule).
     
  22. Offline

    Rpa;otj

    Is there an up to date plugin out there that does what this one did? I am trying to edit damage on lower quality weapons as well as golden hoes to tie in with MCMMO and Mob Arena as well as pvp....
     
  23. Offline

    Milchshakee

    Code:
    2011-06-26 19:25:28 [SEVERE] Could not load 'plugins/CriticalHits.jar' in folder 'plugins':
    unacceptable character #FFFD special characters are not allowed
    in "<reader>", position 1656
        at org.yaml.snakeyaml.reader.StreamReader.checkPrintable(StreamReader.java:68)
        at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:159)
        at org.yaml.snakeyaml.reader.StreamReader.forward(StreamReader.java:89)
        at org.yaml.snakeyaml.reader.StreamReader.forward(StreamReader.java:79)
        at org.yaml.snakeyaml.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:974)
        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:237)
        at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:183)
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:564)
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:228)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:124)
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
        at org.bukkit.util.config.Configuration.load(Configuration.java:82)
        at org.bukkit.plugin.java.JavaPlugin.initialize(JavaPlugin.java:157)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:175)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:194)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:117)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:118)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:362)
        at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:281)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:304)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:725)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:691)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:684)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    What did i wrong ? D:
     
  24. Great plugin man, using this on my arena server with MobArena!

    The plugin still worked under RB860, any chance you can update it to work with 935? I get NullPointerException error messages and the question whether CriticalHits is up to date.
     
  25. Offline

    kahlilnc

    Something is wrong with your yaml. I am guessing but we need this back. :D
     
  26. Offline

    Alarmclock314

    Does not work with bow&arrow?
     
  27. Offline

    Pandamatak

    Can someone help me?

    I'm just looking to edit the damage for the different types of swords (individually) when players wield them. How would I go about doing this?
     

Share This Page