• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Lightning Strike v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: deepstrasz
  • LS Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set LSHash = (Last created hashtable)
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
  • LS Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lightning Strike
    • Actions
      • Set TempUnit1 = (Triggering unit)
      • Set TempUnit2 = (Target unit of ability being cast)
      • Custom script: set udg_TempInteger1 = GetHandleId(udg_TempUnit2)
      • Set TempInteger2 = (Level of (Ability being cast) for TempUnit1)
      • -------- Damage --------
      • Set TempReal1 = (100.00 x (Real(TempInteger2)))
      • Unit - Cause TempUnit1 to damage TempUnit2, dealing TempReal1 damage of attack type Magic and damage type Lightning
      • Special Effect - Create a special effect attached to the origin of TempUnit2 using Abilities\Weapons\Bolt\BoltImpact.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- Jumps --------
      • Set TempInteger3 = (TempInteger2 + 1)
      • Set TempReal1 = (TempReal1 x 0.90)
      • Custom script: call SaveReal(udg_LSHash,udg_TempInteger1,0,udg_TempReal1)
      • Custom script: call SaveInteger(udg_LSHash,udg_TempInteger1,1,udg_TempInteger3)
      • Custom script: call SaveUnitHandle(udg_LSHash,udg_TempInteger1,2,udg_TempUnit1)
      • Set TempPoint1 = (Position of TempUnit1)
      • Set TempPoint2 = (Position of TempUnit2)
      • Custom script: set udg_TempReal1=(50+(GetUnitFlyHeight(udg_TempUnit1)+GetLocationZ(udg_TempPoint1)))
      • Custom script: set udg_TempReal2=(50+(GetUnitFlyHeight(udg_TempUnit2)+GetLocationZ(udg_TempPoint2)))
      • Custom script: set udg_TempLightning=AddLightningEx("CLPB",true,GetLocationX(udg_TempPoint1),GetLocationY(udg_TempPoint1),udg_TempReal1,GetLocationX(udg_TempPoint2),GetLocationY(udg_TempPoint2),udg_TempReal2)
      • Custom script: call SaveLightningHandle(udg_LSHash,udg_TempInteger1,3,udg_TempLightning)
      • Set TempReal1 = (Angle from TempPoint1 to TempPoint2)
      • Custom script: call SaveReal(udg_LSHash,udg_TempInteger1,4,udg_TempReal1)
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Unit Group - Add TempUnit2 to LSGroup
      • Trigger - Turn on LS Periodic <gen>
  • LS Periodic
    • Events
      • Time - Every 0.15 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in LSGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit1 = (Picked unit)
          • Custom script: set udg_TempInteger1 = GetHandleId(udg_TempUnit1)
          • Custom script: set udg_TempInteger2=LoadInteger(udg_LSHash,udg_TempInteger1,1)
          • Custom script: set udg_TempUnit2=LoadUnitHandle(udg_LSHash,udg_TempInteger1,2)
          • Custom script: set udg_TempReal1=LoadReal(udg_LSHash,udg_TempInteger1,0)
          • Custom script: set udg_TempReal2=LoadReal(udg_LSHash,udg_TempInteger1,4)
          • Set TempPoint1 = (Position of TempUnit1)
          • Set TempPoint2 = (TempPoint1 offset by 400.00 towards TempReal2 degrees)
          • Set TempInteger2 = (TempInteger2 - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempInteger2 Greater than 0
            • Then - Actions
              • For each (Integer TempInteger4) from 1 to 2, do (Actions)
                • Loop - Actions
                  • Set TempUnit3 = No unit
                  • Set TempReal5 = 400.00
                  • Custom script: set bj_wantDestroyGroup= true
                  • Unit Group - Pick every unit in (Units within 400.00 of TempPoint2 matching ((((Matching unit) is alive) Equal to True) and ((((Owner of TempUnit2) is an enemy of (Owner of (Matching unit))) Equal to True) and (((Matching unit) is in LSGroup) Equal to False)))) and do (Actions)
                    • Loop - Actions
                      • Set TempUnit4 = (Picked unit)
                      • Set TempPoint3 = (Position of TempUnit4)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between TempPoint1 and TempPoint3) Less than TempReal5
                        • Then - Actions
                          • Set TempReal5 = (Distance between TempPoint1 and TempPoint3)
                          • Set TempUnit3 = TempUnit4
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_TempPoint3)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempUnit3 Not equal to No unit
                    • Then - Actions
                      • Set TempPoint3 = (Position of TempUnit3)
                      • Custom script: set udg_TempInteger3=GetHandleId(udg_TempUnit3)
                      • Unit - Cause TempUnit2 to damage TempUnit3, dealing TempReal1 damage of attack type Magic and damage type Lightning
                      • Special Effect - Create a special effect attached to the origin of TempUnit3 using Abilities\Weapons\Bolt\BoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Set TempReal1 = (TempReal1 x 0.90)
                      • Custom script: call SaveReal(udg_LSHash,udg_TempInteger3,0,udg_TempReal1)
                      • Custom script: call SaveInteger(udg_LSHash,udg_TempInteger3,1,udg_TempInteger2)
                      • Custom script: call SaveUnitHandle(udg_LSHash,udg_TempInteger3,2,udg_TempUnit2)
                      • Custom script: set udg_TempReal3=(50+(GetUnitFlyHeight(udg_TempUnit1)+GetLocationZ(udg_TempPoint1)))
                      • Custom script: set udg_TempReal4=(50+(GetUnitFlyHeight(udg_TempUnit3)+GetLocationZ(udg_TempPoint3)))
                      • Custom script: set udg_TempLightning=AddLightningEx("CLPB",true,GetLocationX(udg_TempPoint1),GetLocationY(udg_TempPoint1),udg_TempReal3,GetLocationX(udg_TempPoint3),GetLocationY(udg_TempPoint3),udg_TempReal4)
                      • Custom script: call SaveLightningHandle(udg_LSHash,udg_TempInteger3,3,udg_TempLightning)
                      • Custom script: call SaveReal(udg_LSHash,udg_TempInteger3,4,udg_TempReal2)
                      • Custom script: call RemoveLocation(udg_TempPoint3)
                      • Unit Group - Add TempUnit3 to LSGroup
                    • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint1)
          • Custom script: call RemoveLocation(udg_TempPoint2)
          • Unit Group - Remove TempUnit1 from LSGroup
          • Custom script: set udg_TempLightning=LoadLightningHandle(udg_LSHash,udg_TempInteger1,3)
          • Lightning - Destroy TempLightning
          • Hashtable - Clear all child hashtables of child TempInteger1 in LSHash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (LSGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
ToolTip
tooltip.jpg
Requested by sonofjay in my spell workshop.
Spell Info
211785-albums5265-picture55484.jpg
How to import

1. Open the spell map
2. Copy and paste the Lightning Strike spell to your map
3. Copy the lightning strike trigger folder to your triggers in your map
4. Edit condition under LS Cast and make it
  • (Ability being cast) Equal to Lightning Strike
5.Edit
  • -------- Damage --------
  • Set TempReal1 = (100.00 x (Real(TempInteger2)))
  • -------- Jumps --------
  • Set TempInteger3 = (TempInteger2 + 1)
to fit your needs
6. Enjoy and give credits ;p
Keywords:
Lightning, Chain, Strike
Contents

Lightning Strike v1.0 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Add importing instructions into the map file Change the ability icon command card position Add learn hotkey Spell is not MUI, try casting it on the same target with two units Do the...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

Reviewed by Maker, Lightning Strike v1.0, 9th Feb 2012

  • Add importing instructions into the map file
  • Change the ability icon command card position
  • Add learn hotkey
  • Spell is not MUI, try casting it on the same target with two units
  • Do the turn off check only after you remove a unit from the group
  • TempPoint 1 and 2 are not always removed in the looping trigger
 
Top