I'm currently trying to copy over a spell from a spellpack into my map, but for some reason I get an error when copying the last trigger. If it is of any help I'll post the whole trigger here and link to the spellpack I'm trying to get it from.
If there's something I've forgotten to show that you need to know let me know and I'll put it up asap. Also, here is the spellpack I'm trying to copy it from.
Thanks in advance.
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
- Set Group[1] = (Units of type Capacitor Dummy)
-
Unit Group - Pick every unit in Group[1] and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Capacitor_Move[(Custom value of (Picked unit))] Equal to True
-
Then - Actions
- Set Unit[1] = (Picked unit)
- Set Point[1] = (Position of (Picked unit))
- Set Point[2] = (Point[1] offset by 24.00 towards (Facing of (Picked unit)) degrees)
- Unit - Move (Picked unit) instantly to Point[2]
- Set Capacitor_Range[(Custom value of (Picked unit))] = (Capacitor_Range[(Custom value of (Picked unit))] + 24.00)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Then - Actions
- Unit - Remove (Picked unit) from the game
- Special Effect - Create a special effect at Point[2] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
- Special Effect - Destroy (Last created special effect)
- Set Group[3] = (Units within 350.00 of Point[2] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Triggering unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True
-
Unit Group - Pick every unit in Group[3] and do (Actions)
-
Loop - Actions
- Set Point[3] = (Position of (Picked unit))
- Unit - Cause Capacitor_Unit[(Custom value of Unit[1])] to damage (Picked unit), dealing (100.00 x Capacitor_Time_2[(Custom value of Unit[1])]) damage of attack Spells and damage type Lightning
- Special Effect - Create a special effect at Point[3] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation (udg_Point[3])
- Custom script: call DestroyGroup (udg_Group[3])
-
Loop - Actions
- Else - Actions
- Set Group[2] = (Units within 100.00 of Point[2] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True
-
Unit Group - Pick every unit in Group[2] and do (Actions)
-
Loop - Actions
- Set Group[3] = (Units within 350.00 of Point[2] matching ((((Matching unit) is A structure Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Picked unit))) Equal to True
-
Unit Grop - Pick every unit in Group[3] and do (Actions)
-
Loop - Actions
- Special Effect - Create a special effect at Point[2] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
- Special Effect - Destroy (Last created special effect)
- Set Point[3] = (Position of (Picked unit))
- Unit - Remove Unit[1] from the game
- Unit - Cause Capacitor_Unit[(Custom value of Unit[1])] to damage (Picked unit), dealing (100.00 x Capacitor_Time_2[(Custom value of Unit[1])]) damage of attack type Spells and damage type Lightning
- Special Effect - Crate a special effect at Point[3] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation (udg_Point[3])
-
Loop - Actions
- Custom script: call DetroyGroup (udg_Group[3])
-
Loop - Actions
- Custom script: call DestroyGroup (udg_Group[2])
- Custom script: call RemoveLocation (udg_Point[1])
- Custom script: call RemoveLocation (udg_Point[2])
- Set Unit[1] = No unit
-
If - Conditions
- Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyGroup (udg_Group[1])
Code:
call UnitDamageTargetBJ( udg_Capacitor_Unit[GetUnitUserData(udg_Unit[1])], GetEnumUnit(), ( 100.00 * udg_Capacitor_Time_2[GetUnitUserData(udg_Unit[1])] ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING )
If there's something I've forgotten to show that you need to know let me know and I'll put it up asap. Also, here is the spellpack I'm trying to copy it from.
Thanks in advance.