Spell Light Dome

Ivach

New Member
Reaction score
18
Light Dome​
Channels immense light energy for 3 seconds, releasing it onto an area in the form of a dome. The dome damages all enemy units inside it and provides huge bonus armor and hp regeneration to friendly units. Friendly units can enter and exit the dome at will. Enemy units inside cannot leave, while the enemies outside may not enter. Lasts for 10 seconds.

Level 1 - 30 damage per second. 50 bonus armor and hp regeneration.
Level 2 - 45 damage per second. 70 bonus armor and hp regeneration.
Level 3 - 60 damage per second. 90 bonus armor and hp regeneration.

Information
GUI
Not MUI
Leakless (As far as I know)
Lagless​

Something that I decided to whip up after not making spells for about a few months. So the code is rather messy and unprofessional. Also, spell is not MUI.

Screenshots
P.S. Its much better to view the spell in game. The screenshots doesn't really do the spell any justice.​
lightdome2.png

lightdome1.png
Code
Trigger:
  • Initialisation
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Light Dome
    • Actions
      • Set LD_Cast = 0
      • Set LD_Duration = 0
      • Set LD_CastPoint = (Target point of ability being cast)
      • Set LD_Caster = (Triggering unit)
      • Countdown Timer - Start LD_CastTimer as a Repeating timer that will expire in 1.00 seconds

Trigger:
  • Cast Countdown
    • Events
      • Time - LD_CastTimer expires
    • Conditions
    • Actions
      • Set LD_Cast = (LD_Cast + 1)
      • Animation - Change LD_Caster's animation speed to 8.00% of its original speed
      • Special Effect - Create a special effect attached to the chest of LD_Caster using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • For each (Integer A) from 1 to 36, do (Actions)
        • Loop - Actions
          • Set LD_BeamPositions = (LD_CastPoint offset by 400.00 towards LD_CastEffectAngle degrees)
          • Special Effect - Create a special effect at LD_BeamPositions using Abilities\Weapons\ProcMissile\ProcMissile.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set LD_CastEffectAngle = (LD_CastEffectAngle + 10.00)
      • Custom script: call RemoveLocation (udg_LD_BeamPositions)

Trigger:
  • Spell Effects
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Light Dome
    • Actions
      • Set LD_OutsideGroup = (Units within 200000.00 of LD_CastPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of LD_Caster)) Equal to True))))
      • Unit Group - Pick every unit in LD_OutsideGroup and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to LD_OutDome
      • Custom script: call DestroyGroup (udg_LD_OutsideGroup)
      • Set LD_InsideGroup = (Units within 350.00 of LD_CastPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of LD_Caster)) Equal to True))))
      • Unit Group - Pick every unit in LD_InsideGroup and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to LD_InDome
      • Custom script: call DestroyGroup (udg_LD_InsideGroup)
      • Unit Group - Remove all units of LD_InDome from LD_OutDome
      • Set LD_CastEffectAngle = 0.00
      • Countdown Timer - Pause LD_CastTimer
      • Animation - Change LD_Caster's animation speed to 100.00% of its original speed
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LD_Cast Equal to 3
        • Then - Actions
          • Trigger - Turn on Beams <gen>
          • Countdown Timer - Start LD_Timer as a One-shot timer that will expire in 1.20 seconds
          • For each (Integer A) from 1 to 18, do (Actions)
            • Loop - Actions
              • Set LD_BeamPositions = (LD_CastPoint offset by 400.00 towards LD_CastEffectAngle degrees)
              • Unit - Create 1 Light Beam for (Owner of LD_Caster) at LD_BeamPositions facing Default building facing degrees
              • Unit - Add a 10.40 second Generic expiration timer to (Last created unit)
              • Unit Group - Add (Last created unit) to LD_Beams
              • Set LD_CastEffectAngle = (LD_CastEffectAngle + (360.00 / 18.00))
          • Custom script: call RemoveLocation (udg_LD_BeamPositions)
        • Else - Actions

Trigger:
  • Effect Cleanup
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Light Dome
    • Actions
      • Animation - Change LD_Dome's animation speed to 100.00% of its original speed
      • Unit Group - Pick every unit in LD_Beams and do (Actions)
        • Loop - Actions
          • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed

Trigger:
  • Beams
    • Events
      • Time - LD_Timer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in LD_Beams and do (Actions)
        • Loop - Actions
          • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
      • Unit - Create 1 Light Dome for (Owner of LD_Caster) at LD_CastPoint facing Default building facing degrees
      • Set LD_Dome = (Last created unit)
      • Unit - Set level of Armor Bonus for LD_Dome to (Level of Light Dome for LD_Caster)
      • Unit - Add a 10.00 second Generic expiration timer to LD_Dome
      • Unit - Add Crow Form to LD_Dome
      • Animation - Change LD_Dome flying height to 450.00 at 0.00
      • Unit - Remove Crow Form from LD_Dome
      • Trigger - Turn on Effects <gen>
      • Trigger - Turn on Dome Blocking <gen>
      • Trigger - Run Dome <gen> (ignoring conditions)

Trigger:
  • Dome
    • Events
    • Conditions
    • Actions
      • Wait 0.40 seconds
      • Animation - Change LD_Dome's animation speed to 0.00% of its original speed

Trigger:
  • Effects
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set LD_Duration = (LD_Duration + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LD_Duration Greater than or equal to 11
        • Then - Actions
          • Unit Group - Remove all units of LD_InDome from LD_InDome
          • Unit Group - Remove all units of LD_OutDome from LD_OutDome
          • Trigger - Turn off (This trigger)
          • Trigger - Turn off Dome Blocking <gen>
          • Custom script: call RemoveLocation (udg_LD_CastPoint)
        • Else - Actions
          • Set LD_HealAndDamageGroup = (Units within 400.00 of LD_CastPoint matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)))
          • Unit Group - Pick every unit in LD_HealAndDamageGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) belongs to an ally of (Owner of LD_Caster)) Equal to True
                • Then - Actions
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (30.00 + (20.00 x (Real((Level of Light Dome for LD_Caster))))))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) belongs to an ally of (Owner of LD_Caster)) Equal to False
                    • Then - Actions
                      • Unit - Cause LD_Caster to damage (Picked unit), dealing (15.00 + (15.00 x (Real((Level of Light Dome for LD_Caster))))) damage of attack type Spells and damage type Normal
                    • Else - Actions
          • Custom script: call DestroyGroup (udg_LD_HealAndDamageGroup)

Trigger:
  • Dome Blocking
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in LD_InDome and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between (Position of (Picked unit)) and LD_CastPoint) Greater than or equal to 350.00
            • Then - Actions
              • Set LD_TempPoint = (LD_CastPoint offset by 345.00 towards (Angle from LD_CastPoint to (Position of (Picked unit))) degrees)
              • Unit - Move (Picked unit) instantly to LD_TempPoint
            • Else - Actions
      • Custom script: call RemoveLocation (udg_LD_TempPoint)
      • Unit Group - Pick every unit in LD_OutDome and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between (Position of (Picked unit)) and LD_CastPoint) Less than or equal to 500.00
            • Then - Actions
              • Set LD_TempPoint = (LD_CastPoint offset by 505.00 towards (Angle from LD_CastPoint to (Position of (Picked unit))) degrees)
              • Unit - Move (Picked unit) instantly to (LD_CastPoint offset by 505.00 towards (Angle from LD_CastPoint to (Position of (Picked unit))) degrees)
            • Else - Actions
      • Custom script: call RemoveLocation (udg_LD_TempPoint)
 

Attachments

  • Light Dome.w3x
    35.3 KB · Views: 261

Komaqtion

You can change this now in User CP.
Reaction score
469
This leaks like he%% !
You really need to clean up all of those leaks !

And also, this isn't the least amount of MUI, try to make it so ;)
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Trigger:
  • Set LD_OutsideGroup = (Units within 200000.00 of LD_CastPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of LD_Caster)) Equal to True))))
    • Unit Group - Pick every unit in LD_OutsideGroup and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to LD_OutDome

Why set a group just to set another group?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
That's just because he might not want to overwrite the old group with the new units, just merge them together ;)
 

Ivach

New Member
Reaction score
18
Missed the leaks in the last trigger. Fixed. Any other parts of the trigger that is still leaking?

I might make it MUI in the near future, but for now, I'll just leave it as it is.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
In the second and third trigger, this line should be inside the loop:
Trigger:
  • Custom script: call RemoveLocation (udg_LD_BeamPositions)


In your seventh trigger, you should just remove this "Else If":
Trigger:
  • ((Picked unit) belongs to an ally of (Owner of LD_Caster)) Equal to False


And just use the "Else" field ;)

In the eigth trigger, there are two leaks:
Trigger:
  • (Distance between (Position of (Picked unit)) and LD_CastPoint) Greater than or equal to 350.00


And you should also move these lines into the "If", and not have them outside it ;)
Trigger:
  • Custom script: call RemoveLocation (udg_LD_TempPoint)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top