• 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.

Spiritual Protection 1.5

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Uploading a Basic absorbing shield for general use.
Edit as much as you like, just credit D4RK_G4ND4LF and Weep when you use it!

Special thanks to Zaio for showing me all the bugs
(HAHAHAHAHAHA, SQUISH, SQUISH!)

My first upload!

Original idea by D4RK_G4ND4LF; edited by Devalut, and credits to Weep for his Damage detection system.

Basic absorb shield which includes:

-Shield Life

-Damage spill (Damage greater than the shield life will damage the unit, I.e. a unit will take 5 damage if the incoming damage is 55 and the shield is 50.)

-Buff reliant (it will expire after a given time or if dispelled.)

-Death saver (units with lower hp than the damage taken will survive)

-multicast at level 2 (REMOVED)

-Stacking Option (available in Triggers via boolean, default off)

-Text display Option (available in Triggers via boolean, default on)

-Effect option, (available in Triggers via boolean, default off)

Keywords:
Shield, Absorb, Protect, Buff, Protoss shield, Spell shield, Damage Shield, Absorbing Shield.
Contents

Spiritual Protection 1.5 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Required changes: Remove the 0.00 in Hashtable - Save (0.00 + (SP_Life +...) Leaks occur when trying to stack the ability The looping trigger will remain turned on if the group used...

Moderator

M

Moderator

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

Reviewed by Maker, Spiritual Protection 1.5, 16th Jan 2012

Required changes:
  • Remove the 0.00 in Hashtable - Save (0.00 + (SP_Life +...)
  • Leaks occur when trying to stack the ability
  • The looping trigger will remain turned on if the group used there is emptied in ShieldBlock trigger. Shiled Block trigger is also not turned off
  • You're setting tempPoint and removing it, but not using it in ShieldBlock
  • ShieldBlock should be turned off when SP_Group becomes empty, not when a unit is removed from that group. (Look at the looping trigger)

Optional changes
  • Usually the buff icon is timed, it starts to blink a bit for it wears off. Now it vanishes instantly
  • Make 50 configurable and distance should be called angle in
    • Set SP_T_Point_2 = (SP_T_Point offset by 50.00 towards ((120.00 x (Real((Integer A)))) + Distance) degrees)
  • Using a countdon timer with 0.00 expiration isn't completely MUI, as units take damage, the timer can be started again before it expires. You should use a unit group for example to handle removing the ability and setting life. Also don't start the timer again if it is started but not expired

Why are you dealing hero/divine damage in ShiledBlock?

Reviewed by Maker, Spiritual Protection 1.4, 11th Jan 2012

Required changes:
  • Add importing instructions into the map file
  • You're not destroying SP_Player_Group after using it
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • SP_Display_Boolean Equal to True
            • SP_Damage Greater than 0.99
    ->
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • SP_Display_Boolean Equal to True
        • SP_Damage Greater than 0.99
  • Why do you use unit group in Shield Block?
Reviewed by Maker, Spiritual Protection 1.3, 11th Jan 2012

Required changes:
  • Add importing instructions into the map file
  • Add learn tooltips
  • You load a value to SP_Real in Dummy Buff cast, but you don't need to if the stack boolean is false
  • Dummy Buff cast should not be on all the time
  • ShieldBlock should not be on all the time
  • You're not removing TempPoint in ShieldBlock
  • You leak player groups in Show floating text to All players matching...

Optional changes:
  • You have Custom script: call RemoveLocation(udg_SP_T_Point) twice in the cast trigger. Make it the last action, only have it once
  • You could use variables for triggering unit and the 50 x Something in the cast trigger
  • The dummy could have the buff ability added in object editor, not with a trigger
01:38, 12th Sep 2011
Pharaoh_: View this for info: http://www.hiveworkshop.com/forums/2001620-post24.html
 
Level 25
Joined
Feb 9, 2009
Messages
1,798
  • ShieldIni
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Set this to true if you want three of the orbit dummies for an effect, otherwise set it to false for an effect above the unit. --------
      • Set SP_Effect_Boolean = True
      • -------- Set this to true if you want three of the orbit dummies for an effect, otherwise set it to false for an effect above the unit. --------
      • -------- --------
      • -------- This denotes whether or not the shield displays remaining life when struck or damage spill when destroyed.. --------
      • Set SP_Display_Boolean = True
      • -------- This denotes whether or not the shield displays remaining life when struck or damage spill when destroyed.. --------
      • -------- --------
      • -------- This denotes whether or not the shield life stacks on subsequent casts --------
      • Set SP_Stack_Boolean = False
      • -------- This denotes whether or not the shield life stacks on subsequent casts --------
      • -------- --------
      • -------- This is the Life of the shield per level. NOTE: the shield life is calculated as SP_Life + (SP_Life x lvl) --------
      • Set SP_Life = 40.00
      • -------- This is the Life of the shield per level. NOTE: the shield life is calculated as SP_Life + (SP_Life x lvl) --------
      • -------- --------
      • -------- This is the duration of the shield --------
      • Set SP_Duration = 10.00
      • -------- This is the duration of the shield --------
      • -------- --------
      • Set SP_Ability = Spiritual Protection
      • Set SP_Buff = Shield
      • Set SP_LifeBonus = Shield Life Bonus
      • Hashtable - Create a hashtable
      • Set SP_Hashtabe = (Last created hashtable)
  • ShieldCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to SP_Ability
    • Actions
      • -------- Shield Life --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SP_Stack_Boolean Equal to True
        • Then - Actions
          • Set SP_Real = (Load 0 of (Key (Target unit of ability being cast)) from SP_Hashtabe)
          • Hashtable - Save (SP_Real + (SP_Life + (SP_Life x (Real((Level of SP_Ability for (Triggering unit))))))) as 0 of (Key (Target unit of ability being cast)) in SP_Hashtabe
          • Hashtable - Save (SP_Real + (SP_Life + (SP_Life x (Real((Level of SP_Ability for (Triggering unit))))))) as (Key Maxlife) of (Key (Target unit of ability being cast)) in SP_Hashtabe
        • Else - Actions
          • Hashtable - Save (0.00 + (SP_Life + (SP_Life x (Real((Level of SP_Ability for (Triggering unit))))))) as 0 of (Key (Target unit of ability being cast)) in SP_Hashtabe
          • Hashtable - Save (0.00 + (SP_Life + (SP_Life x (Real((Level of SP_Ability for (Triggering unit))))))) as (Key Maxlife) of (Key (Target unit of ability being cast)) in SP_Hashtabe
      • -------- Shield Life --------
      • -------- --------
      • -------- Duration --------
      • Hashtable - Save SP_Duration as 1 of (Key (Target unit of ability being cast)) in SP_Hashtabe
      • -------- Duration --------
      • -------- --------
      • -------- Shield effect --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SP_Effect_Boolean Equal to True
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCasterOverhead.mdl
          • Special Effect - Destroy (Last created special effect)
          • Hashtable - Save 0 as (Key Distance) of (Key (Target unit of ability being cast)) in SP_Hashtabe
          • For each (Integer A) from 1 to 3, do (Actions)
            • Loop - Actions
              • Unit - Kill (Load (Key (Buff + (String((Integer A))))) of (Key (Target unit of ability being cast)) in SP_Hashtabe)
          • Set SP_T_Point = (Position of (Target unit of ability being cast))
          • For each (Integer A) from 1 to 3, do (Actions)
            • Loop - Actions
              • Set SP_T_Point_2 = (SP_T_Point offset by 50.00 towards (120.00 x (Real((Integer A)))) degrees)
              • Unit - Create 1 Orbit unit for (Owner of (Target unit of ability being cast)) at SP_T_Point_2 facing Default building facing degrees
              • Hashtable - Save Handle Of(Last created unit) as (Key (Buff + (String((Integer A))))) of (Key (Target unit of ability being cast)) in SP_Hashtabe
              • Custom script: call RemoveLocation(udg_SP_T_Point_2)
          • Custom script: call RemoveLocation(udg_SP_T_Point)
        • Else - Actions
          • Special Effect - Destroy (Load 0 of (Key (Target unit of ability being cast)) in SP_Hashtabe)
          • Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Weapons\VoidWalkerMissile\VoidWalkerMissile.mdl
          • Hashtable - Save Handle Of(Last created special effect) as 0 of (Key (Target unit of ability being cast)) in SP_Hashtabe
      • -------- Shield effect --------
      • Unit Group - Add (Target unit of ability being cast) to SP_Group
      • Trigger - Turn on ShieldLoop <gen>
      • Trigger - Turn on ShieldBlock <gen>
  • ShieldLoop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SP_Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Turn off ShieldBlock <gen>
        • Else - Actions
          • Unit Group - Pick every unit in SP_Group and do (Actions)
            • Loop - Actions
              • Set SP_Real = ((Load 1 of (Key (Picked unit)) from SP_Hashtabe) - 0.05)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (((Picked unit) has buff SP_Buff) Equal to False) or (SP_Real Less than or equal to 0.00)
                • Then - Actions
                  • Set SP_T_Point = (Position of (Picked unit))
                  • Unit - Remove SP_Buff buff from (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SP_Effect_Boolean Equal to True
                    • Then - Actions
                      • For each (Integer A) from 1 to 3, do (Actions)
                        • Loop - Actions
                          • Unit - Kill (Load (Key (Buff + (String((Integer A))))) of (Key (Picked unit)) in SP_Hashtabe)
                    • Else - Actions
                      • Special Effect - Destroy (Load 0 of (Key (Picked unit)) in SP_Hashtabe)
                      • -------- This is the effect when the shield is destroyed. --------
                      • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Weapons\BansheeMissile\BansheeMissile.mdl
                      • -------- This is the effect when the shield is destroyed. --------
                      • Special Effect - Destroy (Last created special effect)
                  • Unit Group - Remove (Picked unit) from SP_Group
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in SP_Hashtabe
                  • If ((SP_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing --------)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (SP_Group is empty) Equal to True
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                      • Trigger - Turn off ShieldBlock <gen>
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_SP_T_Point)
                • Else - Actions
                  • Hashtable - Save SP_Real as 1 of (Key (Picked unit)) in SP_Hashtabe
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SP_Effect_Boolean Equal to True
                    • Then - Actions
                      • Set Distance = ((Load (Key Distance) of (Key (Picked unit)) from SP_Hashtabe) + 12.50)
                      • Hashtable - Save Distance as (Key Distance) of (Key (Picked unit)) in SP_Hashtabe
                      • For each (Integer A) from 1 to 3, do (Actions)
                        • Loop - Actions
                          • Set SP_T_Point = (Position of (Picked unit))
                          • Set SP_T_Point_2 = (SP_T_Point offset by 50.00 towards ((120.00 x (Real((Integer A)))) + Distance) degrees)
                          • Unit - Make (Load (Key (Buff + (String((Integer A))))) of (Key (Picked unit)) in SP_Hashtabe) face SP_T_Point_2 over 0.01 seconds
                          • Unit - Move (Load (Key (Buff + (String((Integer A))))) of (Key (Picked unit)) in SP_Hashtabe) instantly to SP_T_Point_2
                          • Custom script: call RemoveLocation(udg_SP_T_Point)
                          • Custom script: call RemoveLocation(udg_SP_T_Point_2)
                    • Else - Actions
  • ShieldBlock
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamagedUnit has buff SP_Buff) Equal to True
    • Actions
      • Custom script: set udg_SP_UnitID = GetHandleId(udg_GDD_DamagedUnit)
      • Set SP_Real = (Load 0 of SP_UnitID from SP_Hashtabe)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SP_Real Greater than 0.00
        • Then - Actions
          • If (SP_Target Not equal to No unit) then do (Trigger - Run ShieldHeal <gen> (ignoring conditions)) else do (-------- Do Nothing --------)
          • Set SP_Damage = GDD_Damage
          • Set SP_Real = (SP_Real - SP_Damage)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SP_Effect_Boolean Equal to True
            • Then - Actions
              • For each (Integer A) from 1 to 3, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SP_Real Less than or equal to ((Load (Key Maxlife) of SP_UnitID from SP_Hashtabe) - (((Load (Key Maxlife) of SP_UnitID from (Last created hashtable)) / 3.00) x (Real((Integer A)))))
                    • Then - Actions
                      • Unit - Kill (Load (Key (Buff + (String((Integer A))))) of SP_UnitID in SP_Hashtabe)
                    • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SP_Real Less than or equal to 0.00
            • Then - Actions
              • Unit - Remove SP_Buff buff from GDD_DamagedUnit
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SP_Real Less than 0.00
                • Then - Actions
                  • Set SP_T_Point = (Position of GDD_DamagedUnit)
                  • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing (SP_Real x -1.00) damage of attack type Hero and damage type Divine
                  • Custom script: call RemoveLocation(udg_SP_T_Point)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SP_Display_Boolean Equal to True
                    • Then - Actions
                      • Floating Text - Create floating text that reads (String((Integer(SP_Real)))) above GDD_DamagedUnit with Z offset 0.00, using font size 10.00, color (80.00%, 0.00%, 0.00%), and 20.00% transparency
                      • Set SP_FText = (Last created floating text)
                      • Set SP_PlayerGroup = (All players matching ((Owner of (Triggering unit)) Equal to (Triggering player)))
                      • Floating Text - Hide SP_FText for (All players)
                      • Floating Text - Show SP_FText for SP_PlayerGroup
                      • Floating Text - Set the velocity of SP_FText to 90.00 towards 90.00 degrees
                      • Floating Text - Change SP_FText: Disable permanence
                      • Floating Text - Change the lifespan of SP_FText to 2.00 seconds
                      • Floating Text - Change the fading age of SP_FText to 1.00 seconds
                      • Custom script: call DestroyForce(udg_SP_PlayerGroup)
                    • Else - Actions
                • Else - Actions
              • Set SP_Damage = SP_Real
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SP_Effect_Boolean Equal to True
                • Then - Actions
                  • For each (Integer A) from 1 to 3, do (Actions)
                    • Loop - Actions
                      • Unit - Kill (Load (Key (Buff + (String((Integer A))))) of SP_UnitID in SP_Hashtabe)
                • Else - Actions
                  • Special Effect - Destroy (Load 0 of SP_UnitID in SP_Hashtabe)
                  • -------- This is the effect when the shield is destroyed. --------
                  • Special Effect - Create a special effect attached to the overhead of GDD_DamagedUnit using Abilities\Weapons\BansheeMissile\BansheeMissile.mdl
                  • -------- This is the effect when the shield is destroyed. --------
                  • Special Effect - Destroy (Last created special effect)
              • Unit Group - Remove GDD_DamagedUnit from SP_Group
              • Hashtable - Clear all child hashtables of child SP_UnitID in SP_Hashtabe
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SP_Display_Boolean Equal to True
                  • SP_Damage Greater than 0.99
                • Then - Actions
                  • Set SP_T_Point = (Position of GDD_DamagedUnit)
                  • Floating Text - Create floating text that reads (String((Integer(SP_Real)))) at (SP_T_Point offset by (Random real number between 0.00 and 50.00) towards (Random angle) degrees) with Z offset 0.00, using font size 9.00, color (0.00%, 100.00%, 100.00%), and 20.00% transparency
                  • Set SP_FText = (Last created floating text)
                  • Set SP_PlayerGroup = (All players matching ((Owner of (Triggering unit)) Equal to (Triggering player)))
                  • Floating Text - Hide SP_FText for (All players)
                  • Floating Text - Show SP_FText for SP_PlayerGroup
                  • Floating Text - Set the velocity of SP_FText to 90.00 towards 90.00 degrees
                  • Floating Text - Change SP_FText: Disable suspend state
                  • Floating Text - Change SP_FText: Disable permanence
                  • Floating Text - Change the lifespan of SP_FText to 1.00 seconds
                  • Floating Text - Change the fading age of SP_FText to 0.25 seconds
                  • Custom script: call RemoveLocation(udg_SP_T_Point)
                  • Custom script: call DestroyForce(udg_SP_PlayerGroup)
                • Else - Actions
              • Hashtable - Save SP_Real as 0 of SP_UnitID in SP_Hashtabe
          • Set SP_Target = GDD_DamagedUnit
          • -------- Using big life bonus to prevent death if damage>=max hp --------
          • Unit - Add SP_LifeBonus to SP_Target
          • Countdown Timer - Start SP_Timer as a One-shot timer that will expire in 0.00 seconds
        • Else - Actions
          • Unit - Remove SP_Buff buff from GDD_DamagedUnit
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SP_Effect_Boolean Equal to True
            • Then - Actions
              • For each (Integer A) from 1 to 3, do (Actions)
                • Loop - Actions
                  • Unit - Kill (Load (Key (Buff + (String((Integer A))))) of SP_UnitID in SP_Hashtabe)
            • Else - Actions
              • Special Effect - Destroy (Load 0 of SP_UnitID in SP_Hashtabe)
              • -------- This is the effect when the shield is destroyed. --------
              • Special Effect - Create a special effect attached to the overhead of GDD_DamagedUnit using Abilities\Weapons\BansheeMissile\BansheeMissile.mdl
              • -------- This is the effect when the shield is destroyed. --------
              • Special Effect - Destroy (Last created special effect)
          • Unit Group - Remove GDD_DamagedUnit from SP_Group
          • Hashtable - Clear all child hashtables of child SP_UnitID in SP_Hashtabe
  • ShieldHeal
    • Events
      • Time - SP_Timer expires
    • Conditions
    • Actions
      • Unit - Set life of SP_Target to ((Life of SP_Target) + SP_Damage)
      • Unit - Remove SP_LifeBonus from SP_Target
      • Set SP_Target = No unit
oh and the triggers are not copied from http://www.hiveworkshop.com/forums/spells-569/energy-shield-gui-mui-203039/

as this was the previous spell before I uploaded it http://www.hiveworkshop.com/forums/requests-341/requesting-damage-shield-spell-199680/#post1963937

updated some fixes too group leaks
updated floating text should only be revealed to the owner of the unit.
updated Shield cast group leak
updated Shield cast group leak - leak removing was in wrong place
updated Dummy cast
Update1.2
updated Shield cast - added variable
updated Shield cast - leak code in wrong spot
updated Boolean for stacking and text display of shield life and damage spill.
Update1.3
-Stacking basically keeps the shield life of the previous cast (if it is still on the unit), by default this is off.
-Text display speaks for itself, default on.
-boolean found in Shield ini
Update 1.4
-multicast removed (causing leaks)
-theme changed (green is for squares)
-Dummy buff cast Removed.
-leaks removed from shieldblock
-Additional information added to Shieldini, including shieldlife, shielduration.
QuickFix update
- actually fixed leak in shieldblock
-import instruction in trigger comments of ShieldIni
QuickFix update 2
-revamped ShieldBlock with maker's arcane knowledge of the abysmal depths of triggering.
Update 1.5
-New effect option (default off) when turned on the effect of the skull above is replaced by three orbiting units that die off whenever a third of the target's shield is destroyed.
-Made map prettier
QuickFix
-cleared two instances of trigger turn off in shield block
 
Last edited:
Level 8
Joined
Jul 3, 2011
Messages
251
not only do locations leak, groups do too, you have a few unit group leaks... you can remove with call DestroyGroup (udg_GroupName) or by not setting a variable, picking the units directly and before doing that put set bj_wantDestroyGroup = true
 
Level 8
Joined
Jul 3, 2011
Messages
251
Yes, if you want a group to not be removed, a thing you can do is at map init put set udg_GroupName = CreateGroup() then you can add units to it/remove units from it and pick every unit in it, just so long as you dont set it as something else, it wont leak.

EDIT: Also, your floating text is shown through fog, you need to hide it for certain players otherwise everyone can see it from anywhere.
 
Level 25
Joined
Feb 9, 2009
Messages
1,798
Yes, if you want a group to not be removed, a thing you can do is at map init put set udg_GroupName = CreateGroup() then you can add units to it/remove units from it and pick every unit in it, just so long as you dont set it as something else, it wont leak.

EDIT: Also, your floating text is shown through fog, you need to hide it for certain players otherwise everyone can see it from anywhere.

  • ShieldIni
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Shield_Ability_1 = Spiritual Protection
      • Set Shield_Ability_2 = Dummy Buff Spell
      • Set Shield_Buff = Shield
      • Set Shield_LifeBonus = Shield Life Bonus
      • Hashtable - Create a hashtable
      • Set Shield_Hashtabe = (Last created hashtable)
      • Custom script: set udg_Shield_Group = CreateGroup()
with this I can keep the triggers the way they are without using set bj_wantDestroyGroup?
 
Level 8
Joined
Jul 3, 2011
Messages
251
if you mean by set bj_wantDestroyGroup = true you cant use a variable, it picks units directly out of the conditions you set for the units, runs the actions then destroys it, if you mean by the constant global, at init put set udg_GroupName = CreateGroup() then add/remove/pick units in GroupName, this basically just creates a group ONE time only, it will not create it multiple times so it will not leak, it could be usefull to a spell like this to add units with the buff then remove them when the effects end.

On a side note: if you destroy this group, all units inside it will be lost, so if you are going to do this you must never destroy the group.
 
You know that using Damage Modifier you can cut this trigger into.. lets say just couple lines?
I was doing myself absorbing mini-systems for GUI but after moving DM into GUI it's pointless since it covers block too.

Additionaly: this spell does not contain 'fatal block' checker - meaning that if unit is at 100% property trigger creates/recycles timers to add life with delay 0.00 properly. Don't say that that it does because it cotains additional trigger onExpire -> if there are multiple units around damage may be dealt many times within period 0.00 meaning this system won't heal unit by amount of all damage taken within given 0.00 period but only with the last damage value taken after such period.
 
Example ?
Added few informations into last trigger.

Egzample?
  • init
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • DamageEventOverride Equal to False
    • Actions
      • Set DamageEventAmount = 0.00
Nulls all damage taken, no mater the circumstances. And calculating damage taken goes:
MaxAbosrb = MaxAbsorb + DamageEventAmount. Where MaxAbsorb is your variable which stored absorbed dmg.
 
Level 25
Joined
Feb 9, 2009
Messages
1,798
Added few informations into last trigger.

Egzample?
  • init
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • DamageEventOverride Equal to False
    • Actions
      • Set DamageEventAmount = 0.00
Nulls all damage taken.

hmm I might need to look into using that


Your TempGroup in ShieldCast is leaking, dont set a variable as it, pick every units in [units conditions here] but before put set bj_wantDestroyGroup = true

added to your description, triggers updated
Appreciate the help +rep
 
Level 8
Joined
Jul 3, 2011
Messages
251
Also, some of your leak removals are in the wrong places, if you set a location within a group, you must remove it within the group, its basically setting a location per unit in the group, so you must remove it per unit, else you're just removing it for the last unit to use it.
 
Level 8
Joined
Jul 3, 2011
Messages
251
Im sorry but i have to agree with spinnaker, this spell is pointless because of what bribe made, but still, if you can learn from mistakes you can maybe make a better spell, another error: in ShieldCast you set T_Point, pick units in it and set T_Point again before removing it, which leaks, you cant remove it in the group because it will be = null since you only set it once, and you cant remove it before you pick units in the group cause you are picking units near it, so you must create another location and use that instead of the T_Point inside the group, remove that then after picking units in the group, remove T_Point
 
Level 25
Joined
Feb 9, 2009
Messages
1,798
Im sorry but i have to agree with spinnaker, this spell is pointless because of what bribe made, but still, if you can learn from mistakes you can maybe make a better spell, another error: in ShieldCast you set T_Point, pick units in it and set T_Point again before removing it, which leaks, you cant remove it in the group because it will be = null since you only set it once, and you cant remove it before you pick units in the group cause you are picking units near it, so you must create another location and use that instead of the T_Point inside the group, remove that then after picking units in the group, remove T_Point


Fixed & added.
 
Level 8
Joined
Jul 3, 2011
Messages
251
In ShieldCast at the very end, the removal should be in the code block slightly above it, not outside the if/then/else code block, also in the code where you make the floating text, at the very start you set a unit group and use bj_wantDestroyGroup = true, the point of using bj_wantDestroyGroyp = true is to NOT use group variables and pick them directly, that will still leak because you set the group var and didnt destroy it, also you are destroying T_Point at the very start for some known reason...
 
Level 25
Joined
Feb 9, 2009
Messages
1,798
In ShieldCast at the very end, the removal should be in the code block slightly above it, not outside the if/then/else code block, also in the code where you make the floating text, at the very start you set a unit group and use bj_wantDestroyGroup = true, the point of using bj_wantDestroyGroyp = true is to NOT use group variables and pick them directly, that will still leak because you set the group var and didnt destroy it, also you are destroying T_Point at the very start for some known reason...

fixed & added
 
• You are spamming (Key(Target unit of ability being cast)). Use an Integer variable and
  • Custom script: set udg_T_Id = GetHandleId (GetSpellTargetUnit())
• Your variable names are too generic, rename them with a prefix, e.g. S_ (from "Spiritual").

• I really don't see why you use TempGroup:
  • Set TempGroup = (Units within 10.00 of TempPoint matching ((Matching unit) Equal to GDD_DamagedUnit))
Can't you just refer to "GDD_DamagedUnit"?

  • Custom script: set udg_Shield_Group = CreateGroup()
This is not needed; it's already created in the map initialization.

• Use (Triggering player) instead of (Owner of (Triggering unit)) -> It procs faster.

  • Unit Group - Pick every unit in (Units within 260.00 of T_Point matching (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
    • Loop - Actions
      • Set r = 0.00
Why do you declare "r" in this enumeration?

Additionally,
  • Unit Group - Remove (Picked unit) from TempGroup
Why do you remove it and it back, when the dummy casts the spell on the (Picked unit)? It will eventually be added anyway.

• You don't need an additional trigger to detect the dummy's ability cast. Just trigger the events within the previous enumeration.

  • Set Shield_Target = No unit
Globals don't need to be nulled.

  • Floating Text - Show (Last created floating text) for (All players matching ((Matching player) Equal to (Owner of (Picked unit))))
Leaks.

• Use a variable to refer the (Last created floating text), to save calls.

• Use a boolean variable, that will be declared in ShieldIni trigger, which will check whether the user wants to display the damage left in the shield.

  • Set Shield_Target = (Picked unit)
You declare this for a single action, when there are tons of references for (Picked unit) before it (mostly in the if/then/else blocks with the floating text and before). Move it on top of the unit group enumeration and refer to picked unit with this variable.
 
Top