Would it be possible for us to get a event for if a Specific Unit attacks something?
Currently, in order to do something like this, I have to do a Unit is Attacked Event with the condition that the attacking unit is (X), like the below for example…
Soul Overflow Tier 5pt2
Events
Unit - A unit Is attacked
Conditions
And - All (Conditions) are true
Conditions
(Attacking unit) Equal to Arthas Menethil 1590
(Unit-type of (Triggering unit)) Not equal to Build Plot
(Unit-type of (Triggering unit)) Not equal to Control Point
((Triggering unit) is A structure) Equal to False
Actions
Unit - Cause Arthas Menethil 1590 to damage (Attacked unit), dealing 30.00 damage of attack type Chaos and damage type Normal
Unit - Set mana of (Attacked unit) to ((Mana of (Attacked unit)) - 15.00)
Unit - Set life of Arthas Menethil 1590 to ((Life of Arthas Menethil 1590 ) + 30.00)
Unit - Set mana of Arthas Menethil 1590 to ((Mana of Arthas Menethil 1590 ) + 15.00)
…and if I understand WC3 correctly, that will trigger for each and every single unit in the game whenever it is attacked to see if it is attacked by (X), which, in certain maps, can trigger dozens if not hundreds of times in large scale army battles. Having multiples of these triggers checking at once isn’t a good thing for a map I don’t think, it could lead to lag and maybe crashes?
Was hoping we might give us a more straightforward option either in a WC3 Patch, or in reforged.
1 Like
I don’t think this can hurt performance a lot untill there are like thousands of events, but I might be wrong.
I reccomend you to use If (All Conditions are True) then do (Then Actions) else do
action if you have multiple conditions to make sure all of them are cheked.
1 Like
No, that won’t get past the conditions, so it will be ran only when Arthas is attacking a unit that is not Build Plot or Control Point. Therefore that event is quite sufficient - that’s why there are conditions. Or else, by that logic we would need millions of different events for all possible combinations of events happening to certain units.
1 Like
There is an unit attacks event it just has a wierd name, but it fires only when that unit attacks, actually it runs right before the attack even started allowing to add any attack modifier or orb to the attacker and still affecting the current attack which is often not working correctly inside the is attacked Event.
Its jass name is EVENT_UNIT_TARGET_IN_RANGE
I think its english equal in GUI should be Notices a target in range.
To use that event one has to know that attacking unit and attacked unit are not correct inside that event.
Trigger Unit is the attacking unit
Targeted Unit is the attack target.
1 Like
Wouldn’t that still check for every single unit in the game though?
So… something like this?
Untitled Trigger 001
Events
Unit - Marduk Blackpool [Full] 1334 Acquires a target
Conditions
Actions
Set randombuff = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
randombuff Equal to 15
randombuff Equal to 14
randombuff Equal to 13
randombuff Equal to 12
randombuff Equal to 11
randombuff Equal to 10
randombuff Equal to 9
randombuff Equal to 8
randombuff Equal to 7
randombuff Equal to 6
randombuff Equal to 5
randombuff Equal to 4
randombuff Equal to 3
randombuff Equal to 2
randombuff Equal to 1
Then - Actions
Set TempPoint = (Position of (Triggering unit))
Unit - Create 1 Dummy (real) for Player 10 (Light Blue) at TempPoint facing Default building facing degrees
Set dummy = (Last created unit)
Unit - Add Shadow Bolt Volley (Marduk the Black) to (Last created unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Level of Black Arts (Attrib Replacement) for Marduk Blackpool [Full] 1334 ) Equal to 1
Then - Actions
Unit - Set level of Shadow Bolt Volley (Marduk the Black) for dummy to 1
Unit - Order dummy to Night Elf Warden - Fan Of Knives
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Level of Black Arts (Attrib Replacement) for Marduk Blackpool [Full] 1334 ) Equal to 2
Then - Actions
Unit - Set level of Shadow Bolt Volley (Marduk the Black) for dummy to 2
Unit - Order dummy to Night Elf Warden - Fan Of Knives
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Level of Black Arts (Attrib Replacement) for Marduk Blackpool [Full] 1334 ) Equal to 3
Then - Actions
Unit - Set level of Shadow Bolt Volley (Marduk the Black) for dummy to 3
Unit - Order dummy to Night Elf Warden - Fan Of Knives
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Level of Black Arts (Attrib Replacement) for Marduk Blackpool [Full] 1334 ) Equal to 4
Then - Actions
Unit - Set level of Shadow Bolt Volley (Marduk the Black) for dummy to 4
Unit - Order dummy to Night Elf Warden - Fan Of Knives
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Level of Black Arts (Attrib Replacement) for Marduk Blackpool [Full] 1334 ) Equal to 5
Then - Actions
Unit - Set level of Shadow Bolt Volley (Marduk the Black) for dummy to 5
Unit - Order dummy to Night Elf Warden - Fan Of Knives
Else - Actions
Else - Actions
Unit - Remove dummy from the game
Set dummy = No unit
Custom script: call RemoveLocation(udg_TempPoint)
But if this is ‘Aquire’s a target’, couldn’t this be abused? Like, you don’t have to actually attack, just right click a unit, hit stop, rinse and repeat to get the effect without actually going into combat?
1 Like
yes, it can be abused. But “is attacked” has the same abuse problem.
“acquires a target” is not “notices a target” (attacks event).
acquires target is an unit AI event, the unit found an unit to attack when beeing idle or charging to a point.
Right. Yes, “Is attacked” (as well as that “Acquires a target”) is easily manipulated and abused, you are right. If you want to detect a unit’s attack and make it as hard as possible to be abused, you will have to most likely use a damage detection system, which can detect the exact moment the damage is dealt.
You can make 2 triggers.
Idk how units are being introduced into your map, but every time a new unit is added, do “Trigger - Add to (Soul Overflow Tier 5pt2) the event (Unit - (Last created unit) Takes damage)”
Then structure “Soul Overflow Tier 5pt2” the same way with the condition: (Damage source) Equal to Arthas Menethil 1590
That’ll prolly draw on your resources worse than anything, but it’ll be unabusable. 
You can probably set a condition that checks what unit is being attacked. Heck, honestly thats probably the easiest way to accomplish what you want.
Unit - Specific unit event (is issued an order targeting object)
(Conditions)
Unit type of (event response unit issued targeted order) equal to XXXXX
(actions)
yaada yaada…