- Joined
- Jun 10, 2007
- Messages
- 46
Okay, consider these two segments of code:
If...
So basically, is there a way to do this without defining a temporary variable?
- Unit - A unit Dies
-
WARP FIELDS Lightning Strike
-
Events
- Time - Every 0.05 seconds of game time
- Conditions
-
Actions
- Set Loc = (Random point in WARP FIELDS <gen>)
- Special Effect - Create a special effect at Loc using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
- Special Effect - Destroy (Last created special effect)
- Set Ugroup = (Units within 250.00 of Loc matching ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is A structure) Equal to False)))
-
Unit Group - Pick every unit in Ugroup and do (Actions)
-
Loop - Actions
- Set Loc2 = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (500.00 x ((250.00 - (Distance between Loc and Loc2)) / 250.00)) Greater than or equal to 0.00
-
Then - Actions
- Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (500.00 x ((250.00 - (Distance between Loc and Loc2)) / 250.00)))
-
Else - Actions
- Game - Display to (All players) the text: (This is firing incorrectly. + (( + ((String((X of Loc))) + ( + (String((Y of Loc)))))) + (String((Distance between Loc and Loc2), 5, 5))))
-
If - Conditions
- Custom script: call RemoveLocation(udg_Loc2)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_Ugroup)
- Custom script: call RemoveLocation(udg_Loc)
-
Events
If...
- Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (500.00 x ((250.00 - (Distance between Loc and Loc2)) / 250.00)))
- Unit - A unit Dies
So basically, is there a way to do this without defining a temporary variable?