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

[Spell] Passive that stacks attackspeed per attack up to a cap

Status
Not open for further replies.
Level 12
Joined
Jan 4, 2014
Messages
543
Hello, I want to make a spell that does the following,

Every time a specific unit attacks, increase it's attack speed by 10% up to 100%. If no attacks are done within 5 seconds, all stacks are lost.

The increase attack speed part is fairly simple.
(Unit is attacked) >> (int > 10) >> (attacking unit = specific unit) >> (add 10% attack speed)

My issue is having some kind of timer that resets to 5 seconds every time (specific unit attacks) and having a trigger that checks if the timer goes down to 0.

I thought about giving a buff to the unit every time it attacks and having a trigger check every 0.5 seconds if the unit still has the buff, if it doesn't, remove all stacks, but this seems like an annoying way of doing it, since it requires a constant trigger that runs every 0.5 seconds.
 
Level 7
Joined
Jan 23, 2011
Messages
350
Guessing you don't want MUI skill

Just add to your first trigger
Set Time = 5.00
Set Hero = Attacking unit
If DetoLoop <gen> is on equals false then
Turn on DetoLoop
Endif

DetoLoop
Every 0.5

Set Time = Time-0.5
If Time equals or less than 0.00 then
Remove AttackSpeed from Hero
Turn off this trigger
Endif
 
Status
Not open for further replies.
Top