• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Calculate damage taken then remove damage from custom value?

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
I'm working on recreating Protoss Shields from StarCraft. I think I have the basic idea but I'm not really experienced with WC3 triggers so I'm not sure how I would calculate the damage then remove that damage from a custom value.

This is what I have so far:

  • Footman
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Custom value of (Attacked unit)) Less than or equal to 100
          • (Custom value of (Attacked unit)) Greater than 0
    • Actions
      • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing 0.00 damage of attack type Normal and damage type Normal
 
Level 11
Joined
Sep 14, 2009
Messages
284
You need a damage detection system for that, and most DDS systems use custom values of units, so you probably have to make local values/MUI with variables.

Event
"A unit is attacked" won't work.

Imagine if a ranged unit attacks and before that projectile lands another projectile is fired, thus messing up the damage calculated for the first projectile.
 
Status
Not open for further replies.
Top