1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  4. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Viewer

Divine Judge FE.w3x
Variables
Testmap
Revive
Divine Judgement
Judge Config
Judge Cast
Judge Loop
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
Judge_Ability abilcode No
Judge_ActiveSFX string No
Judge_AoE real Yes
Judge_AttackType attacktype No
Judge_COUNT integer No
Judge_CurrentDuration real No
Judge_DamageType damagetype No
Judge_DPS real Yes
Judge_Duration real Yes
Judge_EffectPos string No
Judge_EffectSFX string No
Judge_Group group No
Judge_HASH hashtable No
Judge_HPS real Yes
Judge_KEY integer No
Judge_KEYDAMAGE integer No
Judge_KEYDUR integer No
Judge_KEYEFFECT integer No
Judge_KEYHEAL integer No
Judge_KEYLEVEL integer No
Judge_Level integer No
Judge_LoopSFX string No
Judge_LOOPTIME real No
Judge_LoopTrigger trigger No
Judge_MainGroup group No
Judge_Modifier real No
Judge_PercentDamage real Yes
Judge_Point location No
Judge_Source unit No
Judge_Victim unit No
TempLoc location No
TempUnit unit No
Revive
  Events
    Unit - A unit owned by Player 2 (Blue).Dies
  Conditions
  Actions
    Set VariableSet TempUnit = (Triggering unit)
    Set VariableSet TempLoc = (Position of TempUnit)
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 2 (Blue) at TempLoc facing Default building facing degrees
    Custom script: call RemoveLocation(udg_TempLoc)
Judge Config
  Events
    Map initialization
  Conditions
  Actions
    -------- Ability --------
    Set VariableSet Judge_Ability = Divine Judgement
    -------- Area of effect --------
    Set VariableSet Judge_AoE[1] = 400.00
    Set VariableSet Judge_AoE[2] = 400.00
    Set VariableSet Judge_AoE[3] = 400.00
    -------- Initial health percentage lost (max 100.00) --------
    Set VariableSet Judge_PercentDamage[1] = 20.00
    Set VariableSet Judge_PercentDamage[2] = 40.00
    Set VariableSet Judge_PercentDamage[3] = 60.00
    -------- Initial effect : Attack Type --------
    Set VariableSet Judge_AttackType = Spells
    -------- Initial effect : Damage Type --------
    Set VariableSet Judge_DamageType = Normal
    -------- Heal rate per second --------
    Set VariableSet Judge_HPS[1] = 10.00
    Set VariableSet Judge_HPS[2] = 20.00
    Set VariableSet Judge_HPS[3] = 30.00
    -------- Damage rate per second --------
    Set VariableSet Judge_DPS[1] = 10.00
    Set VariableSet Judge_DPS[2] = 20.00
    Set VariableSet Judge_DPS[3] = 30.00
    -------- Effect duration --------
    Set VariableSet Judge_Duration[1] = 20.00
    Set VariableSet Judge_Duration[2] = 20.00
    Set VariableSet Judge_Duration[3] = 20.00
    -------- Area blast SFX --------
    Set VariableSet Judge_ActiveSFX = Units\NightElf\Wisp\WispExplode.mdl
    -------- Effect SFX --------
    Set VariableSet Judge_EffectSFX = Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
    -------- Looping SFX --------
    Set VariableSet Judge_LoopSFX = Abilities\Spells\Items\StaffOfSanctuary\Staff_Sanctuary_Target.mdl
    -------- SFX Position (Looping and Effect only) --------
    Set VariableSet Judge_EffectPos = overhead
    -------- END CONFIG --------
    Set VariableSet Judge_LOOPTIME = 0.03
    Set VariableSet Judge_LoopTrigger = Judge_Loop <gen>
    Trigger - Add to Judge_LoopTrigger the event (Every Judge_LOOPTIME seconds of game time)
    Hashtable - Create a hashtable
    Set VariableSet Judge_HASH = (Last created hashtable)
    Set VariableSet Judge_COUNT = 0
    Set VariableSet Judge_KEYDUR = 1
    Set VariableSet Judge_KEYLEVEL = 2
    Set VariableSet Judge_KEYDAMAGE = 3
    Set VariableSet Judge_KEYHEAL = 4
Judge Cast
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Judge_Ability
  Actions
    -------- Variables setup --------
    Set VariableSet Judge_Source = (Triggering unit)
    Set VariableSet Judge_Point = (Target point of ability being cast)
    Set VariableSet Judge_Level = (Level of Judge_Ability for Judge_Source)
    Set VariableSet Judge_Group = (Units within Judge_AoE[Judge_Level] of Judge_Point.)
    -------- Field SFX --------
    Special Effect - Create a special effect at Judge_Point using Judge_ActiveSFX
    Special Effect - Destroy (Last created special effect)
    -------- Damage and Group Setup --------
    Unit Group - Pick every unit in Judge_Group and do (Actions)
      Loop - Actions
        Set VariableSet Judge_Victim = (Picked unit)
        Set VariableSet Judge_KEY = (Key (Picked unit).)
        -------- Insert conditions here --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Judge_Victim is A structure) Equal to False
            (Judge_Victim is Mechanical) Equal to False
            (Judge_Victim is Magic Immune) Equal to False
            (Judge_Victim is dead) Equal to False
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Judge_Victim is in Judge_MainGroup.) Equal to False
              Then - Actions
                Set VariableSet Judge_COUNT = (Judge_COUNT + 1)
              Else - Actions
            Unit - Cause Judge_Source to damage Judge_Victim, dealing ((Life of Judge_Victim) x (Judge_PercentDamage[Judge_Level] / 100.00)) damage of attack type Judge_AttackType and damage type Judge_DamageType
            Special Effect - Create a special effect attached to the Judge_EffectPos of Judge_Victim using Judge_EffectSFX
            Special Effect - Destroy (Last created special effect)
            Unit Group - Add Judge_Victim to Judge_MainGroup
            Hashtable - Save Judge_Duration[Judge_Level] as Judge_KEYDUR of Judge_KEY in Judge_HASH.
            Hashtable - Save Judge_Level as Judge_KEYLEVEL of Judge_KEY in Judge_HASH.
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Judge_Victim belongs to an ally of (Owner of Judge_Source).) Equal to True
              Then - Actions
                Hashtable - Save (Judge_HPS[Judge_Level] x Judge_LOOPTIME) as Judge_KEYHEAL of Judge_KEY in Judge_HASH.
                Hashtable - Save 0.00 as Judge_KEYDAMAGE of Judge_KEY in Judge_HASH.
              Else - Actions
                Hashtable - Save (Judge_DPS[Judge_Level] x Judge_LOOPTIME) as Judge_KEYDAMAGE of Judge_KEY in Judge_HASH.
                Hashtable - Save 0.00 as Judge_KEYHEAL of Judge_KEY in Judge_HASH.
          Else - Actions
    Custom script: call RemoveLocation(udg_Judge_Point)
    Custom script: call DestroyGroup(udg_Judge_Group)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Judge_COUNT Equal to 1
      Then - Actions
        Trigger - Turn on Judge_LoopTrigger
      Else - Actions
Judge Loop
  Events
  Conditions
  Actions
    -------- DoT and HoT --------
    Unit Group - Pick every unit in Judge_MainGroup and do (Actions)
      Loop - Actions
        Set VariableSet Judge_Victim = (Picked unit)
        Set VariableSet Judge_KEY = (Key (Picked unit).)
        Set VariableSet Judge_CurrentDuration = (Load Judge_KEYDUR of Judge_KEY from Judge_HASH.)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Judge_CurrentDuration Equal to Judge_Duration[(Load Judge_KEYLEVEL of Judge_KEY from Judge_HASH.)]
          Then - Actions
            -------- For safety reason, I would go with this. I tried to avoid any instance of spell causing a SFX left-over --------
            Special Effect - Destroy (Load Judge_KEYEFFECT of Judge_KEY in Judge_HASH.)
            Special Effect - Create a special effect attached to the Judge_EffectPos of Judge_Victim using Judge_LoopSFX
            Hashtable - Save Handle Of(Last created special effect) as Judge_KEYEFFECT of Judge_KEY in Judge_HASH.
          Else - Actions
        Set VariableSet Judge_Modifier = ((Load Judge_KEYDAMAGE of Judge_KEY from Judge_HASH.) - (Load Judge_KEYHEAL of Judge_KEY from Judge_HASH.))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Judge_Modifier Greater than or equal to ((Life of Judge_Victim) - 1)
          Then - Actions
            Unit - Set life of Judge_Victim to 1.00
          Else - Actions
            Unit - Set life of Judge_Victim to ((Life of Judge_Victim) - Judge_Modifier)
        Unit - Set mana of Judge_Victim to ((Mana of Judge_Victim) - Judge_Modifier)
        Set VariableSet Judge_CurrentDuration = (Judge_CurrentDuration - Judge_LOOPTIME)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                Judge_CurrentDuration Less than or equal to 0.00
                (Judge_Victim is alive) Equal to False
          Then - Actions
            Special Effect - Destroy (Load Judge_KEYEFFECT of Judge_KEY in Judge_HASH.)
            Hashtable - Clear all child hashtables of child Judge_KEY in Judge_HASH.
            Unit Group - Remove Judge_Victim from Judge_MainGroup.
            Set VariableSet Judge_COUNT = (Judge_COUNT - 1)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                Judge_COUNT Equal to 0
              Then - Actions
                Trigger - Turn off Judge_LoopTrigger
              Else - Actions
          Else - Actions
            Hashtable - Save Judge_CurrentDuration as Judge_KEYDUR of Judge_KEY in Judge_HASH.