• 🏆 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!

Unholy Armor (WC2)

Status
Not open for further replies.
Level 4
Joined
Jan 24, 2012
Messages
55
Hi all,

I need a spell (or a explanation how to make this), found nothing to download...

It's the unholy Armor Spell from WC2.

Cast the Spell on a friendly unit; this unit should get 50% damage of the current life and become invulnerable for X seconds.

Would be great if someone nows how to do this.

Thanks!

Vladec
 
Level 11
Joined
Aug 24, 2012
Messages
429
No need for a DDS, the effect is not activated upon attack, it's just a simple buff that removes a unit's life and makes it invulnerable.

There is no spell that makes another unit invulnerable by default. You would probably need arrays or indexing to make this spell MUI. Basically you make a dummy spell that does nothing, and then whenever the dummy spell is cast you use one trigger to remove half of the target's life (Set Target's Life to X) and another to Make Target Invulnerable until the duration wears off.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Okay guys... this is the Request forum, not the World Editor Help Zone.

No need for a DDS, the effect is not activated upon attack, it's just a simple buff that removes a unit's life and makes it invulnerable.
You do need a DDS. The original Unholy Armor ability from WC2 doesn't block any CC; it just absorbs all incoming damage for a limited amount of time. Making a unit invulnerable will prevent any CCs from even being casted on them.


It is a fairly simple spell, so here you go:

  • UA Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- CONFIG START --------
      • Set UA_Ability = Unholy Armor
      • Set UA_Order_ID = channel
      • Set UA_MaxLevel = 3
      • -------- Duration of Ability --------
      • Set UA_Duration[1] = 3.00
      • Set UA_Duration[2] = 6.00
      • Set UA_Duration[3] = 10.00
      • -------- Percentage of Target's Current Health Dealt As Damage --------
      • Set UA_HealthLoss[1] = 50.00
      • Set UA_HealthLoss[2] = 50.00
      • Set UA_HealthLoss[3] = 50.00
      • -------- Special Effects --------
      • Set UA_SFXShield = Abilities\Spells\Undead\AntiMagicShell\AntiMagicShell.mdl
      • Set UA_SFXShield_AP = overhead
      • Set UA_SFXIndicator = Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
      • Set UA_SFXIndicator_AP = origin
      • -------- Other --------
      • Set UA_AttackType = Spells
      • Set UA_DamageType = Normal
      • -------- CONFIG END --------
      • -------- --------
      • Set UA_PeriodicTimer = 0.03
      • Trigger - Add to UA Loop <gen> the event (Time - Every UA_PeriodicTimer seconds of game time)
      • For each (Integer UA_LoopInt) from 1 to UA_MaxLevel, do (Actions)
        • Loop - Actions
          • Set UA_HealthLoss[UA_LoopInt] = (UA_HealthLoss[UA_LoopInt] / 100.00)

  • UA Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to UA_Ability
    • Actions
      • -------- --------
      • Set UA_SpellCount = (UA_SpellCount + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UA_SpellCount Equal to 1
        • Then - Actions
          • Trigger - Turn on UA Loop <gen>
          • Trigger - Turn on UA Event <gen>
        • Else - Actions
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UA_RecycledSize Equal to 0
        • Then - Actions
          • Set UA_MaxIndex = (UA_MaxIndex + 1)
          • Set UA_Spell_ID = UA_MaxIndex
        • Else - Actions
          • Set UA_RecycledSize = (UA_RecycledSize - 1)
          • Set UA_Spell_ID = UA_RecycledStack[UA_RecycledSize]
      • Set UA_NodeNext[UA_Spell_ID] = 0
      • Set UA_NodeNext[UA_NodePrev[0]] = UA_Spell_ID
      • Set UA_NodePrev[UA_Spell_ID] = UA_NodePrev[0]
      • Set UA_NodePrev[0] = UA_Spell_ID
      • -------- --------
      • Set UA_TempUnit = (Triggering unit)
      • Set UA_AbilityLvl[UA_Spell_ID] = (Level of UA_Ability for UA_TempUnit)
      • Set UA_Counter[UA_Spell_ID] = 0.00
      • -------- --------
      • Set UA_Target[UA_Spell_ID] = (Target unit of ability being cast)
      • Special Effect - Create a special effect attached to the UA_SFXIndicator_AP of UA_Target[UA_Spell_ID] using UA_SFXIndicator
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the UA_SFXShield_AP of UA_Target[UA_Spell_ID] using UA_SFXShield
      • Set UA_ShieldSFX[UA_Spell_ID] = (Last created special effect)
      • -------- --------
      • Set UA_TempReal = ((Life of UA_Target[UA_Spell_ID]) x UA_HealthLoss[UA_AbilityLvl[UA_Spell_ID]])
      • Unit - Cause UA_TempUnit to damage UA_Target[UA_Spell_ID], dealing UA_TempReal damage of attack type UA_AttackType and damage type UA_DamageType
      • -------- --------
      • Set UA_Unit_ID = (Custom value of UA_Target[UA_Spell_ID])
      • Set UA_HasShield[UA_Unit_ID] = True

  • UA Cancel
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Level of UA_Ability for (Triggering unit)) Greater than 0
      • (Issued order) Equal to (Order(UA_Order_ID))
    • Actions
      • Set UA_TempUnit = (Target unit of issued order)
      • Set UA_Unit_ID = (Custom value of UA_TempUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UA_HasShield[UA_Unit_ID] Equal to True
        • Then - Actions
          • Set UA_TempUnit = (Triggering unit)
          • Unit - Pause UA_TempUnit
          • Unit - Order UA_TempUnit to Stop
          • Unit - Unpause UA_TempUnit
        • Else - Actions

  • UA Loop
    • Events
    • Conditions
    • Actions
      • Set UA_Spell_ID = 0
      • For each (Integer UA_LoopInt) from 1 to UA_SpellCount, do (Actions)
        • Loop - Actions
          • Set UA_Spell_ID = UA_NodeNext[UA_Spell_ID]
          • Set UA_Counter[UA_Spell_ID] = (UA_Counter[UA_Spell_ID] + UA_PeriodicTimer)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (UA_Target[UA_Spell_ID] is dead) Equal to True
                  • UA_Counter[UA_Spell_ID] Greater than or equal to UA_Duration[UA_AbilityLvl[UA_Spell_ID]]
            • Then - Actions
              • Special Effect - Create a special effect attached to the UA_SFXIndicator_AP of UA_Target[UA_Spell_ID] using UA_SFXIndicator
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Destroy UA_ShieldSFX[UA_Spell_ID]
              • -------- --------
              • Set UA_Unit_ID = (Custom value of UA_Target[UA_Spell_ID])
              • Set UA_HasShield[UA_Unit_ID] = False
              • -------- --------
              • Set UA_RecycledStack[UA_RecycledSize] = UA_Spell_ID
              • Set UA_RecycledSize = (UA_RecycledSize + 1)
              • Set UA_NodeNext[UA_NodePrev[UA_Spell_ID]] = UA_NodeNext[UA_Spell_ID]
              • Set UA_NodePrev[UA_NodeNext[UA_Spell_ID]] = UA_NodePrev[UA_Spell_ID]
              • -------- --------
              • Set UA_SpellCount = (UA_SpellCount - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • UA_SpellCount Equal to 0
                • Then - Actions
                  • Trigger - Turn off UA Loop <gen>
                  • Trigger - Turn off UA Event <gen>
                • Else - Actions
            • Else - Actions

  • UA Event
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • UA_HasShield[(Custom value of DamageEventTarget)] Equal to True
    • Actions
      • Set DamageEventAmount = 0.00


Some things to consider:
  • Requires a unit indexer and Bribe's DDS
  • Does not include a buff indicator
  • Cannot cast more than one "instance" on the same target
 

Attachments

  • LordVladec's Unholy Armor Request.w3x
    33.5 KB · Views: 71

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,502
This doesn't even need all that. A modified Hardened Skin would do the trick (can be set to "100%" chance to block "99999..." damage (both melee/ranged). Then just add/remove it On-Attack (event) based on whether they currently have the buff.

Then a real simple trigger: "unit casts Unholy Armor" -> "set target unit's life to (life * 0.5)".

//I was going to be making this somewhere, so I've been planning it out. Haven't actually tested it, though, to be fair.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
This doesn't even need all that.
So what if there is a triggered ability that decided to deal +1 more damage than the one put in the data field :D does Hardened Skin also only block damage from attacks or does it also take damage from abilities into factor? If the latter, then you are probably right to say that what I provided is not needed.

Regardless, I prefer having complete freedom over the ability than sticking with whatever is hardcoded in the default object editor abilities.

Then just add/remove it On-Attack (event) based on whether they currently have the buff.
It would still be better to use a DDS for this. On-Attack events can easily be abused, and it's not even the moment a unit deals damage to the unit. It also will not take account for damage taken from abilities.
 

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,502
So what if there is a triggered ability that decided to deal +1 more damage than the one put in the data field :D does Hardened Skin also only block damage from attacks or does it also take damage from abilities into factor? If the latter, then you are probably right to say that what I provided is not needed.
Hm, excellent points... I had not considered spell or triggered damage.

Well, for the latter, I can just say "naw"; I don't do that. No triggered damage = no problemo.

But spell damage... You could just say "Unholy Armor only protects against physical attack" and get away with not fixing it. But if you really wanted to make it "the right way"... And you can't use a trigger-forced, self-casted Divine Shield (because then he's "Invulnerable" and no one attacks him, right? (does this work for "Invulnerable" the ability, too?))... Well, we're already attached a modified Hardened Skin, which (for command card purposes) means we're already using a disabled Spellbook. So let's just throw "Spell Immunity" on there as well; that way he's immune to damage (spells & physical), with the side-bonus of being immune to spells (Unholy Armor originally did that, right?).


Good catch.

KILLCIDE said:
It would still be better to use a DDS for this. On-Attack events can easily be abused, and it's not even the moment a unit deals damage to the unit....
I have heard this argument before, and it's an interesting one... Perhaps if I was trying to make a "critical strike" kind of ability, maybe. But think about it; just run through this with me. With the trigger
Code:
EVENT - Unit is attacked
ACTION
 - IF Attacked Unit has X Buff
 - THEN Add (mod Hard. Skin ability & Spell Immunity)
 - ELSE Remove (mod Hard. Skin ability & Spell Immunity)

What can go wrong? "Is attacked" procs before damage is dealt (isn't it technically on the "upswing" or something?), so it's always an accurate "snapshot" of the attacked unit's buff-state... And if someone "cheats" by attack-canceling, all they've done is update the ability status with the buff (properly, I might add).

So it's actually pretty neat. : )

KILLCIDE said:
Regardless, I prefer having complete freedom over the ability than sticking with whatever is hardcoded in the default object editor abilities.
Fair enough. / prefer the freedom of working without encumbering systems and other dependencies, and relish the challenge of working within the hard-coded limitations to achieve amazing things. : )

Also I can't code. :<
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
...with the side-bonus of being immune to spells (Unholy Armor originally did that, right?)
From the description I saw on the wiki, I don't think so. From what I can remember, the ability said that the unit with the armor can still be polymorphed.

What can go wrong? "Is attacked" procs before damage is dealt (isn't it technically on the "upswing" or something?)
The event starts when they being their attack animation. If you have a range unit with a missle-type attack, then the event will fire waaay before the actual projectile hits and deals damage.
 

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,502
From the description I saw on the wiki, I don't think so. From what I can remember, the ability said that the unit with the armor can still be polymorphed.
Huh, interesting. Well, I probably just wouldn't bother with that.

It appears to be a common problem; several solutions were suggested but they'd need to be tested.

The one I rather like is using the Runed Bracers (has "% magic damage reduction" field)... But someone apparently reports that it (magically) fails to work with Hardened Skin. Weird.

KILLCIDE said:
The event starts when they being their attack animation. If you have a range unit with a missle-type attack, then the event will fire waaay before the actual projectile hits and deals damage.
Exactly, it's perfect! You would want the ability to be updated (long) before damage ever got to it's target, right?

I don't mean to bludgeon this poor deceased equine, but let's break it down:

Attacked Unit Has Buff: Trigger keeps the 'blocking' abilities on it
Attacked Unit Doesn't Have Buff: Trigger removes 'blocking' abilities (before damage is dealt, i.e. just in time for it)

Which is just the behavior one would wish for.
 

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,502
Mmm no you wouldn't :p you would only want to stop the damage if damage even occurs. What if the attacked missed? How much damage would you know to "absorb" if the attack hasn't landed yet?
Wait, what? What's this about "knowing to absorb" and "wanting to stop the damage if"?

Maybe I wasn't as explanatory as I could be earlier. The Hardened Skin ability has several fields you can edit, including "what kind of attacks to block" (melee/ranged), "how much damage to block" (integer), "how much damage to let through" (integer), and "chance to block" (%). I'm not "triggering" the blocking of damage or any weirdness like that; it's all taken care of natively by the game's engine via Hardened Skin (and, as you pointed out, Spell Immunity/Runed Bracers/whatever), since I just set it to block "9999..." (i.e. all) of "every" kind of damage (M/R), "100%" of the time.

So, again, like I said, that very ability will be dynamically added or removed, appropriate to it's state (as determined via the buff), "On Attack", long before damage is dealt, which is ideal.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
So, again, like I said, that very ability will be dynamically added or removed, appropriate to it's state (as determined via the buff), "On Attack", long before damage is dealt, which is ideal.
Ahh I wasn't aware we were still talking about that ability :p fair enough, that WOULD work then. That honestly sounds like more work though since you have to use a spellbook. There is also the possibility of a type of damage happening over the value set in the ability's data field.
 
Level 13
Joined
Oct 18, 2013
Messages
691
Hey Kyrbi0, I like the method of just leaving the work to the game engine itself. The only issue i see with this is if the unit already has a hardened skin ability. Do you know how multiple Hardened Skin abilities interact? Even if it is granted by an item, would you be able to disable then enable the hardened skin that could bug the spell?
 

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,502
Hey Kyrbi0, I like the method of just leaving the work to the game engine itself. The only issue i see with this is if the unit already has a hardened skin ability. Do you know how multiple Hardened Skin abilities interact? Even if it is granted by an item, would you be able to disable then enable the hardened skin that could bug the spell?
Now THAT... Is something I had *also* failed to consider. Lawl.

It might very well be that the 'stronger' Hardened Skin works (oh please oh please oh please); if so we're good. But testing would have to be done and if that weren't the case... Well, you're just out of luck with this method, because you're right. (unless your game/mod/conversion/whatever didn't use a normal Hardened Skin ability.)
 
Status
Not open for further replies.
Top