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

[General] Spellshield

Status
Not open for further replies.
Level 24
Joined
Feb 27, 2019
Messages
833
Before you proceed with using Spell Shield, I think many people would agree that there are some problems with using Spell Shield in conjunction with triggered spells. I think its a tricky ability. I will tell you what I mean. If you have a target dummy ability and then a dummy unit that casts another spell on the target, the dummy ability will trigger the Spell Shield and then the spawned dummy will cast another ability that will not trigger the Spell Shield since its already activated. It may also trigger on dummy abilities that are not supposed to be targeted abilities which is not how it is suppose to function. Of course that is not a problem if you dont use any spells triggered in that way or if you dont care about it. You may be able to remedy it in some way but thats to much for me to take into consideration.

However if you still want to know a way to do it I have an idea using a unit group and a special effect array in conjunction with unit indexer. I wont be able to make it now and I may be busy during the weekend. If anyone else has a solution feel free to post it.
 
Level 24
Joined
Feb 27, 2019
Messages
833
Here is a solution to make spell shield visible when its ready. Its not the best approach since its not the most efficient nor accurate but its simple and robust.

For this you need an ability to display an effect on the unit. Create a custom ability based on Item Armor Bonus (+1) and add it to your unit's Abilities - Normal. Change the ability values for Art Target and Attachment Point to choose which effect and set Data - Defense Bonus to 0.
  • Spell Shield Use
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spell Shield (Amulet)
    • Actions
      • Unit - Remove Item Armor Bonus (+1) from (Triggering unit)
      • Unit Group - Add (Triggering unit) to SpellShieldOnGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in SpellShieldOnGroup) Equal to 1
        • Then - Actions
          • Trigger - Turn on Spell Shield Reactivate <gen>
        • Else - Actions
  • Spell Shield Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of Spell Shield (Amulet) for (Triggering unit)) Equal to 1
      • ((Triggering unit) is in SpellShieldOnGroup.) Equal to False
    • Actions
      • Unit - Remove Item Armor Bonus (+1) from (Triggering unit)
      • Unit Group - Add (Triggering unit) to SpellShieldOnGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in SpellShieldOnGroup) Equal to 1
        • Then - Actions
          • Trigger - Turn on Spell Shield Reactivate <gen>
        • Else - Actions
  • Spell Shield Reactivate
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SpellShieldOnGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • (Ability Cooldown Remaining of (Picked unit) for ability Spell Shield (Amulet)..) Equal to 0.00
            • Then - Actions
              • Unit - Add Item Armor Bonus (+1) to (Picked unit)
              • Unit Group - Remove (Picked unit) from SpellShieldOnGroup.
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in SpellShieldOnGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off Spell Shield Reactivate <gen>
        • Else - Actions
 
Status
Not open for further replies.
Top