HorseCharge

Discussion in 'Plugin Requests' started by Jamesol1, Aug 13, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    Jamesol1

    I found a plugin that managed to do this back in 1.8 (back when horses were buggy though...so i can't just make a 1.8 server which would suck for various reasons.
    Basically I'd want attack damage to be increased depending on the speed of the horse. Making horses actually useful for combat instead of just being used for travel. Is there a way of doing this?

    It would be for a 1.12 server.

    Thanks for reading.
     
  2. What does the plugin have to include?
    Does it need to have a .yml file to edit damage values?
     
    Jamesol1 likes this.
  3. Offline

    Jamesol1

    @NullPointerExptn
    A config to edit damage values would be great with configuration options such as:

    - This is bonus damage just for melee attacking while riding a horse.
    StationaryMeleeDamageBoost: 1.2

    -This value is multiplied with your speed and added to your melee damage. 2-4 are reasonable values
    SpeedMeleeDamageMultiplier : 2.0
     
  4. I'll see what I can do :)

    UPDATE:

    After researching, I have found that this will involve editing something called NMS Values, and this isn't something I can help with. I will start learning and fidling about now. I will come back to this if nobody comes forward

     
    Last edited: Aug 13, 2017
    Jamesol1 likes this.
  5. @Jamesol1
    I'll have a go. Shouldn't be too hard.
     
    Jamesol1 likes this.
  6. Offline

    Jamesol1

    @NullPointerExptn
    Thanks a lot for your help! I will see if someone else comments (unlikely but we will see).

    EDIT: Ok scratch that apparently @AlvinB is up for it :D.

    Thanks! If you need anymore details regarding the plugin let me know. I do know a similar plugin that is now outdated also had a feature for allowing attack damage from bows as well as swords/melee weapons. If that is easy to add in by all means but the main focus is melee horse combat.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Aug 13, 2017
  7. @Jamesol1
    Alright, should the damage multiplier be separate for projectiles (bows and whatnot), or should it just read the same value as with melee attacks? If it should be separate, should the static damage bonus be separate for projectiles and melee aswell?
     
    Jamesol1 likes this.
  8. Offline

    Jamesol1

    @AlvinB
    ''should the damage multiplier be separate for projectiles (bows and whatnot), or should it just read the same value as with melee attacks?''
    The damage multiplier should be different for bows/arrows in comparison to swords/melee weapons etc.
    ''If it should be separate, should the static damage bonus be separate for projectiles and melee aswell?''
    Yes.
    I want to be able to balance things out between archery and melee combat.
    Thanks!
    Config will look something like this:
    StationaryMeleeDamageBoost: x.x
    SpeedMeleeDamageMultiplier : x.x
    ------------------------------------
    StationaryRangedDamageBoost : x.x
    SpeedRangedDamageMultiplier : x.x
     
  9. Just a heads up, AlvinB. You will need to use NMS here which will mean having to update the plugin every time the server gets updated. I don't believe bukkit has a Horse API so I don't know how else you will be able to do this, but if you find another way, well done! Good luck! :)

     
  10. @NullPointerExptn
    Actually, I didn't need to use NMS. I just computed the speed using the pythagorean theorem on the x and z values of the Horse#getVelocity() vector.

    And even if I did have to use NMS, I have a pretty decent reflection arsenal at my disposal to make it not be version dependent :p

    @Jamesol1
    I finished the plugin. Download link is here. Source code is here. The plugin uses Metrics on bstats.org. More info on what this is and how it can be disabled can be found here.

    I included two commands in the plugin:
    • /horsecharge reload which reloads the plugin's configuration files. Only users with the horsecharge.reload permission can do this.
    • /horsecharge debug which displays debug information when you hit a mob on a horse. Useful for getting the values right. Only users with the horsecharge.debug permission can do this.
    The config should be pretty self-explanatory, but don't hesitate to ask if you have any questions!
     
    Jamesol1 and NullPointerExptn like this.
  11. Offline

    Jamesol1

    @AlvinB Hi thanks a lot!
    The only issue is that with...
    ''# The amount to multiply with the horse's speed on a melee attack and then add to the damage
    multiplier-melee-damage-bonus: 2.0''


    A head on charge sprinting with the horse always reads 1.7479 speed and 10.639 with these settings:
    ''static-melee-damage-bonus: 0.0
    multiplier-melee-damage-bonus: 2.0''

    But when going around x target in a circle hitting I've noticed i get 'speed reading spikes' of which gives values of 4.48 speed and 15 damage or others.. it happens once every so 10 hits or something. But this never happens when I'm going full speed which defeats the purpose.

    EDIT: Image attached of 25 speed 50 damage :O. Again i was circling while attacking a golem and out of no where a big spike.
    Ok i dont think my image link is working with bukkit forums?
    [​IMG]
    [​IMG]

    P.s the debug add in is a great addition makes things x100 easier to view. Thanks a lot for your help!
     
    Last edited: Aug 15, 2017
  12. @Jamesol1
    Right. This is a problem with the Bukkit API, I just use that regular method.

    I will have a look in the Minecraft internals to see if it's possible to work out another solution, but I can't promise anything.
     
    Jamesol1 likes this.
  13. Offline

    Jamesol1

    @AlvinB
    How are things going? Please let me know if it isn't possible. I will likely just use the stationary damage increase.
     
  14. @Jamesol1
    Yeah, I have yet to find a solution, and I'm not sure I will. The thing is that the velocity is actually managed by the client when riding horses, so it is very difficult to find accurate numbers server side. But if I do happen to stumble across a way to make this work, I'll be sure to update you.

    And for anyone else who might find a solution, please feel free to edit the plugin I wrote to make it work properly.
     
    Jamesol1 likes this.
  15. @Jamesol1
    I actually came up with a bit of a compromise today. What I could do is check the generic movement speed attribute of the Horse, and multiply by that instead. What this effectively means is the number would only be multiplied by how fast the horse can travel, but not how fast it is travelling. Would this be something that could work for you?

    I also might mention that when you press forwards, you will nearly always accelerate to the horse max speed instantly, so I think this solution might be quite a good workaround.
     
    Jamesol1 likes this.
  16. Offline

    Jamesol1

    That sounds like a good alternative. It makes sense that you do more damage on a faster moving horse. Thanks a lot for your help with this!
     
  17. Jamesol1 likes this.
  18. Offline

    Jamesol1

    Ok great! While we are on the topic of horses. I'm not suggesting I want you take this on yourself (as it is different to what you said you would help me out with) but If you could let me know if it is possible that would be great. Horse armor... seems to be very weak. Also you cannot enchant it either. Is there a way of editing the armor values of horse armor? Is it maybe (this would just be a bonus) possible for horse armor to effectively use enchantments such as prot IV?
     
Thread Status:
Not open for further replies.

Share This Page