• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Defend ability to make the unit take less damage

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 74
Joined
Aug 10, 2018
Messages
7,951
You can use a Damage event:
  • Defend Toggle
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(defend))
        • Then - Actions
          • Unit - Add Defend (Check) to (Triggering unit)
          • Set VariableSet DefendCount = (DefendCount + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DefendCount Equal to 1
            • Then - Actions
              • Trigger - Turn on Defend Damage Reduction <gen>
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(undefend))
            • Then - Actions
              • Unit - Remove Defend (Check) from (Triggering unit)
              • Set VariableSet DefendCount = (DefendCount - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DefendCount Equal to 0
                • Then - Actions
                  • Trigger - Turn off Defend Damage Reduction <gen>
                • Else - Actions
            • Else - Actions
  • Defend Damage Reduction
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Level of Defend (Check) for (Triggering unit)) Equal to 1
    • Actions
      • Event Response - Set Damage of Unit Damaged Event to ((Damage taken) x 0.75)
Defend (Check) is a hidden passive ability based on Storm Hammers which serves to detect when a unit is defending or not.

Edit: Or apply Chaosium's suggestion in the first trigger and skip the need for the Defend Damage Reduction trigger and the DefendCount stuff.
 

Attachments

  • Defend 1.w3m
    111.4 KB · Views: 8
Level 8
Joined
Sep 30, 2017
Messages
111
You can use a Damage event:
  • Defend Toggle
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(defend))
        • Then - Actions
          • Unit - Add Defend (Check) to (Triggering unit)
          • Set VariableSet DefendCount = (DefendCount + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DefendCount Equal to 1
            • Then - Actions
              • Trigger - Turn on Defend Damage Reduction <gen>
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(undefend))
            • Then - Actions
              • Unit - Remove Defend (Check) from (Triggering unit)
              • Set VariableSet DefendCount = (DefendCount - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DefendCount Equal to 0
                • Then - Actions
                  • Trigger - Turn off Defend Damage Reduction <gen>
                • Else - Actions
            • Else - Actions
  • Defend Damage Reduction
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Level of Defend (Check) for (Triggering unit)) Equal to 1
    • Actions
      • Event Response - Set Damage of Unit Damaged Event to ((Damage taken) x 0.75)
Defend (Check) is a hidden passive ability based on Storm Hammers which serves to detect when a unit is defending or not.

Edit: Or apply Chaosium's suggestion in the first trigger and skip the need for the Defend Damage Reduction trigger and the DefendCount stuff.
I'm trying these triggers but in the defend damage reduction trigger there is no "Unit - A unit Takes damage" in the generic unit event
also the map you sent is not working.

Edit: The Error Says "level info data missing or invalid."
 
Last edited:
Level 8
Joined
Sep 30, 2017
Messages
111
Create an ability based on Spiked Carapace, it has a field allowing to grant X% damage reduction, then you simply add/remove this ability when defend is cast/cancelled
Which one exactly? Because the Defence Bonus Option data used give him bonus armor. is that what you mean?
 

Attachments

  • Screenshot 2023-10-02 035734.png
    Screenshot 2023-10-02 035734.png
    81.1 KB · Views: 14

Uncle

Warcraft Moderator
Level 74
Joined
Aug 10, 2018
Messages
7,951
Which one exactly? Because the Defence Bonus Option data used give him bonus armor. is that what you mean?
Received Damage Factor = 1.00.

This field says that any damage the unit receives will get multiplied by 1.00. Changing it to 0.75 would mean that the damage gets multiplied by 0.75, which equates to 25% damage reduction.

Also, you can't open my map if you're not on the latest patch, and that Damage Event was introduced in patch 1.31.
 
Last edited:
Status
Not open for further replies.
Top