- Joined
- Jul 21, 2019
- Messages
- 177
Hello, i am working on a spell with the following effect:
Caster casts the spell, units within 500 radius of caster have their movement speed reduced (via dummy unit + ability)
only if they are facing away from the caster.
What im trying to do is to detect if the picked units are facing away from the position of the caster, no matter the facing angle of the caster (picked units can even be behind the caster, but if they are facing away from the point where the caster is they are slowed)
Here is a shitty drawing i made in paint:
And here is my trigger:
Thanks in advance
Caster casts the spell, units within 500 radius of caster have their movement speed reduced (via dummy unit + ability)
only if they are facing away from the caster.
What im trying to do is to detect if the picked units are facing away from the position of the caster, no matter the facing angle of the caster (picked units can even be behind the caster, but if they are facing away from the point where the caster is they are slowed)
Here is a shitty drawing i made in paint:
And here is my trigger:
-
MS Slow
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Mocking Shout
-
Actions
- Set MS_Point = (Position of (Casting unit))
- Set MS_Group = (Units within 500.00 of MS_Point)
-
Unit Group - Pick every unit in MS_Group and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is alive) Equal to True
- ((Picked unit) is A structure) Equal to False
- ((Picked unit) is Magic Immune) Equal to False
- ((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True
-
Then - Actions
- Unit - Create 1 Dummy Unit for Neutral Passive at MS_Point facing Default building facing degrees
- Unit - Set level of Dummy Slow (Mocking Shout) for (Last created unit) to (Level of (Ability being cast) for (Triggering unit))
- Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_MS_Group)
- Custom script: call RemoveLocation(udg_MS_Point)
-
Events
Thanks in advance