1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The long-awaited results for Concept Art Contest #11 have finally been released!
    Dismiss Notice
  3. Join Texturing Contest #30 now in a legendary battle of mythological creatures!
    Dismiss Notice
  4. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice
  5. Hivers united and created a bunch of 2v2 melee maps. Vote for the best in our Melee Mapping Contest #4 - Poll!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice

Trigger Viewer

Lightning Strike.w3x
Variables
Lightning Strike
Readme
Lightning Strike
GUI Knockback System [Paladon]
Cast A Knockback
GetKnockback
This map only
Creep Respawn
Tree Respawn
VisibilityTimeRespawnStart
Refresher

		
Name Type Is Array Initial Value
Creep_Point location Yes
KB_Angle real Yes
KB_Casters unit Yes
KB_CountBuffs integer No
KB_DestroyTrees boolean Yes
KB_Effects_1 string Yes
KB_Effects_2 string Yes
KB_GeneralIntegers integer Yes
KB_KnockbackedUnits group No
KB_Levels integer Yes
KB_MaxDistance real Yes
KB_ReachedDistance real Yes
KB_ReducedReal real No
KB_ReduceSpeedReal real Yes
KB_SpecificSpeed real Yes
KB_StartPositions location Yes
KB_TempPoint location Yes
KB_TempReal real No
KB_TotalKnockUnits integer No
KB_Units unit Yes
KBA_Caster unit No
KBA_DestroyTrees boolean No
KBA_DistancePerLevel real No
KBA_Level integer No
KBA_SpecialEffects string Yes
KBA_Speed real No
KBA_StartingPosition location No
KBA_TargetUnit unit No
LS_Dummy unit No
LS_GeneralInteger integer No
LS_Groups group Yes
LS_TempPoint location Yes
Temp_Integer integer No
What do i need for this spell?

Copy and paste the variables with the prefix 'LS_' into your map. Then copy the trigger 'Lightning Strike'.
Additionally you need all the custom object editor data with the '(LS)' suffix.
Important!
You need my GUI Knockback System to use the knockback effects of this spell.
If you don´t use the knockbacks, delete the actions (contained in the unit group loop 'LS_Groups[1]') between
'-------- Knockback System --------' and '-------- End System --------'.
If you want to use the knockback effect, copy the GUI Knockback System Triggers as well as the 'KB_' and the 'KBA_' variables into your map.
Or i recommend you to download the system from http://www.hiveworkshop.com/forums/resource.php?t=107719
The downloaded system includes a full documentation how to use it.

Lightning Strike
  Events
    Unit - A unit Begins casting an ability
  Conditions
    (Ability being cast) Equal to Lightning Strike (LS)
  Actions
    Set LS_TempPoint[1] = (Position of (Triggering unit))
    Set LS_TempPoint[2] = (Target point of ability being cast)
    Set LS_TempPoint[3] = (LS_TempPoint[2] offset by 400.00 towards (Angle from LS_TempPoint[2] to LS_TempPoint[1]) degrees)
    Unit - Create 1 LightningDummyDown (LS) for (Owner of (Triggering unit)) at LS_TempPoint[2] facing Default building facing degrees
    Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
    Unit - Make (Last created unit) Explode on death
    Set LS_Dummy = (Last created unit)
    For each (Integer LS_GeneralInteger) from 1 to 3, do (Actions)
      Loop - Actions
        Unit - Create 1 LightningDummy (LS) for (Owner of (Triggering unit)) at LS_TempPoint[3] facing Default building facing degrees
        Unit - Order (Last created unit) to Special Archimonde - Finger Of Death LS_Dummy
        Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
        Unit - Make (Last created unit) Explode on death
    Special Effect - Create a special effect at LS_TempPoint[2] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
    Special Effect - Destroy (Last created special effect)
    Special Effect - Create a special effect at LS_TempPoint[2] using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
    Special Effect - Destroy (Last created special effect)
    Set LS_Groups[1] = (Units within 250.00 of LS_TempPoint[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) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))))
    Unit Group - Pick every unit in LS_Groups[1] and do (Actions)
      Loop - Actions
        Unit - Cause (Triggering unit) to damage (Picked unit), dealing (75.00 x (Real((Level of Lightning Strike (LS) for (Triggering unit))))) damage of attack type Spells and damage type Normal
        -------- Knockback System --------
        Set KBA_Caster = (Triggering unit)
        Set KBA_TargetUnit = (Picked unit)
        Set KBA_StartingPosition = (Target point of ability being cast)
        Set KBA_Level = (Level of (Ability being cast) for (Triggering unit))
        Set KBA_Speed = 9.00
        Set KBA_DistancePerLevel = 100.00
        Set KBA_SpecialEffects[1] = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
        Set KBA_SpecialEffects[2] = Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
        Set KBA_DestroyTrees = True
        Trigger - Run Cast_A_Knockback <gen> (checking conditions)
        -------- End System --------
    Custom script: call RemoveLocation (udg_LS_TempPoint[1])
    Custom script: call RemoveLocation (udg_LS_TempPoint[2])
    Custom script: call RemoveLocation (udg_LS_TempPoint[3])
    Custom script: call DestroyGroup (udg_LS_Groups[1])
Cast A Knockback
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (KBA_TargetUnit is in KB_KnockbackedUnits) Equal to True
      Then - Actions
        Unit Group - Remove KBA_TargetUnit from KB_KnockbackedUnits
        Set KB_CountBuffs = (KB_CountBuffs - 1)
        For each (Integer KB_GeneralIntegers[2]) from 1 to KB_TotalKnockUnits, do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                KB_Units[KB_GeneralIntegers[1]] Equal to KBA_TargetUnit
              Then - Actions
                Set KB_GeneralIntegers[1] = KB_GeneralIntegers[2]
                Set KB_GeneralIntegers[2] = KB_TotalKnockUnits
              Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            KB_TotalKnockUnits Greater than KB_GeneralIntegers[1]
          Then - Actions
            Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
            Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
            Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
            Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
            Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
            Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
            Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
            Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
            Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
            Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
          Else - Actions
        Set KB_Units[KB_TotalKnockUnits] = No unit
        Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            KB_CountBuffs Equal to 0
          Then - Actions
            Set KB_TotalKnockUnits = 0
            Trigger - Turn off GetKnockback <gen>
          Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        KB_CountBuffs Equal to 0
      Then - Actions
        Trigger - Turn on GetKnockback <gen>
      Else - Actions
    Set KB_CountBuffs = (KB_CountBuffs + 1)
    Set KB_TotalKnockUnits = (KB_TotalKnockUnits + 1)
    Set KB_Casters[KB_TotalKnockUnits] = KBA_Caster
    Set KB_Levels[KB_TotalKnockUnits] = KBA_Level
    Set KB_Units[KB_TotalKnockUnits] = KBA_TargetUnit
    Set KB_StartPositions[KB_TotalKnockUnits] = KBA_StartingPosition
    Set KB_TempPoint[KB_TotalKnockUnits] = (Position of KBA_TargetUnit)
    Set KB_Angle[KB_TotalKnockUnits] = (Angle from KB_StartPositions[KB_TotalKnockUnits] to KB_TempPoint[KB_TotalKnockUnits])
    Set KB_MaxDistance[KB_TotalKnockUnits] = (KBA_DistancePerLevel x (Real(KBA_Level)))
    Set KB_ReachedDistance[KB_TotalKnockUnits] = 0.00
    Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = 0.00
    Set KB_SpecificSpeed[KB_TotalKnockUnits] = KBA_Speed
    Set KB_Effects_1[KB_TotalKnockUnits] = KBA_SpecialEffects[1]
    Set KB_Effects_2[KB_TotalKnockUnits] = KBA_SpecialEffects[2]
    Set KB_DestroyTrees[KB_TotalKnockUnits] = KBA_DestroyTrees
    Unit Group - Add KBA_TargetUnit to KB_KnockbackedUnits
    Custom script: call RemoveLocation (udg_KBA_StartingPosition)
    Custom script: call RemoveLocation (udg_KB_TempPoint [udg_KB_TotalKnockUnits] )
    Custom script: call RemoveLocation (udg_KB_StartPositions [udg_KB_TotalKnockUnits] )
GetKnockback
  Events
    Time - Every 0.02 seconds of game time
  Conditions
  Actions
    For each (Integer KB_GeneralIntegers[1]) from 1 to KB_TotalKnockUnits, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (KB_Units[KB_GeneralIntegers[1]] is in KB_KnockbackedUnits) Equal to True
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                KB_ReachedDistance[KB_GeneralIntegers[1]] Greater than or equal to KB_MaxDistance[KB_GeneralIntegers[1]]
              Then - Actions
                Unit Group - Remove KB_Units[KB_GeneralIntegers[1]] from KB_KnockbackedUnits
                Set KB_CountBuffs = (KB_CountBuffs - 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_TotalKnockUnits Greater than KB_GeneralIntegers[1]
                  Then - Actions
                    Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
                    Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
                    Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
                    Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
                    Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
                    Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
                    Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
                    Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
                    Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
                    Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
                  Else - Actions
                Set KB_Units[KB_TotalKnockUnits] = No unit
                Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_CountBuffs Equal to 0
                  Then - Actions
                    Set KB_TotalKnockUnits = 0
                    Trigger - Turn off (This trigger)
                  Else - Actions
              Else - Actions
                Set KB_ReducedReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] / KB_MaxDistance[KB_GeneralIntegers[1]]) x KB_ReachedDistance[KB_GeneralIntegers[1]])
                Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = (KB_ReducedReal - (KB_ReduceSpeedReal[KB_GeneralIntegers[1]] x 0.10))
                Set KB_TempReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] - KB_ReduceSpeedReal[KB_GeneralIntegers[1]]) x 2.00)
                Set KB_TempPoint[1] = (Position of KB_Units[KB_GeneralIntegers[1]])
                Set KB_TempPoint[2] = (KB_TempPoint[1] offset by KB_TempReal towards KB_Angle[KB_GeneralIntegers[1]] degrees)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_DestroyTrees[KB_GeneralIntegers[1]] Equal to True
                  Then - Actions
                    Destructible - Pick every destructible within 200.00 of KB_TempPoint[2] and do (Actions)
                      Loop - Actions
                        Destructible - Kill (Picked destructible)
                  Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random integer number between 1 and 5) Equal to 1
                  Then - Actions
                    Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_1[KB_GeneralIntegers[1]]
                    Special Effect - Destroy (Last created special effect)
                  Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random integer number between 1 and 7) Equal to 1
                  Then - Actions
                    Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_2[KB_GeneralIntegers[1]]
                    Special Effect - Destroy (Last created special effect)
                  Else - Actions
                Unit - Move KB_Units[KB_GeneralIntegers[1]] instantly to KB_TempPoint[2]
                Custom script: call RemoveLocation (udg_KB_TempPoint[1])
                Custom script: call RemoveLocation (udg_KB_TempPoint[2])
                Set KB_ReachedDistance[KB_GeneralIntegers[1]] = (KB_ReachedDistance[KB_GeneralIntegers[1]] + KB_TempReal)
          Else - Actions
Creep Respawn
  Events
    Unit - A unit Dies
  Conditions
    ((Triggering unit) belongs to an ally of Player 2 (Blue)) Equal to True
    (Custom value of (Triggering unit)) Greater than 0
  Actions
    Wait 15.00 seconds
    Unit - Create 1 (Unit-type of (Triggering unit)) for Player 2 (Blue) at Creep_Point[(Custom value of (Triggering unit))] facing (Facing of (Triggering unit)) degrees
    Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
Tree Respawn
  Events
    Destructible - A destructible within Gebiet_006 <gen> dies
    Destructible - A destructible within Gebiet_005 <gen> dies
    Destructible - A destructible within Gebiet_000 <gen> dies
    Destructible - A destructible within Gebiet_004 <gen> dies
    Destructible - A destructible within Gebiet_001 <gen> dies
    Destructible - A destructible within Gebiet_002 <gen> dies
    Destructible - A destructible within Gebiet_003 <gen> dies
    Destructible - A destructible within Gebiet_007 <gen> dies
    Destructible - A destructible within Gebiet_008 <gen> dies
    Destructible - A destructible within Gebiet_009 <gen> dies
    Destructible - A destructible within Gebiet_010 <gen> dies
    Destructible - A destructible within Gebiet_011 <gen> dies
    Destructible - A destructible within Gebiet_012 <gen> dies
    Destructible - A destructible within Gebiet_013 <gen> dies
    Destructible - A destructible within Gebiet_014 <gen> dies
  Conditions
  Actions
    Wait 9.00 seconds
    Destructible - Resurrect (Dying destructible) with (Max life of (Dying destructible)) life and Show birth animation
VisibilityTimeRespawnStart
  Events
    Map initialization
  Conditions
  Actions
    Custom script: set bj_wantDestroyGroup=true
    Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
      Loop - Actions
        Set Temp_Integer = (Temp_Integer + 1)
        Unit - Set the custom value of (Picked unit) to Temp_Integer
        Set Creep_Point[Temp_Integer] = (Position of (Picked unit))
    Melee Game - Use melee time of day (for all players)
    Visibility - Disable fog of war
    Visibility - Disable black mask
    Quest - Display to (All players) the Quest Discovered message: Lightning Strikeby PaladonThis spell is of course MUI and leakless.The spell uses Paladon´s GUI Knockback System.
Refresher
  Events
    Player - Player 1 (Red) skips a cinematic sequence
  Conditions
  Actions
    Unit - Reset ability cooldowns for Mage 0001 <gen>