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

[Trigger] Modify Damage Dealt After Attacking Stunned Enemies

Status
Not open for further replies.
Level 3
Joined
Dec 7, 2020
Messages
20
Hi. I'm having a problem with my trigger, which is suppossed to increase damage for a couple of seconds after attacking a stunned target. Ok so, it goes like this: I have a hidden passive ability and a 'buff applier', one serves as a 'checker' of sorts to ensure the Hero has the right talent (I'm using a talent system), once the talent is picked, the ability is added. Then comes this Trigger:

  • Head Cracker Checker
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to Muradin Bronzebeard
      • (Level of Head Cracker (Checker) (Muradin) for DamageEventSource) Equal to 1
      • (DamageEventTarget has buff Stunned (Pause)) Equal to True
    • Actions
      • Set VariableSet _Temp_Player_1 = (Owner of DamageEventSource)
      • Set VariableSet _Temp_Point_1 = (Position of DamageEventSource)
      • Unit - Create 1 Dummy for _Temp_Player_1 at _Temp_Point_1 facing Default building facing degrees
      • Set VariableSet _Temp_DummyUnit_1 = (Last created unit)
      • Unit - Add Head Cracker (Effect Applier) (Uther) to _Temp_DummyUnit_1
      • Unit - Order _Temp_DummyUnit_1 to Human Priest - Inner Fire DamageEventSource
      • Unit - Add a 1.00 second Generic expiration timer to _Temp_DummyUnit_1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Head Cracker Dmg <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Head Cracker Dmg <gen>
        • Else - Actions
So, when damage is dealt, I check for the unit-type, check for the hidden ability (Head Cracker), and check if the damaged unit is stunned. If everything goes right, I create a dummy that applies a buff to my unit. Then comes this other trigger:

  • Head Cracker Dmg
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to Muradin Bronzebeard
      • (DamageEventSource has buff Head Cracker ) Equal to True
    • Actions
      • Set VariableSet DamageEventAmount = (DamageEventAmount x 2.00)
On damage, I check again for unit-type, which may be too much; and for the buff. Then, if everything goes accordingly, I modify the damage dealt. That's were the problem comes in, the buff is applied, but the damage remains the same. I've tried increasing it to absurd amounts such as x10.00 but no difference. I also tried a different approach by adding and removing a second passive ability rather than using a buff, to no avail.

Any help would be really appreciated, and any correction in any other part of the triggers as well. :D
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
What version of Damage Engine are you using? Because until very recently you couldn't modify DamageEventAmount in:
  • Game - DamageEvent becomes Equal to 1.00
You used to have to do it in:
  • DamageModifierEvent becomes Equal to 1.00

Also, I feel like you could combine these two triggers. Create an If Then Else in the first trigger that checks if:
  • (DamageEventSource has buff Head Cracker ) Equal to True
And if true, Then multiply the damage. You could do this before the Dummy applies the buff so the timings would remain the same.

Obviously the above change won't work if you need to use DamageModifierEvent.

You may also be able to remove this condition:
  • (Unit-type of DamageEventSource) Equal to Muradin Bronzebeard
Unless of course Head Cracker is used by other unit-types and you want to differentiate these.

And you can definitely remove the _Temp_Player_1 variable as it's redundant in this case (it's only used once).
 
Last edited:
Status
Not open for further replies.
Top