Shadow Burst v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: Matt
Description
Summons an orb containing an evil ghost and shoots it slowly in the direction of the target location for 1300 range. If the orb comes within 375 range of an enemy unit it speeds up towards it and sticks to the unit for 6 seconds. When the orb sticks, it saps energy from the unit causing damage and making the orb grow. After the 6 seconds the evil ghost bursts from the orb causing which deals 150 damage to the target unit and lowers nearby enemies attack damage. The ghost remains for 8 seconds reducing the armor of nearby enemies by 4, dealing AOE damage, and shooting shadows at random enemies.

[trigger=Setting]
Events
Time - Elapsed game time is 0.51 seconds
Conditions
Actions
-------- Sets the initial speed of the orb --------
Set SB_Orb_Initial_Speed = 10.00
-------- Sets the speed of the orb when enemy is detected --------
Set SB_Orb_Final_Speed = 18.00
-------- Sets the distance needed for the orb to detect an enemy --------
Set SB_Orb_DetectionRange = 375.00
-------- Sets the maximum distance the orb can travel --------
Set SB_Orb_Max_Distance = 1300.00
-------- Sets the duration the orb sticks to the enemy --------
Set SB_Orb_Stick_Duration = 6
-------- Sets the delay (starting from the time of casting the spell) for the orb to detect an enemy unit --------
Set SB_Set_Orb_Detection_Delay = 1.00
-------- Sets how fast the orb will grow --------
Set SB_Orb_Growth_Rate = 5.00
-------- Sets how long the ghost lasts --------
Set SB_Ghost_Duration = 8.00
-------- --------
-------- --------
-------- --------
-------- --------
-------- --------
For each (Integer SB_Timer_Integer) from 1 to SB_Orb_Stick_Duration, do (Actions)
Loop - Actions
Set SB_Timer_Check[SB_Timer_Integer] = ((Real(SB_Timer_Integer)) x 0.99)
[/trigger]

[trigger=Cast]
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Shadow Burst
Actions
Set SB_Count = (SB_Count + 1)
-------- --------
-------- --------
-------- Sets the damage dealt to target unit when ghost pops up --------
Set SB_Damage[SB_Count] = (150.00 x (Real((Level of Shadow Burst for (Triggering unit)))))
-------- --------
-------- --------
Set SB_CountFinishedSpell = (SB_CountFinishedSpell + 1)
Set SB_Caster_Point = (Position of (Triggering unit))
Set SB_Target_Point = (Target point of ability being cast)
Set SB_Timer[SB_Count] = ((Real(SB_Orb_Stick_Duration)) x 0.99)
Set SB_Angle[SB_Count] = (Angle from SB_Caster_Point to SB_Target_Point)
Set SB_Orb_Size[SB_Count] = 240.00
-------- Create 1 Orb Dummy.. --------
Unit - Create 1 Orb Dummy for (Owner of (Triggering unit)) at SB_Caster_Point facing SB_Angle[SB_Count] degrees
Set SB_Unit[SB_Count] = (Last created unit)
Custom script: call RemoveLocation (udg_SB_Caster_Point)
Custom script: call RemoveLocation (udg_SB_Target_Point)
Trigger - Turn on Shadow Burst Loop <gen>
[/trigger]

[trigger=Loop]
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer SB_Integer) from 1 to SB_Count, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SB_Unit[SB_Integer] is alive) Equal to True
OrbTravelDistance[SB_Integer] Less than or equal to SB_Orb_Max_Distance
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SB_Ghost_Active_Boolean[SB_Integer] Equal to False
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in SB_UnitGroup[SB_Integer]) Greater than or equal to 1
Then - Actions
-------- Check if orb is close enough to enemy unit --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SB_Distance_Difference[SB_Integer] Less than or equal to (SB_Orb_Final_Speed + 1.00)
SB_Timer[SB_Integer] Greater than 0.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SB_SFX_Boolean[SB_Integer] Equal to False
Then - Actions
Special Effect - Create a special effect attached to the origin of SB_Unit[SB_Integer] using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
Special Effect - Destroy (Last created special effect)
Set SB_SFX_Boolean[SB_Integer] = True
Else - Actions
-------- Orb movement when orb has reached enemy unit --------
Set SB_Enemy_Point[SB_Integer] = (Position of SB_Target_Unit[SB_Integer])
Unit - Move SB_Unit[SB_Integer] instantly to SB_Enemy_Point[SB_Integer]
For each (Integer SB_Timer_Integer) from 1 to SB_Orb_Stick_Duration, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SB_Timer[SB_Integer] Equal to SB_Timer_Check[SB_Timer_Integer]
Then - Actions
Floating Text - Create floating text that reads (String(((Integer(SB_Timer_Check[SB_Timer_Integer])) + 1))) at SB_Enemy_Point[SB_Integer] with Z offset 100.00, using font size 11.00, color (80.00%, 0.00%, 80.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Else - Actions
Set SB_Timer[SB_Integer] = (SB_Timer[SB_Integer] - 0.03)
Set SB_CountdownToCast[SB_Integer] = (SB_CountdownToCast[SB_Integer] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SB_CountdownToCast[SB_Integer] Equal to 11
Then - Actions
Set SB_General_Point[SB_Integer] = (SB_Enemy_Point[SB_Integer] offset by (Random real number between 200.00 and 800.00) towards (Random real number between -360.00 and 360.00) degrees)
-------- Create 1 SB General Dummy.. --------
Unit - Create 1 SB General Dummy for (Owner of SB_Unit[SB_Integer]) at SB_General_Point[SB_Integer] facing Default building facing degrees
Unit - Order (Last created unit) to Neutral - Firebolt SB_Target_Unit[SB_Integer]
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Set SB_CountdownToCast[SB_Integer] = 0
Custom script: call RemoveLocation (udg_SB_General_Point[udg_SB_Integer])
Set SB_Orb_Size[SB_Integer] = (SB_Orb_Size[SB_Integer] + SB_Orb_Growth_Rate)
Animation - Change SB_Unit[SB_Integer]'s size to (SB_Orb_Size[SB_Integer]%, SB_Orb_Size[SB_Integer]%, SB_Orb_Size[SB_Integer]%) of its original size
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SB_Timer[SB_Integer] Less than or equal to 0.00
Then - Actions
-------- Deal damage to target unit --------
Unit - Cause SB_Unit[SB_Integer] to damage SB_Target_Unit[SB_Integer], dealing SB_Damage[SB_Integer] damage of attack type Spells and damage type Normal
-------- Creating a ghost and reusing the orb current point variable as the position of the ghost. --------
Set SB_Orb_Current_Point[SB_Integer] = (Position of SB_Unit[SB_Integer])
-------- Create 1 SB General Dummy.. --------
Unit - Create 1 SB General Dummy for (Owner of SB_Unit[SB_Integer]) at SB_Orb_Current_Point[SB_Integer] facing Default building facing degrees
-------- (kills the orb) --------
Unit - Kill SB_Unit[SB_Integer]
-------- reusing the variable and setting it as the shadow sfx dummy --------
Set SB_Unit[SB_Integer] = (Last created unit)
Animation - Change SB_Unit[SB_Integer]'s size to (500.00%, 500.00%, 500.00%) of its original size
-------- Add SB Damage Aura to.. --------
Unit - Add SB Damage Aura to SB_Unit[SB_Integer]
-------- Remove SB Dark Aura No Target from.. --------
Unit - Remove SB Dark Aura No Target from SB_Unit[SB_Integer]
-------- Add SB DarkAura to.. --------
Unit - Add SB Dark Aura to SB_Unit[SB_Integer]
Special Effect - Create a special effect attached to the origin of SB_Unit[SB_Integer] using Abilities\Spells\NightElf\shadowstrike\shadowstrike.mdl
Unit - Order SB_Unit[SB_Integer] to Neutral Pit Lord - Howl Of Terror
Special Effect - Create a special effect attached to the origin of SB_Unit[SB_Integer] using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Special Effect - Destroy (Last created special effect)
-------- Resetting the timer for ghost spell casting --------
Set SB_CountdownToCast[SB_Integer] = 0
-------- Enables the final part of the loop and disables the rest --------
Set SB_Ghost_Active_Boolean[SB_Integer] = True
-------- Resetting the timer to duration of ghost --------
Set SB_Timer[SB_Integer] = SB_Ghost_Duration
Else - Actions
Custom script: call RemoveLocation (udg_SB_Enemy_Point[udg_SB_Integer])
Else - Actions
-------- Continuing Orb movement when enemy detected --------
Set SB_Orb_Current_Point[SB_Integer] = (Position of SB_Unit[SB_Integer])
Set SB_Enemy_Point[SB_Integer] = (Position of SB_Target_Unit[SB_Integer])
Set SB_Angle[SB_Integer] = (Angle from SB_Orb_Current_Point[SB_Integer] to SB_Enemy_Point[SB_Integer])
Set SB_Orb_Next_Point[SB_Integer] = (SB_Orb_Current_Point[SB_Integer] offset by SB_Orb_Final_Speed towards SB_Angle[SB_Integer] degrees)
Unit - Move SB_Unit[SB_Integer] instantly to SB_Orb_Next_Point[SB_Integer]
Set SB_Distance_Difference[SB_Integer] = (Distance between SB_Orb_Next_Point[SB_Integer] and SB_Enemy_Point[SB_Integer])
Custom script: call RemoveLocation (udg_SB_Orb_Current_Point[udg_SB_Integer])
Custom script: call RemoveLocation (udg_SB_Enemy_Point[udg_SB_Integer])
Custom script: call RemoveLocation (udg_SB_Orb_Next_Point[udg_SB_Integer])
Else - Actions
-------- Orb Movement when no enemy is detected --------
Set OrbTravelDistance[SB_Integer] = (OrbTravelDistance[SB_Integer] + SB_Orb_Initial_Speed)
Set SB_Orb_Current_Point[SB_Integer] = (Position of SB_Unit[SB_Integer])
Set SB_Orb_Next_Point[SB_Integer] = (SB_Orb_Current_Point[SB_Integer] offset by SB_Orb_Initial_Speed towards SB_Angle[SB_Integer] degrees)
Unit - Move SB_Unit[SB_Integer] instantly to SB_Orb_Next_Point[SB_Integer]
Set SB_Orb_Detection_Delay[SB_Integer] = (SB_Orb_Detection_Delay[SB_Integer] + 0.03)
-------- Checks if enough time has passed for the orb to be able to detect enemy units --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SB_Orb_Detection_Delay[SB_Integer] Greater than or equal to SB_Set_Orb_Detection_Delay
Then - Actions
Set SB_UnitGroup[SB_Integer] = (Units within 375.00 of SB_Orb_Next_Point[SB_Integer] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of SB_Unit[SB_Integer])) Equal to True) and (((Matching unit) is alive) Equal to True))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in SB_UnitGroup[SB_Integer]) Greater than or equal to 1
Then - Actions
-------- Sets up the target unit for the next part of the loop --------
Custom script: set udg_SB_Target_Unit[udg_SB_Integer] = FirstOfGroup(udg_SB_UnitGroup[udg_SB_Integer])
Set SB_Enemy_Point[SB_Integer] = (Position of SB_Target_Unit[SB_Integer])
-------- For condition --------
Set SB_Distance_Difference[SB_Integer] = (Distance between SB_Orb_Next_Point[SB_Integer] and SB_Enemy_Point[SB_Integer])
Else - Actions
Else - Actions
Custom script: call DestroyGroup (udg_SB_UnitGroup[udg_SB_Integer])
Custom script: call RemoveLocation (udg_SB_Orb_Next_Point[udg_SB_Integer])
Custom script: call RemoveLocation (udg_SB_Orb_Current_Point[udg_SB_Integer])
Custom script: call RemoveLocation (udg_SB_Enemy_Point[udg_SB_Integer])
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SB_Timer[SB_Integer] Greater than 0.00
Then - Actions
Set SB_CountdownToCast[SB_Integer] = (SB_CountdownToCast[SB_Integer] + 1)
Set SB_Timer[SB_Integer] = (SB_Timer[SB_Integer] - 0.03)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SB_CountdownToCast[SB_Integer] Equal to 25
Then - Actions
Set SB_UnitGroup[SB_Integer] = (Units within 800.00 of SB_Orb_Current_Point[SB_Integer] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of SB_Unit[SB_Integer])) Equal to True) and (((Matching unit) is alive) Equal to True))))
Unit - Order SB_Unit[SB_Integer] to Night Elf Warden - Shadow Strike (Random unit from SB_UnitGroup[SB_Integer])
Set SB_CountdownToCast[SB_Integer] = 0
Custom script: call DestroyGroup (udg_SB_UnitGroup[udg_SB_Integer])
Else - Actions
Else - Actions
-------- END OF LOOP (when ghost expires) --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
End_Boolean[SB_Integer] Equal to False
Then - Actions
Set End_Boolean[SB_Integer] = True
Special Effect - Create a special effect at SB_Orb_Current_Point[SB_Integer] using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Special Effect - Destroy (Last created special effect)
Unit - Remove SB_Unit[SB_Integer] from the game
Set SB_Unit[SB_Integer] = No unit
Custom script: call RemoveLocation (udg_SB_Orb_Current_Point[udg_SB_Integer])
Set SB_CountFinishedSpell = (SB_CountFinishedSpell - 1)
Else - Actions
Else - Actions
-------- END OF LOOP 2 (when orb has travelled 1300) --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
End_Boolean[SB_Integer] Equal to False
Then - Actions
Set End_Boolean[SB_Integer] = True
Set SB_General_Point[SB_Integer] = (Position of SB_Unit[SB_Integer])
Special Effect - Create a special effect at SB_General_Point[SB_Integer] using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Special Effect - Destroy (Last created special effect)
Unit - Remove SB_Unit[SB_Integer] from the game
Set SB_Unit[SB_Integer] = No unit
Set SB_CountFinishedSpell = (SB_CountFinishedSpell - 1)
Custom script: call RemoveLocation (udg_SB_General_Point[udg_SB_Integer])
Else - Actions
-------- BOTTOM --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SB_CountFinishedSpell Equal to 0
Then - Actions
-------- Resetting --------
For each (Integer SB_Integer) from 1 to SB_Count, do (Actions)
Loop - Actions
Set SB_CountdownToCast[SB_Integer] = 0
Set End_Boolean[SB_Integer] = False
Set SB_Distance_Difference[SB_Integer] = 0.00
Set OrbTravelDistance[SB_Integer] = 0.00
Set SB_SFX_Boolean[SB_Integer] = False
Set SB_Ghost_Active_Boolean[SB_Integer] = False
Set SB_Orb_Detection_Delay[SB_Integer] = 0.00
Trigger - Turn off (This trigger)
Set SB_Count = 0
Else - Actions

[/trigger]


Credits:
dark orb model-frankster
voodoo aura-jetfanginferno


Keywords:
dark, orb, ghost, shadow, burst, evil, undead
Contents

Shadow Burst (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 15:00, 17th Jul 2012 Magtheridon96: -------- Orb Movement when no enemy is detected -------- Set OrbTravelDistance[SB_Integer] = (OrbTravelDistance[SB_Integer] +...

Moderator

M

Moderator

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

15:00, 17th Jul 2012
Magtheridon96:

    • -------- Orb Movement when no enemy is detected --------
    • Set OrbTravelDistance[SB_Integer] = (OrbTravelDistance[SB_Integer] + SB_Orb_Initial_Speed)
    • Set SB_Orb_Current_Point[SB_Integer] = (Position of SB_Unit[SB_Integer])
    • Set SB_Orb_Next_Point[SB_Integer] = (SB_Orb_Current_Point[SB_Integer] offset by SB_Orb_Initial_Speed towards SB_Angle[SB_Integer] degrees)
    • Unit - Move SB_Unit[SB_Integer] instantly to SB_Orb_Next_Point[SB_Integer]
    • Set SB_Orb_Detection_Delay[SB_Integer] = (SB_Orb_Detection_Delay[SB_Integer] + 0.03)
    • -------- Checks if enough time has passed for the orb to be able to detect enemy units --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • SB_Orb_Detection_Delay[SB_Integer] Greater than or equal to SB_Set_Orb_Detection_Delay
      • Then - Actions
        • Set SB_UnitGroup[SB_Integer] = (Units within 375.00 of SB_Orb_Next_Point[SB_Integer] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of SB_Unit[SB_Integer])) Equal to True) and (((Matching unit) is alive) Equal to True))))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in SB_UnitGroup[SB_Integer]) Greater than or equal to 1
          • Then - Actions
            • -------- Sets up the target unit for the next part of the loop --------
            • Custom script: set udg_SB_Target_Unit[udg_SB_Integer] = FirstOfGroup(udg_SB_UnitGroup[udg_SB_Integer])
            • Set SB_Enemy_Point[SB_Integer] = (Position of SB_Target_Unit[SB_Integer])
            • -------- For condition --------
            • Set SB_Distance_Difference[SB_Integer] = (Distance between SB_Orb_Next_Point[SB_Integer] and SB_Enemy_Point[SB_Integer])
          • Else - Actions
      • Else - Actions
        • Custom script: call DestroyGroup (udg_SB_UnitGroup[udg_SB_Integer])
        • Custom script: call RemoveLocation (udg_SB_Orb_Next_Point[udg_SB_Integer])
        • Custom script: call RemoveLocation (udg_SB_Orb_Current_Point[udg_SB_Integer])
        • Custom script: call RemoveLocation (udg_SB_Enemy_Point[udg_SB_Integer])
    This snippet concerns me. The Enemy point inside the if statement leaks, and so
    do all the other points that are not being destroyed in the same level. If you create
    a location, you must destroy it in the same block of code. You can't create a location
    and destroy it inside the "Then" or "Else" actions of the an if statement, because if you
    destroy it in the "Then" actions, the Else actions might run and the whole thing would leak.
    The solution is to move the destruction code to the outside of the if statement.
  • When you scale a unit, only the first value matters. You can use 0 for the others
    and nothing different would happen.
  • Don't use the elapsed game time event, use the "Map initialization" event.
  • Your current method of indexing isn't the best, so it would be best if it were updated to
    use Hanky's Dynamic Indexing method. Take a look at this.
 
Level 4
Joined
Oct 9, 2009
Messages
50
Spell does exactly what it says it does. Only real complaint is that the damage isn't all triggered /easy to scale and change, but it provides a great groundwork for anyone who wants to adjust the damage.

Very innovative design though, I learned a lot reading through the triggers and trying the test map. It does exactly what it says it does, didn't appear to leak or lag (even when chaincasting the ability), and is very flashy. It respects magic immunity, looks great, and is easily configurable in most aspects.

I only do GUI, so I'm always happy to see new spells that I can read through, understand, and learn from.
 
Top