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

[Solved] Power Word: Shield

Status
Not open for further replies.

zam

zam

Level 3
Joined
Jan 1, 2021
Messages
31
Is the shield you're trying to make blocking damage? or just preventing it from happening?
 
Level 9
Joined
Dec 16, 2017
Messages
343
Is the shield you're trying to make blocking damage? or just preventing it from happening?
It can be both, as long as i can set the amount of life that the shield has, for example, if i have a 500 hp shield and someone does a 600 damage to the unit with the shield, he gets damaged 100, if the shield has 500 hp, and someone damages it for 300, it still is there and can block 200 damage more.
 
I'd use a DamageEngine and trigger it.
For that version of Warcraft 3, I guess you need to use:
Damage Engine 3A.0.0.0 and 3.8.0.0 | HIVE
After that, it should be possible "on-damage-taken", check in a hashtable if unit has shield-value over 0, if so,
damageReduced: any temporary real-variable
shieldAmount: real-variable, something you need to save/per unit unit, for example using hashtable or array and unit indexer.
damageEventAmount: DamageEngine system-variable that will adjust the amount of damage a unit takes.
  • set damageReduced = max(shieldAmount, damageEventAmount)
  • set shieldAmount = shieldAmount - damageReduced
  • set damageEventAmount = damageEventAmount - shieldAmount
  • --- Re-save shield amount to hashtable ---
  • --- Check if shield was destroyed and maybe adjust some special effect? ---
I don't think any ability in the game can help you, you'll have to trigger it
 

zam

zam

Level 3
Joined
Jan 1, 2021
Messages
31
It can be both, as long as i can set the amount of life that the shield has, for example, if i have a 500 hp shield and someone does a 600 damage to the unit with the shield, he gets damaged 100, if the shield has 500 hp, and someone damages it for 300, it still is there and can block 200 damage more.
As the gentleman said. Use a DDS to Detect Damage and modify to your needs.

Here is a Simple Idea:
Screenshot2


and another one :

Screenshot3

The first idea is with a Life-timed Shield
The second one is where it makes it 0 Damage to take.
 
Level 9
Joined
Dec 16, 2017
Messages
343
Thank you everyone, i will try all of them and see which works better for me.
Later Edit:@zam this one doesn't work, or maybe i do smth wrong :D

  • Shield
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Power Word: Shield (Priest SHADOW)
    • Actions
      • Set PowerWordShieldCaster = (Triggering unit)
      • Set PowerWordShieldTarget = (Target unit of ability being cast)
      • Unit - Make PowerWordShieldTarget Invulnerable
      • Set PowerWordShieldDamage = 500.00
  • ShieldLoop
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set PowerWordShieldDamage = (PowerWordShieldDamage - (Damage taken))
  • ShieldStop
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PowerWordShieldDamage Less than or equal to 0.00
        • Then - Actions
          • Unit - Make PowerWordShieldTarget Vulnerable
        • Else - Actions
Screenshot 2021-01-11 125806.jpg


@ThompZon for some reason, if i try to start my map or the test map with the damage engine triggers, it crashes..
 
Last edited:

zam

zam

Level 3
Joined
Jan 1, 2021
Messages
31
Thank you everyone, i will try all of them and see which works better for me.
Later Edit:@zam this one doesn't work, or maybe i do smth wrong :D

  • Shield
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Power Word: Shield (Priest SHADOW)
    • Actions
      • Set PowerWordShieldCaster = (Triggering unit)
      • Set PowerWordShieldTarget = (Target unit of ability being cast)
      • Unit - Make PowerWordShieldTarget Invulnerable
      • Set PowerWordShieldDamage = 500.00
  • ShieldLoop
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set PowerWordShieldDamage = (PowerWordShieldDamage - (Damage taken))
  • ShieldStop
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PowerWordShieldDamage Less than or equal to 0.00
        • Then - Actions
          • Unit - Make PowerWordShieldTarget Vulnerable
        • Else - Actions
View attachment 371756

@ThompZon for some reason, if i try to start my map or the test map with the damage engine triggers, it crashes..
You need to have DDS to Detect the Damage you can't just make a [Real] Variable and call it damage taken.
 
Status
Not open for further replies.
Top