i need help in forcing my unit to only cast the target point spell in 45 to 135 degrees only. when the angle from the caster to the target point is greater than 135 the angle will be then changed to 135 and if lower than 45 it changes to 45. i already tried adding conditions;
Is there a better method other than this?
- Set Leak_Unit = (Triggering unit)
- Set Leak_Points[0] = (Position of Leak_Unit)
- Set Leak_Points[1] = (Target point of ability being cast)
- Set Leak_Real = (Angle from Leak_Points[0] to Leak_Points[1])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Leak_Real Greater than 135.00) and (Leak_Real Greater than or equal to 270.00)
-
Then - Actions
- Set SS_Point[SS_Integers[2]] = (Leak_Points[0] offset by 256.00 towards 135.00 degrees)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Leak_Real Less than 45.00) and (Leak_Real Greater than 270.00)
-
Then - Actions
- Set SS_Point[SS_Integers[2]] = (Leak_Points[0] offset by 256.00 towards 45.00 degrees)
-
Else - Actions
- Set SS_Point[SS_Integers[2]] = (Target point of ability being cast)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Set SS_Angle[SS_Integers[2]] = (Angle from Leak_Points[0] to SS_Point[SS_Integers[2]])
Is there a better method other than this?