[Trigger] Need help with Damage Engine Armor Trigger

Level 5
Joined
Feb 13, 2019
Messages
129
Hellllo, I'm just trying to set up a trigger with Bribe's Damage Engine that will act a lot like hardened skin:

I just want the dmg to be reduced by 1, for each point of armor.


This is what I have so far:


  • Events
    • Game - DamageEvent becomes Equal to 1.00
  • Conditions
    • IsDamageSpell Equal to False
  • Actions
    • Set AttackingUnit = DamageEventSource
    • Set AttackedUnit = DamageEventTarget
    • Set AttackedUnitArmor[1] =
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
      • Then - Actions
        • Set DamageEventAmount = (DamageEventAmount - AttackedUnitArmor[1])
      • Else - Actions

But I'm not quite sure how to obtain a units armor and make a variable out of it for the trigger to process?



I'm very new and am probably doing this all wrong so forgive me xd
 

MyPad

Spell Reviewer
Level 26
Joined
May 9, 2014
Messages
1,773
If you have the recent versions of warcraft 3, there would be a gui option to retrieve a unit's armor points. It would be located at the bottom, since it is a relatively new addition to the list of options for real values.

Once you locate it, you can then assign it to the variable as normal.

As it stands, I do not see the need for a condition inside the Actions tab. Hence, that can be removed.

The condition to remove...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Then - Actions
      • Set DamageEventAmount = (DamageEventAmount - AttackedUnitArmor[1])
    • Else - Actions
 
Last edited:
Level 5
Joined
Feb 13, 2019
Messages
129
If you have the recent versions of warcraft 3, there would be a gui option to retrieve a unit's armor points. It would be located at the bottom, since it is a relatively new addition to the list of options for real values.

Once you locate it, you can then assign it to the variable as normal.

As it stands, I do not see the need for a condition inside the Actions tab. Hence, that can be removed.

The conditiont to remove...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Then - Actions
      • Set DamageEventAmount = (DamageEventAmount - AttackedUnitArmor[1])
    • Else - Actions


That's awesome! So I just update this and this trigger should be easy peasy then?

Thank you so much
 
Level 5
Joined
Feb 13, 2019
Messages
129
Set integer = Convert Real to Integer(Unit - Armor of DamageEventTarget)


OMG that's exactly what I think I was looking for for another trigger I'm trying to set up at the moment, I'm trying to make it so say my spell damage gets bonus damage based of my attributes and I think you just solved the problem I was having! :O


  • Events
    • Game - DamageEvent becomes Equal to 1.00
  • Conditions
    • IsDamageSpell Equal to True
  • Actions
    • Set AttackingUnit = DamageEventSource
    • Set AttackedUnit = DamageEventTarget
    • Set HeroInt[1] = (Intelligence of AttackingUnit (Include bonuses))
    • Set HeroIntReal[1] = (Real(HeroInt[1]))
    • Set DamageEventAmount = (DamageEventAmount + HeroIntReal[1])
 

Wrda

Spell Reviewer
Level 23
Joined
Nov 18, 2012
Messages
1,731
OMG that's exactly what I think I was looking for for another trigger I'm trying to set up at the moment, I'm trying to make it so say my spell damage gets bonus damage based of my attributes and I think you just solved the problem I was having! :O


  • Events
    • Game - DamageEvent becomes Equal to 1.00
  • Conditions
    • IsDamageSpell Equal to True
  • Actions
    • Set AttackingUnit = DamageEventSource
    • Set AttackedUnit = DamageEventTarget
    • Set HeroInt[1] = (Intelligence of AttackingUnit (Include bonuses))
    • Set HeroIntReal[1] = (Real(HeroInt[1]))
    • Set DamageEventAmount = (DamageEventAmount + HeroIntReal[1])
Why are you even using these many pointers?
You're not even using AttackedUnit for any thing other than setting it in a variable, it's pointless. Also setting AttackingUnit to another already existing variable and using the former makes no sense. You also don't need to set 2 more variables one for getting the intelligence of DamageEventSource and the other for conversion.
You could just use
  • Set DamageEventAmount = (DamageEventAmount + (Real(Intelligence of DamageEventSource (Include bonuses))))
When you're making triggers you should avoid making too many unnecessary variables, since then they will fill up in the variable editor and it's quite a mess later for yourself to figure out in a huge list which is the variable you need for any stuff you're making, specially with a lot of systems.
 
Level 5
Joined
Feb 13, 2019
Messages
129
Why are you even using these many pointers?
You're not even using AttackedUnit for any thing other than setting it in a variable, it's pointless. Also setting AttackingUnit to another already existing variable and using the former makes no sense. You also don't need to set 2 more variables one for getting the intelligence of DamageEventSource and the other for conversion.
You could just use
  • Set DamageEventAmount = (DamageEventAmount + (Real(Intelligence of DamageEventSource (Include bonuses))))
When you're making triggers you should avoid making too many unnecessary variables, since then they will fill up in the variable editor and it's quite a mess later for yourself to figure out in a huge list which is the variable you need for any stuff you're making, specially with a lot of systems.

Yeahhh now if I think about it with what you said I think I get it, honestly that was like my first somewhat advanced trigger, attempting to use variables etc. But thank you for tips I really appreciate it! :grin:
 
Level 24
Joined
Feb 9, 2009
Messages
1,774
Don't use DamageEvent 1.00, use DamageModifier Event 3.00

I've highlighted the part regarding "Hardened Skin" from his "How to use" spoiler on the main page of the system
If you fully block DamageEventAmount (setting it to 0) the AfterDamageEvent will not run.
DamageModifierEvent is split into four phases. Only 1 and 4 are important, you do not need phase 2 or 3. Your map will still work exactly the same without them. However, they are there to help you out if you want them.
Recommended use:
- Terminal Phase: Equal to 1.00. If your goal is to block damage or switch it to a heal, this is the best time. If you don't want the damage blocked any further, set DamageEventOverride to true. It will skip phases 2 and 3 and even skip phase 4 if the damage is equal to or less than 0.
- Abstract Phase: Equal to 2.00. If you don't need to know the damage event amount to modify the damage, do it here. Multiplication, division and logarithm calculations are ideal, here.
- Direct Phase: Equal to 3.00. Hardened skin reduces damage by 13 but not by less than 3. This phase is the perfect time to implement such a thing.
- Quantitative Shield (Final) Phase: Equal to 4.00. This is the most interesting one. I needed to create it in order to make an Anti-Magic Shell and Mana Shield respond to a modified DamageEventAmount instead of just the original.
 
Top