Archy-X / AuraSkills

The ultra-versatile RPG skills plugin
https://aurelium.dev/auraskills
GNU General Public License v3.0
235 stars 88 forks source link

MythicMobs Hook #260

Closed ErikSzabo closed 4 months ago

ErikSzabo commented 4 months ago

This PR tries to properly apply AuraSkills skill/ability/stat modifiers to Mythic damage mechanics while also adding some new conditions, mechanics and configuration.

Here is how it works:

  1. Mythic damage mechanic runs
  2. It creates an EntityDamageByEntityEvent and calls it
  3. The default listener in AuraSkills can't do too much, because mythic will override it on HIGHEST priority
  4. Before that override Mythic calls MythicDamageEvent with the default mechanic damage
  5. We modify this damage so it has the proper effect (using a fake created EntityDamageByEntityEvent so we don't need to rewrite internals)
  6. After that, Mythic will still apply its modifiers. I think this is correct behavior.

New Mythic Conditions

There is a new condition hasMana{m=number} which you can use if you have MythicCrucible for item skills. eg.: message{m="hello world"} ~onUse ?hasMana{m=490} It checks if the player has the required amount of mana. If not, then the mechanic/skill is cancelled

New Mythic Mechanics

There are 2 new added mythic mechanics. takeMana and giveSkillXP

takeMana Takes mana from the player when the player casts the skill/mechanic on an item. eg.: takeMana{m=20} ~onAttack ?hasMana{m=490} It should usually be combined with hasMana. If the player has the required amount of mana, take the mana and do some skill/mechanic.

giveSkillXP Gives skill xp to the player. eg. as a mob skill: giveSkillXP{xp=100;s=fighting} @trigger ~onDeath Here it will give skill xp to the player who triggered the mobs death. The xp parameter can be a math formula with Mythic placeholders and PAPI placeholders (if you have Mythic Premium) The s parameter can be written as skill. It should support every skill not just the builtin ones.

Mythic Hook Config

  MythicMobs:
    enabled: true
    # Apply fighting abilities damage modifiers on MythicDamageEvent
    handle_fighting_abilities: true
    # Apply damage reduction modifiers and defense abilities on MythicDamageEvent
    handle_damage_reduction: true
    # If true, EntityLeveler won't give XP for MythicMobs
    prevent_regular_xp: false

NOTE It seems like config.yml is not updating with these new values by default. Can I call some internal thing to do that or what should I do?

ErikSzabo commented 4 months ago

Fixes #175

ErikSzabo commented 4 months ago

Possibly resolves #231

ErikSzabo commented 4 months ago

Closing this in favor of #261