• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Reactive Passives

Status
Not open for further replies.
Level 3
Joined
Jul 29, 2006
Messages
61
This has been bugging me for a bit, and is a simple question (And I have yet to get an answer)

What is the difference between a script that detects the attacker has an ability, and a script that detects if the attacked unit has an ability?

And Good Example of the first is this one By Paskovich: http://hiveworkshop.com/forums/showpost.php?p=271785&postcount=5

I Tried converting this script to detect if the Attacked unit has a buff (Can be found here: http://hiveworkshop.com/forums/showpost.php?p=285518&postcount=6 (Second script))
And It wouldn't work. Similarly, paskovich told me this:
I recognise your second script, the original was written by me. It detects if the unit with an ability damages another one (like Critical Strike), but not when the unit is damaged (like Evasion, or Thorns Aura, etc...).

My question is simple. What is the difference between the two? Shouldn't it just require you to change Everything designating "get from attacker" to "get from Attacked unit"?
 
Level 11
Joined
Jul 12, 2005
Messages
764
Take a unit with Evasion. When does the evasion effect go off? When the unit is attacked.
Now what's up with Critical strike? The effect goes off when the unit attacks.

What is so hard to understand about this?

In my attack-detection engine, the trigger detects if the unit with an ability attacks a unit. Like Critical Strike.
If you would want to recreate an artificial Evasion, it would require an other script.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Just use a generic attackdetect with if-statements to sort out the various effects, so that you don't need it implemented once per ability that uses it. You shouldn't have any direct problems then.

Eg:

JASS:
function AnyUnitTakesDamage takes nothing returns nothing
    if GetUnitAbilityLevel( GetEventDamageSource(), 'A002' ) > 0 then
    elseif GetUnitAbilityLevel( GetTriggerUnit(), 'A01B' ) > 0 then
    (etc)
    endif
endfunction
 
Status
Not open for further replies.
Top