Looking for GOOD Shield

Leazy

You can change this now in User CP.
Reaction score
50
Hello!

I'm looking for a good shield spell. A spell that shields the unit, protecting it from X amount of damage over X sec, with X buff (unit loses X buff, unit loses shield) and with X special effect. Shield should not be castable on targets with Y buff. (Pretty much exactly like the WoW Priest spell Power Word: Shield.

+rep if you can tip me of some spell like this/make me one/modify one already existing for my needs. You will also receive credit in my map, for what it's worth :)
 

xAnaMorphine

Active Member
Reaction score
43
http://www.hiveworkshop.com/forums/...-1-2-a-131394/?prev=search=shield&d=list&r=20

Description:
- A JESP spell that allows the hero to cast a shield on a not Ud ally or on an Ud enemy (just like Holy Light). The shield will absorb an amount of damage for the allied unit thus protecting it from harm, or it will amplify the damage caused to the unit if it is enemy. When the shield dies, the shield unit will get healed by the remaining energies of the shield if it is an ally, or it will be damage by the remaining energies if it is an enemy.

Sounds intresting :thup:
 

Leazy

You can change this now in User CP.
Reaction score
50
Sounds like a good idea of a spell, but when I attacked the shielded unit, it still took damage, and I don't want that heal-when-the-shield-dies things, nor the undead things. And it requires like 10 systems, that's a little heavy for my taste. I'm looking for something really simple that does what I need only, maybe some other features, but this system is too much in my taste. Thanks though and +rep.
 

xAnaMorphine

Active Member
Reaction score
43
Sounds like a good idea of a spell, but when I attacked the shielded unit, it still took damage, and I don't want that heal-when-the-shield-dies things, nor the undead things. And it requires like 10 systems, that's a little heavy for my taste. I'm looking for something really simple that does what I need only, maybe some other features, but this system is too much in my taste. Thanks though and +rep.

I am glad that I could help you even though you weren't inneed of such a spell. +rep
 

inclinedplai

Cool Member
Reaction score
0
I've spent a lot of time trying to figure out a good way to do this with simple triggers lately. I ended up with a bit of a clunky outcome, but it seems to work decently.

I didn't want a spell that healed after damage was taken, so I ended up just making the target invulnerable and creating a dummy unit with the amount of HP that I wanted to shield that moved to the position of the target every .05 seconds.

When the shield dies, I made the target vulnerable again.

The problem I had with this though was that it would cause monsters to simply run away rather than attack the shield to destroy it, so I did three* things.

1) added an attack to the shield that did 1 damage, with no cooldown.
2) added a trigger that ordered the shield to attack a random unit in 500 AOE every .05 seconds.
3) added a trigger that, if random number between 0 and 1 was greater* than the distance from the shield to its target divided by 700, it was ordered to attack the shield. (This made it so the further the unit was from the shield, the less likely it would be ordered to attack it.

All of this together seems to have worked out nicely for me. I'd post the triggers but sadly I'm at work.
 

Leazy

You can change this now in User CP.
Reaction score
50
Hmm, thanks for the help, but I don't want units ordered to attack etc. I think that can make pretty many bugs in the future.
 

inclinedplai

Cool Member
Reaction score
0
Hmmm... Does the Hardened Skin ability reduce damage from spells too? I was wondering if this ability could be given to the shielded unit for the duration...

Obviously I'm really interested in this type of spell too :p... Just brainstorming. I like problem solving.
 

Executor

I see you
Reaction score
57
No, the "Hardened Skin" ability just reduces physical damage.

If you would just want a "shield" wich blocks ALL damage over a period of time this spell would be rather simple, but if you want to assign the maximum amount of blocked damage you must react on the "takes damage" events and this is kinda more work.
 

Leazy

You can change this now in User CP.
Reaction score
50
I could use the undead nerubian heroes armor skill, it can reduce damage (spell, attack, everything), but how would I keep count on the damage taken and make it MUI? Also, I think the damage taken would be 0 with that skill, so counting it would be kinda hard.
 

Executor

I see you
Reaction score
57
y, as i said this "amount" parameter is much more work.
Are you able to code in Jass?
Because in Jass this whole spell woulld be rather simple..
 

Leazy

You can change this now in User CP.
Reaction score
50
No, I can't code in jass, that's pretty much why I'm asking for help :p
 

Leazy

You can change this now in User CP.
Reaction score
50
I have seen that system before, but each time I import it and test it I get windows error message saying that world editor must shut down. How can I fix this? / Do you know any other system?
 

Leazy

You can change this now in User CP.
Reaction score
50
I do have the game cache variable called ''hasch''.
 

deebee

New Member
Reaction score
15
I made a pretty crappy written Power Word - Shield Trigger.

Problems:
- Units take damage before Shield can truly protect them, meaning if they take a killing blow hit but they have a shield up, shield wont do anything.
- Stopping the unit from casting power word shield if the unit has a buff. My method works but its not that "great." Should add like an error saying the unit has a Power Word Shield debuff.
- Biggest hurdle for me was the Damage Detection. Its messy and not good enough but it works XD

Trigger:
  • Shield
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Power Word - Shield
    • Actions
      • -------- Config --------
      • Set ShieldAbility = Power Word - Shield
      • Set ShieldHPAmount = 500.00
      • Set ShieldSFXString = Abilities\Spells\Human\DivineShield\DivineShieldTarget.mdl
      • Set ShieldSFXLocation = origin
      • Set ShieldLengthConstant = 7.00
      • Set ShieldBuffConstant = 15.00
      • Set ShieldBuffDummy = Dummy
      • Set ShieldBuffAbility = Power Word - Shield (Buff)
      • Set ShieldBuff = Power Word - Shield
      • -------- Shield Trigger --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) has buff ShieldBuff) Equal to True
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
        • Else - Actions
          • Set ShieldAddEvent = True
          • For each (Integer ShieldTempInt) from 0 to ShieldTempCount, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Target unit of ability being cast) Equal to ShieldUnitCheck[ShieldTempInt]
                • Then - Actions
                  • Set ShieldAddEvent = False
                • Else - Actions
          • Set ShieldCounter = (ShieldCounter + 1)
          • Set ShieldActive = (ShieldActive + 1)
          • Set ShieldActiveBuffs = (ShieldActiveBuffs + 1)
          • Set ShieldHP[ShieldCounter] = (ShieldHPAmount x (Real((Level of ShieldAbility for (Triggering unit)))))
          • Set ShieldLength[ShieldCounter] = ShieldLengthConstant
          • Set ShieldTarget[ShieldCounter] = (Target unit of ability being cast)
          • Set ShieldBuffLength[ShieldCounter] = ShieldBuffConstant
          • Special Effect - Create a special effect attached to the ShieldSFXLocation of ShieldTarget[ShieldCounter] using ShieldSFXString
          • Set ShieldSFX[ShieldCounter] = (Last created special effect)
          • Set ShieldTempPoint = (Position of (Target unit of ability being cast))
          • Unit - Create 1 ShieldBuffDummy for (Owner of (Triggering unit)) at ShieldTempPoint facing Default building facing degrees
          • Unit - Add ShieldBuffAbility to (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Undead Necromancer - Cripple (Target unit of ability being cast)
          • Custom script: call RemoveLocation(udg_ShieldTempPoint)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ShieldAddEvent Equal to True
            • Then - Actions
              • Set ShieldUnitCheck[ShieldTempCount] = (Target unit of ability being cast)
              • Set ShieldTempCount = (ShieldTempCount + 1)
              • Trigger - Add to Shield Check <gen> the event (Unit - (Target unit of ability being cast) Takes damage)
            • Else - Actions
          • Trigger - Turn on Shield Check <gen>
          • Trigger - Turn on Shield Timer <gen>
          • Trigger - Turn on Shield Timer Buff <gen>


Trigger:
  • Shield Check
    • Events
    • Conditions
    • Actions
      • For each (Integer ShieldInt) from 1 to ShieldCounter, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Damage taken) Greater than or equal to ShieldHP[ShieldInt]
              • (Triggering unit) Equal to ShieldTarget[ShieldInt]
              • ShieldHP[ShieldInt] Greater than or equal to 0.01
            • Then - Actions
              • Unit - Set life of ShieldTarget[ShieldInt] to ((Life of ShieldTarget[ShieldInt]) + ShieldHP[ShieldInt])
              • Set ShieldHP[ShieldInt] = -1.00
              • Special Effect - Destroy ShieldSFX[ShieldInt]
              • Set ShieldActive = (ShieldActive - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ShieldActive Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                  • Trigger - Turn off Shield Timer <gen>
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Triggering unit) Equal to ShieldTarget[ShieldInt]
                  • ShieldHP[ShieldInt] Not equal to -1.00
                • Then - Actions
                  • Set ShieldHP[ShieldInt] = (ShieldHP[ShieldInt] - (Damage taken))
                  • Unit - Set life of ShieldTarget[ShieldInt] to ((Life of ShieldTarget[ShieldInt]) + (Damage taken))
                • Else - Actions


Trigger:
  • Shield Timer
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ShieldInt) from 1 to ShieldCounter, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ShieldLength[ShieldInt] Greater than or equal to 0.01
            • Then - Actions
              • Set ShieldLength[ShieldInt] = (ShieldLength[ShieldInt] - 0.04)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ShieldLength[ShieldInt] Not equal to -1.00
                • Then - Actions
                  • Set ShieldLength[ShieldInt] = -1.00
                  • Set ShieldHP[ShieldInt] = -1.00
                  • Special Effect - Destroy ShieldSFX[ShieldInt]
                  • Set ShieldActive = (ShieldActive - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ShieldActive Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions


Trigger:
  • Shield Timer Buff
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ShieldInt) from 1 to ShieldCounter, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ShieldBuffLength[ShieldInt] Greater than or equal to 0.01
            • Then - Actions
              • Set ShieldBuffLength[ShieldInt] = (ShieldBuffLength[ShieldInt] - 0.04)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ShieldBuffLength[ShieldInt] Not equal to -1.00
                • Then - Actions
                  • Unit - Remove ShieldBuff buff from ShieldTarget[ShieldInt]
                  • Set ShieldBuffLength[ShieldInt] = -1.00
                  • Set ShieldActiveBuffs = (ShieldActiveBuffs - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ShieldActiveBuffs Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
 

Attachments

  • DB Shield.w3x
    18.3 KB · Views: 210

Leazy

You can change this now in User CP.
Reaction score
50
Huge thanks for trying, but I could do that trigger myself, I really need the shield to protect damage before it's dealt. +rep though
 

deebee

New Member
Reaction score
15
Hmm, is that even possible? I Mean to detect and stop the damage before it even occurs? XD
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
WC3 already has a shield spell: Anti-Magic Shell. It only blocks spell/magic damage, though, so we have to convert any damage to spell damage. I think this should do what you want...

Demo map attached.

Trigger:
  • Shield Add Damage Detection
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Power Word: Shield
    • Actions
      • -------- Add damage event only if the event has not already been added --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in ShieldGroup) Equal to False
        • Then - Actions
          • Unit Group - Add (Target unit of ability being cast) to ShieldGroup
          • Trigger - Add to Shield Damage Conversion <gen> the event (Unit - (Target unit of ability being cast) Takes damage)
        • Else - Actions
      • -------- Use a dummy to cast a buff that only exists to time when the target can be re-shielded --------
      • Set Temp_Point = (Position of (Target unit of ability being cast))
      • Unit - Create 1 Dummy Unit for (Owner of (Target unit of ability being cast)) at Temp_Point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Unit - Add Recently Shielded (Buff) to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Druid Of The Claw - Rejuvenation (Target unit of ability being cast)
      • Unit - Add a 0.01 second Generic expiration timer to (Last created unit)

Trigger:
  • Shield Damage Conversion
    • Events
    • Conditions
      • ((Triggering unit) has buff Power Word: Shield ) Equal to True
    • Actions
      • -------- Cause spell-type damage equal to the damage that would have been taken --------
      • -------- Also, turn off the trigger when applying the damage to prevent an infinite loop --------
      • Trigger - Turn off (This trigger)
      • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing (Damage taken) damage of attack type Spells and damage type Normal
      • Trigger - Turn on (This trigger)
      • -------- Turn the unit invulnerable to block the original incoming damage --------
      • Unit - Add Invulnerable (Neutral) to (Triggering unit)
      • -------- Trigger the removal of invulnerability an instant later --------
      • Unit Group - Add (Triggering unit) to ShieldTimerGroup
      • Countdown Timer - Start TempTimer as a One-shot timer that will expire in 0.00 seconds

Trigger:
  • Shield Damage Prevention End
    • Events
      • Time - TempTimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ShieldTimerGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove Invulnerable (Neutral) from (Picked unit)
          • Unit Group - Remove (Picked unit) from ShieldTimerGroup

Trigger:
  • Shield Target Cooldown
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Recently Shielded (Buff)
    • Actions
      • -------- Set local integer b to the rawcode for the buff which prevents re-shielding --------
      • -------- You can get this code by selecting View > Display Values As Raw Data in the Buff editor --------
      • Custom script: local integer b = 'B001'
      • -------- Set local unit u to the targeted unit, to allow the wait to be MUI --------
      • Custom script: local unit u = GetSpellTargetUnit()
      • Unit - Add classification of An Ancient to (Target unit of ability being cast)
      • -------- Wait until the buff is gone --------
      • Custom script: loop
      • Custom script: call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.1))
      • Custom script: exitwhen ( GetUnitAbilityLevel(u, b) == 0 )
      • Custom script: endloop
      • Custom script: call UnitRemoveType( u, UNIT_TYPE_ANCIENT )
      • Custom script: set u = null
 
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