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. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. Ride into the sunset with the 32nd Modeling Contest.
    Dismiss Notice
  5. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  6. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    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

AoD.w3x
Variables
Initialization
Melee Initialization
Untitled Trigger 001
Untitled Trigger 002
Untitled Trigger 002 Copy
Untitled Trigger 003
Untitled Trigger 004
Untitled Trigger 007
Arrow of Death
DestructableLib
AoD Init
AoD Run
AoD Loop
AoD Target
AoD Area
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.

		
Name Type Is Array Initial Value
AoD_Ability abilcode No
AoD_Angle real No
AoD_Animater unitcode No
AoD_Arrow unit Yes
AoD_ArrowType unitcode No
AoD_BounceChance integer Yes
AoD_Caster unit Yes
AoD_Damage real Yes
AoD_Damage2 real Yes
AoD_Damage2Enabled boolean No
AoD_Damage2PerLevel real No
AoD_DamagePerLevel real No
AoD_DeathFeature boolean No
AoD_DesirablePoint location No
AoD_Effect string No
AoD_EffectInterval integer No
AoD_From location No
AoD_Index integer Yes
AoD_IndexMaxSize integer No
AoD_IndexSize integer No
AoD_KillDestructibles boolean No
AoD_Loop integer No
AoD_PercentPerLevel integer No
AoD_Region rect No
AoD_SecondaryEffect string No
AoD_Speed real No
AoD_Target unit Yes
AoD_Timing integer Yes
AoD_To location No
TempGroup group No
TempInt integer No
TempPoint location No
TempReal real No
TempUnit unit No
TempUnit2 unit No
Default melee game initialization for all players
Melee Initialization
  Events
    Map initialization
  Conditions
  Actions
    Unit - Change color of Tauren 0031 <gen> to Red
    Unit - Change color of Watch Tower 0030 <gen> to Red
    Unit - Change color of Tauren 0029 <gen> to Red
    Unit - Change color of Dark Ranger 0002 <gen> to Purple
    Unit - Change color of Dark Ranger 0001 <gen> to Blue
    Unit - Change color of Dark Ranger 0003 <gen> to Purple
    Unit - Change color of Priestess of the Moon 0042 <gen> to Teal
    Unit - Order Acolyte 0037 <gen> to Harvest.Haunted Gold Mine 0032 <gen>
    Unit - Order Acolyte 0036 <gen> to Harvest.Haunted Gold Mine 0032 <gen>
    Unit - Order Acolyte 0033 <gen> to Harvest.Haunted Gold Mine 0032 <gen>
    Unit - Order Acolyte 0034 <gen> to Harvest.Haunted Gold Mine 0032 <gen>
    Unit - Order Acolyte 0035 <gen> to Harvest.Haunted Gold Mine 0032 <gen>
    Destructible - Make Demonic Gate 1929 <gen> Invulnerable
    Unit - Order Wisp 0041 <gen> to Harvest.Ashenvale Tree Wall 0566 <gen>
    Visibility - Disable fog of war
    Visibility - Disable black mask
    Player - Make Player 1 (Red) treat Player 4 (Purple) as an Ally
    Player - Make Player 4 (Purple) treat Player 1 (Red) as an Ally
    Animation - Play Necromancer 0062 <gen>'s stand channel (animationname) animation
Untitled Trigger 001
  Events
    Time - Every 6.00 seconds of game time
  Conditions
  Actions
    Unit - Order Ancient of War 0038 <gen> to train/upgrade to a Archer
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in (Units owned by Neutral Hostile of type Archer)) Greater than 5
      Then - Actions
        Unit Group - Pick every unit in (Units owned by Neutral Hostile of type Archer) and do (Actions)
          Loop - Actions
            Unit - Order (Picked unit) to Attack-Move To.(Position of Haunted Gold Mine 0032 <gen>)
        Unit - Order Priestess of the Moon 0042 <gen> to Attack-Move To.(Position of Haunted Gold Mine 0032 <gen>)
      Else - Actions
        Unit Group - Pick every unit in (Units owned by Neutral Hostile of type Archer) and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Life of (Picked unit)) Less than 100.00
              Then - Actions
                Unit - Order (Picked unit) to Night Elf Sentinels - Hide.
              Else - Actions
                Unit - Order (Picked unit) to Move To.(Random point in Region_000 <gen>)
            Unit - Order Priestess of the Moon 0042 <gen> to Move To.(Random point in Region_000 <gen>)
Untitled Trigger 002
  Events
    Unit - A unit enters Region_001 <gen>
  Conditions
    (Number of units in (Units in Region_001 <gen>)) Equal to 0
  Actions
    Destructible - Open Demonic Gate 1929 <gen>
Untitled Trigger 002 Copy
  Events
    Unit - A unit leaves Region_001 <gen>
  Conditions
    (Number of units in (Units in Region_001 <gen>)) Equal to 0
  Actions
    Destructible - Close Demonic Gate 1929 <gen>
Untitled Trigger 003
  Events
    Time - Elapsed game time is 30.00 seconds
  Conditions
  Actions
    Unit - Order Wisp 0041 <gen> to build a Ancient Protector at (Center of Region_002 <gen>)
Untitled Trigger 004
  Events
    Time - Every 20.00 seconds of game time
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Necromancer 0062 <gen> is alive) Equal to True
      Then - Actions
        Special Effect - Create a special effect at (Center of Region_003 <gen>) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Unit - Create 1.Ghoul for Player 4 (Purple) at (Center of Region_003 <gen>) facing Default building facing degrees
        Unit - Order (Last created unit) to Attack-Move To.(Random point in Region_000 <gen>)
      Else - Actions
        Trigger - Turn off (This trigger)
Untitled Trigger 007
  Events
    Unit - Necromancer 0062 <gen> Is attacked
  Conditions
  Actions
    Animation - Reset Necromancer 0062 <gen>'s animation
    Trigger - Turn off Untitled_Trigger_004 <gen>
//TESH.scrollpos=0
//TESH.alwaysfold=0
library DestructableLib initializer Initialization
//* ============================================================================ *
//* Made by PitzerMike                                                           *
//*                                                                              *
//* I made this to detect if a destructable is a tree or not. It works not only  *
//* for the standard trees but also for custom destructables created with the    *
//* object editor. It uses a footie as a dummy with the goul's harvest ability.  *
//* The dummy ids can be changed though. I also added the IsDestructableDead     *
//* function for completeness.                                                   *
//* ============================================================================ *

globals
    private constant integer DUMMY_UNIT_ID = 'hfoo' // footman
    private constant integer HARVEST_ID    = 'Ahrl' // ghouls harvest
    private constant player OWNING_PLAYER  = Player(15)
   
    private unit dummy = null
endglobals

function IsDestructableDead takes destructable dest returns boolean
    return GetDestructableLife(dest) <= 0.405
endfunction

function IsDestructableTree takes destructable dest returns boolean
    local boolean result = false
    if (dest != null) then
        call PauseUnit(dummy, false)
        set result = IssueTargetOrder(dummy, "harvest", dest)
        call PauseUnit(dummy, true) // stops order
    endif
    return result
endfunction

private function Initialization takes nothing returns nothing
    set dummy = CreateUnit(OWNING_PLAYER, DUMMY_UNIT_ID, 0.0, 0.0, 0.0)
    call ShowUnit(dummy, false) // cannot enumerate
    call UnitAddAbility(dummy, HARVEST_ID)
    call UnitAddAbility(dummy, 'Aloc') // unselectable, invulnerable
    call PauseUnit(dummy, true)
endfunction
endlibrary
 
AoD Init
  Events
    Map initialization
  Conditions
  Actions
    -------- --------
    -------- Animater (Unit): --------
    Set VariableSet AoD_Animater = Animate Dead
    -------- Arrow of Death (Unit): --------
    Set VariableSet AoD_ArrowType = Arrow of Death
    -------- To kill destructibles on arrow's way: --------
    Set VariableSet AoD_KillDestructibles = True
    -------- Configure this to change arrow's damage: --------
    Set VariableSet AoD_DamagePerLevel = 100.00
    -------- Configure this to change arrow's speed (notice 0.03 loop): --------
    Set VariableSet AoD_Speed = 18.00
    -------- This is the effect when arrow moves: --------
    Set VariableSet AoD_Effect = Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
    -------- This is the effect when arrow dies/bounces: --------
    Set VariableSet AoD_SecondaryEffect = Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
    -------- This is the chance of arrow bouncing once, increasing every level. 0 for no bounce. --------
    Set VariableSet AoD_PercentPerLevel = 20
    -------- Interval between moving effects: --------
    Set VariableSet AoD_EffectInterval = 10
    -------- When true it spawns the AoD_Animator if the target dies by the arrow: --------
    Set VariableSet AoD_DeathFeature = True
    -------- Move effect damage enabled: --------
    Set VariableSet AoD_Damage2Enabled = False
    -------- Configure this to change arrow's move effect damage: --------
    Set VariableSet AoD_Damage2PerLevel = 50.00
    -------- --------
AoD Run
  Events
  Conditions
  Actions
    -------- --------
    Set VariableSet AoD_IndexSize = (AoD_IndexSize + 1)
    -------- --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AoD_IndexSize Greater than AoD_IndexMaxSize
      Then - Actions
        Set VariableSet AoD_Index[AoD_IndexSize] = AoD_IndexSize
        Set VariableSet AoD_IndexMaxSize = AoD_IndexSize
      Else - Actions
    -------- --------
    Set VariableSet TempInt = AoD_Index[AoD_IndexSize]
    -------- --------
    Set VariableSet AoD_Caster[TempInt] = TempUnit
    Set VariableSet AoD_Target[TempInt] = TempUnit2
    Set VariableSet AoD_From = (Position of AoD_Caster[TempInt])
    Set VariableSet AoD_Angle = (Facing of AoD_Caster[TempInt])
    Set VariableSet AoD_Timing[TempInt] = 0
    Set VariableSet AoD_Damage[TempInt] = (AoD_DamagePerLevel x (Real((Level of AoD_Ability for AoD_Caster[TempInt]))))
    Set VariableSet AoD_Damage2[TempInt] = (AoD_Damage2PerLevel x (Real((Level of AoD_Ability for AoD_Caster[TempInt]))))
    Set VariableSet AoD_BounceChance[TempInt] = (AoD_PercentPerLevel x (Level of AoD_Ability for AoD_Caster[TempInt]))
    -------- --------
    Unit - Create 1.AoD_ArrowType for (Owner of AoD_Caster[TempInt]) at AoD_From facing AoD_Angle degrees
    Set VariableSet AoD_Arrow[TempInt] = (Last created unit)
    Trigger - Turn on AoD_Loop <gen>
    -------- --------
    Custom script: call RemoveLocation(udg_AoD_From)
    -------- --------
AoD Loop
  Events
    Time - Every 0.03 seconds of game time
  Conditions
  Actions
    -------- --------
    For each (Integer TempInt) from 1 to AoD_IndexSize, do (Actions)
      Loop - Actions
        Set VariableSet AoD_Loop = AoD_Index[TempInt]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (AoD_Arrow[AoD_Loop] is alive) Equal to True
          Then - Actions
            -------- --------
            -------- Setting the location of the arrow --------
            Set VariableSet AoD_From = (Position of AoD_Arrow[AoD_Loop])
            Set VariableSet AoD_DesirablePoint = (Position of AoD_Target[AoD_Loop])
            Set VariableSet AoD_Angle = (Angle from AoD_From to AoD_DesirablePoint)
            Set VariableSet AoD_To = (AoD_From offset by AoD_Speed towards AoD_Angle degrees.)
            -------- --------
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                AoD_Timing[AoD_Loop] Less than AoD_EffectInterval
              Then - Actions
                Set VariableSet AoD_Timing[AoD_Loop] = (AoD_Timing[AoD_Loop] + 1)
              Else - Actions
                -------- --------
                -------- If the AoD_Timing equal to AoD_EffectInterval, it will spawn the moving effect --------
                Special Effect - Create a special effect at AoD_To using AoD_Effect
                Special Effect - Destroy (Last created special effect)
                -------- --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    AoD_Damage2Enabled Equal to True
                  Then - Actions
                    -------- --------
                    -------- This will locate any nearby enemy --------
                    Set VariableSet TempGroup = (Units within 100.00 of AoD_To matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A flying unit) Equal to False) and ((((Owner of (Matching unit)) is an enemy of (Owner of AoD_Caster[AoD_Loop]).) Equal to True) and ((Matching unit) Not equal to AoD_Target[AoD_Loop])))).)
                    -------- --------
                    Unit Group - Pick every unit in TempGroup and do (Actions)
                      Loop - Actions
                        -------- This will damage nearby enemies --------
                        Unit - Cause AoD_Caster[AoD_Loop] to damage (Picked unit), dealing AoD_Damage2[AoD_Loop] damage of attack type Spells and damage type Universal
                    -------- --------
                    Custom script: call DestroyGroup(udg_TempGroup)
                    -------- --------
                  Else - Actions
                -------- Reset the effect interval --------
                Set VariableSet AoD_Timing[AoD_Loop] = 0
            -------- Moving the arrow --------
            Unit - Move AoD_Arrow[AoD_Loop] instantly to AoD_To, facing AoD_Angle degrees
            -------- --------
            -------- Destroying any nearby tree --------
            Set VariableSet AoD_Region = (Region centered at AoD_To with size (100.00, 100.00))
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                AoD_KillDestructibles Equal to True
              Then - Actions
                Destructible - Pick every destructible in AoD_Region and do (Actions)
                  Loop - Actions
                    Custom script: if (IsDestructableTree(GetEnumDestructable())) then
                    Destructible - Kill (Picked destructible)
                    Custom script: endif
              Else - Actions
            -------- --------
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (AoD_Region contains AoD_Target[AoD_Loop]) Equal to True
              Then - Actions
                -------- Making the arrow "bounce" if possible --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random integer number between 1 and 100) Less than or equal to AoD_BounceChance[AoD_Loop]
                  Then - Actions
                    -------- --------
                    Special Effect - Create a special effect attached to the chest (attachpoint) of AoD_Arrow[AoD_Loop] using AoD_SecondaryEffect
                    Special Effect - Destroy (Last created special effect)
                    Unit - Cause AoD_Caster[AoD_Loop] to damage AoD_Target[AoD_Loop], dealing AoD_Damage[AoD_Loop] damage of attack type Spells and damage type Universal
                    -------- --------
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        AoD_DeathFeature Equal to True
                        (AoD_Target[AoD_Loop] is dead) Equal to True
                      Then - Actions
                        -------- Death feature is the animate death ability casted by the second dummy unit --------
                        Set VariableSet TempPoint = (Position of AoD_Target[AoD_Loop])
                        Unit - Create 1.AoD_Animater for (Owner of AoD_Caster[AoD_Loop]) at TempPoint facing Default building facing degrees
                        Set VariableSet TempUnit = (Last created unit)
                        Unit - Order TempUnit to Undead Death Knight - Animate Dead.
                        Unit - Add a 1.00 second Generic expiration timer to TempUnit
                        Custom script: call RemoveLocation(udg_TempPoint)
                      Else - Actions
                    -------- --------
                    -------- Death feature is the animate death ability casted by the second dummy unit --------
                    Set VariableSet TempGroup = (Units within 400.00 of AoD_To matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A flying unit) Equal to False) and ((((Owner of (Matching unit)) is an enemy of (Owner of AoD_Caster[AoD_Loop]).) Equal to True) and ((Matching unit) Not equal to AoD_Target[AoD_Loop])))).)
                    Set VariableSet AoD_Target[AoD_Loop] = (Random unit from TempGroup)
                    -------- Disabling the bounce --------
                    Set VariableSet AoD_BounceChance[AoD_Loop] = 0
                    -------- --------
                    Custom script: call DestroyGroup(udg_TempGroup)
                    -------- --------
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        AoD_Target[AoD_Loop] Equal to No unit
                      Then - Actions
                        -------- --------
                        Unit - Kill AoD_Arrow[AoD_Loop]
                        -------- --------
                        Skip remaining actions
                      Else - Actions
                  Else - Actions
                    -------- --------
                    Special Effect - Create a special effect attached to the chest (attachpoint) of AoD_Arrow[AoD_Loop] using AoD_SecondaryEffect
                    Special Effect - Destroy (Last created special effect)
                    -------- --------
                    Unit - Kill AoD_Arrow[AoD_Loop]
                    Unit - Cause AoD_Caster[AoD_Loop] to damage AoD_Target[AoD_Loop], dealing AoD_Damage[AoD_Loop] damage of attack type Spells and damage type Universal
                    -------- --------
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        AoD_DeathFeature Equal to True
                        (AoD_Target[AoD_Loop] is dead) Equal to True
                      Then - Actions
                        -------- Death feature is the animate death ability casted by the second dummy unit --------
                        Set VariableSet TempPoint = (Position of AoD_Target[AoD_Loop])
                        Unit - Create 1.AoD_Animater for (Owner of AoD_Caster[AoD_Loop]) at TempPoint facing Default building facing degrees
                        Set VariableSet TempUnit = (Last created unit)
                        Unit - Order TempUnit to Undead Death Knight - Animate Dead.
                        Unit - Add a 1.00 second Generic expiration timer to TempUnit
                        Custom script: call RemoveLocation(udg_TempPoint)
                      Else - Actions
                    -------- --------
                    -------- Avoiding double damage --------
                    Skip remaining actions
                    -------- --------
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (AoD_Target[AoD_Loop] is dead) Equal to True
              Then - Actions
                Special Effect - Create a special effect attached to the chest (attachpoint) of AoD_Arrow[AoD_Loop] using AoD_SecondaryEffect
                Special Effect - Destroy (Last created special effect)
                Unit - Kill AoD_Arrow[AoD_Loop]
                Unit - Cause AoD_Caster[AoD_Loop] to damage AoD_Target[AoD_Loop], dealing AoD_Damage[AoD_Loop] damage of attack type Spells and damage type Universal
              Else - Actions
            -------- --------
            Custom script: call RemoveRect(udg_AoD_Region)
            Custom script: call RemoveLocation(udg_AoD_From)
            Custom script: call RemoveLocation(udg_AoD_To)
            Custom script: call RemoveLocation(udg_AoD_DesirablePoint)
            -------- --------
          Else - Actions
            -------- --------
            -------- Dynamic stuff --------
            Set VariableSet AoD_Index[TempInt] = AoD_Index[AoD_IndexSize]
            Set VariableSet AoD_Index[AoD_IndexSize] = AoD_Loop
            Set VariableSet AoD_IndexSize = (AoD_IndexSize - 1)
            Set VariableSet TempInt = (TempInt - 1)
            -------- --------
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                AoD_IndexSize Equal to 0
              Then - Actions
                Trigger - Turn off (This trigger)
                Skip remaining actions
              Else - Actions
    -------- --------
AoD Target
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Arrow of Death (Target)
  Actions
    -------- Arrow of Death (Ability): --------
    Set VariableSet AoD_Ability = Arrow of Death (Target)
    -------- --------
    Set VariableSet TempUnit = (Triggering unit)
    Set VariableSet TempUnit2 = (Target unit of ability being cast)
    Trigger - Run AoD_Run <gen> (ignoring conditions)
    -------- --------
AoD Area
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Arrow of Death (Area)
  Actions
    -------- Arrow of Death (Ability): --------
    Set VariableSet AoD_Ability = Arrow of Death (Area)
    -------- --------
    Set VariableSet TempReal = (250.00 + (50.00 x (Real((Level of AoD_Ability for (Triggering unit))))))
    Set VariableSet TempPoint = (Target point of ability being cast)
    Set VariableSet TempGroup = (Units within TempReal of TempPoint.)
    Unit Group - Pick every unit in TempGroup and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Owner of (Picked unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True
            ((Picked unit) is A flying unit) Equal to False
            ((Picked unit) is A structure) Equal to False
          Then - Actions
            Set VariableSet TempUnit = (Triggering unit)
            Set VariableSet TempUnit2 = (Picked unit)
            Trigger - Run AoD_Run <gen> (ignoring conditions)
          Else - Actions
    Custom script: call DestroyGroup(udg_TempGroup)
    Custom script: call RemoveLocation(udg_TempPoint)
    -------- --------