- Reaction score
- 534
> Actually units have a limit of 512
522.
------------------------------------
7 triggers? You can certainly do this with less than 7 triggers.
Triggers that use the same event should be merged together, in order to reduce the number of triggers.
Grapple Init + Lightning
Grapple Effect + GrappleHook + DestroyNHalt + MoveLightning
Grapple Damage alone
-------------------------------------
> Wait until ((Distance between (Position of GrappleHook) and TargetPoint) Less than or equal to 50.00), checking every 0.10 seconds
Leak
You must remove the location before setting it to a new value.
Same.
Same.
---------------------------------
Remove the wait.
Remove the wait.
522.
------------------------------------
7 triggers? You can certainly do this with less than 7 triggers.
Triggers that use the same event should be merged together, in order to reduce the number of triggers.
Grapple Init + Lightning
Grapple Effect + GrappleHook + DestroyNHalt + MoveLightning
Grapple Damage alone
-------------------------------------
> Wait until ((Distance between (Position of GrappleHook) and TargetPoint) Less than or equal to 50.00), checking every 0.10 seconds
Leak
Code:
GrappleHook
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units of type GrappleDummy)) Equal to 0
GrappleSnagged Equal to False
Then - Actions
Unit - Create 1 GrappleDummy for (Owner of Caster1) at (CasterPosition offset by 11.00 towards Angle degrees) facing Angle degrees
Set GrappleHook = (Last created unit)
Unit - Order GrappleHook to Move To TargetPoint
[B]Set GrappleHookLoc = (Position of GrappleHook)[/B]
Trigger - Add to GrappleDamage <gen> the event (Unit - A unit comes within 66.00 of GrappleHook)
Trigger - Turn on GrappleDamage <gen>
Else - Actions
Wait until ((Distance between (Position of GrappleHook) and TargetPoint) Less than or equal to 50.00), checking every 0.10 seconds
Trigger - Turn on Grapple Effect <gen>
Set CasterPosition = (Position of Caster1)
Wait until ((Distance between CasterPosition and GrappleHookLoc) Less than or equal to 10.00), checking every 0.10 seconds
Unit - Remove GrappleHook from the game
Trigger - Turn off (This trigger)
You must remove the location before setting it to a new value.
Code:
GrappleDamage
Events
Conditions
(Triggering unit) Not equal to Caster1
(Triggering unit) Not equal to GrappleHook
Actions
Unit - Pause GrappleHook
Set GrappleSnagged = True
Unit - Cause Caster1 to damage (Triggering unit), dealing (90.00 x (Real((Level of Grapple for Caster1)))) damage of attack type Chaos and damage type Normal
[B]Set TargetPoint = (Position of GrappleHook)
Set GrappleHookLoc = (Position of GrappleHook)[/B]
Set Distance = (Distance between CasterPosition and TargetPoint)
Wait 1.00 seconds
Trigger - Turn on DestroyNHalt <gen>
Trigger - Turn off (This trigger)
Same.
Code:
MoveLightning
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
[B]Set CasterPos2 = (Position of Caster1)
Set GrappleHookLoc = (Position of GrappleHook)[/B]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Caster1 is alive) Equal to True
Then - Actions
Lightning - Move (Last created lightning effect) to source CasterPos2 and target GrappleHookLoc
Trigger - Turn on DestroyNHalt <gen>
Else - Actions
Lightning - Destroy Lightning
Same.
---------------------------------
Code:
Grapple Init
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Grapple
Actions
Set GrappleSnagged = False
Set Caster1 = (Casting unit)
Set CasterPosition = (Position of Caster1)
Set PointVarCaster1 = (Position of Caster1)
Set TargetPoint = (Target point of ability being cast)
Set Distance = (Distance between CasterPosition and TargetPoint)
Set Angle = (Angle from CasterPosition to TargetPoint)
Set N = 0.00
Selection - Clear selection for (Owner of Caster1)
[B]Wait 0.01 seconds[/B]
Selection - Select Caster1 for (Owner of Caster1)
Unit - Pause Caster1
Animation - Play Caster1's attack animation
Unit - Turn collision for Caster1 Off
Trigger - Turn on GrappleHook <gen>
Remove the wait.
Code:
Lightning
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Grapple
Actions
[B]Wait 0.03 seconds[/B]
Set GrappleHookLoc = (Position of GrappleHook)
Set CasterPos2 = (Position of Caster1)
Lightning - Create a Magic Leash lightning effect from source CasterPos2 to target PointVarCaster1
Set Lightning = (Last created lightning effect)
Lightning - Change color of Lightning to (0.70 0.40 0.20) with 1.00 alpha
Wait until (((Playable map area) contains GrappleHook) Equal to True), checking every 0.10 seconds
Trigger - Turn on MoveLightning <gen>
Remove the wait.