- Joined
- Jun 10, 2019
- Messages
- 69
Hi all,
Today I'm working on an ability I'm calling "Cosmic Link." The caster can target either an ally or an enemy, forming a tether between them. 10 markers appear between the caster and the target, showing the tether. An allied target is healed over time while an enemy target is damaged over time so long as the tether holds (if the target and the caster move too far apart, the tether breaks early).
Here are my triggers:
Any help would be greatly appreciated!
Thanks!
Today I'm working on an ability I'm calling "Cosmic Link." The caster can target either an ally or an enemy, forming a tether between them. 10 markers appear between the caster and the target, showing the tether. An allied target is healed over time while an enemy target is damaged over time so long as the tether holds (if the target and the caster move too far apart, the tether breaks early).
Here are my triggers:
-
Cosmic Link Hashtable Creation
-
Events
- Map initialization
- Conditions
-
Actions
- Hashtable - Create a hashtable
- Set VariableSet CLink_Hashtable = (Last created hashtable)
-
Events
-
Cosmic Link Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Cosmic Link
-
Actions
- Set VariableSet CLink_Instances = (CLink_Instances + 1)
- Set VariableSet CLink_Caster[CLink_Instances] = (Triggering unit)
- Set VariableSet CLink_Target[CLink_Instances] = (Target unit of ability being cast)
- Set VariableSet CLink_TempPoint[1] = (Position of CLink_Caster[CLink_Instances])
- Set VariableSet CLink_TempPoint[2] = (Position of CLink_Target[CLink_Instances])
- Set VariableSet CLink_TempDistance = (Distance between CLink_TempPoint[1] and CLink_TempPoint[2])
- Set VariableSet CLink_TempAngle = (Angle from CLink_TempPoint[1] to CLink_TempPoint[2])
-
For each (Integer CLink_MarkerInteger) from 1 to 10, do (Actions)
-
Loop - Actions
- Set VariableSet CLink_TempPoint[3] = (CLink_TempPoint[1] offset by (((Real(CLink_MarkerInteger)) x CLink_TempDistance) / 11.00) towards CLink_TempAngle degrees.)
- Unit - Create 1 Cosmic Link Marker Dummy for (Owner of CLink_Caster[CLink_Instances]) at CLink_TempPoint[3] facing CLink_TempPoint[2]
- Hashtable - Save Handle Of(Last created unit) as CLink_MarkerInteger of CLink_Instances in CLink_Hashtable.
-
Loop - Actions
- Set VariableSet CLink_HealingDamage[CLink_Instances] = ((5.00 x (Real((Intelligence of CLink_Caster[CLink_Instances] (Include bonuses))))) + (30.00 x (Real((Level of Cosmic Link for CLink_Caster[CLink_Instances])))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (CLink_Caster[CLink_Instances] has buff Astral Infusion (Buff)) Equal to True
-
Then - Actions
- Set VariableSet CLink_HealingDamage[CLink_Instances] = (CLink_HealingDamage[CLink_Instances] + (((Real((Level of Astral Infusion for CLink_Caster[CLink_Instances]))) x 30.00) + (3.00 x (Real((Intelligence of CLink_Caster[CLink_Instances] (Include bonuses)))))))
- Unit - Remove Astral Infusion (Buff) buff from CLink_Caster[CLink_Instances]
- Special Effect - Create a special effect attached to the overhead of CLink_Caster[CLink_Instances] using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
- Special Effect - Destroy (Last created special effect)
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation(udg_CLink_TempPoint[1])
- Custom script: call RemoveLocation(udg_CLink_TempPoint[2])
- Custom script: call RemoveLocation(udg_CLink_TempPoint[3])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- CLink_Instances Equal to 1
-
Then - Actions
- Trigger - Turn on Cosmic Link Loop <gen>
- Else - Actions
-
If - Conditions
-
Events
-
Cosmic Link Loop
-
Events
- Time - Every 0.02 seconds of game time
- Conditions
-
Actions
-
For each (Integer CLink_Loop) from 1 to CLink_Instances, do (Actions)
-
Loop - Actions
- Set VariableSet CLink_TempPoint[1] = (Position of CLink_Caster[CLink_Loop])
- Set VariableSet CLink_TempPoint[2] = (Position of CLink_Target[CLink_Loop])
- Set VariableSet CLink_TempDistance = (Distance between CLink_TempPoint[1] and CLink_TempPoint[2])
- Set VariableSet CLink_TempAngle = (Angle from CLink_TempPoint[1] to CLink_TempPoint[2])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Distance between CLink_TempPoint[1] and CLink_TempPoint[2]) Greater than or equal to 750.00
- (CLink_Target[CLink_Loop] has buff Cosmic Link ) Equal to True
-
Then - Actions
- Unit - Remove Cosmic Link buff from CLink_Target[CLink_Loop]
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (CLink_Target[CLink_Loop] has buff Cosmic Link ) Equal to True
-
Then - Actions
-
For each (Integer CLink_MarkerInteger) from 1 to 10, do (Actions)
-
Loop - Actions
- Set VariableSet CLink_TempPoint[3] = (CLink_TempPoint[1] offset by (((Real(CLink_MarkerInteger)) x CLink_TempDistance) / 11.00) towards CLink_TempAngle degrees.)
- Unit - Move (Load CLink_MarkerInteger of CLink_Loop in CLink_Hashtable.) instantly to CLink_TempPoint[3]
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (CLink_Target[CLink_Loop] belongs to an ally of (Owner of CLink_Caster[CLink_Loop]).) Equal to True
-
Then - Actions
- Unit - Set life of CLink_Target[CLink_Loop] to ((Life of CLink_Target[CLink_Loop]) + (CLink_HealingDamage[CLink_Loop] / 300.00))
-
Else - Actions
- Unit - Set life of CLink_Target[CLink_Loop] to ((Life of CLink_Target[CLink_Loop]) - (CLink_HealingDamage[CLink_Loop] / 300.00))
-
If - Conditions
-
For each (Integer CLink_MarkerInteger) from 1 to 10, do (Actions)
-
Else - Actions
-
For each (Integer CLink_MarkerInteger) from 1 to 10, do (Actions)
-
Loop - Actions
- Unit - Kill (Load CLink_MarkerInteger of CLink_Loop in CLink_Hashtable.)
-
Loop - Actions
- Set VariableSet CLink_Caster[CLink_Loop] = CLink_Caster[CLink_Instances]
- Set VariableSet CLink_Target[CLink_Loop] = CLink_Target[CLink_Instances]
- Set VariableSet CLink_HealingDamage[CLink_Loop] = CLink_HealingDamage[CLink_Instances]
- Set VariableSet CLink_Loop = (CLink_Loop - 1)
- Set VariableSet CLink_Instances = (CLink_Instances - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- CLink_Instances Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
For each (Integer CLink_MarkerInteger) from 1 to 10, do (Actions)
-
If - Conditions
- Custom script: call RemoveLocation(udg_CLink_TempPoint[1])
- Custom script: call RemoveLocation(udg_CLink_TempPoint[2])
- Custom script: call RemoveLocation(udg_CLink_TempPoint[3])
-
Loop - Actions
-
For each (Integer CLink_Loop) from 1 to CLink_Instances, do (Actions)
-
Events
Any help would be greatly appreciated!
Thanks!
Last edited: