• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Energy Shield [GUI - MUI]

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This is a simple shield spell i made for my map and i wanted to share it with you guys...
i know that it's nothing special and there are a lot better shield spells in THW but oh well...
it should be MUI and leak-less...proove me wrong pls *_*

  • EnergyShield Hash
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set EnergyShield_Hashtable = (Last created hashtable)
  • EnergyShield Cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Energy Shield
    • Actions
      • Special Effect - Destroy (Load 1 of (Key (Target unit of ability being cast)) in EnergyShield_Hashtable)
      • Special Effect - Create a special effect attached to the chest of (Target unit of ability being cast) using Energy Shield.mdx
      • Hashtable - Save Handle Of(Last created special effect) as 1 of (Key (Target unit of ability being cast)) in EnergyShield_Hashtable
      • Hashtable - Save (100 x (Level of Energy Shield for (Triggering unit))) as 2 of (Key (Target unit of ability being cast)) in EnergyShield_Hashtable
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in EnergyShield_UnitGroup) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit Group - Add (Target unit of ability being cast) to EnergyShield_UnitGroup
          • Trigger - Add to EnergyShield Damaged <gen> the event (Unit - (Target unit of ability being cast) Takes damage)
  • EnergyShield Damaged
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Energy Shield ) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 2 of (Key (Triggering unit)) from EnergyShield_Hashtable) Greater than or equal to (Integer((Damage taken)))
            • Then - Actions
              • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
              • Set EnergyShield_DamagedAbsorbed[1] = (Load 2 of (Key (Triggering unit)) from EnergyShield_Hashtable)
              • Set EnergyShield_DamagedAbsorbed[2] = (EnergyShield_DamagedAbsorbed[1] - (Integer((Damage taken))))
              • Hashtable - Save EnergyShield_DamagedAbsorbed[2] as 2 of (Key (Triggering unit)) in EnergyShield_Hashtable
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: (Shield Left: + (String(EnergyShield_DamagedAbsorbed[2])))
            • Else - Actions
              • Unit - Remove Energy Shield buff from (Triggering unit)
              • Special Effect - Destroy (Load 1 of (Key (Triggering unit)) in EnergyShield_Hashtable)
              • Hashtable - Save 0 as 2 of (Key (Triggering unit)) in EnergyShield_Hashtable
              • Set EnergyShield_ExplodePoint = (Position of (Triggering unit))
              • Special Effect - Create a special effect at EnergyShield_ExplodePoint using Arcane Explosion.mdx
              • Special Effect - Destroy (Last created special effect)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 200.00 of EnergyShield_ExplodePoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy and do (Actions)
                • Loop - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 50.00 damage of attack type Spells and damage type Magic
              • Custom script: call RemoveLocation(udg_EnergyShield_ExplodePoint)
        • Else - Actions
Special thanks to:
Champara Bros for Energy Shield and Arcane Explosion models

Keywords:
energy, shield, protection.
Contents

Transfer Shot (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Use a unit indexer to avoid having unneeded damage detection events. Use a way to detect whether the unit already has the effect, so you won't create/store it again. Boolean - Hastable...

Moderator

M

Moderator

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

Maker, Energy Shield, 16th Oct 2011

Use a unit indexer to avoid having unneeded damage detection events.
Use a way to detect whether the unit already has the effect, so you won't create/store it again. Boolean - Hastable value exists.
Use starts the effect of an ability event.
 
Level 16
Joined
Apr 4, 2011
Messages
995
1) Don't use imports in this spell. They aren't necessary from what I gather (Blizz provided spell shield model, it could work for this)

2) Improve the description. I gathered the general idea of the spell from looking at the triiggers (This spell shield absorbs 100/200/300 damage before evaporating), but you should add a description.

3) Use GetHandleID for your hashtables.

4) Units that take enough damage to kill them instantly wont have the damage negated via spell shield, because it checks AFTER the damage is received. For example, if I had a 50HP unit with energy shield take 75 damage, the spell wouldn't work.

5) In the /Then/ block of the EnergyShield Damage trigger, you could merge those two variable settings and the saving.

6)
  • Trigger - Add to EnergyShield Damaged <gen> the event (Unit - (Target unit of ability being cast) Takes damage)
This seems like it would overwrite itself upon multiple casts. I havent tested, so I wouldn't know.

7) You should make the damage configurable and increase by level.

Overall, nice spell. I haven't tested, I'm not on my main computer right now, I'll do it tomorrow. This has inspired me to create a new passive :D
 
Level 11
Joined
Aug 1, 2009
Messages
714
1) Don't use imports in this spell. They aren't necessary from what I gather (Blizz provided spell shield model, it could work for this)

2) Improve the description. I gathered the general idea of the spell from looking at the triiggers (This spell shield absorbs 100/200/300 damage before evaporating), but you should add a description.

3) Use GetHandleID for your hashtables.

4) Units that take enough damage to kill them instantly wont have the damage negated via spell shield, because it checks AFTER the damage is received. For example, if I had a 50HP unit with energy shield take 75 damage, the spell wouldn't work.

5) In the /Then/ block of the EnergyShield Damage trigger, you could merge those two variable settings and the saving.

6)
  • Trigger - Add to EnergyShield Damaged <gen> the event (Unit - (Target unit of ability being cast) Takes damage)
This seems like it would overwrite itself upon multiple casts. I havent tested, so I wouldn't know.

7) You should make the damage configurable and increase by level.

Overall, nice spell. I haven't tested, I'm not on my main computer right now, I'll do it tomorrow. This has inspired me to create a new passive :D

6) That's why I recommended GDD Detection for that code line.
 
Level 20
Joined
Jul 12, 2010
Messages
1,717
thnx for feedback all!!
this is my first MUI spell and as you can see i don't have that much experience :p

1) Don't use imports in this spell. They aren't necessary from what I gather (Blizz provided spell shield model, it could work for this)
well blizz shield models are not that good and i also needed the shield and explosion models to match each other :p

4) Units that take enough damage to kill them instantly wont have the damage negated via spell shield, because it checks AFTER the damage is received. For example, if I had a 50HP unit with energy shield take 75 damage, the spell wouldn't work.
yeah i noticed that too, i was rushing to finish the spell asap because im making lots of simple MUI spells for my map...
im gonna fix it when im done with the others spells...
 
Level 11
Joined
Sep 30, 2009
Messages
697
well blizz shield models are not that good and i also needed the shield and explosion models to match each other :p

You could link to the ressource then and say it fits to this spell

yeah i noticed that too, i was rushing to finish the spell asap because im making lots of simple MUI spells for my map...
im gonna fix it when im done with the others spells...

Releasing stuff in a rush is rarely a good idea.
 
Top