Question about a shielding spell

Avaleirra

Is back. Probably.
Reaction score
128
Hi. I'm planning on creating a spell that absorbs a certain amount of damage before disappearing.

I just have a few questions:

-How would I make this MUI and MPI?

-What would a trigger that allowed damage absorbtion look like?


I'm using EGUI so if there is something in there that can help that would be great.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
get a damage detection system, thats be best way.

otherwise you may try to use the hardened skin (or whatever it was called) of the mountain giant. it grants damages absortion and is passive. you may add it hidden in a spellbook and remove it whenever you want.
 

Avaleirra

Is back. Probably.
Reaction score
128
I have GDD but I'm not sure how I would apply that.

And probably not going to use Hardened skin because the shield needs to divert spell based attacks as well.
 

Carnerox

The one and only.
Reaction score
84
EGUI has a built in damage detection soo..

So something like

Any unit takes damage.

If damaged unit has YourBuff == (true)

set life of unit to current life of unit + damage taken.

note: sorry for freehand

Edit* you wanted spells to, so there is an undead spell called something like magic shield or something.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
what undead cow wrote is MUI but it wouldnt work if the damage a unit takes would kill it. if it has 80 hitpoints left and it would take 100 points of damage it would die although 50% would be shielded because the damage triggers before the heal.

and when its MUI it got to be MPI as well.
 

Carnerox

The one and only.
Reaction score
84
Trigger:
  • Example
    • Events
      • EGUI Unit - Any unit takes damage
    • Conditions
      • ((Triggering unit) has buff YourBuff) Equal to True
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))



I tested the 80 life taking 100 damage, and the unit did NOT die. So this works.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
well i dont know how the EGUI damage detection triggers (although i believe its like all the others) but everything i heard about triggers like these is that it wont work. maybe i am wrong, i just want to warn you guys.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
what undead cow wrote is MUI but it wouldnt work if the damage a unit takes would kill it. if it has 80 hitpoints left and it would take 100 points of damage it would die
Almost; it would only die if it's maximum HP is 100 or less, not its current HP.

Here's a MUI shield using GDD and a hashtable, with the shield strength being 150 x Ability Level:
Trigger:
  • Shield Globals
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set ShieldHash = (Last created hashtable)
Trigger:
  • Shield Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shield
    • Actions
      • Hashtable - Save (150.00 x (Real((Level of Shield for (Triggering unit))))) as (Key ShieldStrength) of (Key (Target unit of ability being cast)) in ShieldHash
Trigger:
  • Shield Hit
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamagedUnit has buff Shield) Equal to True
      • GDD_Damage Greater than 0.00
    • Actions
      • Unit - Set life of GDD_DamagedUnit to ((Life of GDD_DamagedUnit) + (Min(GDD_Damage, (Load (Key ShieldStrength) of (Key (Triggering unit)) from ShieldHash))))
      • Hashtable - Save (Max(0.00, ((Load (Key ShieldStrength) of (Key (Triggering unit)) from ShieldHash) - GDD_Damage))) as (Key ShieldStrength) of (Key (Triggering unit)) in ShieldHash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load (Key ShieldStrength) of (Key (Triggering unit)) from ShieldHash) Equal to 0.00
        • Then - Actions
          • Unit - Remove Shield buff from GDD_DamagedUnit
        • Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top