• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Magical Damage Detection

Status
Not open for further replies.
Hello everyone. I found another way of detecting whether the damage came from a spell or from natural damage.

Now, for those of you who do not know how magic damage is detected, I advise you to look at the following links:
In short, they detect magical damage by reducing magical damage by 2.00 using Runed Bracers, which was a finding that revolutionized damage detection systems in the Hive and served as the blueprint for future DDS.

However, that meant that spell reduction items would have to be softcoded as using Runed Bracers overrode the spell reduction mechanism, not allowing any more setbacks.

From these findings, I felt like incorporating yet another object in the object editor in making my DDS when I stumbled upon one predicament, using the Defend ability.

For those who are unaware of its' unexpectedly wide range of uses, I advise you to look at the following links:
Now, I stumbled upon the following fields of Defend, particularly these fields:

temp_001.png


I fiddled around with the fields, negating the chance to deflect spells to 0%, and setting Magic Damage Reduction to -1.00. To my surprise, I noticed that when spell damage is dealt, the expected buggy behavior of the negative spell damage arose, which then struck an idea.

"Why not combine unit removal and revival detection with spell damage differentiation?"

With that in mind, I worked to resolve that buggy behavior of negative spell damage, and ended up with having a universal defend ability for detecting removal, revival and spell damage differentiation.

EDIT:
Tested all possible case scenarios with the observed bugs and all of them seemed to arise from the same issue with detecting spell damage. If spell damage differentiation is not yet implemented in Patch 1.29, it wouldn't be necessary, due to SetEventDamage

My recommendation for those who would take up the endeavor of writing their own damage detection systems is to outsource the spell damage differentiation to unit removal detector libraries which utilize the defend ability or its derivatives.

For now, I will test some more case scenarios... Cheers!
MyPad
 

Attachments

  • Essential Libraries.j
    42.4 KB · Views: 62
  • Extension Libraries.j
    74.7 KB · Views: 71
  • Utility Libraries.j
    64.8 KB · Views: 72
  • (4)TurtleRockAltered.w3x
    241.7 KB · Views: 62
Last edited:
Consider this an update of sorts.

  • Deflect Damage Taken for Magic should have its' parameter set to 0.00 instead of 1.00

Furthermore, using Elune's Grace for detecting magical damage would mean negating the damage output of units dealing magic attacks. (Not so sure about spell attacks). However, a physical damage instance would never allow negative damage, and so will only reduce them to 0.
 
Status
Not open for further replies.
Top