1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. The Results have come out of the old ARENA oven. Check out who won the 30th Texturing Contest!
    Dismiss Notice
  4. Hey guys, we've posted the Results for the 30th Modeling Contest. Check them out!
    Dismiss Notice
  5. The 15th Mini-Mapping Contest came to an end. The Secrets of Warcraft 3 are soon to be revealed! Come and vote in the public poll for your favorite maps.
    Dismiss Notice
  6. The 12th incarnation of the Music Contest is LIVE! The theme is Synthwave. Knight Rider needs a song to listen to on his journey. You should definitely have some fun with this theme!
    Dismiss Notice
  7. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Persistent Beam v3.2

Submitted by Spellbound
This bundle is marked as approved. It works and satisfies the submission rules.
[​IMG]



This resource is used in:


[​IMG]


PSA: If Persistent Beam for some reason refuses to work properly on your map, I have made an alternate version that has fewer features but is significantly less buggy. It remains unable to visually connect lightning effects over water because Blizzard (please, new natives, pleeeeeez), but it should handle properly on land. It will still work, it just won't look very nice. It's also in vJASS, so if you're unfamiliar with that, it might be a bit of a challenge to set up. Also, Void Ray is integrated into the system, but it remains optional (yay!). Read the instructions from the 'Persistent Beam CE MAIN' trigger to see how to use it: DOWNLOAD vJASS VERSION

NB: I used Beamer for the unit projecting the beam/lightning effect.

Update Log
UPDATE v3.2
- Fixed an issue with BeamEvent equal to 2.00 not working.
- The Archmage was updated to demo single-shot attacks with a charge-up fx.

UPDATE v3.1
- Fixed an issue where non-magic beams would not retarget when their current target died.
- Made the changes requested here.

UPDATE v3.0
- Fixed an issue with attack-move orders not being followed after re-targeting had occured.
- Removed two lines of code that were unnecessary.

UPDATE v2.9
- Fixed an issue with deindexing
- Added BeamEvents & GUSC_Hash variables to the Variable Creator
- Order sequences should not longer be interrupted
- Updated documentation

UPDATE v2.8
- Fixed an issue where certain spells would interrupt beams regardless of whether they were allowed to or not.
- Added BeamEvents to allow you to catch various stages of the Persistent Beam. Refer to the README (at the bottom) for more information. In the demo map, try attacking the chickens to the north with a Flying Machine to see what events can allow you to do (kinda badly coded though).
- Updated Demo Map.

UPDATE v2.7
- Abilities will now interrupt beams. Add them to the new trigger Persistent Beam Ability Interrupt Exceptions to make them not interrupt beams. This can be configured for immobilised or unimmobilised Beamer.
- You can now set the colour and transparency of the lightning effect. Use values between 0.00 and 1.00.

UPDATE v2.6
- Fixed an issue with issuing orders being bugged and not functioning properly.

UPDATE v2.5
- Fixed an issue with retargeting that made beams never terminate on beamers that have IsImmobilised set to false.
- Added spellbreaker as another example of what can be done.
- BeamConfig_SweepAOE[] set to 0 will now cause lock-on beams to reset if target has changed. Set this value to x2 of BeamConfig_Range[] to allow the beamer to immediately switch between targets without have to restart charge-up process.

UPDATE v2.4
- Added a new feature where you can configure an 'auxiliary turret' in the setup trigger. This allows you to set the beam to fire from a moving dummy. Refer to the Owl Scout for an example.

UPDATE v2.3
- Fixed an issue that caused beams to bug out if the average damage returned 0.
- You may now fire on the move if IsImmobilised is set to false. Check the Wisp for an example of that.
- Follow and attack-move should now work properly.

UPDATE v2.2
- The problem I was having seems to have been solved with the integration of a LastOrder system that now allows Beamers to resume following a friendly unit, or attack-moved to a location.
- follow range should now be set at configuration with BeamConfig_FollowRange[]. Default is 400. Hopefully this is the last config variable to be added.
- Beamers with BeamConfig_IsImmobilised[] set to false can now fire on the move if they are following a friendly unit.

UPDATE v2.1
- When a target moves out of range, the beam will acquire a nearby enemy as target if there is any nearby withing sweeping range, the same way it does for if the target dies.
- A beamer with non-AoE beams can now also use the sweep feature: the target will take damage only if they are within 20 units of the beam. This value become configurable in the next update.
- lock-on beams will now instantly target nearby enemies when their target moves out of range or dies, if their Beam_SweepAOE is higher than 0.

UPDATE v2.0
- Fixed an issue where stunning a Beamer would interfere with the dummy units carrying the beams.

UPDATE v1.9
- Removed all location variables and switched to x/y coordinates, which should improve performance.
- ForGroups have been replaced with FirstOfGroup calls within loops to further improve performance.
- You must now setup your dummy unit in the configuration trigger. This comes with the added advantage of being able to use dummies with different collisions as sometimes, depending on the unit, the center of the model will be offset by 16 units. Having a dummy with a collision of 16 will fix that.

UPDATE v1.8
- Added CasterAngle[] to allow you to configure the angle of the offset so you can align it with the unit's weapon.
- Lock-on beams will no longer strike a target at the center of the model. Instead the impact of the beam will appear to strike the surface of the model. This effect is not possible with non-locked-on beams.

UPDATE v1.7
- Attack speed is now use to calculate a dps instead of being locked to a specific value. Units gaining a temporary boost in attack speed will deal more damage instead of dealing it faster.
- You can now configure how many times you want the beam to strike within 1 second. The default is 3, but feel free to crank it up to 11 (literally) for a smoother health drain.
- Fixed an issue where locked-on beams would not update the location of Beam_Caster[] in relation to the target.

UPDATE v1.6
- Updated to use Damage Engine v3.5.4.1. There should no longer be random moments when damage was applied when it shouldn't have been.

UPDATE v1.5
- The DamageType can now be configured on setup. Refer to the Gargoyle.

UPDATE v1.4
- Beamers are now configured upon being indexed, not every time they begin projecting a beam.

UPDATE v1.3
- Fixed an issue where buildings were not being damaged.

UPDATE v1.2
- Fixed a problem with lock-on beams not dealing any damage.
- Lock-on beams can now reaquire targets without having to recharge while still in charge-up phase.
- Fixed an issue where the units were taking damage during charge-up. This *should* be fixed.
- Attack-move orders should now cancel a beam if there are no enemies nearby.

UPDATE v1.1
- Fixed a problem where the beams would randomly terminate. This required the removal of a grace period where the Beamer could reacquire a new target. In retrospect, the inclusion of an automatic re-targeting section in the trigger made that redundant, so no big loss.
- Simplified the importation/installation process to no longer require an ability for immobilising the Beamer.


Big thanks to Bribe for helping make this happen.

Code (vJASS):


    PERSISTENT BEAM v3.2 by Spellbound
   
    Persistent Beam will attempt to mimic how beams work in Starcraft 2. Any unit configured to use Persistent Beam will fire a constant stream of energy at its
    target, dealing damage X times per second. The beam can be configured to lock onto the target, or follow the target around at a set speed, dealing area of
    effect damage, like the Colossus in Starcraft 2 Alpha.
   
   
   
    REQUIREMENTS:
   
    Unit Indexer by Bribe           http://www.hiveworkshop.com/forums/spells-569/gui-unit-indexer-1-2-0-2-a-197329/
    Damage Engine by Bribe          http://www.hiveworkshop.com/forums/spells-569/gui-damage-engine-v3-5-4-1-a-201016/
    GetUnitCollisionSize by Almia   http://www.hiveworkshop.com/forums/spells-569/getunitcollisionsize-gui-v1-4-a-225448/

   
   
    HOW TO IMPORT:

    * import the dummy.mdx model (credits to Vexorian) to your map.
    * import the dummy unit from the object editor to your map.
    * Make sure that in File > Preferences > General, the box next to 'Automatically create unknown variables while pasting trigger data' is ticked.
    * Copy Unit Indexer to your map.
    * Copy Damage Engine to your map. Go to the Object Editor and copy the abilities 'Cheat Death Ability (+500,000)' and 'Detect Spell Damage' to your map.
    * Set those abilities to the proper variabls in Damage Engine. Eg:  Set DamageBlockingAbility = Cheat Death Ability (+500,000)
                                                                        Set SpellDamageAbility = Detect Spell Damage
    * If you were already using Damage Engine, or obtained it via the link above, add Set DamageTypeBeam = 5 to Damage Engine list of damage types.
      The value of DamageTypeBeam may be changed to any number if 5 is already in use. //DamageTypeHPDrain is optional. Demo purposes.
    * Copy GetUnitCollisionSize to your map.
    * Copy the Variable Creator to your map.
    * Copy the Persistent Beam folder to your map.
    * Setup your units inside (see HOW TO GIVE UNITS PERSISTENT BEAM).
    * Go to Persistent Beam Ability Exceptions and add whatever abilities you want to the list that you want to not interrupt beams.
    * You are done!
   
    PS: I am using custom lightning effects in this map. Feel free to import them if your want, but keep in mind this is not the complete list.
    Credits to WILL THE ALMIGHTY for the green laser special effect.
   
   
   
    HOW TO GIVE UNITS PERSISTENT BEAM:
   
    * In the Object Edtitor, change Projectile Speed to 10000 and Projectile Art to none.
    * The system averages a dps depending on your the Cooldown Time of the unit, so you can set that to whatever avlue you desire.
      However, a long Cooldown Time will delay when the charge-up begins, so avoid setting it higher than 1 second. 0.25 or 0.5 are good compromises, but calculate your dps accordingly.
    * 'In Persistent Beam Setup' copy/paste one of the if/then/else blocks and configure it with your unit.
    * Refer to the variables below for an explanation of what they do.



    VARIABLES:

    BeamConfig_BeamType[UDex] // the lightning effect
    BeamConfig_RED[UDex] //For Lightning Effect colour. Use 0.00 - 1.00 as value. Eg: 0.50 is 50%.
    BeamConfig_GREEN[UDex] //For Lightning Effect colour. Use 0.00 - 1.00 as value. Eg: 0.50 is 50%.
    BeamConfig_BLUE[UDex] //For Lightning Effect colour. Use 0.00 - 1.00 as value. Eg: 0.50 is 50%.
    BeamConfig_ALPHA[UDex] //For Lightning Effect TRANSPARENCY. Use 0.00 - 1.00 as value. 0.00 is completely invisible. 1.00 is maximum opacity (fully visible).
    BeamConfig_AbilityCasterFX[UDex] // ability variable. I use this to add special effects so that you mastack multiple effects.
    BeamConfig_AbilityTargetFX[UDex] // same as above. This one is onto the move.
    BeamConfig_ImpactPeriodicFX[UDex] // use this to create recurring effects on the mover. The mover is locked onto the target.
    BeamConfig_CasterPeriodicFX[UDex] // use this to create recurring effects on the caster. The caster is locked onto the attacker and can be offset to match with the attacker's weapon position.
    BeamConfig_ChargeUpFX[UDex] // FX for charging up. Use special effects that animate on death, like a missile. Same for the above two.
    BeamConfig_AttackType[UDex] = Magic // sets the attack type of the attacker. This is required for AoE damage, since different units have different armour types.
    BeamConfig_DamageType[UDex] = DamageTypeBeam // The damage type that Damage Engine will deal. This is useful if you want something different, like a life drain. See Gargoyle.
    BeamConfig_HitsPerSecond[UDex] // This is hoe many times you want the beam to strike in 1 second. A value of 3 is default. This does not alter damage.
    BeamConfig_IntervalFXLimit[UDex] = 4 //This sets how frequently the charge/impact/caster effects will happen. Lower than 3 may drop your framerate if you have too many Beamers attacking at once.
    BeamConfig_CasterScale[UDex] = 100.00 // scale of the caster dummy unit. A value of 100 is 100%.
    BeamConfig_MoverScale[UDex] = 140.00 // scale of the mover dummy unit.
    BeamConfig_ChargeLimit[UDex] = 66 // timer clicks ever 0.03 seconds, so 33 intervals is 0.99 seconds, aka 1 seconds for simplicity's sake. 66 intervals  = 2 seconds.
    BeamConfig_CasterOffset[UDex] = 0.00 // by how much to offset the caster so that it's aligned with the attacker's weapon. Set to 0 to disregard.
    BeamConfig_CasterAngle[UDex] = 0.00 // by how many degrees to angle the caster if CasterOffset is more than 0.00. Use this to position the caster with a unit's weapon or hand.
    BeamConfig_CasterHeight[UDex] = 260.00 // changing height of casting to fit with attacker's model/weapon/etc.
    BeamConfig_Range[UDex] = 800.00 // attack range of the attacker. If target goes beyond that, the beam is destroyed. Avoid setting that to a different value than your unit's attack range.
    BeamConfig_SweepSpeed[UDexD] = 300.00 // speed at which the beam follows the target. If the value is 0, the beam will lock on to the target.
    BeamConfig_DamageAOE[UDex] = 100.00 // the AoE around the mover that will pick units to damage. If the value is 0 the damage will apply ONLY to the target.
    BeamConfig_SweepAOE[UDex] = 600.00 // the scan range for when the mover reacquires new targets. If new targets are outside that scan range, the beam resets.
    BeamConfig_FollowRange[UDex] = 400.00 // the range at which a beamer will follow another unit.
    BeamConfig_IsImmobilised[UDex] // if this is TRUE, then Beamer will have to stay stationary to fire. If FALSE, the Beamer may move around while firing. Use Stop command to end beam.
    BeamConfig_IsMoverGrounded[UDex] = True // if this is TRUE, the mover will be constrained to the ground. Refer to the Shade's attack to see how this can be useful.
    BeamConfig_HitAlt[UDex] = True // if this is TRUE, then your beam will hit ground and air units simultaneously. Make sure your unit can also target both in the object editor.
    BeamConfig_AuxillaryTurret[UDex] // if you have a moving turret, set this to a unit so the beam fires from it. Leave at No Unit until your turret is created. Refer to the Owl Scout config.
    BeamConfig_DummyType[UDex] = Dummy Unit (0 Collision) // this is necessary for the code to work, but also comes with the advantage of allowing you to have dummies with different collision,
                                                          // allowing you to center it correctly on a model that is off-center, with a collision of 16 on your dummy rather than 0.
   
    NB:
    set udg_Beam_IsABeamer[udg_UDex] = true // make sure you have this in your if/then/else config block and ensure it's always set to TRUE or else the beams won't fire.
   
   
   
    BEAM EVENTS
   
    Since v2.8, Persistent Beam has events that you may use to catch when beams begin charge-up, every charge-up interval, charge-up end/beam creation,
    beam interval, beam retargeting, & beam end.
   
    Game - BeamEvent becomes Equal to 1.00 // Fires when the Beam begins chargeup
    Game - BeamEvent becomes Equal to 1.50 // Fires every 0.03 seconds of chargeup time.
    Game - BeamEvent becomes Equal to 2.00 // Fires when chargeup completes and the beam is created.
    Game - BeamEvent becomes Equal to 2.50 // Fires every 0.03 seconds of beam time, after chargeup is complete
    Game - BeamEvent becomes Equal to 3.00 // Fires when target is reacquired automatically.
    Game - BeamEvent becomes Equal to 4.00 // Fires when Beam is terminated.
   
    Here are the variables that you can use with those events. Those are mostly for reference. If you wish to alter an actual value, use the BeamConfig ones.
   
    BeamEvent_Source    // this is the Beamer.
    BeamEvent_Target    // this is the target your beam follows or is lock-on to.
    BeamEvent_Caster    // this is the dummy unit that projects the beam.
    BeamEvent_Mover     // this is the dummy unit that recieves the beam and moves it around. If beam is locked-on, the position of BeamMover will not be the same as BeamTarget.
    BeamEvent_Damage    // this is the average dps of your Beamer, averaged over 3 seconds.
    BeamEvent_Target_OLD// this is the target before target was switch. IT IS ONLY AVAILABLE WHEN BeamEvent is equal to 3.00
    BeamEvent_Lightning // this is the lightning effect itself. You can use this to change it's colour if you so desire. To swap if for something else, destroy (cont.)
                        // destroy the lightning, null it, and then recreate the beam and set it to BeamLightning[Custom Value of Beamer]. Be sure to check whether a lightning
                        // effect exists before you destroy it. For example, the Shade does not use a lightning effect. Use the following if/then/else block for safety:
                       
                        if udg_BeamLightning[udg_BeamID] != null then
                            Destroy lightning
                            Null lightning
                            Recreate lightning
                            Set BeamLightning[Custom Value of Beamer] = Last Created Lightning Effect
                        endif
                       
                        // BeamEvent_Lightning is NOT available when BeamEvent is equal to 1.00 or 1.50 as the lightning has not yet been created.
   
   
     
 


  • Persistent Beam Setup
    • Persistent Beam Setup
      • Events
        • Game - UnitIndexEvent becomes Equal to 1.00
        • Game - UnitIndexEvent becomes Equal to 2.00
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • UnitIndexEvent Equal to 1.00
          • Then - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • -------- CONFIGURE HERE -------- -------- -------- -------- --------
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Or - Any (Conditions) are true
                  • Conditions
                    • (Unit-type of UDexUnits[UDex]) Equal to Wisp
                    • (Unit-type of UDexUnits[UDex]) Equal to Blood Mage
              • Then - Actions
                • Set BeamConfig_BeamType[UDex] = ARBM
                • Set BeamConfig_RED[UDex] = 1.00
                • Set BeamConfig_GREEN[UDex] = 1.00
                • Set BeamConfig_BLUE[UDex] = 1.00
                • Set BeamConfig_APLHA[UDex] = 1.00
                • Set BeamConfig_AbilityCasterFX[UDex] = FX - BeamCaster (Wisp)
                • Set BeamConfig_AbilityMoverFX[UDex] = FX - BeamMover (Wisp)
                • Set BeamConfig_ImpactPeriodicFX[UDex] = Abilities\Weapons\BlackKeeperMissile\BlackKeeperMissile.mdl
                • Set BeamConfig_CasterPeriodicFX[UDex] = Abilities\Weapons\BlackKeeperMissile\BlackKeeperMissile.mdl
                • Set BeamConfig_ChargeUpFX[UDex] = Abilities\Weapons\BlackKeeperMissile\BlackKeeperMissile.mdl
                • Set BeamConfig_AttackType[UDex] = Magic
                • Set BeamConfig_DamageType[UDex] = DamageTypeBeam
                • Set BeamConfig_HitsPerSecond[UDex] = 11
                • Set BeamConfig_IntervalFXLimit[UDex] = 4
                • Set BeamConfig_CasterScale[UDex] = 100.00
                • Set BeamConfig_MoverScale[UDex] = 150.00
                • Set BeamConfig_ChargeLimit[UDex] = 33
                • Set BeamConfig_CasterOffset[UDex] = 70.00
                • Set BeamConfig_CasterAngle[UDex] = 0.00
                • Set BeamConfig_CasterHeight[UDex] = 60.00
                • Set BeamConfig_Range[UDex] = 700.00
                • Set BeamConfig_SweepSpeed[UDex] = 300.00
                • Set BeamConfig_DamageAOE[UDex] = 150.00
                • Set BeamConfig_SweepAOE[UDex] = 600.00
                • Set BeamConfig_FollowRange[UDex] = 400.00
                • Set BeamConfig_IsImmobilised[UDex] = False
                • Set BeamConfig_IsMoverGrounded[UDex] = False
                • Set BeamConfig_HitAll[UDex] = False
                • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
                • Set BeamConfig_DummyType[UDex] = Dummy Unit (0 Collision)
                • Custom script: set udg_Beam_IsABeamer[udg_UDex] = true
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of UDexUnits[UDex]) Equal to Arcane Tower
              • Then - Actions
                • Set BeamConfig_BeamType[UDex] = SLSB
                • Set BeamConfig_RED[UDex] = 1.00
                • Set BeamConfig_GREEN[UDex] = 1.00
                • Set BeamConfig_BLUE[UDex] = 1.00
                • Set BeamConfig_APLHA[UDex] = 1.00
                • Set BeamConfig_AbilityCasterFX[UDex] = FX - BeamCaster (Arcane Tower)
                • Set BeamConfig_AbilityMoverFX[UDex] = FX - BeamMover (Arcane Tower)
                • Set BeamConfig_ImpactPeriodicFX[UDex] = Abilities\Weapons\PriestMissile\PriestMissile.mdl
                • Set BeamConfig_CasterPeriodicFX[UDex] = Abilities\Weapons\PriestMissile\PriestMissile.mdl
                • Set BeamConfig_ChargeUpFX[UDex] = Abilities\Weapons\BlackKeeperMissile\BlackKeeperMissile.mdl
                • Set BeamConfig_AttackType[UDex] = Hero
                • Set BeamConfig_DamageType[UDex] = DamageTypeExplosive
                • Set BeamConfig_HitsPerSecond[UDex] = 11
                • Set BeamConfig_IntervalFXLimit[UDex] = 4
                • Set BeamConfig_CasterScale[UDex] = 100.00
                • Set BeamConfig_MoverScale[UDex] = 140.00
                • Set BeamConfig_ChargeLimit[UDex] = 66
                • Set BeamConfig_CasterOffset[UDex] = 0.00
                • Set BeamConfig_CasterAngle[UDex] = 0.00
                • Set BeamConfig_CasterHeight[UDex] = 260.00
                • Set BeamConfig_Range[UDex] = 800.00
                • Set BeamConfig_SweepSpeed[UDex] = 0.00
                • Set BeamConfig_DamageAOE[UDex] = 0.00
                • Set BeamConfig_SweepAOE[UDex] = 0.00
                • Set BeamConfig_FollowRange[UDex] = 400.00
                • Set BeamConfig_IsImmobilised[UDex] = True
                • Set BeamConfig_IsMoverGrounded[UDex] = False
                • Set BeamConfig_HitAll[UDex] = False
                • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
                • Set BeamConfig_DummyType[UDex] = Dummy Unit (0 Collision)
                • Custom script: set udg_Beam_IsABeamer[udg_UDex] = true
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of UDexUnits[UDex]) Equal to Archmage
              • Then - Actions
                • Set BeamConfig_BeamType[UDex] = <Empty String>
                • Set BeamConfig_RED[UDex] = 1.00
                • Set BeamConfig_GREEN[UDex] = 1.00
                • Set BeamConfig_BLUE[UDex] = 1.00
                • Set BeamConfig_APLHA[UDex] = 1.00
                • Set BeamConfig_AbilityCasterFX[UDex] = FX - BeamCaster (Arcane Tower)
                • Set BeamConfig_AbilityMoverFX[UDex] = FX - BeamMover (Arcane Tower)
                • Set BeamConfig_ImpactPeriodicFX[UDex] = <Empty String>
                • Set BeamConfig_CasterPeriodicFX[UDex] = <Empty String>
                • Set BeamConfig_ChargeUpFX[UDex] = Abilities\Weapons\PriestMissile\PriestMissile.mdl
                • Set BeamConfig_AttackType[UDex] = Hero
                • Set BeamConfig_DamageType[UDex] = 0
                • Set BeamConfig_HitsPerSecond[UDex] = 1
                • Set BeamConfig_IntervalFXLimit[UDex] = 4
                • Set BeamConfig_CasterScale[UDex] = 100.00
                • Set BeamConfig_MoverScale[UDex] = 140.00
                • Set BeamConfig_ChargeLimit[UDex] = 132
                • Set BeamConfig_CasterOffset[UDex] = 0.00
                • Set BeamConfig_CasterAngle[UDex] = 0.00
                • Set BeamConfig_CasterHeight[UDex] = 260.00
                • Set BeamConfig_Range[UDex] = 800.00
                • Set BeamConfig_SweepSpeed[UDex] = 0.00
                • Set BeamConfig_DamageAOE[UDex] = 200.00
                • Set BeamConfig_SweepAOE[UDex] = 0.00
                • Set BeamConfig_FollowRange[UDex] = 400.00
                • Set BeamConfig_IsImmobilised[UDex] = True
                • Set BeamConfig_IsMoverGrounded[UDex] = False
                • Set BeamConfig_HitAll[UDex] = False
                • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
                • Set BeamConfig_DummyType[UDex] = Dummy Unit (0 Collision)
                • Custom script: set udg_Beam_IsABeamer[udg_UDex] = true
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of UDexUnits[UDex]) Equal to Shade
              • Then - Actions
                • Set BeamConfig_BeamType[UDex] = <Empty String>
                • Set BeamConfig_RED[UDex] = 1.00
                • Set BeamConfig_GREEN[UDex] = 1.00
                • Set BeamConfig_BLUE[UDex] = 1.00
                • Set BeamConfig_APLHA[UDex] = 1.00
                • Set BeamConfig_AbilityCasterFX[UDex] = FX - BeamCaster (Shade)
                • Set BeamConfig_AbilityMoverFX[UDex] = FX - BeamMover (Shade)
                • Set BeamConfig_ImpactPeriodicFX[UDex] = <Empty String>
                • Set BeamConfig_CasterPeriodicFX[UDex] = Abilities\Weapons\BloodElfMissile\BloodElfMissile.mdl
                • Set BeamConfig_ChargeUpFX[UDex] = Abilities\Weapons\KeeperGroveMissile\KeeperGroveMissile.mdl
                • Set BeamConfig_AttackType[UDex] = Siege
                • Set BeamConfig_DamageType[UDex] = DamageTypeBeam
                • Set BeamConfig_HitsPerSecond[UDex] = 3
                • Set BeamConfig_IntervalFXLimit[UDex] = 4
                • Set BeamConfig_CasterScale[UDex] = 100.00
                • Set BeamConfig_MoverScale[UDex] = 100.00
                • Set BeamConfig_ChargeLimit[UDex] = 66
                • Set BeamConfig_CasterOffset[UDex] = 0.00
                • Set BeamConfig_CasterAngle[UDex] = 0.00
                • Set BeamConfig_CasterHeight[UDex] = 120.00
                • Set BeamConfig_Range[UDex] = 700.00
                • Set BeamConfig_SweepSpeed[UDex] = 200.00
                • Set BeamConfig_DamageAOE[UDex] = 170.00
                • Set BeamConfig_SweepAOE[UDex] = 600.00
                • Set BeamConfig_FollowRange[UDex] = 400.00
                • Set BeamConfig_IsImmobilised[UDex] = True
                • Set BeamConfig_IsMoverGrounded[UDex] = True
                • Set BeamConfig_HitAll[UDex] = True
                • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
                • Set BeamConfig_DummyType[UDex] = Dummy Unit (0 Collision)
                • Custom script: set udg_Beam_IsABeamer[udg_UDex] = true
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of UDexUnits[UDex]) Equal to Gargoyle
              • Then - Actions
                • Set BeamConfig_BeamType[UDex] = DRAL
                • Set BeamConfig_RED[UDex] = 1.00
                • Set BeamConfig_GREEN[UDex] = 1.00
                • Set BeamConfig_BLUE[UDex] = 1.00
                • Set BeamConfig_APLHA[UDex] = 0.50
                • Set BeamConfig_AbilityCasterFX[UDex] = FX - BeamCaster (Gargoyle)
                • Set BeamConfig_AbilityMoverFX[UDex] = FX - BeamMover (Gargoyle)
                • Set BeamConfig_ImpactPeriodicFX[UDex] = Abilities\Weapons\KeeperGroveMissile\KeeperGroveMissile.mdl
                • Set BeamConfig_CasterPeriodicFX[UDex] = Abilities\Weapons\KeeperGroveMissile\KeeperGroveMissile.mdl
                • Set BeamConfig_ChargeUpFX[UDex] = Abilities\Weapons\KeeperGroveMissile\KeeperGroveMissile.mdl
                • Set BeamConfig_AttackType[UDex] = Normal
                • Set BeamConfig_DamageType[UDex] = DamageTypeHPDrain
                • Set BeamConfig_HitsPerSecond[UDex] = 6
                • Set BeamConfig_IntervalFXLimit[UDex] = 4
                • Set BeamConfig_CasterScale[UDex] = 60.00
                • Set BeamConfig_MoverScale[UDex] = 60.00
                • Set BeamConfig_ChargeLimit[UDex] = 66
                • Set BeamConfig_CasterOffset[UDex] = 40.00
                • Set BeamConfig_CasterAngle[UDex] = 0.00
                • Set BeamConfig_CasterHeight[UDex] = 20.00
                • Set BeamConfig_Range[UDex] = 500.00
                • Set BeamConfig_SweepSpeed[UDex] = 450.00
                • Set BeamConfig_DamageAOE[UDex] = 0.00
                • Set BeamConfig_SweepAOE[UDex] = 600.00
                • Set BeamConfig_FollowRange[UDex] = 400.00
                • Set BeamConfig_IsImmobilised[UDex] = True
                • Set BeamConfig_IsMoverGrounded[UDex] = False
                • Set BeamConfig_HitAll[UDex] = False
                • Set BeamConfig_RED[UDex] = 100.00
                • Set BeamConfig_GREEN[BeamID] = 100.00
                • Set BeamConfig_BLUE[UDex] = 100.00
                • Set BeamConfig_APLHA[UDex] = 100.00
                • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
                • Set BeamConfig_DummyType[UDex] = Dummy Unit (0 Collision)
                • Custom script: set udg_Beam_IsABeamer[udg_UDex] = true
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of UDexUnits[UDex]) Equal to Owl Scout (Level 1)
              • Then - Actions
                • Set BeamConfig_BeamType[UDex] = GRSB
                • Set BeamConfig_RED[UDex] = 1.00
                • Set BeamConfig_GREEN[UDex] = 1.00
                • Set BeamConfig_BLUE[UDex] = 1.00
                • Set BeamConfig_APLHA[UDex] = 1.00
                • -------- disable this or use custom script to set ability variables to 0 if you are not going to use them --------
                • Set BeamConfig_AbilityCasterFX[UDex] = FX - BeamCaster (Own Scout)
                • Set BeamConfig_AbilityMoverFX[UDex] = FX - BeamMover (Owl Scout)
                • Set BeamConfig_ImpactPeriodicFX[UDex] = Abilities\Weapons\KeeperGroveMissile\KeeperGroveMissile.mdl
                • Set BeamConfig_CasterPeriodicFX[UDex] = Abilities\Weapons\KeeperGroveMissile\KeeperGroveMissile.mdl
                • Set BeamConfig_ChargeUpFX[UDex] = Abilities\Weapons\KeeperGroveMissile\KeeperGroveMissile.mdl
                • Set BeamConfig_AttackType[UDex] = Chaos
                • Set BeamConfig_DamageType[UDex] = DamageTypeBeam
                • Set BeamConfig_HitsPerSecond[UDex] = 6
                • Set BeamConfig_IntervalFXLimit[UDex] = 4
                • Set BeamConfig_CasterScale[UDex] = 60.00
                • Set BeamConfig_MoverScale[UDex] = 60.00
                • Set BeamConfig_ChargeLimit[UDex] = 66
                • Set BeamConfig_CasterOffset[UDex] = 15.00
                • Set BeamConfig_CasterAngle[UDex] = 0.00
                • Set BeamConfig_CasterHeight[UDex] = 0.00
                • Set BeamConfig_Range[UDex] = 800.00
                • Set BeamConfig_SweepSpeed[UDex] = 450.00
                • Set BeamConfig_DamageAOE[UDex] = 0.00
                • Set BeamConfig_SweepAOE[UDex] = 600.00
                • Set BeamConfig_FollowRange[UDex] = 400.00
                • Set BeamConfig_IsImmobilised[UDex] = False
                • Set BeamConfig_IsMoverGrounded[UDex] = False
                • Set BeamConfig_HitAll[UDex] = False
                • Set BeamConfig_DummyType[UDex] = Dummy Unit (0 Collision)
                • -------- You can create the Auxillary Turret here. I use a separet trigger to keep things clean. --------
                • Trigger - Run Owl Orb Setup <gen> (ignoring conditions)
                • -------- // End Auxillary Turret setup --------
                • Custom script: set udg_Beam_IsABeamer[udg_UDex] = true
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of UDexUnits[UDex]) Equal to Spellbreaker Orbs (0 Collision)
              • Then - Actions
                • Set BeamConfig_BeamType[UDex] = SLTB
                • Set BeamConfig_RED[UDex] = 1.00
                • Set BeamConfig_GREEN[UDex] = 1.00
                • Set BeamConfig_BLUE[UDex] = 1.00
                • Set BeamConfig_APLHA[UDex] = 1.00
                • Set BeamConfig_AbilityCasterFX[UDex] = FX - BeamCaster (Arcane Tower)
                • Set BeamConfig_AbilityMoverFX[UDex] = FX - BeamMover (Arcane Tower)
                • Set BeamConfig_ImpactPeriodicFX[UDex] = Abilities\Weapons\PriestMissile\PriestMissile.mdl
                • Set BeamConfig_CasterPeriodicFX[UDex] = Abilities\Weapons\PriestMissile\PriestMissile.mdl
                • Set BeamConfig_ChargeUpFX[UDex] = Abilities\Weapons\BlackKeeperMissile\BlackKeeperMissile.mdl
                • Set BeamConfig_AttackType[UDex] = Magic
                • Set BeamConfig_DamageType[UDex] = DamageTypeBeam
                • Set BeamConfig_HitsPerSecond[UDex] = 6
                • Set BeamConfig_IntervalFXLimit[UDex] = 4
                • Set BeamConfig_CasterScale[UDex] = 20.00
                • Set BeamConfig_MoverScale[UDex] = 40.00
                • Set BeamConfig_ChargeLimit[UDex] = 33
                • Set BeamConfig_CasterOffset[UDex] = 0.00
                • Set BeamConfig_CasterAngle[UDex] = 0.00
                • Set BeamConfig_CasterHeight[UDex] = 0.00
                • Set BeamConfig_Range[UDex] = 800.00
                • Set BeamConfig_SweepSpeed[UDex] = 750.00
                • Set BeamConfig_DamageAOE[UDex] = 0.00
                • Set BeamConfig_SweepAOE[UDex] = 1200.00
                • Set BeamConfig_FollowRange[UDex] = 400.00
                • Set BeamConfig_IsImmobilised[UDex] = False
                • Set BeamConfig_IsMoverGrounded[UDex] = False
                • Set BeamConfig_HitAll[UDex] = False
                • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
                • Set BeamConfig_DummyType[UDex] = Dummy Unit (0 Collision)
                • Custom script: set udg_Beam_IsABeamer[udg_UDex] = true
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of UDexUnits[UDex]) Equal to Flying Machine
              • Then - Actions
                • Set BeamConfig_BeamType[UDex] = SLPB
                • Set BeamConfig_RED[UDex] = 1.00
                • Set BeamConfig_GREEN[UDex] = 1.00
                • Set BeamConfig_BLUE[UDex] = 1.00
                • Set BeamConfig_APLHA[UDex] = 1.00
                • Set BeamConfig_AbilityCasterFX[UDex] = FX - BeamCaster (Arcane Tower)
                • Set BeamConfig_AbilityMoverFX[UDex] = FX - BeamMover (Arcane Tower)
                • Set BeamConfig_ImpactPeriodicFX[UDex] = Abilities\Weapons\PriestMissile\PriestMissile.mdl
                • Set BeamConfig_CasterPeriodicFX[UDex] = Abilities\Weapons\PriestMissile\PriestMissile.mdl
                • Set BeamConfig_ChargeUpFX[UDex] = Abilities\Weapons\BlackKeeperMissile\BlackKeeperMissile.mdl
                • Set BeamConfig_AttackType[UDex] = Pierce
                • Set BeamConfig_DamageType[UDex] = DamageTypeExplosive
                • Set BeamConfig_HitsPerSecond[UDex] = 11
                • Set BeamConfig_IntervalFXLimit[UDex] = 4
                • Set BeamConfig_CasterScale[UDex] = 100.00
                • Set BeamConfig_MoverScale[UDex] = 100.00
                • Set BeamConfig_ChargeLimit[UDex] = 66
                • Set BeamConfig_CasterOffset[UDex] = 40.00
                • Set BeamConfig_CasterAngle[UDex] = 0.00
                • Set BeamConfig_CasterHeight[UDex] = 20.00
                • Set BeamConfig_Range[UDex] = 700.00
                • Set BeamConfig_SweepSpeed[UDex] = 0.00
                • Set BeamConfig_DamageAOE[UDex] = 0.00
                • Set BeamConfig_SweepAOE[UDex] = 1200.00
                • Set BeamConfig_FollowRange[UDex] = 400.00
                • Set BeamConfig_IsImmobilised[UDex] = True
                • Set BeamConfig_IsMoverGrounded[UDex] = False
                • Set BeamConfig_HitAll[UDex] = False
                • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
                • Set BeamConfig_DummyType[UDex] = Dummy Unit (0 Collision)
                • Custom script: set udg_Beam_IsABeamer[udg_UDex] = true
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of UDexUnits[UDex]) Equal to Flying Machine Chain (0 Collision)
              • Then - Actions
                • Set BeamConfig_BeamType[UDex] = SLPB
                • Set BeamConfig_RED[UDex] = 1.00
                • Set BeamConfig_GREEN[UDex] = 1.00
                • Set BeamConfig_BLUE[UDex] = 1.00
                • Set BeamConfig_APLHA[UDex] = 1.00
                • Set BeamConfig_AbilityCasterFX[UDex] = FX - BeamAuxillary (Owls)
                • Set BeamConfig_AbilityMoverFX[UDex] = FX - BeamMover (Arcane Tower)
                • Set BeamConfig_ImpactPeriodicFX[UDex] = <Empty String>
                • Set BeamConfig_CasterPeriodicFX[UDex] = <Empty String>
                • Set BeamConfig_ChargeUpFX[UDex] = <Empty String>
                • Set BeamConfig_AttackType[UDex] = Pierce
                • Set BeamConfig_DamageType[UDex] = DamageTypeBeam
                • Set BeamConfig_HitsPerSecond[UDex] = 6
                • Set BeamConfig_IntervalFXLimit[UDex] = 4
                • Set BeamConfig_CasterScale[UDex] = 20.00
                • Set BeamConfig_MoverScale[UDex] = 100.00
                • Set BeamConfig_ChargeLimit[UDex] = 0
                • Set BeamConfig_CasterOffset[UDex] = 0.00
                • Set BeamConfig_CasterAngle[UDex] = 0.00
                • Set BeamConfig_CasterHeight[UDex] = 0.00
                • Set BeamConfig_Range[UDex] = 800.00
                • Set BeamConfig_SweepSpeed[UDex] = 0.00
                • Set BeamConfig_DamageAOE[UDex] = 0.00
                • Set BeamConfig_SweepAOE[UDex] = 1200.00
                • Set BeamConfig_FollowRange[UDex] = 400.00
                • Set BeamConfig_IsImmobilised[UDex] = False
                • Set BeamConfig_IsMoverGrounded[UDex] = False
                • Set BeamConfig_HitAll[UDex] = False
                • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
                • Set BeamConfig_DummyType[UDex] = Dummy Unit (0 Collision)
                • Custom script: set udg_Beam_IsABeamer[udg_UDex] = true
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • -------- END CONFIGURATION -------- -------- -------- -------- --------
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Beam_IsABeamer[UDex] Equal to True
              • Then - Actions
                • Set BeamConfig_BeamType[UDex] = <Empty String>
                • Set BeamConfig_RED[UDex] = 1.00
                • Set BeamConfig_GREEN[UDex] = 1.00
                • Set BeamConfig_BLUE[UDex] = 1.00
                • Set BeamConfig_APLHA[UDex] = 1.00
                • Custom script: set udg_BeamConfig_AbilityCasterFX[udg_UDex] = 0
                • Custom script: set udg_BeamConfig_AbilityMoverFX[udg_UDex] = 0
                • Set BeamConfig_ImpactPeriodicFX[UDex] = <Empty String>
                • Set BeamConfig_CasterPeriodicFX[UDex] = <Empty String>
                • Set BeamConfig_ChargeUpFX[UDex] = <Empty String>
                • Custom script: set udg_BeamConfig_AttackType[udg_UDex] = null
                • Set BeamConfig_DamageType[UDex] = 0
                • Set BeamConfig_HitsPerSecond[UDex] = 3
                • Set BeamConfig_IntervalFXLimit[UDex] = 4
                • Set BeamConfig_CasterScale[UDex] = 100.00
                • Set BeamConfig_MoverScale[UDex] = 100.00
                • Set BeamConfig_ChargeLimit[UDex] = 66
                • Set BeamConfig_CasterOffset[UDex] = 0.00
                • Set BeamConfig_CasterHeight[UDex] = 0.00
                • Set BeamConfig_Range[UDex] = 0.00
                • Set BeamConfig_SweepSpeed[UDex] = 0.00
                • Set BeamConfig_DamageAOE[UDex] = 0.00
                • Set BeamConfig_SweepAOE[UDex] = 0.00
                • Set BeamConfig_FollowRange[UDex] = 400.00
                • Set BeamConfig_IsImmobilised[UDex] = False
                • Set BeamConfig_IsMoverGrounded[UDex] = False
                • Set BeamConfig_HitAll[UDex] = False
                • Set BeamConfig_AuxiliaryTurret[UDex] = No unit
                • Set BeamConfig_DummyString[UDex] = <Empty String>
                • Custom script: set udg_Beam_IsABeamer[udg_UDex] = false
              • Else - Actions
  • Persistent Beam Attack
    • Persistent Beam Attack
      • Events
        • Game - DamageModifierEvent becomes Equal to 1.00
      • Conditions
        • DamageEventType Equal to 0
        • Beam_IsABeamer[(Custom value of DamageEventSource)] Equal to True
        • IsDamageSpell Equal to False
      • Actions
        • Custom script: local real xA
        • Custom script: local real yA
        • Custom script: local real xB
        • Custom script: local real yB
        • Custom script: local real xC
        • Custom script: local real yC
        • Custom script: local real dx
        • Custom script: local real dy
        • Custom script: local real distance
        • Custom script: local real angle
        • Set DamageEventAmount = 0.00
        • Set DamageEventType = DamageTypeBlocked
        • Set BeamID = (Custom value of DamageEventSource)
        • Set Beam_HitStack[BeamID] = (Beam_HitStack[BeamID] + 1)
        • Set Beam_DamageStack[BeamID] = (Beam_DamageStack[BeamID] + DamageEventPrevAmt)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (DamageEventSource is in Beam_MainGroup) Equal to False
          • Then - Actions
            • Set Beam_IntervalDMGTrigger[BeamID] = (33 / BeamConfig_HitsPerSecond[BeamID])
            • Set BeamOwner[BeamID] = (Owner of DamageEventSource)
            • Custom script: if udg_BeamConfig_AttackType[udg_BeamID] == ATTACK_TYPE_MAGIC then
            • Set Beam_CannotHitMagicImmune[BeamID] = True
            • Custom script: endif
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • Custom script: set xA = GetUnitX(udg_DamageEventSource)
            • Custom script: set yA = GetUnitY(udg_DamageEventSource)
            • Custom script: set xB = GetUnitX(udg_DamageEventTarget)
            • Custom script: set yB = GetUnitY(udg_DamageEventTarget)
            • Custom script: set dx = xB-xA
            • Custom script: set dy = yB-yA
            • Custom script: set distance = SquareRoot(dx*dx+dy*dy)
            • Custom script: set angle = Atan2(yA-yB, xA-xB)
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • BeamConfig_CasterOffset[BeamID] Greater than 0.00
              • Then - Actions
                • Custom script: set xC = xA + Cos(angle) * udg_BeamConfig_CasterOffset[udg_BeamID]
                • Custom script: set yC = yA + Sin(angle) * udg_BeamConfig_CasterOffset[udg_BeamID]
                • Custom script: set udg_BeamCaster[udg_BeamID] = CreateUnit(udg_BeamOwner[udg_BeamID], udg_BeamConfig_DummyType[udg_BeamID], xC, yC, angle)
              • Else - Actions
                • Custom script: set udg_BeamCaster[udg_BeamID] = CreateUnit(udg_BeamOwner[udg_BeamID], udg_BeamConfig_DummyType[udg_BeamID], xA, yA, angle)
            • Unit - Pause BeamCaster[BeamID]
            • Animation - Change BeamCaster[BeamID] flying height to ((Current flying height of DamageEventSource) + BeamConfig_CasterHeight[BeamID]) at 0.00
            • Animation - Change BeamCaster[BeamID]'s size to (BeamConfig_CasterScale[BeamID]%, BeamConfig_CasterScale[BeamID]%, BeamConfig_CasterScale[BeamID]%) of its original size
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • Custom script: set udg_BeamMover[udg_BeamID] = CreateUnit(udg_BeamOwner[udg_BeamID], udg_BeamConfig_DummyType[udg_BeamID], xB, yB, angle)
            • Unit - Pause BeamMover[BeamID]
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • BeamConfig_IsMoverGrounded[BeamID] Equal to True
              • Then - Actions
                • Animation - Change BeamMover[BeamID] flying height to 0.00 at 0.00
              • Else - Actions
                • Animation - Change BeamMover[BeamID] flying height to ((Current flying height of DamageEventTarget) + 50.00) at 0.00
            • Animation - Change BeamMover[BeamID]'s size to (BeamConfig_MoverScale[BeamID]%, BeamConfig_MoverScale[BeamID]%, BeamConfig_MoverScale[BeamID]%) of its original size
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • Set BeamTarget[BeamID] = DamageEventTarget
            • Unit Group - Add DamageEventSource to Beam_MainGroup
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Persistent Beam Tracking <gen> is on) Equal to False
              • Then - Actions
                • Trigger - Turn on Persistent Beam Cancel A <gen>
                • Trigger - Turn on Persistent Beam Cancel B <gen>
                • Trigger - Turn on Persistent Beam Tracking <gen>
              • Else - Actions
            • Set BeamEvent_Source = DamageEventSource
            • Set BeamEvent_Target = DamageEventTarget
            • Set BeamEvent_Caster = BeamCaster[BeamID]
            • Set BeamEvent_Mover = BeamMover[BeamID]
            • Set BeamEvent_Damage = DamageEventPrevAmt
            • Set BeamEvent = 1.00
            • Set BeamEvent = 0.00
            • Set BeamEvent_Source = No unit
            • Set BeamEvent_Target = No unit
            • Set BeamEvent_Caster = No unit
            • Set BeamEvent_Mover = No unit
            • Set BeamEvent_Damage = 0.00
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • DamageEventTarget Not equal to BeamTarget[BeamID]
              • Then - Actions
                • Set BeamTarget[BeamID] = DamageEventTarget
              • Else - Actions
  • Persistent Beam Tracking
    • Persistent Beam Tracking
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • Custom script: local unit u = null
        • Custom script: local integer ID = 0
        • Custom script: local real z1 = 0.0
        • Custom script: local real z2 = 0.0
        • Custom script: local real z3 = 0.0
        • Custom script: local real zInc = 0.0
        • Custom script: local real xA = 0.0
        • Custom script: local real yA = 0.0
        • Custom script: local real xB = 0.0
        • Custom script: local real yB = 0.0
        • Custom script: local real xC = 0.0
        • Custom script: local real yC = 0.0
        • Custom script: local real xD = 0.0
        • Custom script: local real yD = 0.0
        • Custom script: local real xE = 0.0
        • Custom script: local real yE = 0.0
        • Custom script: local real speed = 0.0
        • Custom script: local real angle = 0.0
        • Custom script: local real dx = 0.0
        • Custom script: local real dy = 0.0
        • Custom script: local real distance = 0.0
        • Custom script: local real reach = 0.0
        • Custom script: local real leash = 0.0
        • Custom script: local boolean retarget = false
        • Custom script: local boolean hastarget = false
        • Custom script: local boolean array b
        • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
        • -------- Check if Beam_MainGroup is empty. If empty, turn this trigger off --------
        • Custom script: if FirstOfGroup(udg_Beam_MainGroup) == null then
        • Trigger - Turn off (This trigger)
        • Trigger - Turn off Persistent Beam Cancel A <gen>
        • Trigger - Turn off Persistent Beam Cancel B <gen>
        • Custom script: else
        • -------- Main loop --------
        • Custom script: loop
        • Custom script: set udg_Beamer = FirstOfGroup(udg_Beam_MainGroup)
        • Custom script: exitwhen udg_Beamer == null
        • Custom script: call GroupRemoveUnit(udg_Beam_MainGroup,udg_Beamer)
        • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
        • Set BeamID = (Custom value of Beamer)
        • Set Beam_IntervalFX[BeamID] = (Beam_IntervalFX[BeamID] + 1)
        • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
        • Custom script: set udg_Beam_X[udg_BeamID] = GetUnitX(udg_Beamer)
        • Custom script: set udg_Beam_Y[udg_BeamID] = GetUnitY(udg_Beamer)
        • -------- ________________________________________ --------
        • -------- | | --------
        • -------- * * * * DISTANCE CHECK --------
        • Custom script: if udg_Beam_IsFollowing[udg_BeamID] then
        • Custom script: set xA = GetUnitX(udg_Beamer)
        • Custom script: set yA = GetUnitY(udg_Beamer)
        • Custom script: set xB = GetUnitX(udg_Beam_OrderWidget[udg_BeamID])
        • Custom script: set yB = GetUnitY(udg_Beam_OrderWidget[udg_BeamID])
        • Custom script: set dx = xB-xA
        • Custom script: set dy = yB-yA
        • Custom script: set leash = SquareRoot(dx*dx+dy*dy)
        • Custom script: if leash > udg_BeamConfig_FollowRange[udg_BeamID] then
        • Custom script: call IssueTargetOrderById(udg_Beamer, 851971, udg_Beam_OrderWidget[udg_BeamID])
        • Custom script: if udg_BeamConfig_IsImmobilised[udg_BeamID] then
        • Custom script: set udg_Beam_TerminateBeam[udg_BeamID] = true
        • Custom script: endif
        • Custom script: endif
        • Custom script: endif
        • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
        • Set GUCS_U = BeamTarget[BeamID]
        • Trigger - Run GetUnitCollisionSize <gen> (ignoring conditions)
        • Set Beam_ImpactOffset = GUCS_Size
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • GUCS_Size Greater than or equal to 144
          • Then - Actions
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • GUCS_Size Less than or equal to 2
              • Then - Actions
                • Set GUCS_Size = 12
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • GUCS_Size Less than or equal to 8
                  • Then - Actions
                    • Set GUCS_Size = (GUCS_Size x 6)
                  • Else - Actions
        • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
        • Custom script: set xA = GetUnitX(udg_Beamer)
        • Custom script: set yA = GetUnitY(udg_Beamer)
        • Custom script: set xB = GetUnitX(udg_BeamTarget[udg_BeamID])
        • Custom script: set yB = GetUnitY(udg_BeamTarget[udg_BeamID])
        • Custom script: set dx = xB-xA
        • Custom script: set dy = yB-yA
        • Custom script: set distance = SquareRoot(dx*dx+dy*dy)
        • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
        • Custom script: if GetUnitState(udg_Beamer, UNIT_STATE_LIFE) <= 0 or GetUnitCurrentOrder(udg_Beamer) == 851973 then
        • Custom script: set udg_Beam_TerminateBeam[udg_BeamID] = true
        • Custom script: endif
        • Custom script: if distance > (udg_BeamConfig_Range[udg_BeamID] + (udg_GUCS_Size * 2.00)) or GetUnitState(udg_BeamTarget[udg_BeamID], UNIT_STATE_LIFE) <= 0 then
        • Custom script: if udg_BeamConfig_SweepAOE[udg_BeamID] > 0.0 then
        • Custom script: set udg_Beam_ReacquireTarget[udg_BeamID] = true
        • Custom script: else
        • Custom script: set udg_Beam_TerminateBeam[udg_BeamID] = true
        • Custom script: endif
        • Custom script: endif
        • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
        • -------- // END DISTANCE CHECK --------
        • -------- [_______________________________________] --------
        • -------- --------
        • -------- --------
        • -------- --------
        • -------- ________________________________________ --------
        • -------- | | --------
        • -------- * * * * SWEEP BEAM --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • BeamConfig_SweepSpeed[BeamID] Greater than 0.00
          • Then - Actions
            • Custom script: set xC = GetUnitX(udg_BeamMover[udg_BeamID])
            • Custom script: set yC = GetUnitY(udg_BeamMover[udg_BeamID])
            • Custom script: set dx = xC-xB
            • Custom script: set dy = yC-yB
            • Custom script: set distance = SquareRoot(dx*dx+dy*dy)
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • Custom script: if distance > (udg_BeamConfig_SweepSpeed[udg_BeamID] / 33.00) then
            • Custom script: set angle = Atan2(yB-yC,xB-xC)
            • Custom script: set xD = xC + Cos(angle) * (udg_BeamConfig_SweepSpeed[udg_BeamID] / 33.00)
            • Custom script: set yD = yC + Sin(angle) * (udg_BeamConfig_SweepSpeed[udg_BeamID] / 33.00)
            • Custom script: else
            • Custom script: set xD = xB
            • Custom script: set yD = yB
            • Custom script: endif
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • Custom script: set angle = Atan2(yD-yA,xD-xA)
            • Custom script: call SetUnitPosition(udg_BeamMover[udg_BeamID], xD, yD)
            • Custom script: call SetUnitFacing(udg_BeamMover[udg_BeamID], angle * bj_RADTODEG)
          • Else - Actions
            • Custom script: set xD = xB
            • Custom script: set yD = yB
            • Custom script: set angle = Atan2(yA-yD,xA-xD)
            • Custom script: set xE = xD + Cos(angle) * (udg_Beam_ImpactOffset - (udg_Beam_ImpactOffset * 0.20))
            • Custom script: set yE = yD + Sin(angle) * (udg_Beam_ImpactOffset - (udg_Beam_ImpactOffset * 0.20))
            • Custom script: call SetUnitPosition(udg_BeamMover[udg_BeamID], xE, yE)
            • Custom script: call SetUnitFacing(udg_BeamMover[udg_BeamID], angle + 180)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • BeamConfig_IsMoverGrounded[BeamID] Equal to False
          • Then - Actions
            • Custom script: set z1 = GetUnitFlyHeight(udg_BeamCaster[udg_BeamID])
            • Custom script: set z2 = GetUnitFlyHeight(udg_BeamMover[udg_BeamID])
            • Custom script: set z3 = GetUnitFlyHeight(udg_BeamTarget[udg_BeamID]) + 60
            • Custom script: set zInc = udg_BeamConfig_SweepSpeed[udg_BeamID] / 33
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • BeamConfig_SweepSpeed[BeamID] Greater than 0.00
              • Then - Actions
                • Custom script: if z2 < z3 then
                • Custom script: if z3 - z2 > (zInc) then
                • Custom script: call SetUnitFlyHeight(udg_BeamMover[udg_BeamID], z2 + zInc, 0)
                • Custom script: else
                • Custom script: call SetUnitFlyHeight(udg_BeamMover[udg_BeamID], z3, 0)
                • Custom script: endif
                • Custom script: else
                • Custom script: if z2 - z3 > (zInc) then
                • Custom script: call SetUnitFlyHeight(udg_BeamMover[udg_BeamID], z2 - zInc, 0)
                • Custom script: else
                • Custom script: call SetUnitFlyHeight(udg_BeamMover[udg_BeamID], z3, 0)
                • Custom script: endif
                • Custom script: endif
              • Else - Actions
                • Custom script: call SetUnitFlyHeight(udg_BeamMover[udg_BeamID], z3, 0)
          • Else - Actions
        • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
        • Custom script: if udg_BeamConfig_AuxiliaryTurret[udg_BeamID] == null then
        • Custom script: set xE = GetUnitX(udg_Beamer)
        • Custom script: set yE = GetUnitY(udg_Beamer)
        • Custom script: call SetUnitFlyHeight(udg_BeamCaster[udg_BeamID], GetUnitFlyHeight(udg_Beamer) + udg_BeamConfig_CasterHeight[udg_BeamID], 0)
        • Custom script: else
        • Custom script: set xE = GetUnitX(udg_BeamConfig_AuxiliaryTurret[udg_BeamID])
        • Custom script: set yE = GetUnitY(udg_BeamConfig_AuxiliaryTurret[udg_BeamID])
        • Custom script: call SetUnitFlyHeight(udg_BeamCaster[udg_BeamID], GetUnitFlyHeight(udg_BeamConfig_AuxiliaryTurret[udg_BeamID]) + udg_BeamConfig_CasterHeight[udg_BeamID], 0)
        • Custom script: endif
        • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • BeamConfig_CasterOffset[BeamID] Greater than 0.00
          • Then - Actions
            • Custom script: set angle = Atan2(yD-yE,xD-xE) + (udg_BeamConfig_CasterAngle[udg_BeamID] * bj_DEGTORAD)
            • Custom script: set xC = xE + Cos(angle) * udg_BeamConfig_CasterOffset[udg_BeamID]
            • Custom script: set yC = yE + Sin(angle) * udg_BeamConfig_CasterOffset[udg_BeamID]
            • Custom script: set angle = Atan2(yD-yC,xD-xC)
            • Custom script: call SetUnitPosition(udg_BeamCaster[udg_BeamID], xC, yC)
            • Custom script: call SetUnitFacing(udg_BeamCaster[udg_BeamID], angle * bj_RADTODEG)
          • Else - Actions
            • Custom script: set angle = Atan2(yD-yE,xD-xE)
            • Custom script: call SetUnitPosition(udg_BeamCaster[udg_BeamID], xE, yE)
            • Custom script: call SetUnitFacing(udg_BeamCaster[udg_BeamID], angle * bj_RADTODEG)
        • Custom script: call SetUnitFacing(udg_BeamCaster[udg_BeamID], angle * bj_RADTODEG)
        • Custom script: if udg_BeamLightning[udg_BeamID] != null then
        • Custom script: call MoveLightningEx(udg_BeamLightning[udg_BeamID], true, GetUnitX(udg_BeamCaster[udg_BeamID]), GetUnitY(udg_BeamCaster[udg_BeamID]), z1, GetUnitX(udg_BeamMover[udg_BeamID]), GetUnitY(udg_BeamMover[udg_BeamID]), z2)
        • Custom script: endif
        • -------- // END SWEEP BEAM --------
        • -------- [_______________________________________] --------
        • -------- --------
        • -------- --------
        • -------- --------
        • -------- ________________________________________ --------
        • -------- | | --------
        • -------- * * * * REACQUIRE TARGETING --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Beam_ReacquireTarget[BeamID] Equal to True
          • Then - Actions
            • Set Beam_ReacquireTarget[BeamID] = False
            • Custom script: call GroupEnumUnitsInRange(udg_Beam_group1, xA, yA, udg_BeamConfig_Range[udg_BeamID], null)
            • Custom script: call GroupEnumUnitsInRange(udg_Beam_group2, xD, yD, udg_BeamConfig_SweepAOE[udg_BeamID], null)
            • -------- -------- -------- -------- -------- --------
            • Custom script: loop
            • Custom script: set udg_BeamerPick = FirstOfGroup(udg_Beam_group1)
            • Custom script: exitwhen udg_BeamerPick == null
            • Custom script: if IsUnitInGroup(udg_BeamerPick,udg_Beam_group2) then
            • Custom script: call GroupAddUnit(udg_Beam_group3,udg_BeamerPick)
            • Custom script: endif
            • Custom script: call GroupRemoveUnit(udg_Beam_group1, udg_BeamerPick)
            • Custom script: endloop
            • -------- -------- -------- -------- -------- --------
            • Custom script: if FirstOfGroup(udg_Beam_group3) == null then
            • Custom script: set udg_Beam_TerminateBeam[udg_BeamID] = true
            • Custom script: else
            • Custom script: set retarget = true
            • Custom script: endif
            • -------- -------- -------- -------- -------- --------
            • Custom script: if retarget then
            • Custom script: loop
            • Custom script: set udg_BeamerPick = FirstOfGroup(udg_Beam_group3)
            • Custom script: exitwhen udg_BeamerPick == null
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (BeamerPick is alive) Equal to True
                • (BeamerPick belongs to an enemy of BeamOwner[BeamID]) Equal to True
                • (BeamerPick has buff Invulnerable) Equal to False
                • (Level of Invulnerable (Neutral) for BeamerPick) Less than or equal to 0
                • Or - Any (Conditions) are true
                  • Conditions
                    • Beam_CannotHitMagicImmune[BeamID] Equal to False
                    • And - All (Conditions) are true
                      • Conditions
                        • Beam_CannotHitMagicImmune[BeamID] Equal to True
                        • (BeamerPick is Magic Immune) Equal to False
              • Then - Actions
                • Set BeamEvent_Target_OLD = BeamTarget[BeamID]
                • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
                • Set BeamTarget[BeamID] = BeamerPick
                • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
                • Set BeamEvent_Source = Beamer
                • Set BeamEvent_Target = BeamTarget[BeamID]
                • Set BeamEvent_Caster = BeamCaster[BeamID]
                • Set BeamEvent_Mover = BeamMover[BeamID]
                • Set BeamEvent_Damage = Beam_Damage[BeamID]
                • Custom script: if udg_BeamLightning[udg_BeamID] != null then
                • Custom script: set udg_BeamEvent_Lightning = udg_BeamLightning[udg_BeamID]
                • Custom script: endif
                • Set BeamEvent = 3.00
                • Set BeamEvent = 0.00
                • Set BeamEvent_Source = No unit
                • Set BeamEvent_Target = No unit
                • Set BeamEvent_Caster = No unit
                • Set BeamEvent_Mover = No unit
                • Set BeamEvent_Damage = 0.00
                • Set BeamEvent_Target_OLD = No unit
                • Custom script: if udg_BeamEvent_Lightning != null then
                • Custom script: set udg_BeamEvent_Lightning = null
                • Custom script: endif
                • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
                • Custom script: call GroupClear(udg_Beam_group3)
                • Custom script: set hastarget = true
              • Else - Actions
                • Custom script: call GroupRemoveUnit(udg_Beam_group3, udg_BeamerPick)
            • Custom script: endloop
            • Custom script: set retarget = false
            • -------- -------- --------
            • Custom script: if hastarget then
            • Custom script: set hastarget = false
            • Custom script: else
            • Custom script: set udg_Beam_TerminateBeam[udg_BeamID] = true
            • Custom script: if udg_Beam_RestoreLastOrder[udg_BeamID] and udg_Beam_IsFollowing[udg_BeamID] then
            • Custom script: call IssueTargetOrderById(udg_Beamer, udg_Beam_LastOrder[udg_BeamID], udg_Beam_OrderWidget[udg_BeamID])
            • Custom script: endif
            • Custom script: endif
            • Custom script: endif
          • Else - Actions
        • -------- // END REACQUIRE TARGETING --------
        • -------- [_______________________________________] --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Beam_IsChargingDone[BeamID] Equal to False
          • Then - Actions
            • -------- ________________________________________ --------
            • -------- | | --------
            • -------- * * * * CHARGE-UP PHASE --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Beam_IntervalFX[BeamID] Greater than or equal to BeamConfig_IntervalFXLimit[BeamID]
              • Then - Actions
                • Special Effect - Create a special effect attached to the origin of BeamCaster[BeamID] using BeamConfig_ChargeUpFX[BeamID]
                • Special Effect - Destroy (Last created special effect)
                • Set Beam_IntervalFX[BeamID] = 0
              • Else - Actions
            • Set Beam_Interval[BeamID] = (Beam_Interval[BeamID] + 1)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Beam_Interval[BeamID] Greater than or equal to BeamConfig_ChargeLimit[BeamID]
              • Then - Actions
                • Set Beam_Interval[BeamID] = 0
                • Set Beam_IsChargingDone[BeamID] = True
                • Unit - Add BeamConfig_AbilityCasterFX[BeamID] to BeamCaster[BeamID]
                • Unit - Add BeamConfig_AbilityMoverFX[BeamID] to BeamMover[BeamID]
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • BeamConfig_BeamType[BeamID] Not equal to <Empty String>
                  • Then - Actions
                    • Custom script: set udg_BeamLightning[udg_BeamID] = AddLightningEx(udg_BeamConfig_BeamType[udg_BeamID], true, GetUnitX(udg_BeamCaster[udg_BeamID]), GetUnitY(udg_BeamCaster[udg_BeamID]), z1, GetUnitX(udg_BeamMover[udg_BeamID]), GetUnitY(udg_BeamMover[udg_BeamID]), z2)
                    • Lightning - Change color of BeamLightning[BeamID] to (BeamConfig_RED[BeamID] BeamConfig_GREEN[BeamID] BeamConfig_BLUE[BeamID]) with BeamConfig_APLHA[BeamID] alpha
                  • Else - Actions
                • Set Beam_Damage[BeamID] = ((Beam_DamageStack[BeamID] / (Real(Beam_HitStack[BeamID]))) / (Real(BeamConfig_HitsPerSecond[BeamID])))
                • Set Beam_HitStack[BeamID] = 0
                • Set Beam_DamageStack[BeamID] = 0.00
                • Set Beam_IntervalDPS[BeamID] = 0
                • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
                • Set BeamEvent_Source = Beamer
                • Set BeamEvent_Target = BeamTarget[BeamID]
                • Set BeamEvent_Caster = BeamCaster[BeamID]
                • Set BeamEvent_Mover = BeamMover[BeamID]
                • Set BeamEvent_Damage = Beam_Damage[BeamID]
                • Custom script: if udg_BeamLightning[udg_BeamID] != null then
                • Custom script: set udg_BeamEvent_Lightning = udg_BeamLightning[udg_BeamID]
                • Custom script: endif
                • Set BeamEvent = 2.00
              • Else - Actions
                • Set BeamEvent_Source = Beamer
                • Set BeamEvent_Target = BeamTarget[BeamID]
                • Set BeamEvent_Caster = BeamCaster[BeamID]
                • Set BeamEvent_Mover = BeamMover[BeamID]
                • Set BeamEvent_Damage = Beam_Damage[BeamID]
                • Custom script: if udg_BeamLightning[udg_BeamID] != null then
                • Custom script: set udg_BeamEvent_Lightning = udg_BeamLightning[udg_BeamID]
                • Custom script: endif
                • Set BeamEvent = 1.50
            • Set BeamEvent = 0.00
            • Set BeamEvent_Source = No unit
            • Set BeamEvent_Target = No unit
            • Set BeamEvent_Caster = No unit
            • Set BeamEvent_Mover = No unit
            • Set BeamEvent_Damage = 0.00
            • Custom script: if udg_BeamEvent_Lightning != null then
            • Custom script: set udg_BeamEvent_Lightning = null
            • Custom script: endif
            • -------- // END CHARGE-UP --------
            • -------- [_______________________________________] --------
          • Else - Actions
            • -------- ________________________________________ --------
            • -------- | | --------
            • -------- * * * * DAMAGE PHASE --------
            • Set Beam_IntervalDPS[BeamID] = (Beam_IntervalDPS[BeamID] + 1)
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • -------- Calculate average damage --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Beam_IntervalDPS[BeamID] Greater than or equal to 99
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Beam_DamageStack[BeamID] Greater than 0.00
                  • Then - Actions
                    • Set Beam_Damage[BeamID] = ((Beam_DamageStack[BeamID] / (Real(Beam_HitStack[BeamID]))) / (Real(BeamConfig_HitsPerSecond[BeamID])))
                    • Set Beam_LastDamage[BeamID] = Beam_Damage[BeamID]
                    • Set Beam_HitStack[BeamID] = 0
                    • Set Beam_DamageStack[BeamID] = 0.00
                  • Else - Actions
                    • Set Beam_Damage[BeamID] = Beam_LastDamage[BeamID]
                    • Custom script: set xA = GetUnitX(udg_Beamer)
                    • Custom script: set yA = GetUnitY(udg_Beamer)
                    • Custom script: set xB = GetUnitX(udg_BeamTarget[udg_BeamID])
                    • Custom script: set yB = GetUnitY(udg_BeamTarget[udg_BeamID])
                    • Custom script: set dx = xB-xA
                    • Custom script: set dy = yB-yA
                    • Custom script: set distance = SquareRoot(dx*dx+dy*dy)
                    • Custom script: if udg_Beam_IsFollowing[udg_BeamID] and leash < udg_BeamConfig_FollowRange[udg_BeamID] then
                    • Custom script: if GetUnitCurrentOrder(udg_Beamer) == 851972 or GetUnitCurrentOrder(udg_Beamer) == 851990 or GetUnitCurrentOrder(udg_Beamer) == 851986 or GetUnitCurrentOrder(udg_Beamer) == 851971 then
                    • Custom script: call IssueTargetOrderById(udg_Beamer, 851983, udg_BeamTarget[udg_BeamID])
                    • Custom script: endif
                    • Custom script: endif
                    • Custom script: if not udg_Beam_IsFollowing[udg_BeamID] and distance < udg_BeamConfig_Range[udg_BeamID] and (udg_Beam_X[udg_BeamID] == udg_Beam_X_Moved[udg_BeamID] or udg_Beam_Y[udg_BeamID] == udg_Beam_Y_Moved[udg_BeamID]) then
                    • Custom script: call IssueTargetOrderById(udg_Beamer, 851983, udg_BeamTarget[udg_BeamID])
                    • Custom script: endif
                • Set Beam_IntervalDPS[BeamID] = 0
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • Set Beam_IntervalDMG[BeamID] = (Beam_IntervalDMG[BeamID] + 1)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Beam_IntervalDMG[BeamID] Greater than or equal to Beam_IntervalDMGTrigger[BeamID]
              • Then - Actions
                • Set Beam_IntervalDMG[BeamID] = 0
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • BeamConfig_DamageAOE[BeamID] Greater than 0.00
                  • Then - Actions
                    • Custom script: set xC = GetUnitX(udg_BeamMover[udg_BeamID])
                    • Custom script: set yC = GetUnitY(udg_BeamMover[udg_BeamID])
                    • Custom script: set xD = GetUnitX(udg_BeamTarget[udg_BeamID])
                    • Custom script: set yD = GetUnitY(udg_BeamTarget[udg_BeamID])
                    • Custom script: set dx = xD-xC
                    • Custom script: set dy = yD-yC
                    • Custom script: set reach = SquareRoot(dx*dx+dy*dy)
                    • -------- -------- -------- -------- -------- --------
                    • Custom script: if (reach <= udg_BeamConfig_DamageAOE[udg_BeamID]) and (IsUnitAlly(udg_BeamTarget[udg_BeamID], udg_BeamOwner[udg_BeamID])) then
                    • Set NextDamageType = BeamConfig_DamageType[BeamID]
                    • Unit - Cause Beamer to damage BeamTarget[BeamID], dealing Beam_Damage[BeamID] damage of attack type BeamConfig_AttackType[BeamID] and damage type Universal
                    • Trigger - Run ClearDamageEvent (checking conditions)
                    • Custom script: endif
                    • -------- -------- -------- -------- -------- --------
                    • Custom script: call GroupEnumUnitsInRange(udg_Beam_group1, xC, yC, udg_BeamConfig_DamageAOE[udg_BeamID], null)
                    • Custom script: loop
                    • Custom script: set udg_BeamerPick = FirstOfGroup(udg_Beam_group1)
                    • Custom script: exitwhen udg_BeamerPick == null
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (BeamerPick is alive) Equal to True
                        • (BeamerPick belongs to an enemy of BeamOwner[BeamID]) Equal to True
                        • (BeamerPick has buff Invulnerable) Equal to False
                        • (Level of Invulnerable (Neutral) for BeamerPick) Less than or equal to 0
                      • Then - Actions
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • BeamConfig_HitAll[BeamID] Equal to True
                          • Then - Actions
                            • Set NextDamageType = BeamConfig_DamageType[BeamID]
                            • Unit - Cause Beamer to damage BeamerPick, dealing Beam_Damage[BeamID] damage of attack type BeamConfig_AttackType[BeamID] and damage type Universal
                            • Trigger - Run ClearDamageEvent (checking conditions)
                          • Else - Actions
                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • Or - Any (Conditions) are true
                                  • Conditions
                                    • (BeamerPick is A ground unit) Equal to True
                                    • (BeamerPick is A structure) Equal to True
                                • Or - Any (Conditions) are true
                                  • Conditions
                                    • (BeamTarget[BeamID] is A ground unit) Equal to True
                                    • (BeamTarget[BeamID] is A structure) Equal to True
                              • Then - Actions
                                • Set NextDamageType = BeamConfig_DamageType[BeamID]
                                • Unit - Cause Beamer to damage BeamerPick, dealing Beam_Damage[BeamID] damage of attack type BeamConfig_AttackType[BeamID] and damage type Universal
                                • Trigger - Run ClearDamageEvent (checking conditions)
                              • Else - Actions
                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  • If - Conditions
                                    • (BeamerPick is A flying unit) Equal to True
                                    • (BeamTarget[BeamID] is A flying unit) Equal to True
                                  • Then - Actions
                                    • Set NextDamageType = BeamConfig_DamageType[BeamID]
                                    • Unit - Cause Beamer to damage BeamerPick, dealing Beam_Damage[BeamID] damage of attack type BeamConfig_AttackType[BeamID] and damage type Universal
                                    • Trigger - Run ClearDamageEvent (checking conditions)
                                  • Else - Actions
                      • Else - Actions
                    • Custom script: call GroupRemoveUnit(udg_Beam_group1, udg_BeamerPick)
                    • Custom script: endloop
                    • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • BeamConfig_SweepSpeed[BeamID] Greater than 0.00
                      • Then - Actions
                        • Custom script: set xC = GetUnitX(udg_BeamMover[udg_BeamID])
                        • Custom script: set yC = GetUnitY(udg_BeamMover[udg_BeamID])
                        • Custom script: set xD = GetUnitX(udg_BeamTarget[udg_BeamID])
                        • Custom script: set yD = GetUnitY(udg_BeamTarget[udg_BeamID])
                        • Custom script: set dx = xD-xC
                        • Custom script: set dy = yD-yC
                        • Custom script: set reach = SquareRoot(dx*dx+dy*dy)
                        • -------- -------- -------- -------- -------- --------
                        • Custom script: if reach <= 20 then
                        • Set NextDamageType = BeamConfig_DamageType[BeamID]
                        • Unit - Cause Beamer to damage BeamTarget[BeamID], dealing Beam_Damage[BeamID] damage of attack type BeamConfig_AttackType[BeamID] and damage type Universal
                        • Trigger - Run ClearDamageEvent (checking conditions)
                        • Custom script: endif
                        • -------- -------- -------- -------- -------- --------
                      • Else - Actions
                        • Set NextDamageType = BeamConfig_DamageType[BeamID]
                        • Unit - Cause Beamer to damage BeamTarget[BeamID], dealing Beam_Damage[BeamID] damage of attack type BeamConfig_AttackType[BeamID] and damage type Universal
                        • Trigger - Run ClearDamageEvent (checking conditions)
              • Else - Actions
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • Set BeamEvent_Source = Beamer
            • Set BeamEvent_Target = BeamTarget[BeamID]
            • Set BeamEvent_Caster = BeamCaster[BeamID]
            • Set BeamEvent_Mover = BeamMover[BeamID]
            • Set BeamEvent_Damage = Beam_Damage[BeamID]
            • Custom script: if udg_BeamLightning[udg_BeamID] != null then
            • Custom script: set udg_BeamEvent_Lightning = udg_BeamLightning[udg_BeamID]
            • Custom script: endif
            • Set BeamEvent = 2.50
            • Set BeamEvent = 0.00
            • Set BeamEvent_Source = No unit
            • Set BeamEvent_Target = No unit
            • Set BeamEvent_Caster = No unit
            • Set BeamEvent_Mover = No unit
            • Set BeamEvent_Damage = 0.00
            • Custom script: if udg_BeamEvent_Lightning != null then
            • Custom script: set udg_BeamEvent_Lightning = null
            • Custom script: endif
            • -------- // END DAMAGE --------
            • -------- [_______________________________________] --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Beam_IntervalFX[BeamID] Greater than or equal to BeamConfig_IntervalFXLimit[BeamID]
              • Then - Actions
                • -------- ________________________________________ --------
                • -------- | | --------
                • -------- * * * * SPECIAL EFFECTS --------
                • Special Effect - Create a special effect attached to the origin of BeamCaster[BeamID] using BeamConfig_CasterPeriodicFX[BeamID]
                • Special Effect - Destroy (Last created special effect)
                • Special Effect - Create a special effect attached to the origin of BeamMover[BeamID] using BeamConfig_ImpactPeriodicFX[BeamID]
                • Special Effect - Destroy (Last created special effect)
                • Set Beam_IntervalFX[BeamID] = 0
                • -------- // END SPECIAL EFFECTS --------
                • -------- [_______________________________________] --------
              • Else - Actions
        • -------- Store X/Y of Beamer to see if the Beamer has moved and thus is motion. This compared to udg_Beam_X/Y at the top of the trigger --------
        • Custom script: set udg_Beam_X_Moved[udg_BeamID] = GetUnitX(udg_Beamer)
        • Custom script: set udg_Beam_Y_Moved[udg_BeamID] = GetUnitY(udg_Beamer)
        • -------- ======================================================================== --------
        • -------- ======================================================================== --------
        • -------- if TERMINATE BEAM = TRUE --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Beam_TerminateBeam[BeamID] Equal to True
          • Then - Actions
            • Set BeamEvent_Source = Beamer
            • Set BeamEvent_Target = BeamTarget[BeamID]
            • Set BeamEvent_Caster = BeamCaster[BeamID]
            • Set BeamEvent_Mover = BeamMover[BeamID]
            • Set BeamEvent_Damage = Beam_Damage[BeamID]
            • Custom script: if udg_BeamLightning[udg_BeamID] != null then
            • Custom script: set udg_BeamEvent_Lightning = udg_BeamLightning[udg_BeamID]
            • Custom script: endif
            • Set BeamEvent = 4.00
            • Set BeamEvent = 0.00
            • Set BeamEvent_Source = No unit
            • Set BeamEvent_Target = No unit
            • Set BeamEvent_Caster = No unit
            • Set BeamEvent_Mover = No unit
            • Set BeamEvent_Damage = 0.00
            • Custom script: if udg_BeamEvent_Lightning != null then
            • Custom script: set udg_BeamEvent_Lightning = null
            • Custom script: endif
            • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
            • Set Beam_CannotHitMagicImmune[BeamID] = False
            • Set Beam_Damage[BeamID] = 0.00
            • Set Beam_Interval[BeamID] = 0
            • Set Beam_IntervalDMG[BeamID] = 0
            • Set Beam_IntervalDPS[BeamID] = 0
            • Set Beam_IntervalFX[BeamID] = 0
            • Set Beam_HitStack[BeamID] = 0
            • Set Beam_DamageStack[BeamID] = 0.00
            • Unit - Unpause BeamCaster[BeamID]
            • Unit - Unpause BeamMover[BeamID]
            • Unit - Add a 0.01 second Generic expiration timer to BeamCaster[BeamID]
            • Unit - Add a 0.01 second Generic expiration timer to BeamMover[BeamID]
            • Custom script: if udg_BeamLightning[udg_BeamID] != null then
            • Custom script: call DestroyLightning(udg_BeamLightning[udg_BeamID])
            • Custom script: set udg_BeamLightning[udg_BeamID] = null
            • Custom script: endif
            • Set Beam_IsChargingDone[BeamID] = False
            • Set Beam_TerminateBeam[BeamID] = False
            • Set BeamSource[BeamID] = No unit
            • Set BeamTarget[BeamID] = No unit
            • Set BeamCaster[BeamID] = No unit
            • Set BeamMover[BeamID] = No unit
            • Set BeamStop[BeamID] = True
          • Else - Actions
        • Set BeamerPick = No unit
        • Custom script: call GroupAddUnit(udg_Beam_group4,udg_Beamer)
        • Custom script: endloop
        • -------- --------
        • -------- Beamer is added to udg_Beam_group4 in the above loop and if BeamStop[BeamID] is FALSE, add Beamer back into Beam_MainGroup in the loop below --------
        • Custom script: loop
        • Custom script: set u = FirstOfGroup(udg_Beam_group4)
        • Custom script: exitwhen u == null
        • Custom script: set ID = GetUnitUserData(u)
        • Custom script: if udg_BeamStop[ID] then
        • Custom script: set udg_BeamStop[ID] = false
        • Custom script: else
        • Custom script: call GroupAddUnit(udg_Beam_MainGroup, u)
        • Custom script: endif
        • Custom script: call GroupRemoveUnit(udg_Beam_group4, u)
        • Custom script: endloop
        • -------- --------
        • Custom script: endif
  • =Persistent Beam Cancel A
    • Persistent Beam Cancel A
      • Events
        • Unit - A unit Is issued an order targeting a point
        • Unit - A unit Is issued an order with no target
      • Conditions
        • ((Triggering unit) is in Beam_MainGroup) Equal to True
      • Actions
        • Custom script: local real xA
        • Custom script: local real yA
        • Custom script: local real xB
        • Custom script: local real yB
        • Custom script: local real xC
        • Custom script: local real yC
        • Custom script: local real dx
        • Custom script: local real dy
        • Custom script: local real range
        • Set BeamID = (Custom value of (Triggering unit))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • (Issued order) Equal to (Order(smart))
                • (Issued order) Equal to (Order(stop))
                • (Issued order) Equal to (Order(move))
                • (Issued order) Equal to (Order(patrol))
                • (Issued order) Equal to (Order(attack))
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Issued order) Equal to (Order(attack))
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (BeamTarget[BeamID] belongs to an ally of (Owner of (Triggering unit))) Equal to True
                  • Then - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • BeamConfig_SweepAOE[BeamID] Greater than 0.00
                      • Then - Actions
                        • Set Beam_ReacquireTarget[BeamID] = True
                      • Else - Actions
                        • Set Beam_TerminateBeam[BeamID] = True
                  • Else - Actions
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Or - Any (Conditions) are true
                      • Conditions
                        • (Issued order) Equal to (Order(stop))
                        • BeamConfig_IsImmobilised[BeamID] Equal to True
                  • Then - Actions
                    • Set Beam_TerminateBeam[BeamID] = True
                  • Else - Actions
          • Else - Actions
  • Persistent Beam Cancel B
    • Persistent Persistent Beam Cancel B
      • Events
        • Unit - A unit Is issued an order targeting an object
      • Conditions
        • ((Triggering unit) is in Beam_MainGroup) Equal to True
      • Actions
        • Custom script: local real xA
        • Custom script: local real yA
        • Custom script: local real xB
        • Custom script: local real yB
        • Custom script: local real xC
        • Custom script: local real yC
        • Custom script: local real dx
        • Custom script: local real dy
        • Custom script: local real range
        • Custom script: local real distance
        • Custom script: local unit u = GetOrderTargetUnit()
        • Set BeamID = (Custom value of (Triggering unit))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • (Issued order) Equal to (Order(smart))
                • (Issued order) Equal to (Order(attack))
                • (Issued order) Equal to (Order(patrol))
                • (Issued order) Equal to (Order(move))
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Target unit of issued order) belongs to an ally of (Owner of (Triggering unit))) Equal to True
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Or - Any (Conditions) are true
                      • Conditions
                        • (Issued order) Equal to (Order(smart))
                        • (Issued order) Equal to (Order(patrol))
                        • (Issued order) Equal to (Order(move))
                  • Then - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • BeamConfig_IsImmobilised[BeamID] Equal to True
                      • Then - Actions
                        • Set Beam_TerminateBeam[BeamID] = True
                      • Else - Actions
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Target unit of issued order) Not equal to BeamTarget[BeamID]
                      • Then - Actions
                        • Custom script: set xA = GetUnitX(GetTriggerUnit())
                        • Custom script: set yA = GetUnitY(GetTriggerUnit())
                        • Custom script: set xB = GetUnitX(u)
                        • Custom script: set yB = GetUnitY(u)
                        • Custom script: set dx = xB-xA
                        • Custom script: set dy = yB-yA
                        • Custom script: set range = SquareRoot(dx*dx+dy*dy)
                        • Custom script: if range > udg_BeamConfig_Range[udg_BeamID] then
                        • Custom script: set udg_Beam_TerminateBeam[udg_BeamID] = true
                        • Custom script: else
                        • Custom script: set xC = GetUnitX(udg_BeamMover[udg_BeamID])
                        • Custom script: set yC = GetUnitY(udg_BeamMover[udg_BeamID])
                        • Custom script: set dx = xC-xB
                        • Custom script: set dy = yC-yB
                        • Custom script: set distance = SquareRoot(dx*dx+dy*dy)
                        • Custom script: if distance > udg_BeamConfig_SweepAOE[udg_BeamID] then
                        • Custom script: set udg_Beam_TerminateBeam[udg_BeamID] = true
                        • Custom script: else
                        • Custom script: set udg_BeamTarget[udg_BeamID] = u
                        • Custom script: endif
                        • Custom script: endif
                      • Else - Actions
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Or - Any (Conditions) are true
                      • Conditions
                        • (Issued order) Equal to (Order(smart))
                        • (Issued order) Equal to (Order(attack))
                  • Then - Actions
                    • Custom script: set xA = GetUnitX(GetTriggerUnit())
                    • Custom script: set yA = GetUnitY(GetTriggerUnit())
                    • Custom script: set xB = GetUnitX(u)
                    • Custom script: set yB = GetUnitY(u)
                    • Custom script: set dx = xB-xA
                    • Custom script: set dy = yB-yA
                    • Custom script: set range = SquareRoot(dx*dx+dy*dy)
                    • Custom script: if range > udg_BeamConfig_Range[udg_BeamID] then
                    • Custom script: set udg_Beam_TerminateBeam[udg_BeamID] = true
                    • Custom script: else
                    • Custom script: set xC = GetUnitX(udg_BeamMover[udg_BeamID])
                    • Custom script: set yC = GetUnitY(udg_BeamMover[udg_BeamID])
                    • Custom script: set dx = xC-xB
                    • Custom script: set dy = yC-yB
                    • Custom script: set distance = SquareRoot(dx*dx+dy*dy)
                    • Custom script: if distance > udg_BeamConfig_SweepAOE[udg_BeamID] then
                    • Custom script: set udg_Beam_TerminateBeam[udg_BeamID] = true
                    • Custom script: else
                    • Custom script: set udg_BeamTarget[udg_BeamID] = u
                    • Custom script: endif
                    • Custom script: endif
                  • Else - Actions
          • Else - Actions
        • Custom script: set u = null
  • Persistent Beam LastOrder A
    • Persistent Beam LastOrder A
      • Events
        • Unit - A unit Is issued an order targeting a point
        • Unit - A unit Is issued an order with no target
      • Conditions
        • Beam_IsABeamer[(Custom value of (Triggering unit))] Equal to True
      • Actions
        • Custom script: local integer ID = GetUnitUserData(GetTriggerUnit())
        • Custom script: if GetIssuedOrderId() == 851990 or GetIssuedOrderId() == 851983 then
        • Custom script: set udg_Beam_IsFollowing[ID] = false
        • Custom script: set udg_Beam_X[ID] = GetOrderPointX()
        • Custom script: set udg_Beam_Y[ID] = GetOrderPointY()
        • Custom script: set udg_Beam_LastOrder[ID] = GetIssuedOrderId()
        • Custom script: if not udg_Beam_RestoreLastOrder[ID] then
        • Custom script: set udg_Beam_RestoreLastOrder[ID] = true
        • Custom script: endif
        • Custom script: else
        • Custom script: if udg_Beam_IsFollowing[ID] then
        • Custom script: set udg_Beam_IsFollowing[ID] = false
        • Custom script: set udg_Beam_LastOrder[ID] = 0
        • Custom script: set udg_Beam_OrderWidget[ID] = null
        • Custom script: endif
        • Custom script: if udg_Beam_RestoreLastOrder[ID] then
        • Custom script: set udg_Beam_RestoreLastOrder[ID] = false
        • Custom script: endif
        • Custom script: endif
  • Persistent Beam LastOrder B
    • Persistent Beam LastOrder B
      • Events
        • Unit - A unit Is issued an order targeting an object
      • Conditions
        • Beam_IsABeamer[(Custom value of (Triggering unit))] Equal to True
      • Actions
        • Custom script: local integer ID = GetUnitUserData(GetTriggerUnit())
        • Custom script: local integer OrderCheck = GetIssuedOrderId()
        • Custom script: if IsUnitAlly(GetOrderTargetUnit(), GetOwningPlayer(udg_UDexUnits[ID])) and (OrderCheck == 851990 or GetIssuedOrderId() == 851986 or OrderCheck == 851971) then
        • Custom script: set udg_Beam_IsFollowing[ID] = true
        • Custom script: set udg_Beam_LastOrder[ID] = GetIssuedOrderId()
        • Custom script: set udg_Beam_OrderWidget[ID] = GetOrderTargetUnit()
        • Custom script: if not udg_Beam_RestoreLastOrder[ID] then
        • Custom script: set udg_Beam_RestoreLastOrder[ID] = true
        • Custom script: endif
        • Custom script: else
        • Custom script: set udg_Beam_IsFollowing[ID] = false
        • Custom script: set udg_Beam_LastOrder[ID] = 0
        • Custom script: set udg_Beam_OrderWidget[ID] = null
        • Custom script: if udg_Beam_RestoreLastOrder[ID] then
        • Custom script: set udg_Beam_RestoreLastOrder[ID] = false
        • Custom script: endif
        • Custom script: endif
  • Persistent Beam Ability Exceptions
    • Persistent Beam Ability Exceptions
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • ((Triggering unit) is in Beam_MainGroup) Equal to True
      • Actions
        • Set BeamIDAbility = (Custom value of (Triggering unit))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • (Ability being cast) Equal to Wind Walk
                • (Ability being cast) Equal to Wind Walk (Neutral Hostile)
                • (Ability being cast) Equal to Immolation
                • (Ability being cast) Equal to Immolation (Neutral Hostile)
                • (Ability being cast) Equal to Mana Shield
                • (Ability being cast) Equal to Mana Shield (Neutral Hostile)
                • (Ability being cast) Equal to Chemical Rage
                • (Ability being cast) Equal to Berserk
                • (Ability being cast) Equal to Divine Shield (Neutral Hostile)
                • (Ability being cast) Equal to Divine Shield
                • (Ability being cast) Equal to Avatar
                • (Ability being cast) Equal to Avatar (Neutral)
                • And - All (Conditions) are true
                  • Conditions
                    • BeamConfig_IsImmobilised[BeamIDAbility] Equal to False
                    • Or - Any (Conditions) are true
                      • Conditions
                        • (Ability being cast) Equal to War Stomp (Neutral Hostile 1)
                        • (Ability being cast) Equal to Flame Strike
                        • (Ability being cast) Equal to Phoenix
                        • (Ability being cast) Equal to Banish
                • And - All (Conditions) are true
                  • Conditions
                    • BeamConfig_IsImmobilised[BeamIDAbility] Equal to True
                    • Or - Any (Conditions) are true
                      • Conditions
                        • (Ability being cast) Equal to Summon Water Elemental
                        • (Ability being cast) Equal to Shockwave (Neutral Hostile)
          • Then - Actions
          • Else - Actions
            • Set Beam_TerminateBeam[BeamIDAbility] = True


Keywords:
Beam, Persistent, Starcraft, Channelling, Channel. Lightning, Drain, Void Ray
Contents

Beam Auto-Attack System v3.2 (Map)

Reviews
Moderator
11:52, 6th Oct 2015 Bribe: Absolutely flawless from the tests that I've done with this cool resource. This system has really come a long way since you started with it. The code is very efficient. I can run this on my netbook (the worst PC pretty much...
  1. 11:52, 6th Oct 2015
    Bribe: Absolutely flawless from the tests that I've done with this cool resource. This system has really come a long way since you started with it. The code is very efficient. I can run this on my netbook (the worst PC pretty much anyone could have) without lag which means that others will not have issues, themselves. An easy 5/5, perhaps even Director's Cut if another moderator agrees. Great work! I hope to see more from you.
     
  2. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,575
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    Ugh.. that HAS to be inefficient.
    You re-store variables on cast, that is never a good thing.

    Also don't kill a unit, add a 0.01 expiration timer.

    I also suggest doing this as it saves quite a lot of lines.
    • Custom script: local unit udg_beamer = GetEnumUnit()
    • Custom script: local integer udg_BeamId = GetUnitUserData(udg_beamer)
    • Custom script: local real x1 = GetUnitX(udg_BeamCaster[udg_BeamID])
    • Custom script: local real y1= GetUnitY(udg_BeamCaster[udg_BeamID])
    • Custom script: local real z1= GetUnitFlyHeight(udg_BeamCaster[udg_BeamID])
    • Custom script: local real x2 = GetUnitX(udg_BeamMover[udg_BeamID])
    • Custom script: local real y2 = GetUnitY(udg_BeamMover[udg_BeamID])
    • Custom script: local real z2= GetUnitFlyHeight(udg_BeamMover[udg_BeamID])
    • Custom script: local real z3 = GetUnitFlyHeight(udg_BeamTarget[udg_BeamID]) + 60
     
  3. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    I guess I can have a separate trigger to setup all the units when they get indexed? Also those lines of locals don't work.
     
  4. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,575
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    It should be possible to have settings per unit type or whatever at an init trigger.

    And the locals do indeed work, I can go and compile that code right now.

    edit:
    • Custom script: local real x1
    • Custom script: local real y1
    • Custom script: local real z1
    • Custom script: local real x2
    • Custom script: local real y2
    • Custom script: local real z2
    • Custom script: local real z3
    • Custom script: local real zInc
    • Set Beamer = (Picked unit)
    • Set BeamID = (Custom value of Beamer)
    • -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
    • Custom script: set x1 = GetUnitX(udg_BeamCaster[udg_BeamID])
    • Custom script: set y1 = GetUnitY(udg_BeamCaster[udg_BeamID])
    • Custom script: set z1 = GetUnitFlyHeight(udg_BeamCaster[udg_BeamID])
    • Custom script: set x2 = GetUnitX(udg_BeamMover[udg_BeamID])
    • Custom script: set y2 = GetUnitY(udg_BeamMover[udg_BeamID])
    • Custom script: set z2 = GetUnitFlyHeight(udg_BeamMover[udg_BeamID])
    • Custom script: set z3 = GetUnitFlyHeight(udg_BeamTarget[udg_BeamID]) + 60


    I do not see what prevents you from doing what I said earlier.
     
  5. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    It doesn't give me any errors but nothing happens when I do this and setup the values of the locals on the same line.

    • Custom script: local unit udg_beamer = GetEnumUnit()
    • Custom script: local integer udg_BeamId = GetUnitUserData(udg_beamer)


    I don't think the index is being stored in udg_BeamID
     
  6. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,575
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    Put a message and display the BeamId variable?
     
  7. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    That is really strange. It's detecting the index and the unit, but nothing besides that is happening.

    EDIT: okay I have no idea why it's behaving that way. It's like it's not ticking every .03 seconds. I had to set the locals to something else (u and ID) and then convert them to the globals after they were all setup and then it worked. Didn't save as many lines as you wanted, but it's something :p

    EDIT2: updated to v1.4 v1.5 v1.6
     
    Last edited: Sep 28, 2015
  8. ZiBitheWand3r3r

    ZiBitheWand3r3r

    Joined:
    Nov 21, 2012
    Messages:
    896
    Resources:
    15
    Maps:
    7
    Spells:
    8
    Resources:
    15
    I must admit the effects in game are really awsome:]
     
  9. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    Thanks :) I tried to make it look as nice as I could :p
     
  10. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    UPDATE v1.7
    - Attack speed is now use to calculate a dps instead of being locked to a specific value. Units gaining a temporary boost in attack speed will deal more damage instead of dealing it faster.
    - You can now configure how many times you want the beam to strike within 1 second. The default is 3, but feel free to crank it up to 11 (literally) for a smoother health drain.

    UPDATE v1.8
    - Added CasterAngle[] to allow you to configure the angle of the offset so you can align it with the unit's weapon.
    - Lock-on beams will no longer strike a target at the center of the model. Instead the impact of the beam will appear to strike the surface of the model. This effect is not possible with non-locked-on beams.
     
    Last edited: Oct 5, 2015
  11. btdonald

    btdonald

    Joined:
    Dec 3, 2011
    Messages:
    349
    Resources:
    8
    Maps:
    1
    Spells:
    7
    Resources:
    8
    I think launch X,Y,Z would be better than CasterAngle ^^
     
  12. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    I'm awful at trig :p
     
  13. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,745
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    Great system. Good job :)
     
  14. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    UPDATE v2.0
    - Fixed an issue where stunning a Beamer would interfere with the dummy units carrying the beams.

    UPDATE v1.9
    - Removed all location variables and switched to x/y coordinates, which should improve performance.
    - ForGroups have been replaced with FirstOfGroup calls within loops to further improve performance.
    - You must now setup your dummy unit in the configuration trigger. This comes with the added advantage of being able to use dummies with different collisions as sometimes, depending on the unit, the center of the model will be offset by 16 units. Having a dummy with a collision of 16 will fix that.

    Danke :D

    Major thanks to Retera for helping me with all those calculation @_@
     
  15. NightSkyAurora

    NightSkyAurora

    Joined:
    Mar 1, 2013
    Messages:
    528
    Resources:
    8
    Models:
    4
    Spells:
    4
    Resources:
    8
    I took a wisp and attacked a peasant. The wisp kept attacking even after the peasant died. about 10 seconds later the lighting died but not the special effects. When that wisp attack again, it doesn't charge anymore.
     
  16. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    Did that happen in v2.1?

    EDIT: There seems to be an underlying problem with dummy destruction. I'll put v1.8 back up for download while I try to fix this issue.
     
    Last edited: Oct 11, 2015
  17. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    UPDATE v2.2
    - The problem I was having seems to have been solved with the integration of a LastOrder system that now allows Beamers to resume following a friendly unit, or attack-moved to a location.
    - follow range should now be set at configuration with BeamConfig_FollowRange[]. Default is 400. Hopefully this is the last config variable to be added.
    - Beamers with BeamConfig_IsImmobilised[] set to false can now fire on the move if they are following a friendly unit.

    In case v2.2 is still buggy, you can download Persistent Beam v1.8 here.
     
    Last edited: Oct 13, 2015
  18. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    UPDATE v2.3
    - Fixed an issue that caused beams to bug out if the average damage returned 0.
    - You may now fire on the move if IsImmobilised is set to false. Check the Wisp for an example of that.
    - Follow and attack-move should now work properly.
     
    Last edited: Oct 13, 2015
  19. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,916
    Resources:
    15
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    15
    UPDATE v2.4
    - Added a new feature where you can configure an 'auxiliary turret' in the setup trigger. This allows you to set the beam to fire from a moving dummy. Refer to the Owl Scout for an example.