• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[GUI] Essence Shift / Revivable Hero

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
No describe for this spell





  • Spell Init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set ES_Duration_Setup[1] = 15
      • Set ES_Duration_Setup[2] = 30
      • Set ES_Duration_Setup[3] = 60
      • Set ES_Duration_Setup[4] = 120



  • Essence Shift Add Group
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • ((Entering unit) is in ES_RegisGroup) Equal to False
    • Actions
      • Unit Group - Add (Entering unit) to ES_RegisGroup
      • Trigger - Add to Essence Shift Take Damage <gen> the event (Unit - (Entering unit) Takes damage)



  • Essence Shift Attacking
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Essence Shift for (Attacking unit)) Greater than 0
      • ((Attacking unit) is A Hero) Equal to True
      • ((Attacking unit) belongs to an enemy of (Owner of (Attacked unit))) Equal to True
      • ((Strength of (Attacked unit) (Exclude bonuses)) Greater than 1) and (((Agility of (Attacked unit) (Exclude bonuses)) Greater than 1) and ((Intelligence of (Attacked unit) (Exclude bonuses)) Greater than 1))
    • Actions
      • Set ES_Attacking_Unit = (Attacking unit)
      • Set ES_Attacked_Unit = (Attacked unit)



  • Essence Shift Take Damage
    • Events
    • Conditions
      • ((Triggering unit) Equal to ES_Attacked_Unit) and ((Damage source) Equal to ES_Attacking_Unit)
    • Actions
      • Custom script: set udg_ES_Attacking_Unit = null
      • Custom script: set udg_ES_Attacked_Unit = null
      • Set ES_Count = (ES_Count + 1)
      • Set ES_Attacker[ES_Count] = (Damage source)
      • Set ES_Attacked[ES_Count] = (Triggering unit)
      • Set ES_AttackerLvl[ES_Count] = (Level of ES_Attacker[ES_Count])
      • Set ES_SpellLvl[ES_Count] = (Level of Essence Shift for ES_Attacker[ES_Count])
      • Set ES_Duration[ES_Count] = ES_Duration_Setup[ES_SpellLvl[ES_Count]]
      • Hero - Modify Agility of ES_Attacker[ES_Count]: Add 3
      • Hero - Modify Strength of ES_Attacked[ESIndexLoop]: Subtract 1
      • Hero - Modify Agility of ES_Attacked[ESIndexLoop]: Subtract 1
      • Hero - Modify Intelligence of ES_Attacked[ESIndexLoop]: Subtract 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ES_Count Equal to 1
        • Then - Actions
          • Trigger - Turn on Essence Shift Loop <gen>
        • Else - Actions
      • Custom script: set udg_ES_SpellLvl [ udg_ES_Count ] = 0
      • Custom script: set udg_ES_AttackerLvl [ udg_ES_Count ] = 0



  • Essence Shift Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ESIndexLoop) from 1 to ES_Count, do (Actions)
        • Loop - Actions
          • Set ES_Duration[ESIndexLoop] = (ES_Duration[ESIndexLoop] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ES_Duration[ESIndexLoop] Less than or equal to 0
            • Then - Actions
              • Hero - Modify Agility of ES_Attacker[ESIndexLoop]: Subtract 3
              • Hero - Modify Strength of ES_Attacked[ESIndexLoop]: Add 1
              • Hero - Modify Agility of ES_Attacked[ESIndexLoop]: Add 1
              • Hero - Modify Intelligence of ES_Attacked[ESIndexLoop]: Add 1
              • Custom script: set udg_ES_Attacker [ udg_ESIndexLoop ] = udg_ES_Attacker [ udg_ES_Count ]
              • Custom script: set udg_ES_Attacker [ udg_ES_Count ] = null
              • Custom script: set udg_ES_Attacked [ udg_ESIndexLoop ] = udg_ES_Attacked [ udg_ES_Count ]
              • Custom script: set udg_ES_Attacked [ udg_ES_Count ] = null
              • Custom script: set udg_ES_Duration [ udg_ESIndexLoop ] = udg_ES_Duration [ udg_ES_Count ]
              • Custom script: set udg_ES_Duration [ udg_ES_Count ] = 0
              • Custom script: set udg_ESIndexLoop = udg_ESIndexLoop - 1
              • Custom script: set udg_ES_Count = udg_ES_Count - 1
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ES_Count Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions



  • Essence Shift Die
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • (Level of Essence Shift for (Dying unit)) Greater than 0
    • Actions
      • For each (Integer ESIndexLoop2) from 1 to ES_Count, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ES_Attacker[ESIndexLoop2] Equal to (Dying unit)
            • Then - Actions
              • Set ES_Duration[ESIndexLoop2] = 0
            • Else - Actions






  • Revivable Heroes Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ReviveTime_Factor = 2.25



  • Revivable Heroes
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set Revive_Count = (Revive_Count + 1)
      • Set Revive_DyingUnit[Revive_Count] = (Dying unit)
      • Set Revive_OwnDyingUnit[Revive_Count] = (Owner of Revive_DyingUnit[Revive_Count])
      • Set Revive_LvlDyingUnit = (Level of Revive_DyingUnit[Revive_Count])
      • Set Revive_BaseTime = ((Real(Revive_LvlDyingUnit)) x ReviveTime_Factor)
      • If ((Revive_DyingUnit[Revive_Count] has an item of type Scroll of the Unholy Legion [-6s]) Equal to True) then do (Set Revive_Reduce = (Revive_Reduce + 6.00)) else do (Do nothing)
      • If ((Revive_DyingUnit[Revive_Count] has an item of type Life Token [-9s]) Equal to True) then do (Set Revive_Reduce = (Revive_Reduce + 9.00)) else do (Do nothing)
      • If ((Revive_DyingUnit[Revive_Count] has an item of type Ankh of Revivable [-12s]) Equal to True) then do (Set Revive_Reduce = (Revive_Reduce + 12.00)) else do (Do nothing)
      • If ((Revive_DyingUnit[Revive_Count] has an item of type Horn of Soul) Equal to True) then do (Set Revive_Reduce = (Revive_Reduce + (Real((Charges remaining in (Item carried by Revive_DyingUnit[Revive_Count] of type Horn of Soul)))))) else do (Do nothing)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Revive_DyingUnit[Revive_Count] has an item of type Horn of Soul) Equal to True
        • Then - Actions
          • Set Revive_Reduce = (Revive_Reduce + (Real((Charges remaining in (Item carried by Revive_DyingUnit[Revive_Count] of type Horn of Soul)))))
          • Hero - Add (Charges remaining in (Item carried by Revive_DyingUnit[Revive_Count] of type Horn of Soul)) experience to Revive_DyingUnit[Revive_Count], Hide level-up graphics
          • Item - Set charges remaining in (Item carried by Revive_DyingUnit[Revive_Count] of type Horn of Soul) to 0
        • Else - Actions
      • If ((Revive_DyingUnit[Revive_Count] has an item of type Horn of Soul) Equal to True) then do (Set Revive_Reduce = (Revive_Reduce + (Real((Charges remaining in (Item carried by Revive_DyingUnit[Revive_Count] of type Horn of Soul)))))) else do (Do nothing)
      • Set Revive_ReviveTime[Revive_Count] = (Revive_BaseTime - Revive_Reduce)
      • If (Revive_ReviveTime[Revive_Count] Greater than 100.00) then do (Set Revive_ReviveTime[Revive_Count] = 100.00) else do (Do nothing)
      • If (Revive_ReviveTime[Revive_Count] Less than or equal to 0.00) then do (Set Revive_ReviveTime[Revive_Count] = 1.00) else do (Do nothing)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Revive_ShowTime[(Player number of Revive_OwnDyingUnit[Revive_Count])] Equal to True
        • Then - Actions
          • Countdown Timer - Create a timer window for Revive_Timer[Revive_Count] with title (Name of Revive_OwnDyingUnit[Revive_Count])
          • Set Revive_TimerWindows[Revive_Count] = (Last created timer window)
          • Countdown Timer - Show Revive_TimerWindows[Revive_Count] for Revive_OwnDyingUnit[Revive_Count]
          • Countdown Timer - Start Revive_Timer[Revive_Count] as a One-shot timer that will expire in Revive_ReviveTime[Revive_Count] seconds
          • Set Revive_Timer[Revive_Count] = (Last started timer)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Revive_Count Equal to 1
        • Then - Actions
          • Trigger - Turn on Revivable Heroes Loop <gen>
        • Else - Actions
      • Custom script: set udg_Revive_LvlDyingUnit = 0
      • Custom script: set udg_Revive_BaseTime = 0
      • Custom script: set udg_Revive_Reduce = 0



  • Revivable Heroes Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ReviveIndexLoop) from 1 to Revive_Count, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Revive_DyingUnit[ReviveIndexLoop] is dead) Equal to False
            • Then - Actions
              • Set Revive_ReviveTime[ReviveIndexLoop] = 0.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Revive_ReviveTime[ReviveIndexLoop] Less than or equal to 0.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Revive_OwnDyingUnit[ReviveIndexLoop] controller) Not equal to User
                • Then - Actions
                  • Hero - Instantly revive Revive_DyingUnit[ReviveIndexLoop] at (Revive_OwnDyingUnit[ReviveIndexLoop] start location), Show revival graphics
                • Else - Actions
                  • Hero - Instantly revive Revive_DyingUnit[ReviveIndexLoop] at (Random point in (Playable map area)), Show revival graphics
              • Unit - Set life of Revive_DyingUnit[ReviveIndexLoop] to 100.00%
              • Unit - Set mana of Revive_DyingUnit[ReviveIndexLoop] to 100.00%
              • Animation - Reset Revive_DyingUnit[ReviveIndexLoop]'s body-part facing
              • Unit - Remove All buffs from Revive_DyingUnit[ReviveIndexLoop]
              • Animation - Change Revive_DyingUnit[ReviveIndexLoop]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • If ((Revive_DyingUnit[ReviveIndexLoop] is paused) Equal to True) then do (Unit - Unpause Revive_DyingUnit[ReviveIndexLoop]) else do (Do nothing)
              • Selection - Select Revive_DyingUnit[Revive_Count] for Revive_OwnDyingUnit[ReviveIndexLoop]
              • Countdown Timer - Destroy Revive_TimerWindows[ReviveIndexLoop]
              • Custom script: set udg_Revive_TimerWindows [ udg_ReviveIndexLoop ] = udg_Revive_TimerWindows [ udg_Revive_Count ]
              • Custom script: set udg_Revive_ReviveTime [ udg_ReviveIndexLoop ] = udg_Revive_ReviveTime [ udg_Revive_Count ]
              • Custom script: set udg_Revive_ReviveTime [ udg_Revive_Count ] = 0
              • Custom script: set udg_Revive_DyingUnit [ udg_ReviveIndexLoop ] = udg_Revive_DyingUnit [ udg_Revive_Count ]
              • Custom script: set udg_Revive_DyingUnit [ udg_Revive_Count ] = null
              • Custom script: set udg_Revive_OwnDyingUnit [ udg_ReviveIndexLoop ] = udg_Revive_OwnDyingUnit [ udg_Revive_Count ]
              • Custom script: set udg_Revive_OwnDyingUnit [ udg_Revive_Count ] = null
              • Custom script: set udg_ReviveIndexLoop = udg_ReviveIndexLoop - 1
              • Custom script: set udg_Revive_Count = udg_Revive_Count - 1
            • Else - Actions
              • Set Revive_ReviveTime[ReviveIndexLoop] = (Revive_ReviveTime[ReviveIndexLoop] - 0.10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Revive_Count Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions





Changelog

Now - First release version
Maker/Credit

By : [rainbow][App][/rainbow]
Keywords:
Essence Shift, Revive, Revivable, Revivable Hero, Passive Cooldown
Contents

[GUI] Essence Shift / Revivable Hero (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 11:18, 14th Jun 2014 BPower: Please use one of the existing damage detection systems from our database. Like Timer systems DDSs are complex and require a decent knowledge. Please also...

Moderator

M

Moderator

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

11:18, 14th Jun 2014
BPower:
Please use one of the existing damage detection systems from our database. Like Timer systems DDSs are complex and require a decent knowledge. Please also don't feel encouraged to design your own, we have enough of them.
 
Your triggers are also inefficient.
Anything used twice or more should be stored into a variable and the variable should be used.
Also never use entering unit or attacked unit. Use triggering unit instead.
In your ITEs don't use (Do nothing). Use a comment if you have to. Do nothing slows down the trigger. It is inefficient.

This is a good system but I think it needs added functionality.

*It should have the ability to revive hero units at a different interval.
**The interval should be able to include unit type / based on stats / based on level.

*It would be nice if it could revive units also.

*You need to have a lot more configurables.

*Almost all configurables should be in map init trigger.

*The periodic trigger should run every 0.03 seconds not every 0.1
**The time should be able to be changed easily since you use it in the ITEs below think about making it into a configurable variable.

*As said above a DDS would be very good with this. (Although it should be noted that any can be used. Daffa was just recommending one he likes.)
**I prefer the one made by looking for help. It is called Physical damage detection. It detects damage based on code / physical / spell.
 
Level 3
Joined
Oct 8, 2012
Messages
24
you dont make a dds silly you simply use one of the existing dds http://www.hiveworkshop.com/forums/...e-v2-2-1-0-a-201016/?prev=d=list&r=20&u=bribe

I dont know how to make dds in this example, but I see that it may be made by these actions. it's true or not?


  • Custom script: function CreateDmgEv takes nothing returns nothing
  • Custom script: set udg_DamageEventTrigger = CreateTrigger()
  • Custom script: call TriggerAddCondition(udg_DamageEventTrigger, Filter(function OnDmgEv))
  • Custom script: endfunction
  • Custom script:
  • Custom script: function SetupDmgEv takes nothing returns boolean
  • Custom script: local integer pdex = udg_UDex
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • UnitIndexEvent Equal to 1.00
    • Then - Actions
      • Set TempUnit = UDexUnits[UDex]
      • Custom script: if GetUnitAbilityLevel(udg_TempUnit, 'Aloc') == 0 and DmgEvFilter() then
      • Set UnitDamageRegistered[UDex] = True
      • Trigger - Add to DamageEventTrigger the event (Unit - TempUnit Takes damage)
      • Custom script: endif
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitDamageRegistered[UDex] Equal to True
        • Then - Actions
          • Set UnitDamageRegistered[UDex] = False
          • Set DamageEventsWasted = (DamageEventsWasted + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DamageEventsWasted Equal to 15
            • Then - Actions
              • Set DamageEventsWasted = 0
              • Custom script: call DestroyTrigger(udg_DamageEventTrigger)
              • Custom script: call CreateDmgEv()
              • Set UDex = UDexNext[0]
              • Custom script: loop
              • Custom script: exitwhen udg_UDex == 0
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • UnitDamageRegistered[UDex] Equal to True
                • Then - Actions
                  • Trigger - Add to DamageEventTrigger the event (Unit - UDexUnits[UDex] Takes damage)
                • Else - Actions
              • Set UDex = UDexNext[UDex]
              • Custom script: endloop
              • Custom script: set udg_UDex = pdex
            • Else - Actions
        • Else - Actions
  • Custom script: return false
  • Custom script: endfunction
  • Custom script:
  • Custom script: function InitDamageEvent takes nothing returns nothing
  • Custom script: call CreateDmgEv()
  • Custom script: call TriggerAddCondition(GetTriggeringTrigger(), Filter(function SetupDmgEv))
  • Set UnitIndexerEnabled = False
  • Custom script: set udg_TempUnit = CreateUnit(Player(15), 'uloc', 0, 0, 0)
  • Set UnitIndexerEnabled = True
  • Unit - Add DamageBlockingAbility to TempUnit
  • Unit - Remove TempUnit from the game
  • Countdown Timer - Start DmgEvTimer as a One-shot timer that will expire in 0.00 seconds
  • Trigger - Run (This trigger) (checking conditions)
 
Last edited:
Top