Inactive [MECH/ADMN] ModDamage - Change damage mechanics on the fly!

Discussion in 'Inactive/Unsupported Plugins' started by KoryuObihiro, May 20, 2011.

  1. Offline

    KoryuObihiro

    ModDamage
    We've moved to BukkitDev!
     
  2. Offline

    Moromillas

    And thank you kind sir for the fine code.

    Yes, I did find that version a while ago and started playing around with. It is very nice. I managed to get around the prime numbers divided by 2 ending up as integers instead of floats by just multiplying everything, lolz. I think you mentioned that all the calculations ended up as integers, I could be mistaken.

    Code:
    Damage:
        - 'if attacker.type.human and event.time.lessthan.12000': 'mult.2'
        - 'if_not attacker.type.human':
            - 'if target.type.human and event.time.greaterthan.12000 or target.type.mob or target.type.animal': 'mult.2'
    Spawn:
        - 'if_not target.type.human': 'mult.2'
    Doesn't look that pretty, but it works really well. Would have liked to have all the conditions all on the one line with brackets, I luv mah brackets. :D

    The code snippets on the wiki were most helpful, like the damage for groups, defaults, and admins one. It's really helpful to see working code, and have each line annotated with a comment about what the line is doing.

    I look forward to the future release, almost as much as 1.8.
     
  3. Offline

    sagethor

    To be frank... I have no idea how to set this up with the Invdef version of this. Do you have any example config which I can use as reference? I only want Global settings, so nothing per world. Thanks! :)
     
  4. Offline

    lucent

    I'm finding that 'event.rangedelement.arrow' is not working. It loads from the config, fine, but doesn't actually change anything in game. On the other hand, 'event.rangedelement.egg' and 'event.rangedelement.snowball' do properly work. I tested it via the following global nodes:

    Code:
                - 'if event.rangedelement.arrow': 'set.30'
                - 'if event.rangedelement.egg': 'set.9'
                - 'if event.rangedelement.snowball': 'set.7'
    
    Eggs and snowballs did the appropriate damage, but arrows still did just 4.

    Also, in case anyone else tests their configs like me (localhost, stripped down server), I wrote a very basic functionality mod that outputs damage you deal by strike/arrow/egg/snowball, and how much damage you are dealt, when struck by an entity. I think there are several other events it doesn't catch (falling, skeleton's shooting you), and it has some kinks (can't get getNoDamageTicks to work right), but nonetheless, it's been useful to me. Here's the dropbox:

    http://dl.dropbox.com/u/7949526/temp/Spamage.jar
     
  5. Offline

    KoryuObihiro

    Sample config for server global stuff:
    Code:
    Damage:
        - INSERT STUFF HERE
    Spawn:
        - INSERT STUFF HERE
    debugging: normal
    
    Done. Did you want something more specific? :p

    Oooh, nice. I like it. I eventually hope to be able to get this sort of functionality with variables in 0.9.6, but in the meantime debugging tools like this are nice. :D

    EDIT: LOL, should probably address the problem. I'll add this to the tracker - I'm at work. Get back with you on that tonight.
     
  6. Offline

    sagethor

    Uh... that doesn't seem to quite help me. :p

    I'm running a PvP server with mobs off, so I just mainly want to set damage values of items and naturally occuring damage. Sorry for being so annoying :p
     
  7. Offline

    p000ison

    Ok I think its not compitabel with Magic Spells:

    Code:
    2011-08-24 19:55:02 [SEVERE] Could not pass event ENTITY_DAMAGE to ModDamage
    java.lang.ClassCastException: org.bukkit.craftbukkit.entity.CraftFireball cannot be cast to org.bukkit.entity.LivingEntity
        at com.KoryuObihiro.bukkit.ModDamage.ModDamage.handleDamageEvent(ModDamage.java:300)
        at com.KoryuObihiro.bukkit.ModDamage.ModDamageEntityListener.onEntityDamage(ModDamageEntityListener.java:14)
        at org.bukkit.plugin.java.JavaPluginLoader$59.execute(JavaPluginLoader.java:656)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
        at net.minecraft.server.EntityFireball.m_(EntityFireball.java:145)
        at net.minecraft.server.World.entityJoinedWorld(World.java:1212)
        at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
        at net.minecraft.server.World.playerJoinedWorld(World.java:1194)
        at net.minecraft.server.World.cleanUp(World.java:1110)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:450)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    And I got some Exeptions while I played War. The plugin War.
     
  8. Offline

    KoryuObihiro

    You're not annoying, I just don't understand what the block in understanding is. Have you tried tinkering with the Wielding and EntityType conditionals for Damage?

    The more you can report, the better.

    Hmm...I'll look into this. It seems I'm not getting my projectile information quite right.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  9. Offline

    p000ison



    If a player cast a fireball against a mob or player I get this Exeption.

    Code:
    2011-08-24 19:59:32 [SEVERE] Could not pass event ENTITY_DAMAGE to ModDamage[/SIZE]
    [SIZE=3]java.lang.ClassCastException: org.bukkit.craftbukkit.entity.CraftArrow cannot be cast to org.bukkit.entity.LivingEntity[/SIZE]
    [SIZE=3]    at com.KoryuObihiro.bukkit.ModDamage.ModDamage.handleDamageEvent(ModDamage.java:300)[/SIZE]
    [SIZE=3]    at com.KoryuObihiro.bukkit.ModDamage.ModDamageEntityListener.onEntityDamage(ModDamageEntityListener.java:14)[/SIZE]
    [SIZE=3]    at org.bukkit.plugin.java.JavaPluginLoader$59.execute(JavaPluginLoader.java:656)[/SIZE]
    [SIZE=3]    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)[/SIZE]
    [SIZE=3]    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)[/SIZE]
    [SIZE=3]    at net.minecraft.server.EntityArrow.m_(EntityArrow.java:183)[/SIZE]
    [SIZE=3]    at net.minecraft.server.World.entityJoinedWorld(World.java:1212)[/SIZE]
    [SIZE=3]    at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)[/SIZE]
    [SIZE=3]    at net.minecraft.server.World.playerJoinedWorld(World.java:1194)[/SIZE]
    [SIZE=3]    at net.minecraft.server.World.cleanUp(World.java:1110)[/SIZE]
    [SIZE=3]    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:450)[/SIZE]
    [SIZE=3]    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)[/SIZE]
    [SIZE=3]    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)[/SIZE]
    
    [SIZE=3]Ok this is also a Exeption with Moddabame and magispells.
    [/CODE][/SIZE][/FONT]
     
  10. Offline

    KoryuObihiro

    @lucent I know you posted here. 0.9.5 catches the correct shooter, when it identifies a Projectile. I think the problem would lie in my RangedElement enum.
     
  11. Offline

    lucent

    @Koryu and I know you posted and deleted, too! *dog with shifty eyes*
     
  12. Offline

    KoryuObihiro

    XD Yeah. I got really, really tired of messing with the popup editor. It couldn't get @p000ison's message right. **insert ragequit**

    Trying again:


    [/CODE][/quote]
    Looking into it. WHY, though, is it throwing for an Arrow, and not a Fireball? Put into the issues tracker.

    EDIT: WHAT IS THIS I DON'T EVEN *ragequit*
     
  13. Offline

    MJE

    Looks good but does not seem to work with any worlds other than world and world_nether.

    It says "No matching World alias or value "world1""

    I've tried defining an alias but it does not seem to want to see that world even though it's valid.

    Thanks!
     
  14. Offline

    sagethor

    Well, it's more on the fact that I'm new to your plugin, and I have no idea what to put in the spaces, since the wiki on the latest version gives very little details. Sorry for not being very specific!
     
  15. Offline

    KoryuObihiro

    Don't ever be afraid to post your config. The worst that can happen there is it getting ignored; at best, I can solve your problem much more quickly. First step of troubleshooting that comes to mind: Is your case/capitalization correct?

    Yeah...I definitely want to have those tuts finished soon.

    So, my guess is you'll want something like this structure:
    Code:
    Damage:
        - 'switch.attacker.wielding':
            _sword:
                 - 'ASDF'
            _hoe:
                 - 'ASDF'
            _axe:
                - 'ASDF'
            SOMERANDOMITEM:
                - 'ASDF'
          [ . . . ]
        - 'switch.attacker.type':
            fall:
                - 'ASDF'
            burn:
                 - 'ASDF'
            lightning:
                 - 'ASDF'
            Creeper:
                 - 'ASDF'
            Zombie:
                 - 'ASDF'
          [ . . . ]
    
    Making any more sense?

    :D That's good to know that the work I put into the wiki is worth something. If you feel like contributing, go for it!

    As for boolean encapsulation, I'd like to stay away from lexical analysis where I can. This is supposed to be a bridge between programming and system administration...and I've yet to see where parentheses are absolutely necessary. That and analyzing that stuff isn't necessarily something I want to put the effort into. :p
     
  16. Offline

    sagethor

    Making more sense, thank you! I'll still have to do some research though, probably on the old wiki. :)
     
  17. Offline

    MJE

    Here is my config, I may be missing something simple. The worlds case sensetivity match. World and nether work fine its just world1 that is not.
    Code:
    Aliases:
        Item:
            pickaxe:
            - WOOD_PICKAXE
            - STONE_PICKAXE
            - IRON_PICKAXE
            - GOLD_PICKAXE
            - DIAMOND_PICKAXE
            spade:
            - WOOD_SPADE
            - STONE_SPADE
            - IRON_SPADE
            - GOLD_SPADE
            - DIAMOND_SPADE
            hoe:
            - WOOD_HOE
            - STONE_HOE
            - IRON_HOE
            - GOLD_HOE
            - DIAMOND_HOE
            axe:
            - WOOD_AXE
            - STONE_AXE
            - IRON_AXE
            - GOLD_AXE
            - DIAMOND_AXE
            sword:
            - WOOD_SWORD
            - STONE_SWORD
            - IRON_SWORD
            - GOLD_SWORD
            - DIAMOND_SWORD
    Death:
    Food:
    debugging: normal
    Spawn:
    Damage:
        - 'switch.event.world':
            world:
                - 'if attacker.type.Creeper':
                    - 'set.15'
                - 'if attacker.type.Creeper_Charged':
                    - 'set.20'
                - 'if attacker.type.Spider_Riderless':
                    - 'set.3'
                - 'if attacker.type.Spider_Jockey':
                    - 'set.8'
                - 'if attacker.type.Ghast':
                    - 'set.14'
                - 'if attacker.type.Giant':
                    - 'set.20'
                - 'if attacker.type.Zombie':
                    - 'set.7'
                - 'if attacker.type.ZombiePigman':
                    - 'set.7'
                - 'if attacker.type.Slime':
                    - 'set.8'
                - 'if attacker.type.Skeleton':
                    - 'set.5'
            world_nether:
                - 'if attacker.type.Creeper':
                    - 'set.7'
                - 'if attacker.type.Creeper_Charged':
                    - 'set.14'
                - 'if attacker.type.Spider_Riderless':
                    - 'set.2'
                - 'if attacker.type.Spider_Jockey':
                    - 'set.7'
                - 'if attacker.type.Ghast':
                    - 'set.7'
                - 'if attacker.type.Giant':
                    - 'set.10'
                - 'if attacker.type.Zombie':
                    - 'set.5'
                - 'if attacker.type.ZombiePigman':
                    - 'set.5'
                - 'if attacker.type.Slime':
                    - 'set.4'
                - 'if attacker.type.Skeleton':
                    - 'set.4'
            world1:
                - 'if attacker.type.Creeper':
                    - 'set.7'
                - 'if attacker.type.Creeper_Charged':
                    - 'set.14'
                - 'if attacker.type.Spider_Riderless':
                    - 'set.2'
                - 'if attacker.type.Spider_Jockey':
                    - 'set.7'
                - 'if attacker.type.Ghast':
                    - 'set.7'
                - 'if attacker.type.Giant':
                    - 'set.10'
                - 'if attacker.type.Zombie':
                    - 'set.5'
                - 'if attacker.type.ZombiePigman':
                    - 'set.5'
                - 'if attacker.type.Slime':
                    - 'set.4'
                - 'if attacker.type.Skeleton':
                    - 'set.4'
    
     
  18. Offline

    m5k

    Any estimate on when you're going to switch to permissionsbukkit ?
     
  19. Offline

    Ranzear

    The only thing it doesn't support (not that I've tested or attempted, I just know permsbukkit doesn't support) is doing things per a player's group. Everything in my config ignores player groups and everything works fine. Koryu could probably add a 'does this player have moddamage.group permission' check, that is: checking for a unique permission added to a group as surrogate to checking their group, while we wait for PermsBukkit to get with the picture and let plugins read a player's group.

    On that account, I'll be posting my config again, with some tweaks:
    1. Give all body and leg armors a consistent few points of damage reduction so Iron isn't the only option for going deep.
    2. Remove fall damage from being dodgeable, consider other damages (fire, burn, lava). Dodging explosions is awesome though
    3. Add some of the 'underground' bonuses 'at night' for 'exposedtosky' creatures No real point, nearly all mobs spawn at night anyway. Added this to wolves anyway though.
    4. Make two-stage 'deep' mob bonus, tone down 'middle' stage. Should be diamond range mob = does not dick around.
    5. Bumped up damage bonus on leather, particularly with bows.
    Code:
    Aliases:
        Item:
            pickaxe:
            - WOOD_PICKAXE
            - STONE_PICKAXE
            - IRON_PICKAXE
            - GOLD_PICKAXE
            - DIAMOND_PICKAXE
            spade:
            - WOOD_SPADE
            - STONE_SPADE
            - IRON_SPADE
            - GOLD_SPADE
            - DIAMOND_SPADE
            hoe:
            - WOOD_HOE
            - STONE_HOE
            - IRON_HOE
            - GOLD_HOE
            - DIAMOND_HOE
            axe:
            - WOOD_AXE
            - STONE_AXE
            - IRON_AXE
            - GOLD_AXE
            - DIAMOND_AXE
            sword:
            - WOOD_SWORD
            - STONE_SWORD
            - IRON_SWORD
            - GOLD_SWORD
            - DIAMOND_SWORD
    Damage:
        - 'switch.attacker.type': #Begin major Offensive tree
            mob: #Let's make everything nastier with this first number. 2 is decent, 4-6 is pushing past 'hard mode'.
                - '2'
                - 'if Attacker.Y.lessthan.48': #Get deep, take extra damage
                    - 'roll.2'
                - 'if Attacker.Y.lessthan.24': #Get deeper, take even more damage
                    - 'roll.2'
                - 'if event.hasrangedelement': #This handles skeletons because I'm lazy.
                    - '-1'
                    - 'roll.4'
            NPC:
                - 'if Attacker.Y.lessthan.42': #Just in case HeroBrine shows up.
                    - 'roll.2'
                - 'if Attacker.Y.lessthan.24':
                    - 'roll.3'
            Player: #Flatten all damage, recant some portion of it per Tool or AIR (bare fist).
                - '-5'
                - 'if attacker.wielding.AIR':
                    - '4'
                    - 'roll.4'
                    - 'if target.type.ZombiePigman': #Compensate blunt/slashing damage, etc
                        - 'div.2'
                        - '-2'
                        - 'roll.2'
                    - 'if target.type.Zombie and target.fireticks.lessthan.20':
                        - 'div.2'
                        - 'roll.2'
                    - 'if target.type.Skeleton':
                        - '1'
                        - 'roll.2'
                - 'if attacker.wielding._sword':
                    - '6'
                    - 'roll.4'
                    - 'if target.type.ZombiePigman':
                        - '3'
                        - 'roll.2'
                    - 'if target.type.Zombie':
                        - '3'
                        - 'roll.2'
                        - 'if target.fireticks.greaterthan.1':
                            - '3'
                    - 'if target.type.Skeleton':
                        - 'div.2'
                        - '-6'
                        - 'roll.2'
                - 'if attacker.wielding._axe': #Let's make these useful since mcMMO has some neat axe effects and a melee skill that never gets used.
                    - '8'
                    - 'roll.4'
                    - 'if target.type.ZombiePigman': #I quantify axes as 'blunt damage', just for balance purposes so they can be crazy player slayers but not so good against zombies.
                        - 'div.2'
                        - '-5'
                        - 'roll.2'
                    - 'if target.type.Zombie and target.fireticks.lessthan.20':
                        - 'div.2'
                        - '-4'
                        - 'roll.2'
                    - 'if target.type.Skeleton':
                        - '3'
                        - 'roll.2'
                - 'if attacker.wielding.BOW': #A little randomization for player arrows.
                    - '-2'
                    - 'roll.4'
                    - 'if target.type.ZombiePigman': #and some reduction for 'piercing' types, but more just a down-randomizer.
                        - '-2'
                        - 'roll.2'
                    - 'if target.type.Zombie and target.fireticks.lessthan.20':
                        - '-2'
                        - 'roll.2'
                    - 'if target.type.Skeleton': #Except skeletons, who laugh at your arrows going right through them.
                        - 'div.2'
                        - '-2'
                        - 'roll.2'
                - 'if Target.Y.lessthan.48': #Players do less damage when 'deep' as well
                    - '-1'
                - 'if Target.Y.lessthan.24': #Players do less damage when 'deep' as well
                    - '-2'
                - 'if attacker.wielding._pickaxe': #Covering the rest of the tools, picks do 'piercing' like arrows, so get an extra hitch against skellies.
                    - '3'
                    - 'roll.2'
                    - 'if target.type.Skeleton':
                        - '-4'
                        - 'roll.2'
                - 'if attacker.wielding._spade': #Shovels suck. Use it to dig your own grave! Except against zombies
                    - '2'
                    - 'if target.type.Zombie': #Easter eggs
                        - '4'
                        - 'roll.4'
                        - 'if binom.5':
                            - "message.attacker.<Shaun> Ed, this is serious!"
                        - 'if binom.5':
                            - "message.attacker.<Ed> Don't forget to kill Philip!"
                - 'if attacker.wielding._hoe': #This makes more sense with my server's texture pack, hoes look like scythes!
                    - 'roll.4'
                    - 'if target.type.Skeleton':
                        - '-2'
                    - 'if target.type.ZombiePigman':
                        - 'roll.6'
                    - 'if target.type.Zombie':
                        - 'roll.8'
                - 'if attacker.wielding.DIAMOND_AXE': #High Crit!
                    - 'if binom.40':
                        - 'roll.12'
                        - "message.attacker.Critical Hit!"
                        - "message.target.You've been critically hit!"
                - 'if attacker.wielding.DIAMOND_SWORD': #Crit!
                    - 'if binom.30':
                        - 'roll.8'
                        - "message.attacker.Critical Hit!"
                        - "message.target.You've been critically hit!"
                - 'if attacker.wielding.IRON_AXE': #Less Crit!
                    - 'if binom.20':
                        - 'roll.6'
                        - "message.attacker.Critical Hit!"
                        - "message.target.You've been critically hit!"
                - 'if attacker.wielding.IRON_SWORD': #Bitty Crit!
                    - 'if binom.15':
                        - 'roll.4'
                        - "message.attacker.Critical Hit!"
                        - "message.target.You've been critically hit!"
                - 'if attacker.wielding.GOLD_SWORD': #FIRE! Gold stuff is magical btw.
                    - 'if binom.60 and target.fireticks.lessthan.20':
                        - 'targeteffect.addfireticks':
                            - '60'
                    - 'if binom.100 and target.fireticks.greaterthanequals.20':
                        - 'targeteffect.addfireticks':
                            - '20'
                - 'if attacker.wielding.GOLD_AXE': #Magic or just insane, idk.
                    - 'if binom.50':
                        - 'targeteffect.explode': '2'
                - 'if attacker.falldistance.greaterthanequals.1 and !event.hasrangedelement': #High ground has advantage in melee? Why not.
                    - '3'
                    - "message.attacker.Leap Attack!"
                    - "message.target.You've been sundered by a Leap Attack!"
                - 'if attacker.wielding.DIAMOND_HOE': #Now we just need cloaks and skull masks...
                    - 'if binom.3':
                        - '10'
                        - 'roll.20'
                        - "message.attacker.Reaped!"
                        - "message.target.You've been reaped!"
                - 'if attacker.wielding.GOLD_HOE': #Higher rate because of stupid low durability, but does slightly less insane damage.
                    - 'if binom.5':
                        - 'roll.30'
                        - "message.attacker.Reaped!"
                        - "message.target.You've been reaped!"
                - 'if attacker.wielding.IRON_HOE': #Just to keep the trend
                    - 'if binom.1':
                        - 'roll.18'
                        - "message.attacker.Reaped!"
                        - "message.target.You've been reaped!"
                - 'if attacker.wielding.WOOD_HOE': #Keep this our little secret!
                    - 'if binom.1':
                        - 'if binom.1':
                            - 'targeteffect.explode': '1'
                            - 'roll.60'
                            - "message.attacker.SUPER REAPED!"
                            - "message.target.You've been SUPER REAPED!"
                - 'if attacker.wearing.LEATHER_CHESTPLATE': #Deal less damage if wearing armor!
                    - '-1'
                #- 'if attacker.wearing.LEATHER_HELMET': Just gonna negate these trivial pieces
                - 'if attacker.wearing.LEATHER_LEGGINGS':
                    - '-1'
                #- 'if attacker.wearing.LEATHER_BOOTS':
                - 'if attacker.wearingonly.LEATHER_HELMET*LEATHER_CHESTPLATE*LEATHER_LEGGINGS*LEATHER_BOOTS': #Leather switches to a teeny damage bonus if wearing full set, larger bonus if shooting a bow or even if throwing eggs or snowballs!
                    - '4'
                    - 'if event.hasrangedelement':
                        - '3'
                        - 'roll.2'
                - 'if attacker.wearing.IRON_CHESTPLATE': #Iron really slows you down if you want that damage reduction...
                    - '-2'
                - 'if attacker.wearing.IRON_HELMET':
                    - '-1'
                    - 'roll.1'
                - 'if attacker.wearing.IRON_LEGGINGS':
                    - '-2'
                    - 'roll.1'
                - 'if attacker.wearing.IRON_BOOTS':
                    - '-1'
                    - 'roll.1'
                - 'if attacker.wearingonly.IRON_HELMET*IRON_CHESTPLATE*IRON_LEGGINGS*IRON_BOOTS': #Wearing whole set negates a little penalty
                    - '2'
                - 'if attacker.wearing.GOLD_CHESTPLATE': #Gold breaks the mould! Random damage bonus!
                    - 'roll.3'
                - 'if attacker.wearing.GOLD_HELMET':
                    - 'roll.1'
                - 'if attacker.wearing.GOLD_LEGGINGS':
                    - 'roll.2'
                - 'if attacker.wearing.GOLD_BOOTS':
                    - 'roll.1'
                - 'if attacker.wearingonly.GOLD_HELMET*GOLD_CHESTPLATE*GOLD_LEGGINGS*GOLD_BOOTS': #and a little guaranteed bonus with full set, with a chance of fire damage with any weapon!
                    - '2'
                    - 'if binom.10':
                        - 'targeteffect.addfireticks': '20'
                - 'if attacker.wearing.DIAMOND_CHESTPLATE': #Diamond's pieces will randomly negate the penalty
                    - '-2'
                    - 'if binom.50':
                        - '2'
                - 'if attacker.wearing.DIAMOND_HELMET':
                    - '-1'
                    - 'if binom.50':
                        - '1'
                - 'if attacker.wearing.DIAMOND_LEGGINGS':
                    - '-2'
                    - 'if binom.50':
                        - '2'
                - 'if attacker.wearing.DIAMOND_BOOTS':
                    - '-1'
                    - 'if binom.50':
                        - '1'
                - 'if attacker.wearingonly.DIAMOND_HELMET*DIAMOND_CHESTPLATE*DIAMOND_LEGGINGS*DIAMOND_BOOTS': #Full set gives a little random life leech.
                    - 'attackereffect.heal': 'roll.2'
            animal: #Same 'deep' thing, but on wolves if they get down there...
                - 'if Attacker.Y.lessthan.48':
                    - 'roll.2'
                - 'if Attacker.Y.lessthan.24':
                    - 'roll.2'
            lightning: #Boosh!
                - '-2'
                - 'roll.6'
            lava: #I'd rather the lava kill me than the fire ticks afterward
                - '2'
                - 'if target.wearing.DIAMOND_BOOTS': #Direct exposure reduction. Could probably wade through lava for a short time with gold boots and iron damage reduction... which is AWESOME!
                    - '-4'
                - 'if target.wearing.GOLD_BOOTS':
                    - '-6'
                - 'if target.wearing.IRON_BOOTS':
                    - '-2'
                - 'if target.wearing.LEATHER_BOOTS':
                    - '-1'
            explosion: #Helmets reduce this. Gold is extra good of course.
                - 'if target.wearing.DIAMOND_HELMET':
                    - '-3'
                - 'if target.wearing.GOLD_HELMET':
                    - 'div.2'
                - 'if target.wearing.IRON_HELMET':
                    - '-2'
                - 'if target.wearing.LEATHER_HELMET':
                    - '-1'
            fall: #Boots reduce fall damage. Not by too much though...
                - 'if target.wearing.DIAMOND_BOOTS':
                    - '-2'
                - 'if target.wearing.GOLD_BOOTS':
                    - '-6'
                - 'if target.wearing.IRON_BOOTS':
                    - '-1'
                - 'if target.wearing.LEATHER_BOOTS':
                    - '-3'
            void: #Get on with it!
                - 'set.20'
            burn: #Tick damage reduction. Gold practically negates.
                - 'if target.wearing.DIAMOND_LEGGINGS':
                    - '-3'
                - 'if target.wearing.GOLD_LEGGINGS':
                    - '-5'
                - 'if target.wearing.IRON_LEGGINGS':
                    - '-2'
                - 'if target.wearing.LEATHER_LEGGINGS':
                    - '-1'
                - '2'
            fire: #Direct exposure reduction.
                - 'if target.wearing.DIAMOND_BOOTS':
                    - '-4'
                - 'if target.wearing.GOLD_BOOTS':
                    - '-6'
                - 'if target.wearing.IRON_BOOTS':
                    - '-2'
                - 'if target.wearing.LEATHER_BOOTS':
                    - '-1'
                - '2'
            drowning: #Changes drowning dynamic. Won't get stuck underwater because of constant damage taken, but still drown just as fast.
                - '3'
                - 'targeteffect.addairticks': '40'
            cactus: #This is more to reduce damage to mobs. Player's armor handles the rest.
                - '-2'
                - 'roll.3'
            ZombiePigman:
                - '2'
                - 'roll.4'
                - 'if event.environment.NETHER': #Make em extra nasty!
                    - '2'
                    - 'targeteffect.addfireticks': '20'
            Creeper_Normal: #Damage reduced when wearing a helmet, gold is extra good.
                - 'if target.wearing.DIAMOND_HELMET':
                    - '-3'
                - 'if target.wearing.GOLD_HELMET':
                    - 'div.2'
                - 'if target.wearing.IRON_HELMET':
                    - '-2'
                - 'if target.wearing.LEATHER_HELMET':
                    - '-1'
            Creeper_Charged: #Creeper cluster bombs?
                - 'targeteffect.explode': '2'
                - 'if target.wearing.DIAMOND_HELMET':
                    - '-3'
                - 'if target.wearing.GOLD_HELMET':
                    - 'div.2'
                - 'if target.wearing.IRON_HELMET':
                    - '-2'
                - 'if target.wearing.LEATHER_HELMET':
                    - '-1'
            Spider: #Spiders are less hax but will always do a half heart (You'll see later in this config).
                - '-3' #They definitely still chew up your armor fast though.
                - 'roll.7'
            Giant:
                - 'roll.4'
            Zombie: #Zombies heal by biting things!
                - '2'
                - 'roll.2'
                - 'attackereffect.heal': '5'
            Slime:
                - 'roll.8'
                - 'if event.value.greaterthan.7':
                    - 'attackereffect.setsize': '8'
                - '-4'
            #Skeleton: Handled earlier cause I'm lazy.
            Ghast:
                - '2'
            Wolf_Wild: #Similar to spiders, slightly less damage because they hit fast but chew up your armor.
                - '-4'
                - 'roll.4'
                - 'if event.time.lessthan.14000': #Normalized damage at night
                    - '2'
                - 'if event.environment.NETHER': #Wolves spawned in the nether by AngryWolves in place of pigzombies are flaming hellhounds.
                    - 'targeteffect.setfireticks': #So let's make them really firey.
                        - '40'
            Wolf_Tame: #A little randomization but no bonus because wolves are a little OP anyway.
                - '-2'
                - 'roll.4'
        - 'if target.type.Spider': #Punching spiders gets you bitten. Makes up for their occasionally floored hits.
            'if attacker.wielding.AIR':
                - 'attackereffect.Hurt': '1'
        - 'if target.type.Player': #Player defensive tree
            - 'if event.value.lessthanequals.0': #Always take at least half a heart to apply armor damage.
                - 'set.1'
                - 'if attacker.type.player': #Unless it's a player punching us with an item maybe
                    - 'set.0'
                    - 'if attacker.wielding.AIR': #So we'll check for fists and tools too! Tried an 'or' statement but didn't seem to work...
                        - 'set.1'
                    - 'if attacker.wielding._sword':
                        - 'set.1'
                    - 'if attacker.wielding._axe':
                        - 'set.1'
                    - 'if attacker.wielding.BOW':
                        - 'set.1'
                    - 'if attacker.wielding._pickaxe':
                        - 'set.1'
                    - 'if attacker.wielding._spade':
                        - 'set.1'
                    - 'if attacker.wielding._hoe':
                        - 'set.1'
            - 'if target.wearing.LEATHER_CHESTPLATE': #Leather makes you dodge, tweaked to ignore some environmentals
                - '-1' #All chestplates and leggings give a little bit of 100% damage reduction
                - 'if binom.6 and !attacker.type.fire and !attacker.type.lava and !attacker.type.fall and !attacker.type.burn':
                    - 'set.0'
                    - "message.target.Dodged!"
                    - "message.attacker.Your attack was dodged!"
            - 'if target.wearing.LEATHER_HELMET':
                - 'if binom.2 and !attacker.type.fire and !attacker.type.lava and !attacker.type.fall and !attacker.type.burn':
                    - 'set.0'
                    - "message.target.Dodged!"
                    - "message.attacker.Your attack was dodged!"
            - 'if target.wearing.LEATHER_LEGGINGS':
                - '-1'
                - 'if binom.3 and !attacker.type.fire and !attacker.type.lava and !attacker.type.fall and !attacker.type.burn':
                    - 'set.0'
                    - "message.target.Dodged!"
                    - "message.attacker.Your attack was dodged!"
            - 'if target.wearing.LEATHER_BOOTS':
                - 'if binom.2 and !attacker.type.fire and !attacker.type.lava and !attacker.type.fall and !attacker.type.burn':
                    - 'set.0'
                    - "message.target.Dodged!"
                    - "message.attacker.Your attack was dodged!"
            - 'if target.wearingonly.LEATHER_HELMET*LEATHER_CHESTPLATE*LEATHER_LEGGINGS*LEATHER_BOOTS': #Set bonus totals out to ~30% dodge rate
                - 'if binom.20 and !attacker.type.fire and !attacker.type.lava and !attacker.type.fall and !attacker.type.burn':
                    - 'set.0'
                    - "message.target.Dodged!"
                    - "message.attacker.Your attack was dodged!"
            - 'if target.wearing.IRON_CHESTPLATE': #Iron gives straight damage reduction chance
                - '-1'
                - 'if binom.25':
                    - '-3'
            - 'if target.wearing.IRON_HELMET':
                - 'if binom.10':
                    - '-1'
            - 'if target.wearing.IRON_LEGGINGS':
                - '-1'
                - 'if binom.15':
                    - '-2'
            - 'if target.wearing.IRON_BOOTS':
                - 'if binom.10':
                    - '-1'
            - 'if target.wearingonly.IRON_HELMET*IRON_CHESTPLATE*IRON_LEGGINGS*IRON_BOOTS':  #Set bonus is ~60% total chance to reduce an average of ~4 hearts of damage
                - 'if binom.20':
                    - '-2'
            - 'if target.wearing.GOLD_CHESTPLATE': #Gold set is like gold weapons, sets attackers ON FIRE!
                - '-1'
                - 'if binom.30':
                    - 'attackereffect.addfireticks':
                        - '60'
            - 'if target.wearing.GOLD_HELMET':
                - 'if binom.10':
                    - 'attackereffect.addfireticks':
                        - '20'
            - 'if target.wearing.GOLD_LEGGINGS':
                - '-1'
                - 'if binom.20':
                    - 'attackereffect.addfireticks':
                        - '40'
            - 'if target.wearing.GOLD_BOOTS':
                - 'if binom.10':
                    - 'attackereffect.addfireticks':
                        - '20'
            - 'if target.wearingonly.GOLD_HELMET*GOLD_CHESTPLATE*GOLD_LEGGINGS*GOLD_BOOTS': #Even more fire duration, with a chance of a little extra 'kick'!
                - 'attackereffect.addfireticks':
                    - '80'
                - 'if binom.10':
                    - 'attackereffect.explode': '1'
            - 'if target.wearing.DIAMOND_CHESTPLATE': #Diamond reflects damage back at the attacker.
                - '-2'
                - 'if binom.30':
                    - 'attackereffect.Hurt': '3'
            - 'if target.wearing.DIAMOND_HELMET':
                - 'if binom.10':
                    - 'attackereffect.Hurt': '1'
            - 'if target.wearing.DIAMOND_LEGGINGS':
                - '-1'
                - 'if binom.20':
                    - 'attackereffect.Hurt': '2'
            - 'if target.wearing.DIAMOND_BOOTS':
                - 'if binom.10':
                    - 'attackereffect.Hurt': '1'
            - 'if target.wearingonly.DIAMOND_HELMET*DIAMOND_CHESTPLATE*DIAMOND_LEGGINGS*DIAMOND_BOOTS': #Guaranteed damage to attacker with full set, and should average 3.5 hearts reflected.
                - 'attackereffect.Hurt': '2'
            - 'if target.light.lessthanequals.5': #Players take extra damage in the darkness!
                - 'roll.4'
        # mob:
        # armor:
        # ranged:
        # humans:
        # melee:
        # animal:
        # Creeper:
        # Spider:
        # Giant:
        # Slime:
        # Ghast:
        # snowball:
        # bow:
        # egg:
        # fireball:
        # other:
        # pickaxe:
        # AIR:
        # spade:
        # hoe:
        # axe:
        # sword:
    # animal:
        # Chicken:
        # Sheep:
        # Pig:
        # Squid:
        # Wolf:
        # Cow:
    Death:
    Food:
    debugging: normal
    Spawn:
        - 'switch.target.type': #A little extra health for animals too because of lethality running rampant. Underground spawns get bonus health.
            Creeper:
                - 'if !target.exposedtosky and target.Y.lessthanequals.64':
                    - 'roll.4'
            Chicken:
                - '2'
            Sheep:
                - '6'
            # Giant:
            Slime:
                - '2'
            ZombiePigman:
                - 'range.44.50'
            Spider:
                - 'range.14.16'
                - 'if !target.exposedtosky and target.Y.lessthanequals.64':
                    - 'roll.8'
            Pig:
                '3'
            # Squid:
            Wolf:
                - 'range.16.18'
                - 'if !target.exposedtosky and target.Y.lessthanequals.64': #Never a natural spawn underground, only AngryWolves spawns which are hostile, so let's make this consistent!
                    - '4'
                    - 'roll.2'
                - 'if target.exposedtosky and event.time.lessthan.14000': #Outside spawns at night, particulary on the 'full moons' that AngryWolves does.
                    - '2' #No point on other mobs, because most mobs spawn at night anyway.
            Zombie:
                - 'range.36.40'
                - 'if !target.exposedtosky and target.Y.lessthanequals.64':
                    - 'roll.12'
            Cow: #Bovines are tough mofos!
                - '8'
            Ghast: #Because I hate them SO MUCH... and arrows kinda suck now.
                - '-4'
            Skeleton:
                - 'range.12.18'
                - 'if !target.exposedtosky and target.Y.lessthanequals.64':
                    - 'roll.6'
    
     
  20. Offline

    KoryuObihiro

    @Ranzear Dammit, stop reading my mind. :p Since it doesn't look like I'll be finishing MD 0.9.5 tuts until this weekend (Grrrrrr...work) I'll be implementing a system almost exactly as you say. @m5k It should be fairly easy to set up....but from an admin's perspective (puts on the Admin hat) it's hard to beat Perms 3.x's maturity. I'm sad to see it dying.

    Will look at this tomorrow during lunch.
     
  21. @KoryuObihiro

    When will you add full support for PermissionsBukkit (SuperPerms)?
    I think our server has to change in the next days/weeks :/

    ...

    Ok question is answered above ^^
     
  22. Offline

    KoryuObihiro

    By the end of this week.
     
  23. Offline

    Ranzear

    Turned Chainmail into epic ninja armor. It's only awesome at night, so works great in my always-night nether. You get it by killing Zombie Pigmen with sub-4% droprates though >:D (Cookiemonster for that btw, see sig)

    Anyway, I was wearing it in one of my extra worlds for respawn handling and jumped in a handy pool of lava for lulz. Server lagged like crazy, spammed a bazillion of these:

    Code:
    2011-08-25 05:30:09 [SEVERE] Could not pass event ENTITY_DAMAGE to ModDamage
    java.lang.NullPointerException
        at com.KoryuObihiro.bukkit.ModDamage.RoutineObjects.Conditional.EntityCoordinateComparison.getRelevantInfo(EntityCoordinateComparison.java:24)
        at com.KoryuObihiro.bukkit.ModDamage.RoutineObjects.Conditional.EntityCoordinateComparison.getRelevantInfo(EntityCoordinateComparison.java:1)
        at com.KoryuObihiro.bukkit.ModDamage.RoutineObjects.Conditional.EntityComparison.condition(EntityComparison.java:16)
        at com.KoryuObihiro.bukkit.ModDamage.RoutineObjects.ConditionalRoutine.run(ConditionalRoutine.java:35)
        at com.KoryuObihiro.bukkit.ModDamage.RoutineObjects.ConditionalRoutine.run(ConditionalRoutine.java:38)
        at com.KoryuObihiro.bukkit.ModDamage.RoutineObjects.ConditionalRoutine.run(ConditionalRoutine.java:38)
        at com.KoryuObihiro.bukkit.ModDamage.ModDamageEntityListener.onEntityDamage(ModDamageEntityListener.java:49)
        at org.bukkit.plugin.java.JavaPluginLoader$59.execute(JavaPluginLoader.java:656)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
        at net.minecraft.server.Entity.ab(Entity.java:300)
        at net.minecraft.server.Entity.R(Entity.java:274)
        at net.minecraft.server.EntityLiving.R(EntityLiving.java:113)
        at net.minecraft.server.Entity.m_(Entity.java:195)
        at net.minecraft.server.EntityLiving.m_(EntityLiving.java:217)
        at net.minecraft.server.EntityHuman.m_(EntityHuman.java:97)
        at net.minecraft.server.EntityPlayer.a(EntityPlayer.java:193)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:299)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:528)
        at net.minecraft.server.Packet10Flying.a(SourceFile:126)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:89)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:436)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:454)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Maybe you can make some sense of that. Fairly same config as above if you just figure I was wearing equivalent to the 'iron' set. Could it be because my MD config is pushing 750 lines? I just added about 125 conditionals for it to check when I'm wearing the full chainmail armor set (checking for four different times of day per piece and then for full set) and a few dozen more for the environmental damage additions/reductions. I realize now I was probably pushing about 150 conditionals per tick by jumping in there in that armor set! The server did recover after I died from the Lava long after I had timed out from the lag, probably after it finally broke down my chainmail and broke the set bonus to finally do >1 damage per hit to me.
     
  24. Offline

    KoryuObihiro

    Error was due to not checking for null entity when getting location. Fixed. :D
     
  25. Offline

    Ranzear

    Pump me an RC3? It's murdering my server any time I trip into some fire or lava while ninja'ing about... :p
     
  26. Offline

    KoryuObihiro

    There's a couple of other NPEs I'm attending to as well. Before I make a release like that I'd also like to have SuperPerms implemented.

    All in all, expect one today or tomorrow - depends on how lunch goes today. **has crazy schedule**
     
  27. Offline

    Clucky

    Awesome plugin :D

    • Aliasing for the following:
      • Armor sets
      • Biomes
      • Entity types
      • Groups
      • Items
      • Message - see the Message routine for more details [here].
      • Worlds
    I see Armor, Biome, World, all of which I am interested in. How exactly would I set up in the config, for example, where a golden helmet has no drowning damage in a world named Ocean? Sorry, but this is all confusing. And if you don't have that feature integrated into your plugin yet, would you be willing?
     
  28. Offline

    KoryuObihiro

    The example you provide is easy. :D
    Code:
    Damage:
        - 'if event.world.Ocean and target.wearing.GOLD_HELMET':
            - 'set.0'
    
    In 0.9.5, anyway. I'd suggest you use RC2 for now - 0.9.4.x is going to be phased out the instant I have enough free time to finish the half-complete tutorials for the new release.
     
  29. Offline

    Ranzear

    I'd recommend 0.9.5 RC2 anyway, just because I've found little wrong with it that Koryu isn't or hasn't already fixed.
     
    KoryuObihiro likes this.
  30. Offline

    Clucky

    Alright, that makes sense, however, how do I make it only protect against drowning, and can I also protect against suffocation? If so, could you show me how to do a combo for the helmet. If you have the time; If not I'll get my friend, who is more comprehensive than me, to explain it :p
     
  31. Offline

    lucent

    I believe this should work, and should be fairly legible:

    Code:
    Damage:
        - 'if event.world.Ocean and target.wearing.GOLD_HELMET':
            - 'if attacker.type.drowning or attacker.type.suffocation':
                - 'set.0'
    
     
    KoryuObihiro likes this.

Share This Page