Lightning Orb v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: deepstrasz
Description
Summons a lightning orb that sends bolts of lightning to nearby enemy units. When a unit is struck it is knocked back. Each level increases the damage and the amount the lightning bounces.
Used

Bribe's Knockback 2D
Bribe's Unit Indexer
Bribe's Damage Event
(Credits to Bribe for his wonderful systems)
2 dummies
4 abilities
Triggers
  • Int LightningOrb
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set LightningAbility = Lightning
      • Set LightningOrbAbility = Lightning Orb
      • Set LightningSpeed = 15.00
      • Set LightningRange[1] = 500.00
      • Set LightningRange[2] = 600.00
      • Set LightningRange[3] = 700.00
      • Set LightningDuration[1] = 5.00
      • Set LightningDuration[2] = 10.00
      • Set LightningDuration[3] = 15.00
  • Lightning Orb Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to LightningOrbAbility
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempPoint1 = (Position of TempUnit)
      • Set TempPoint2 = (Target point of ability being cast)
      • Unit - Create 1 Dummy for (Triggering player) at TempPoint1 facing (Angle from TempPoint1 to TempPoint2) degrees
      • Set TempUnit2 = (Last created unit)
      • Set TempInteger = (Custom value of TempUnit2)
      • Set LightningDummy[TempInteger] = True
      • Set LightningLevel[TempInteger] = (Level of LightningOrbAbility for TempUnit)
      • Unit - Add LightningAbility to TempUnit2
      • Unit - Set level of LightningAbility for TempUnit2 to LightningLevel[TempInteger]
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Set LightningCaster[TempInteger] = TempUnit
      • Set LightningD[TempInteger] = LightningDuration[LightningLevel[TempInteger]]
      • Unit Group - Add TempUnit2 to LightningGroup
      • Trigger - Turn on Lightning Prd <gen>
  • Lightning Prd
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in LightningGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Set TempInteger = (Custom value of TempUnit)
          • Set LightningD[TempInteger] = (LightningD[TempInteger] - 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LightningD[TempInteger] Greater than 0.00
            • Then - Actions
              • Set TempPoint1 = (Position of TempUnit)
              • Set TempPoint2 = (TempPoint1 offset by LightningSpeed towards (Facing of TempUnit) degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Playable map area) contains TempPoint2) Equal to False
                • Then - Actions
                  • Custom script: call RemoveLocation(udg_TempPoint2)
                  • Set TempPoint2 = (TempPoint1 offset by LightningSpeed towards ((Facing of TempUnit) - 180.00) degrees)
                  • Unit - Move TempUnit instantly to TempPoint1, facing TempPoint2
                • Else - Actions
              • Custom script: call SetUnitX(udg_TempUnit, GetLocationX(udg_TempPoint2))
              • Custom script: call SetUnitY(udg_TempUnit, GetLocationY(udg_TempPoint2))
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within LightningRange[LightningLevel[TempInteger]] of TempPoint2) and do (Actions)
                • Loop - Actions
                  • Unit - Order TempUnit to Orc Far Seer - Chain Lightning (Picked unit)
              • Custom script: call RemoveLocation(udg_TempPoint1)
              • Custom script: call RemoveLocation(udg_TempPoint2)
            • Else - Actions
              • Unit Group - Remove TempUnit from LightningGroup
              • Unit - Kill TempUnit
              • Set LightningDummy[TempInteger] = False
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in LightningGroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
  • Lightning Knock
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set TempInteger = (Custom value of DamageEventSource)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LightningDummy[TempInteger] Equal to True
        • Then - Actions
          • Special Effect - Create a special effect attached to the chest of DamageEventTarget using Abilities\Weapons\Bolt\BoltImpact.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set TempReal = DamageEventAmount
          • Set DamageEventAmount = 0.00
          • Unit - Cause LightningCaster[TempInteger] to damage DamageEventTarget, dealing TempReal damage of attack type Chaos and damage type Lightning
          • Set CenterPoint = (Position of DamageEventSource)
          • Set TargetPoint = (Position of DamageEventTarget)
          • Set Knockback2DAngle = (Angle from CenterPoint to TargetPoint)
          • Custom script: call RemoveLocation(udg_TargetPoint)
          • Custom script: call RemoveLocation(udg_CenterPoint)
          • Set Knockback2DTime = 0.50
          • Set Knockback2DDistance = 150.00
          • Set Knockback2DUnit = DamageEventTarget
          • Trigger - Run Knockback 2D <gen> (ignoring conditions)
        • Else - Actions
Credits
Please give credits to Bribe for his systems if you use this spell but credits to myself are optional. Feel free to edit my spell to however you like.
Please report any bugs you might find while using this spell to me. Thanks.

Keywords:
Lightning Orb, Orb, Lightning, Shock, Knockback, AoE
Contents

Just another Warcraft III map (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Required changes: Add importing instructions into the map file Add hotkeys Learned icon position should be changed Try to avoid spamming the cast order Lightning Knock shouldn't be...

Moderator

M

Moderator

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

Reviewed by Maker, Lightning Orb v1.0, 11th Jan 2012

Required changes:
  • Add importing instructions into the map file
  • Add hotkeys
  • Learned icon position should be changed
  • Try to avoid spamming the cast order
  • Lightning Knock shouldn't be on all the time
 
Almost perfect!

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Playable map area) contains TempPoint2) Equal to False
    • Then - Actions
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Set TempPoint2 = (TempPoint1 offset by LightningSpeed towards ((Facing of TempUnit) - 180.00) degrees)
      • Unit - Move TempUnit instantly to TempPoint1, facing TempPoint2
    • Else - Actions
You don't have to check if the point is inside the playable map area :p

The user would be expected to have some library like BoundSentinel implemented :p (Yes, there are Jass versions)

Also, you should cache (Facing of TempUnit) there since you're repeating it twice ^.^

Other than that, this looks like a simple, but nifty GUI spell :)
 
Level 21
Joined
Jan 1, 2011
Messages
1,420
If I didn't know that existed I'm sure other GUIers wouldn't know that existed either. Therefore I'm going to keep the bounds check just as a precaution. (A map crash can be very troubling for a mapper)

Also, putting the facing into a variable would not increase efficiency for a sufficient amount of time. Because it is only used twice when it is near map bounds.

N yeah this spell is indeed nifty. It surprised me at how well it worked. But when I tried it for the first time I didn't know it would circle around it's target. (Didn't realize that units who cast spells face that direction therefore altering the path of the lightning orb) It created a nice unintentional effect :)
 
Top