Defend ability to make the unit take less damage

Status
Not open for further replies.
Level 6
Joined
Sep 30, 2017
Messages
75
Is there anyway to make the footman defend ability to have him take reduced damage, like maybe 25% from all damage sources?
 

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,266
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: 4
Level 6
Joined
Sep 30, 2017
Messages
75
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 6
Joined
Sep 30, 2017
Messages
75
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: 7

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,266
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