[Trigger] Add Spell then remove it from current unit

Level 14
Joined
Aug 23, 2011
Messages
662
Hello, I'm making aura like trigger; which is how I want to make it:

There is moonkin unit and it has aura, it gives crit ability to nearby allies for duration and it triggers by moonkin's auto attack.

Everything is working till now.

But, It should remove from unit after 4 seconds and I didn't manage to create time expired trigger. Even I searched for custom script but it doesn'T work.

I've tried wait 4 seconds and then remove ability from temp unit but it doesn't work if multiple unit has ability.
Timer version old v2 trigger gives synthax error. Is there possible way to manage it by using GUI? Ty for help ^^
1782371720004.webp
1782371671474.webp
 
using "A unit is attacked" event is a bad choice here, since this event fires when unit is starting its attack, i.e. footman begins swinging his sword or archer begins drawing her bow, but before the actual attack takes place (i.e. before arrow is shot, before sword hits target).
The actual attack happens a bit later (the delay is set in object editor in 'Combat - Attack N - Animation Damage Point' field).

Why the "is attacked" event is bad choice here is because until that small delay between attack starting and attack being carried out elapses, you can interrupt attack by spamming 'S' key to stops unit's attack. Because units automatically try to auto-attack any close unit, by spamming 'S' key you will spam the 'A unit is attacked' event. As the aura bonus is chance based, you can essentially circumvent the chance.

You should instead detect when target unit takes damage, as that way you have ensured the attack was actually carried out. If you are on version v1.31+, you can use generic "A unit takes damage" event. If you are on older versions, you will need to use a damage detection system (DDS) to detect when any unit takes damage.

---
I am also confused a bit by what you want and what you actually have: You wrote you want the ability to give crit to nearby allies, yet you just add it to a single unit.
How should it work? The attack of a moonkin with aura has a 50% chance to give bonus crit to all nearby allies for 4 seconds, or it gives crit to a single nearby ally for 4 seconds (but it should be possible for multiple allies to have bonus crit if multiple aura procs overlap within the 4 second window)?

---
As for your issue with "timer version old v2" trigger, the custom script for condition should be if *condition* then. You are missing the "then" key word. Also, you are missing closing square bracket for MoonkinCritTimer array.

---
In your "Moonkin Crit Group Ver Copy" trigger the custom script call GroupEnumUnitsOfPlayer(... does not make much sense. The GUI action above it populates TempGroup with alive units and then the custom script clears that same group and populates it with all units of attacking player, i.e. dead units, the moonkin itself, etc.
 
Back
Top