- Joined
- Sep 26, 2013
- Messages
- 8
Hello everybody,
I was trying to write a trigger for the following scenario:
Unit attacks another unit. Casts a specific targeted spell on the unit it is attacking, each time it attacks.
To be more precise: I used a code for a knockback mechanism, which moves the target unit away from the caster of the spell for a certain time. The issue I'm having is: The trigger in question needs a caster and a target to work and if I simply replace the spell I used, which was Stormbolt with something auto-casted like Frost arrows it does not work since Frost arrows appears not to be a casted ability.
I tried out the following trigger:
Event:
-Every 0.01 seconds of game time
Actions:
- Set variable 1 (Bouncer) = Random unit from (Units in (Playable map area) matching ((Unit.type of (Attacking unit)) equals Unit type (Bounce Tower) )))
- Set Variable 2 (Bounced Unit) = Random unit from (Units in (Playable map area)))
-Unit group - Pick every unit in (Units in (Playable map area)) and do (Unit - Order Variable 1 (Bouncer) to Human - Mountain King Stormbolt - variable 2 (Bounced unit)
I hope you guys can help me out with this!
P.S. I know choosing the "random unit" part was probably not the most clever solution!
I was trying to write a trigger for the following scenario:
Unit attacks another unit. Casts a specific targeted spell on the unit it is attacking, each time it attacks.
To be more precise: I used a code for a knockback mechanism, which moves the target unit away from the caster of the spell for a certain time. The issue I'm having is: The trigger in question needs a caster and a target to work and if I simply replace the spell I used, which was Stormbolt with something auto-casted like Frost arrows it does not work since Frost arrows appears not to be a casted ability.
I tried out the following trigger:
Event:
-Every 0.01 seconds of game time
Actions:
- Set variable 1 (Bouncer) = Random unit from (Units in (Playable map area) matching ((Unit.type of (Attacking unit)) equals Unit type (Bounce Tower) )))
- Set Variable 2 (Bounced Unit) = Random unit from (Units in (Playable map area)))
-Unit group - Pick every unit in (Units in (Playable map area)) and do (Unit - Order Variable 1 (Bouncer) to Human - Mountain King Stormbolt - variable 2 (Bounced unit)
I hope you guys can help me out with this!
P.S. I know choosing the "random unit" part was probably not the most clever solution!