• 🏆 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!

[General] Thorns Aura for Ranged Units?

Status
Not open for further replies.

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
I think you will need a DDS (Damage Detection System) for this. Vampiric aura, thorns aura and spiked carrapace are hardcoded to only work for the weapon type "normal" (melee).
With a DDS it should be rather easy:

event - a unit takes damage
if(damaged unit has buff Custom Thorns Aura)
deal 30% of damage dealt to damaging unit

This is just an example and has to be improved obviously. You need to filter, that it only affects attacks (which will also avoid infinite loops, because thorns damage won't be attacks).
 
Last edited:
Level 2
Joined
May 20, 2015
Messages
25
You could also try tweaking the "Defend" ability that the Human Footman has in normal games. Change the % chance to 100% then tweak the numbers a bit? That might allow you to simulate a ranged thorns aura and it might be the easiest solution. That could work for a single unit but I have no idea how you would make it an aura though...
 
I think you will need a DDS (Damage Detection System) for this. Vampiric aura, thorns aura and spiked carrapace are hardcoded to only work for the weapon type "normal" (melee).
With a DDS it should be rather easy:

event - a unit takes damage
if(damaged unit has buff Custom Thorns Aura)
deal 30% of damage dealt to damaging unit

This is just an example and has to be improved obviously. You need to filter, that it only affects attacks (which will also avoid infinite loops, because thorns damage won't be attacks).

tried that with Bribe's DDS. Thing is, a unit takes damage event refers to any source of damage (eg:spells,basic attacks, even triggered/default thorns aura damage)

You could also try tweaking the "Defend" ability that the Human Footman has in normal games. Change the % chance to 100% then tweak the numbers a bit? That might allow you to simulate a ranged thorns aura and it might be the easiest solution. That could work for a single unit but I have no idea how you would make it an aura though...

Defend wont work, its a very hardcoded ability. Changing the chance to 100% wont change it, it will still count as its original 15%.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
tried that with Bribe's DDS. Thing is, a unit takes damage event refers to any source of damage (eg:spells,basic attacks, even triggered/default thorns aura damage)
An easy solution is to use his boolean "isSpellDamage" (don't remember the exact name). In warcraft 3 probably all abilities use spell damage (I can't think of any ability that does not use spell damage at the moment), so you can distinguish between damage from attacks (no spell damage) and damage from abilities (spell damage). If you have custom abilities that deal non spell damage or attacks that deal spell damage that won't work anymore.
Furthermore you can determine attacks by using a dummy buff placing attack modifier. Use attack of corruption for example. Whenever a unit takes damage and his this buff, you know it was an attack and you immediatly remove the buff. However this has a lot of downsides, which require a lot of work to work around them.
As the ability does not stack with other orb effects, you will have to trigger all of them. Also it does only work for non-aoe attacks. For aoe attacks you can use frost wyrms frost breath ability, so you see you will have to do a lot of things for it to work correctly.
If you have a map that is close to normal warcraft, you can probably use the first solution. If not a lot of work arounds might be necessary.
 
Level 13
Joined
Jul 15, 2007
Messages
763
tried that with Bribe's DDS. Thing is, a unit takes damage event refers to any source of damage (eg:spells,basic attacks, even triggered/default thorns aura damage)



Defend wont work, its a very hardcoded ability. Changing the chance to 100% wont change it, it will still count as its original 15%.

What Jampion said. You can distinguish between spell damage and non-spell damage with the DDS. There's not a massive reason to not reflect physical ability damage (and wouldn't make sense if you can reflect physical damage from attacks but not abilities). You don't have to be that good with triggering to avoid the custom thorns aura from triggering itself.

The only weirdness i can think of is if your ranged unit has a physical damage ability that is melee; then you'd have to get creative on how to avoid your thorns aura trigger from picking it up.
 

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,492
Defend wont work, its a very hardcoded ability. Changing the chance to 100% wont change it, it will still count as its original 15%.
That is not true; 100% chance will indeed reflect 100% of piercing damage (check my Hero Contest entry ("Windlord") for proof).

However, Defend (& it's sister abilities: Magic Defend (unused Spell Breaker ability) & Elune's Grace (passive for Archers)) are indeed frustratingly hard-coded on some matters.
 
That is not true; 100% chance will indeed reflect 100% of piercing damage (check my Hero Contest entry ("Windlord") for proof).

I tried that for a scarab thing i did in one of my dead maps,i couldn't see the the difference. Still, I was a complete jackass warcraft editor at that time. If it does work, I may use it.
 
Status
Not open for further replies.
Top