2.6: Getting Skill Name from EntityDamageByEntity event

Discussion in 'Add-Ons, API & Compatible Plugins' started by Mixxit, Feb 28, 2017.

  1. Mixxit

    Mixxit Member
    Supporter Premium Supporter

    Joined:
    Jun 10, 2016
    Messages:
    42
    Likes Received:
    2
    I'm trying to detect the skill name that was used to damage the player but having some difficulty finding a way

    I thought maybe I could bounce back to the activemob from the player to determine its last skill used but i dont see it on the classes methods

    Can anyone think of a way to achieve this?
     
    #1
  2. Xikage

    Xikage Administrator
    Administrator Developer Super Moderator Supporter Premium Supporter Quality Assurance

    Joined:
    Jul 18, 2015
    Messages:
    657
    Likes Received:
    230
    There is no good way to do this in 2.6. I could easily add a way in 4.0, though.
     
    #2
    Mixxit and zDrakon like this.
  3. Mixxit

    Mixxit Member
    Supporter Premium Supporter

    Joined:
    Jun 10, 2016
    Messages:
    42
    Likes Received:
    2
    Sadly I have attempted to upgrade to 4.0 a few times but i keep having to roll back a lot of code due to issues with spawners not spawning or a spawner bugging out and spawning multiple of the same mobs simultaneously. I will eventually jump to it after it has been out a bit longer though, it's new and changing a lot so I can wait. 2.6 has been good to me so I will be patient while you guys refactor most of the namespaces etc

    The reasoning I am requesting the above is because i'm implementing a resists system that needs the spell name that was cast. I use this to determine the type of spell that hit the player such as conjuration, subjucation etc to calculate their chance of resisting it and cancelling the event

    I don't use mythicmobs in a traditional way but have a wrapper plugin to manage spawners, skills, npcs etc, my plugin generates mythicmobs config files that get overwritten by a management plugin and i have a lot of code that listens for interactions or adjusts activemobs aggro and manage their faction etc

    Most of my mythicmobs names contain the ID of the mob, spawngroups contains the ID of the spawngroup which I lookup internally to determine additional information i have associated with a spawngroup, like rotation for example or for npcs chat interactions - the skill system is based around the same abilities my players get, which get exported as ability files for npcs to use as well which works great but when implementing resists I have yet to find a way of getting the name of the skill that hit the player in the damage event

    What would be ideal would be a SkillDamageEvent but if this doesn't eixst I will need to find a new way

    I was hoping I could pass some sort of tuple as the damage in a way like maybe a decimal fraction or some way of carrying a reference id around
     
    #3
    Last edited: Mar 1, 2017
  4. BerndiVader

    BerndiVader Active Member
    Supporter

    Joined:
    Feb 9, 2016
    Messages:
    602
    Likes Received:
    219
    sure not a nice way but still.... add a tag befor the mob do the damage. the in the dmgevent go for that tag.... not clean but hey..
     
    #4
    Mixxit likes this.

Share This Page