1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  3. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  4. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  5. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  6. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  7. The glory of the 20th Icon Contest is yours for the taking!
    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.

Trigger Viewer

Albatross Dive Attack.w3x
Variables
Test Map Stuff
Melee Initialization
ESC
spawn birds
Albatross
Import guide
Config
Albatross on trained
Dive Attack order checks
Dive Attack start
Dive Attack effect
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.


fixed getting stick on long ranged kills
fixed attack orders while rooted/hexed/ethereal turning attack on
function PlaySoundAtPoint takes string f, real x, real y, real p, integer v returns nothing
    local sound s = CreateSound( f, false, true, true, 10, 10, "" )
    call SetSoundDuration( s, GetSoundFileDuration(f) )
    call SetSoundChannel( s, 0 )
    call SetSoundVolume( s, v )
    call SetSoundPitch( s, p )
    call SetSoundPosition(s, x, y, 0)
    call StartSound(s)
    call KillSoundWhenDone(s)
    set s = null
endfunction
Name Type Is Array Initial Value
DiveAttackAudioInt integer No
DiveAttackCanceled boolean Yes
DiveAttackCaster unit Yes
DiveAttackChaseDur real No
DiveAttackCooldownMax real No
DiveAttackCooldownMin real No
DiveAttackCooldownTimer real Yes
DiveAttackDamage real Yes
DiveAttackDamageMax real No
DiveAttackDamageMin real No
DiveAttackDir real No
DiveAttackDist real No
DiveAttackGroup group No
DiveAttackGroupAutocast group No
DiveAttackHeal real Yes
DiveAttackHealMultiplier real No
DiveAttackHeight real Yes
DiveAttackHeightLoss real No
DiveAttackIndex integer No
DiveAttackLocCasterCurrent location No
DiveAttackLocCasterNew location No
DiveAttackLocCursor location No
DiveAttackLoop integer No
DiveAttackMaxDur real Yes
DiveAttackMoveSpeed real No
DiveAttackSpeed real Yes
DiveAttackSpeedMultiplier real No
DiveAttackState integer Yes
DiveAttackTarget unit Yes
DiveAttackUnit unit Yes
TempLoc location No
Default melee game initialization for all players
Melee Initialization
  Events
    Map initialization
  Conditions
  Actions
    Melee Game - Use melee time of day (for all players)
    Melee Game - Run melee AI scripts (for computer players)
    Visibility - Disable black mask
    Visibility - Disable fog of war
    Unit - Order Albatross Aviary 0148 <gen> to Right-Click.(Position of Altar of Storms 0010 <gen>)
    Game - Display to (All players) for 120.00 seconds the text: Press ESC to toggle Albatross auto-production on/off.
    Player - Change color of Player 1 (Red) to Maroon, Changing color of existing units
    Player - Change color of Player 2 (Blue) to Red, Changing color of existing units
ESC
  Events
    Player - Player 1 (Red) skips a cinematic sequence
  Conditions
  Actions
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Picked unit) is alive) Equal to False
            (Unit-type of (Picked unit)) Not equal to Albatross
          Then - Actions
            Unit - Replace (Picked unit) with a (Unit-type of (Picked unit)) using The new unit's max life and mana
          Else - Actions
        Unit - Set life of (Picked unit) to 100%
        Unit - Set mana of (Picked unit) to 100%
        Unit - Reset ability cooldowns for (Picked unit).
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Picked unit) is A Hero) Equal to True
          Then - Actions
            Hero - Set (Picked unit) Hero-level to 10, Show level-up graphics
          Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (spawn_birds <gen> is on) Equal to True
      Then - Actions
        Trigger - Turn off spawn_birds <gen>
      Else - Actions
        Trigger - Turn on spawn_birds <gen>
spawn birds
  Events
    Time - Every 1.00 seconds of game time
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Player 1 (Red) Food used) Less than 100
      Then - Actions
        Unit - Order Albatross Aviary 0148 <gen> to train/upgrade to a Albatross
      Else - Actions
1. Tick "Automatically Create Variables when Pasting Trigger Data" under preferences setting
2. Copy the Dive Attack ability in the object editor
3. Copy the Albatross unit in the object editor
4. Copy the custom script (required for the sounds)
5. Copy the Albatross folder in the trigger editor
6. Add the Dive Attack ability to the Albatross
7. Move the actions of the "Config" trigger to your "Map initialization" trigger
8. In the "Albatross on trained" trigger, make sure the Dive Attack spell is selected in the condition
9. In the "Dive Attack order checks" trigger, make sure the Dive Attack spell is selected in the condition
10. In the "Dive Attack start" trigger, make sure the Dive Attack spell is selected in the condition
11. Go through the variables in the variable editor and make sure they are all copied properly

Object editor: The unit with this ability must have:
1. Attack enabled
2. Have an attack point of at least 1 second (for some reason, it doesn't work when it's too low)
3. Flying movement
4. A fyling height of at least 51 or higher (no max height limit, works fine with e.g. 1k)
5. Obviously have the Dive Attack ability

Variables:

DiveAttackCanceled: Boolean array
DiveAttackCaster: Unit array
DiveAttackCooldownTimer: Real array
DiveAttackDamage: Real
DiveAttackDir: Real
DiveAttackDist: Real
DiveAttackGroup: Unit Group
DiveAttackGroupAutocast: Unit Group
DiveAttackHeal: Real
DiveAttackHeight: Real array
DiveAttackHeightLoss: Real
DiveAttackIndex: Integer
DiveAttackLocCasterCurrent: Point
DiveAttackLocCasterNew: Point
DiveAttackLocCursor: Point
DiveAttackLoop: Integer
DiveAttackMaxDur: Real array
DiveAttackSpeed: Real array
DiveAttackSpeedMultiplier: Real
DiveAttackState: Integer
DiveAttackTarget: Unit array
TempInt: Int
TempLoc: Point
Creating unit groups and pre-loading sounds.

1. DiveAttackDamageMin/Max: Determine the damage dealt on hit (set both to same number if you want consistent damage)
2. DiveAttackHealMultiplier: Determines the amount of heal, based on how much damage was dealt (percentage, where 1 is 100%)
3. DiveAttackChaseDur: Determines for how long the bird can chase the target before it stops the chase automatically
4. DiveAttackMoveSpeed: Determines the dive speed. When set to 0 (or lower), uses the bird's current movement speed.
5. DiveAttackSpeedMultiplier: Multiplies the move speed by this factor. This multiplier is only used when DiveAttackMoveSpeed is set to 0 or lower.
6. DiveAttackCooldownMin/Max: Determines the time the bird has to wait after a dive, before being able to attack again. (set both to same number if you want consistent cd)
Config
  Events
    Map initialization
  Conditions
  Actions
    -------- Dive Attack config --------
    -------- Change these values as you will --------
    Set VariableSet DiveAttackDamageMin = 8.00
    Set VariableSet DiveAttackDamageMax = 12.00
    Set VariableSet DiveAttackHealMultiplier = 1.00
    Set VariableSet DiveAttackChaseDur = 3.00
    Set VariableSet DiveAttackMoveSpeed = 0.00
    Set VariableSet DiveAttackSpeedMultiplier = 1.50
    Set VariableSet DiveAttackCooldownMin = 0.80
    Set VariableSet DiveAttackCooldownMax = 1.20
    -------- Dive Attack pre-loading stuff --------
    Custom script: set udg_DiveAttackGroupAutocast = CreateGroup()
    Custom script: set udg_DiveAttackGroup = CreateGroup()
    Wait 1.00 seconds
    Set VariableSet TempLoc = (Center of (Playable map area))
    Custom script: call PlaySoundAtPoint("Sound\\Units\\Combat\\WoodLightBashFlesh1.wav", GetLocationX(udg_TempLoc), GetLocationY(udg_TempLoc), 1.0, 1)
    Custom script: call PlaySoundAtPoint("Sound\\Units\\Combat\\WoodLightBashFlesh2.wav", GetLocationX(udg_TempLoc), GetLocationY(udg_TempLoc), 1.0, 1)
    Custom script: call PlaySoundAtPoint("Sound\\Units\\Combat\\WoodLightBashFlesh3.wav", GetLocationX(udg_TempLoc), GetLocationY(udg_TempLoc), 1.0, 1)
    Custom script: call RemoveLocation(udg_TempLoc)
Optional trigger. Turns autocast on upon spawning
Albatross on trained
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Level of Dive Attack for (Trained unit)) Greater than 0
  Actions
    Unit - Order (Trained unit) to Neutral Sea Witch - Activate Frost Arrows.
Order checks happen here. Do not change, it's easy to break things here.
Dive Attack order checks
  Events
    Unit - A unit Is issued an order with no target
    Unit - A unit Is issued an order targeting an object
    Unit - A unit Is issued an order targeting a point
  Conditions
    (Level of Dive Attack for (Triggering unit)) Greater than 0
  Actions
    Set VariableSet DiveAttackUnit[1] = (Ordered unit)
    -------- Turning autocast off --------
    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(holdposition))
            (Issued order) Equal to (Order(uncoldarrows))
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (DiveAttackUnit[1] is in DiveAttackGroupAutocast.) Equal to True
          Then - Actions
            Unit - Add Cargo Hold (Orc Burrow) to DiveAttackUnit[1]
            Unit Group - Remove DiveAttackUnit[1] from DiveAttackGroupAutocast.
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Issued order) Not equal to (Order(uncoldarrows))
              Then - Actions
                Trigger - Turn off (This trigger)
                Unit - Order DiveAttackUnit[1] to Neutral Sea Witch - Deactivate Frost Arrows.
                Trigger - Turn on (This trigger)
              Else - Actions
          Else - Actions
      Else - Actions
    -------- Turning autocast on --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Issued order) Equal to (Order(coldarrows))
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (DiveAttackUnit[1] is in DiveAttackGroupAutocast.) Equal to False
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (DiveAttackUnit[1] is in DiveAttackGroup.) Equal to False
              Then - Actions
                Unit - Remove Cargo Hold (Orc Burrow) from DiveAttackUnit[1]
              Else - Actions
            Unit Group - Add DiveAttackUnit[1] to DiveAttackGroupAutocast
          Else - Actions
      Else - Actions
    -------- right-click smart cast, and manual cast --------
    Custom script: if GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER then
    Set VariableSet DiveAttackUnit[2] = (Target unit of issued order)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (DiveAttackUnit[1] is Snared) Equal to False
        (DiveAttackUnit[1] is Polymorphed) Equal to False
        (DiveAttackUnit[1] is Ethereal) Equal to False
        Or - Any (Conditions) are true
          Conditions
            (Issued order) Equal to (Order(coldarrowstarg))
            And - All (Conditions) are true
              Conditions
                (Issued order) Equal to (Order(smart))
                (DiveAttackUnit[2] belongs to an enemy of (Owner of DiveAttackUnit[1]).) Equal to True
                (DiveAttackUnit[2] is A structure) Equal to False
                (DiveAttackUnit[2] is Mechanical) Equal to False
                (DiveAttackUnit[2] is A flying unit) Equal to False
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (DiveAttackUnit[1] is in DiveAttackGroup.) Equal to False
          Then - Actions
            Unit - Remove Cargo Hold (Orc Burrow) from DiveAttackUnit[1]
            Trigger - Turn off (This trigger)
            Unit - Order DiveAttackUnit[1] to Attack.DiveAttackUnit[2]
            Trigger - Turn on (This trigger)
          Else - Actions
      Else - Actions
        -------- Disarming when other unit-targeted orders are given while autocast is off --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (DiveAttackUnit[1] is in DiveAttackGroupAutocast.) Equal to False
          Then - Actions
            Unit - Add Cargo Hold (Orc Burrow) to DiveAttackUnit[1]
          Else - Actions
    Custom script: endif
    -------- Disarming when point-targeted orders are given while autocast is off --------
    Custom script: if GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER then
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (DiveAttackUnit[1] is in DiveAttackGroupAutocast.) Equal to False
      Then - Actions
        Unit - Add Cargo Hold (Orc Burrow) to DiveAttackUnit[1]
      Else - Actions
    Custom script: endif
    -------- Stop attacking current target when order is given after hitting the target. --------
    For each (Integer DiveAttackLoop) from 1 to DiveAttackIndex, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DiveAttackUnit[1] Equal to DiveAttackCaster[DiveAttackLoop]
            DiveAttackState[DiveAttackLoop] Equal to 3
            (Issued order) Not equal to (Order(uncoldarrows))
            (Issued order) Not equal to (Order(coldarrows))
          Then - Actions
            Set VariableSet DiveAttackCanceled[DiveAttackLoop] = True
          Else - Actions
    Set VariableSet DiveAttackUnit[1] = No unit
    Set VariableSet DiveAttackUnit[2] = No unit
Dive Attack start
  Events
    Unit - A unit Is attacked
  Conditions
    And - All (Conditions) are true
      Conditions
        (Level of Dive Attack for (Attacking unit)) Greater than 0
        ((Attacking unit) is Snared) Equal to False
  Actions
    Set VariableSet DiveAttackIndex = (DiveAttackIndex + 1)
    Set VariableSet DiveAttackCaster[DiveAttackIndex] = (Attacking unit)
    Set VariableSet DiveAttackTarget[DiveAttackIndex] = (Attacked unit)
    Set VariableSet DiveAttackHeight[DiveAttackIndex] = (Default flying height of DiveAttackCaster[DiveAttackIndex])
    Set VariableSet DiveAttackCanceled[DiveAttackIndex] = False
    Set VariableSet DiveAttackState[DiveAttackIndex] = 1
    Set VariableSet DiveAttackDamage[DiveAttackIndex] = (Random real number between DiveAttackDamageMin and DiveAttackDamageMax)
    Set VariableSet DiveAttackHeal[DiveAttackIndex] = (DiveAttackDamage[DiveAttackIndex] x DiveAttackHealMultiplier)
    Set VariableSet DiveAttackMaxDur[DiveAttackIndex] = DiveAttackChaseDur
    Set VariableSet DiveAttackCooldownTimer[DiveAttackIndex] = (Random real number between DiveAttackCooldownMin and DiveAttackCooldownMax)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DiveAttackMoveSpeed Less than or equal to 0.00
      Then - Actions
        Set VariableSet DiveAttackSpeed[DiveAttackIndex] = ((Current movement speed of DiveAttackCaster[DiveAttackIndex]) x DiveAttackSpeedMultiplier)
      Else - Actions
        Set VariableSet DiveAttackSpeed[DiveAttackIndex] = DiveAttackMoveSpeed
    Unit - Add Cargo Hold (Orc Burrow) to DiveAttackCaster[DiveAttackIndex]
    Trigger - Turn off Dive_Attack_order_checks <gen>
    Unit - Order DiveAttackCaster[DiveAttackIndex] to Neutral Sea Witch - Frost Arrows.DiveAttackTarget[DiveAttackIndex]
    Trigger - Turn on Dive_Attack_order_checks <gen>
    Unit Group - Add DiveAttackCaster[DiveAttackIndex] to DiveAttackGroup
    If (DiveAttackIndex Equal to 1) then do (Turn on Dive_Attack_effect <gen>) else do (Do nothing)
    Animation - Play DiveAttackCaster[DiveAttackIndex]'s attack (animationname) animation
Dive Attack effect
  Events
    Time - Every 0.03 seconds of game time
  Conditions
  Actions
    For each (Integer DiveAttackLoop) from 1 to DiveAttackIndex, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                (DiveAttackTarget[DiveAttackLoop] is alive) Equal to False
                (DiveAttackCaster[DiveAttackLoop] is alive) Equal to False
                DiveAttackMaxDur[DiveAttackLoop] Less than or equal to 0.00
                And - All (Conditions) are true
                  Conditions
                    DiveAttackState[DiveAttackLoop] Equal to 1
                    (Current order of DiveAttackCaster[DiveAttackLoop]) Not equal to (Order(coldarrowstarg))
                (DiveAttackCaster[DiveAttackLoop] is Snared) Equal to True
                (DiveAttackCaster[DiveAttackLoop] is Stunned) Equal to True
                (DiveAttackCaster[DiveAttackLoop] is Polymorphed) Equal to True
                (DiveAttackCaster[DiveAttackLoop] is Sleeping) Equal to True
                (DiveAttackCaster[DiveAttackLoop] is Ethereal) Equal to True
                (DiveAttackCaster[DiveAttackLoop] is hidden) Equal to True
                (DiveAttackCaster[DiveAttackLoop] is paused) Equal to True
                (DiveAttackTarget[DiveAttackLoop] is hidden) Equal to True
                (DiveAttackTarget[DiveAttackLoop] is A flying unit) Equal to True
          Then - Actions
            Set VariableSet DiveAttackCanceled[DiveAttackLoop] = True
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DiveAttackState[DiveAttackLoop] Equal to 1
          Then - Actions
            Set VariableSet DiveAttackMaxDur[DiveAttackLoop] = (DiveAttackMaxDur[DiveAttackLoop] - 0.03)
            Set VariableSet DiveAttackLocCursor = (Position of DiveAttackTarget[DiveAttackLoop])
            Set VariableSet DiveAttackLocCasterCurrent = (Position of DiveAttackCaster[DiveAttackLoop])
            Set VariableSet DiveAttackDist = (Distance between DiveAttackLocCasterCurrent and DiveAttackLocCursor)
            Set VariableSet DiveAttackDir = (Angle from DiveAttackLocCasterCurrent to DiveAttackLocCursor)
            Set VariableSet DiveAttackLocCasterNew = (DiveAttackLocCasterCurrent offset by (DiveAttackSpeed[DiveAttackLoop] x 0.03) towards DiveAttackDir degrees.)
            Set VariableSet DiveAttackHeightLoss = (Min((((Current flying height of DiveAttackCaster[DiveAttackLoop]) - 50.00) / (DiveAttackDist / (DiveAttackSpeed[DiveAttackLoop] x 0.03))), 40.00))
            Set VariableSet DiveAttackHeight[DiveAttackLoop] = ((DiveAttackHeight[DiveAttackLoop] - DiveAttackHeightLoss) + 0.00)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                DiveAttackDist Greater than (DiveAttackSpeed[DiveAttackLoop] x 0.03)
                (DiveAttackCaster[DiveAttackLoop] is Snared) Equal to False
              Then - Actions
                Custom script: call SetUnitX(udg_DiveAttackCaster[udg_DiveAttackLoop], GetLocationX(udg_DiveAttackLocCasterNew))
                Custom script: call SetUnitY(udg_DiveAttackCaster[udg_DiveAttackLoop], GetLocationY(udg_DiveAttackLocCasterNew))
              Else - Actions
            Unit - Make DiveAttackCaster[DiveAttackLoop] face DiveAttackDir over 0 seconds
            Animation - Change DiveAttackCaster[DiveAttackLoop] flying height to DiveAttackHeight[DiveAttackLoop] at 0.00
            Custom script: call RemoveLocation(udg_DiveAttackLocCasterCurrent)
            Custom script: call RemoveLocation(udg_DiveAttackLocCasterNew)
            Custom script: call RemoveLocation(udg_DiveAttackLocCursor)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                Or - Any (Conditions) are true
                  Conditions
                    (Current flying height of DiveAttackCaster[DiveAttackLoop]) Less than 50.00
                    DiveAttackCanceled[DiveAttackLoop] Equal to True
              Then - Actions
                Set VariableSet DiveAttackState[DiveAttackLoop] = 2
              Else - Actions
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DiveAttackState[DiveAttackLoop] Equal to 2
          Then - Actions
            Set VariableSet DiveAttackLocCursor = (Position of DiveAttackTarget[DiveAttackLoop])
            Set VariableSet DiveAttackLocCasterCurrent = (Position of DiveAttackCaster[DiveAttackLoop])
            Set VariableSet DiveAttackLocCasterNew = (DiveAttackLocCasterCurrent offset by (Min(((Current movement speed of DiveAttackCaster[DiveAttackLoop]) x (DiveAttackCooldownTimer[DiveAttackLoop] - 0.10)), (Current acquisition range of DiveAttackCaster[DiveAttackLoop]))) towards (DiveAttackDir + (Random real number between -50.00 and 50.00)) degrees.)
            Animation - Change DiveAttackCaster[DiveAttackLoop] flying height to (Default flying height of DiveAttackCaster[DiveAttackLoop]) at (Default flying height of DiveAttackCaster[DiveAttackLoop])
            Animation - Play DiveAttackCaster[DiveAttackLoop]'s walk (animationname) animation
            Trigger - Turn off Dive_Attack_order_checks <gen>
            Unit - Order DiveAttackCaster[DiveAttackLoop] to Move To.DiveAttackLocCasterNew
            Trigger - Turn on Dive_Attack_order_checks <gen>
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                DiveAttackDist Less than 100.00
                DiveAttackCanceled[DiveAttackLoop] Equal to False
              Then - Actions
                Set VariableSet DiveAttackAudioInt = (Random integer number between 0 and 2)
                Unit - Cause DiveAttackCaster[DiveAttackLoop] to damage DiveAttackTarget[DiveAttackLoop], dealing DiveAttackDamage[DiveAttackLoop] damage of attack type Pierce and damage type Normal
                Unit - Set life of DiveAttackCaster[DiveAttackLoop] to ((Life of DiveAttackCaster[DiveAttackLoop]) + DiveAttackHeal[DiveAttackLoop])
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    DiveAttackAudioInt Equal to 0
                  Then - Actions
                    Custom script: call PlaySoundAtPoint("Sound\\Units\\Combat\\WoodLightBashFlesh1.wav", GetLocationX(udg_DiveAttackLocCursor), GetLocationY(udg_DiveAttackLocCursor), 1.0, 127)
                  Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        DiveAttackAudioInt Equal to 1
                      Then - Actions
                        Custom script: call PlaySoundAtPoint("Sound\\Units\\Combat\\WoodLightBashFlesh2.wav", GetLocationX(udg_DiveAttackLocCursor), GetLocationY(udg_DiveAttackLocCursor), 1.0, 127)
                      Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            DiveAttackAudioInt Equal to 2
                          Then - Actions
                            Custom script: call PlaySoundAtPoint("Sound\\Units\\Combat\\WoodLightBashFlesh3.wav", GetLocationX(udg_DiveAttackLocCursor), GetLocationY(udg_DiveAttackLocCursor), 1.0, 127)
                          Else - Actions
                Special Effect - Create a special effect attached to the chest (attachpoint) of DiveAttackTarget[DiveAttackLoop] using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
                Special Effect - Destroy (Last created special effect)
              Else - Actions
            Custom script: call RemoveLocation(udg_DiveAttackLocCursor)
            Custom script: call RemoveLocation(udg_DiveAttackLocCasterCurrent)
            Custom script: call RemoveLocation(udg_DiveAttackLocCasterNew)
            Set VariableSet DiveAttackState[DiveAttackLoop] = 3
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DiveAttackState[DiveAttackLoop] Equal to 3
          Then - Actions
            Set VariableSet DiveAttackCooldownTimer[DiveAttackLoop] = (DiveAttackCooldownTimer[DiveAttackLoop] - 0.03)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                DiveAttackCooldownTimer[DiveAttackLoop] Less than or equal to 0.00
              Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (DiveAttackCaster[DiveAttackLoop] is in DiveAttackGroupAutocast.) Equal to True
                  Then - Actions
                    Unit - Remove Cargo Hold (Orc Burrow) from DiveAttackCaster[DiveAttackLoop]
                  Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Current order of DiveAttackCaster[DiveAttackLoop]) Equal to (Order((null)))
                    DiveAttackCanceled[DiveAttackLoop] Equal to False
                    (DiveAttackTarget[DiveAttackLoop] is alive) Equal to True
                  Then - Actions
                    Trigger - Turn off Dive_Attack_order_checks <gen>
                    Unit - Remove Cargo Hold (Orc Burrow) from DiveAttackCaster[DiveAttackLoop]
                    Unit - Order DiveAttackCaster[DiveAttackLoop] to Stop.
                    Unit - Order DiveAttackCaster[DiveAttackLoop] to Attack.DiveAttackTarget[DiveAttackLoop]
                    Trigger - Turn on Dive_Attack_order_checks <gen>
                  Else - Actions
                Unit Group - Remove DiveAttackCaster[DiveAttackLoop] from DiveAttackGroup.
                Set VariableSet DiveAttackCaster[DiveAttackLoop] = DiveAttackCaster[DiveAttackIndex]
                Set VariableSet DiveAttackHeight[DiveAttackLoop] = DiveAttackHeight[DiveAttackIndex]
                Set VariableSet DiveAttackCooldownTimer[DiveAttackLoop] = DiveAttackCooldownTimer[DiveAttackIndex]
                Set VariableSet DiveAttackTarget[DiveAttackLoop] = DiveAttackTarget[DiveAttackIndex]
                Set VariableSet DiveAttackState[DiveAttackLoop] = DiveAttackState[DiveAttackIndex]
                Set VariableSet DiveAttackCanceled[DiveAttackLoop] = DiveAttackCanceled[DiveAttackIndex]
                Set VariableSet DiveAttackSpeed[DiveAttackLoop] = DiveAttackSpeed[DiveAttackIndex]
                Set VariableSet DiveAttackMaxDur[DiveAttackLoop] = DiveAttackMaxDur[DiveAttackIndex]
                Set VariableSet DiveAttackDamage[DiveAttackLoop] = DiveAttackDamage[DiveAttackIndex]
                Set VariableSet DiveAttackHeal[DiveAttackLoop] = DiveAttackHeal[DiveAttackIndex]
                Set VariableSet DiveAttackIndex = (DiveAttackIndex - 1)
                Set VariableSet DiveAttackLoop = (DiveAttackLoop - 1)
                If (DiveAttackIndex Equal to 0) then do (Turn off (This trigger)) else do (Do nothing)
              Else - Actions
          Else - Actions