Inner Shield

SouLEDGE

Damn you advanced calculus
Reaction score
75
Okay, so I'll be damned if I can't finish this spell.
Description: Passive spell with cooldown.
On enemy hit at creates a shield for 2 secs and absorbs incoming damage
When 2 secs is over it releases the damage in a 500 AOE.
The problem is it works for the first time round but then the spell(icon) and spell(cooldown) are not switched back.

Trigger:
  • Inner Shield Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Inner Shield (Research)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned skill level) Equal to 1
        • Then - Actions
          • Unit - Add Inner Shield (Icon) to (Triggering unit)
          • Trigger - Turn on Inner Shield <gen>
        • Else - Actions
      • Unit - Set level of Inner Shield (Cooldown) for (Triggering unit) to (Learned skill level)
      • Unit - Set level of Inner Shield (Icon) for (Triggering unit) to (Learned skill level)

Trigger:
  • Inner Shield
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Inner Shield (Icon) for GDD_DamagedUnit) Not equal to 0
      • ((Owner of GDD_DamageSource) is an enemy of (Owner of GDD_DamagedUnit)) Equal to True
    • Actions
      • Set IS_level = (Level of Inner Shield (Icon) for GDD_DamagedUnit)
      • Unit - Add Inner Shield (Cooldown) to GDD_DamagedUnit
      • Unit - Set level of Inner Shield (Cooldown) for GDD_DamagedUnit to IS_level
      • Unit - Remove Inner Shield (Icon) from GDD_DamagedUnit
      • Unit - Order GDD_DamagedUnit to Orc Troll Berserker - Berserk
      • -------- - --------
      • Trigger - Turn on Inner Shield Damage <gen>
      • Set IS_group = (Units within 500.00 of (Position of GDD_DamagedUnit))
      • Wait 2.00 seconds
      • Unit Group - Pick every unit in IS_group and do (Actions)
        • Loop - Actions
          • Unit - Cause GDD_DamagedUnit to damage (Picked unit), dealing IS_damage damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
      • Special Effect - Create a special effect attached to the origin of GDD_DamagedUnit using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Trigger - Turn off Inner Shield Damage <gen>
      • EGUI Leak - Destroy IS_group
      • Set IS_damage = 0.00
      • -------- - --------
      • Wait 8.00 seconds
      • Unit - Add Inner Shield (Icon) to GDD_DamagedUnit
      • Unit - Set level of Inner Shield (Icon) for GDD_DamagedUnit to IS_level
      • Unit - Remove Inner Shield (Cooldown) from GDD_DamagedUnit

Trigger:
  • Inner Shield Damage
    • Events
      • Game - GDD_Damage becomes Equal to 0.00
    • Conditions
      • (Level of Inner Shield (Icon) for GDD_DamagedUnit) Not equal to 0
      • (GDD_DamagedUnit has buff Inner Shield ) Equal to True
      • ((Owner of GDD_DamageSource) is an enemy of (Owner of GDD_DamagedUnit)) Equal to True
    • Actions
      • Set IS_damage = (IS_damage + GDD_Damage)
      • Unit - Set life of GDD_DamagedUnit to ((Life of GDD_DamagedUnit) + GDD_Damage)

The problem is it works for the first time round but then the spell(icon) and spell(cooldown) are not switched back and it doesn't work again. Any thoughts?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Trigger:
  • Inner Shield
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Inner Shield (Icon) for GDD_DamagedUnit) Not equal to 0
      • ((Owner of GDD_DamageSource) is an enemy of (Owner of GDD_DamagedUnit)) Equal to True
    • Actions
      • Set IS_level = (Level of Inner Shield (Icon) for GDD_DamagedUnit)
      • Unit - Add Inner Shield (Cooldown) to GDD_DamagedUnit
      • Unit - Set level of Inner Shield (Cooldown) for GDD_DamagedUnit to IS_level
      • Unit - Remove Inner Shield (Icon) from GDD_DamagedUnit
      • Unit - Order GDD_DamagedUnit to Orc Troll Berserker - Berserk
      • -------- - --------
      • Trigger - Turn on Inner Shield Damage <gen>
      • Set IS_group = (Units within 500.00 of (Position of GDD_DamagedUnit))
      • Wait 2.00 seconds
      • Unit Group - Pick every unit in IS_group and do (Actions)
        • Loop - Actions
          • Unit - Cause GDD_DamagedUnit to damage (Picked unit), dealing IS_damage damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
      • Special Effect - Create a special effect attached to the origin of GDD_DamagedUnit using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Trigger - Turn off Inner Shield Damage <gen>
      • EGUI Leak - Destroy IS_group
      • Set IS_damage = 0.00
      • -------- - --------
      • Wait 8.00 seconds
      • Unit - Add Inner Shield (Icon) to GDD_DamagedUnit
      • Unit - Set level of Inner Shield (Icon) for GDD_DamagedUnit to IS_level
      • Unit - Remove Inner Shield (Cooldown) from GDD_DamagedUnit
GDD's responses aren't wait-safe. If you want to use waits, you can use Triggering Unit in place of GDD_DamagedUnit. There isn't a wait-safe equivalent to GDD_DamageSource. Alternately, since your ability isn't MUI nor MPI (per use of a single global in Inner Shield Damage), you could just use another unit variable to save which unit has the ability.

Also, you might as well create the unit group IS_group after the wait, so the AOE is centered on the caster at the time of damage. Yet also, in the creation of that group, (Position of GDD_DamagedUnit) leaks a point. ;)

Trigger:
  • Inner Shield Damage
    • Events
      • Game - GDD_Damage becomes Equal to 0.00
Should be GDD_Event.
 

SouLEDGE

Damn you advanced calculus
Reaction score
75
Okay, I'll try and fix it in the mean time, maybe retry to do it, but how would I make it MUI? What do you suggest using instead of GDD so that it's wait safe?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
What do you suggest using instead of GDD so that it's wait safe?
Well, as I mentioned, you can Triggering Unit in place of GDD_DamagedUnit in order to be wait-safe, and since it's the only response you're using after the wait, it would be OK.

but how would I make it MUI?
I'd suggest first adopting a unit auto-indexer into your map, such as Jesus4Lyf's AIDS (there is also a GUI-AIDS version at the bottom of the post). That will give every unit on the map a unique custom value, making it easy to make things MUI using arrays.

Here's how I'd modify the spell to use with a unit auto-indexer (though, still using waits):
Trigger:
  • Inner Shield Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Inner Shield (Research)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned skill level) Equal to 1
        • Then - Actions
          • Unit - Add Inner Shield (Icon) to (Triggering unit)
        • Else - Actions
      • Unit - Set level of Inner Shield (Icon) for (Triggering unit) to (Learned skill level)

Trigger:
  • Inner Shield
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Inner Shield (Icon) for GDD_DamagedUnit) Not equal to 0
      • ((Owner of GDD_DamageSource) is an enemy of (Owner of GDD_DamagedUnit)) Equal to True
    • Actions
      • Unit - Add Inner Shield (Cooldown) to GDD_DamagedUnit
      • Unit - Set level of Inner Shield (Cooldown) for GDD_DamagedUnit to (Level of Inner Shield (Research) for GDD_DamagedUnit)
      • Unit - Remove Inner Shield (Icon) from GDD_DamagedUnit
      • Unit - Order GDD_DamagedUnit to Orc Troll Berserker - Berserk
      • Set IS_index = (Custom value of GDD_DamagedUnit)
      • Set IS_damage[IS_index] = 0.00
      • -------- - --------
      • Wait 2.00 seconds
      • Set IS_index = (Custom value of (Triggering unit))
      • Set IS_point = (Position of (Triggering unit))
      • Set IS_group = (Units within 500.00 of IS_point matching (((Matching unit) is dead Equal to false)) and ((Matching unit) is Not equal to (Triggering unit)))
      • Unit Group - Pick every unit in IS_group and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing IS_damage[IS_index] damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • EGUI Leak - Destroy IS_group
      • EGUI Leak - Destroy IS_point
      • -------- - --------
      • Wait 8.00 seconds
      • Unit - Add Inner Shield (Icon) to (Triggering unit)
      • Unit - Set level of Inner Shield (Icon) for (Triggering unit) to (Level of Inner Shield (Research) for (Triggering unit))
      • Unit - Remove Inner Shield (Cooldown) from (Triggering unit)

Trigger:
  • Inner Shield Damage
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Inner Shield (Icon) for GDD_DamagedUnit) Not equal to 0
      • (GDD_DamagedUnit has buff Inner Shield ) Equal to True
      • ((Owner of GDD_DamageSource) is an enemy of (Owner of GDD_DamagedUnit)) Equal to True
    • Actions
      • Set IS_index = (Custom value of (Triggering unit))
      • Set IS_damage[IS_index] = (IS_damage[IS_index] + GDD_Damage)
      • Unit - Set life of GDD_DamagedUnit to ((Life of GDD_DamagedUnit) + GDD_Damage)
 

SouLEDGE

Damn you advanced calculus
Reaction score
75
Okay great, it's working, the only problem is my unit is still taking damage, ie. not being healed.
Trigger:
  • Inner Shield Damage
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Inner Shield (Icon) for GDD_DamagedUnit) Not equal to 0
      • (GDD_DamagedUnit has buff Inner Shield ) Equal to True
      • ((Owner of GDD_DamageSource) is an enemy of (Owner of GDD_DamagedUnit)) Equal to True
    • Actions
      • Set IS_index = (Custom value of (Triggering unit))
      • Set IS_damage[IS_index] = (IS_damage[IS_index] + GDD_Damage)
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + GDD_Damage)

Just another I noticed was that he stop's when he's attacked. I thought beserk wasn't supposed to interrupt orders?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Okay great, it's working, the only problem is my unit is still taking damage, ie. not being healed.
At all, or only when at full health? The damage prevention method you're using can't block damage taken at full health (or damage that exceeds the amount of health missing) because the damage is dealt after it's restored.

Examples:
400/500 HP, unit takes 50 damage. HP is set to 450, then 50 is deducted. HP remains at 400.
450/500 HP, unit takes 100 damage. HP is set to 550 but limited to 500 at max, then 100 is deducted. HP becomes 400.

A way to block all damage, even damage and full health and one-shot-kill damage, is to use a temporary +health ability.

Just another I noticed was that he stop's when he's attacked. I thought beserk wasn't supposed to interrupt orders?
Yes, but also no. It sucks, because giving a unit an order from a trigger will interrupt it if the order is successful - any order, even for orders that wouldn't interrupt if you issued it by clicking in-game (eg. clicking on Berserk, right-clicking an autocast ability). :(
 

SouLEDGE

Damn you advanced calculus
Reaction score
75
It doesn't get healed at all

I can try implementing your spell shield idea, and see if that works, because I'd prefer, as I'm sure any one would, that the unit doesn't stop
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
It doesn't get healed at all
Is that trigger turned on? Originally, you had the triggers being turned on from the learn event, so I assume you had it off...but if the spell will be MUI, there's not much point in turning it on/off.
 

SouLEDGE

Damn you advanced calculus
Reaction score
75
Ahh, just had to change:
Trigger:
  • ((Level of Inner Shield (Icon) for (Triggering unit)) Not equal to 0)

to:
Trigger:
  • ((Level of Inner Shield (Icon) for (Triggering unit)) Not equal to 0) or ((Level of Inner Shield (Cooldown) for (Triggering unit)) Not equal to 0)

Now that that's done I'll have to work on the unit not stopping, what a pity that it happens like that though:mad:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top